Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dynamic=False and groupby multi-dim #268

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ahuang11
Copy link
Member

I think it's more impressive if users can try out the slider.

image

I think it's more impressive if it works on the website
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ahuang11 ahuang11 changed the title Change note Remove hvplot slider note and use dynamic=False Jun 11, 2024
@scottyhq
Copy link
Contributor

scottyhq commented Jun 20, 2024

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: holoviz/hvplot#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

Copy link

github-actions bot commented Jun 25, 2024

🎊 PR Preview 38e88b5 has been successfully built and deployed to https://xarray-contrib-xarray-tutorial-preview-pr-268.surge.sh

🕐 Build time: 0.01s

🤖 By surge-preview

@ahuang11
Copy link
Member Author

ahuang11 commented Jul 1, 2024

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?

image

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,
)

@ahuang11 ahuang11 changed the title Remove hvplot slider note and use dynamic=False Use dynamic=False and groupby multi-dim Jul 1, 2024
@scottyhq
Copy link
Contributor

scottyhq commented Jul 2, 2024

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 !

@ahuang11
Copy link
Member Author

ahuang11 commented Jul 2, 2024

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.

@scottyhq
Copy link
Contributor

scottyhq commented Jul 3, 2024

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 ?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants