hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Improving hvsampledata usage

Open jbednar opened this issue 6 months ago • 0 comments

The new hvPlot docs improvements are great! Some notes and questions about streamlining how these sample datasets are accessed:

  • [ ] Some of the examples are using hvsampledata, which means they need to import hvsampledata, which is then a distracting line of code that will likely stay around confusingly in user code when they copy and paste to create their own plots. To avoid these imports when accessing examples, I vote that the hvplot and hv namespaces should include a function like hv.sampledata.xxx() and hvplot.sampledata.xxx() as proposed in #1496.

  • [ ] Some examples also use what seems to be an older approach, i.e. a separate hvplot.sample_data module that itself needs to be imported. That's confusing, and maybe we could remove that code from our examples (without removing the module necessarily) and update them to use a function (not needing importing) instead.

  • [ ] There are also lots of examples using Bokeh's sample data. Should those be updated to get sample data via the hvsampledata package instead?

  • [ ] There are also a few examples using sample data from xarray. I propose that we maybe leave those as they are, because xarray users may already be familiar with the examples and will find it cognitively simpler to simply refer to these known examples rather than wonder how our versions differ from xarray's. (To me xarray examples are a different case from bokeh's, because hvplot is positioning itself as an alternative interface to Bokeh's API, meaning that most people who use hvplot + Bokeh are likely not to be Bokeh users, whereas any user of hvplot.xarray is also by definition an xarray user directly.)

jbednar avatar Jun 26 '25 16:06 jbednar