Open ahuang11 opened 4 weeks ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Thanks @ahuang11 I agree this would be nice, but if I view the HTML generated by jupyterbook the slider doesn't update the plot. You can access the HTML as a build artifact in the CI https://github.com/xarray-contrib/xarray-tutorial/actions/runs/9473640096?pr=268
maybe related: https://github.com/holoviz/hvplot/issues/1241
The preview of the slider that should advance is here https://xarray-contrib-xarray-tutorial-preview-pr-268.surge.sh/overview/xarray-in-45-min.html#holoviz
🎊 PR Preview 38e88b58f4599f68ad322b4a2dfda5083d2703c1 has been successfully built and deployed to https://xarray-contrib-xarray-tutorial-preview-pr-268.surge.sh
🕐 Build time: 0.01s
🤖 By surge-preview
You're right; seems like an issue.
To get around that, maybe can demo how powerful hvPlot can be simply by ticking off keywords such as groupby, hover, responsive, etc? Unless that's too many keywords?
Not sure which one I like more, explicit x/y and implicit groupby, or vice versa.
import hvplot.xarray
ds.groupby("time.season").mean().hvplot(
groupby=["season", "lat"],
hover="vline",
responsive=True,
dynamic=False,
ylim=(240, 310),
min_height=350,
)
ds.groupby("time.season").mean().hvplot(
x="lon",
y="air",
hover="vline",
responsive=True,
dynamic=False,
ylim=(240, 310),
min_height=350,
)
Those are great suggestions! Whatever your think is best without being too much to take in.
For the existing case, it seems that just removing widget_location='bottom'
might fix the interactivity
We also have this separate notebook focused entirely on hvplot https://tutorial.xarray.dev/intermediate/hvplot.html !
I think the current changes is a better example to highlight hvPlot's capabilities, and I'd be happy for this to be merged when you think it's ready.
For the existing case, it seems that just removing widget_location='bottom' might fix the interactivity
Yes. I think it might squish the plot a bit too much, but a line plot is still readable.
We also have this separate notebook focused entirely on hvplot https://tutorial.xarray.dev/intermediate/hvplot.html !
Would you like me to try revising that too? Particularly, I think it can also show other type of plots.
I think the current changes is a better example to highlight hvPlot's capabilities, and I'd be happy for this to be merged when you think it's ready.
I really like that the new plot is interactive both on the website and the notebook. It is however a bit complicated. I'd suggest keeping the "Xarray in 45 minutes" example super simple (otherwise when presenting these notebooks in tutorial settings you get lots of questions).
Would you like me to try revising that too? Particularly, I think it can also show other type of plots.
How about your original suggestion of just embedding a couple time slices in the overview notebook and adding this new excellent example of grouping by season and latitude in the 'intermediate' notebook? For this new example and any others you'd like to add please explain what each keyword is doing and link to the relevant upstream docs (here https://hvplot.holoviz.org/user_guide/Customization.html#generic-options ?)
I think it's more impressive if users can try out the slider.