-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Adds resample_when; the limit before automatically applying datashade/rasterize/downsample #1103
Conversation
Could a case be made for having Also is your example running the current code? I can't see why |
Oops the video I set a default op_threshold of 5000 but I decided not to modify the default. Having rasterize and datashade accept integers could work. What are others preferences? |
I personally prefer it separate as it's more explicit. For example, this reads better: df.hvplot.points('0', '1', rasterize=True, op_threshold=1000) Than this in my opinion: df.hvplot.points('0', '1', rasterize=1000) Implementation wise, it'd be slightly cleaner too I think:
vs
|
Then I would suggest going in the other direction and having two variables, An alternative could be another prefix. |
I do not like having both keywords like that; one keyword internally does the same thing to both operations so it's a good balance I think; if not it's another if else: if rasterize_threshold is not None:
threshold = rasterize_threshold
elif datashade_threshold is not None:
threshold = datashade_threshold or threshold = rasterize_threshold or datashade_threshold Perhaps I like aggregation_threshold, or if a really long name, |
Generally when it's about API design I ask @jbednar, @philippjfr or @jlstevens what they think about the suggestions. They probably already thought about the suggested API a number of years ago, I also like the idea that it can help ensuring consistency with the existing APIs (name, style, etc.) across HoloViz as they've designed most of that. |
I like aggregation_threshold=1e8, or rasterize_threshold=1e8, or aggregate_over=1e8 or rasterize_if_over=1e8. I agree it should be one argument to cover all aggregation operations. I think there should also be a way to configure this as a default at the holoviews level, BTW, not just hvplot. |
Having a default will cause it to always return an overlay of the original chart element + Image (rasterized) so I'm hesitant on that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahuang11 do you think aggregator_threshold
could also be used to apply the downsample operation (lttb
by default now but will certainly be extended to nth
for some tabular plot types and regrid
for gridded types)? If so, should it be renamed to reflect that it just doesn't apply to aggregator operations like rasterize and datashade (assuming for instance that lttb isn't an aggregating operation, which I think is correct to say?).
We're seriously lacking a user guide that demonstrates how to plot large data and where we could demonstrate that feature and how other operations work, not your fault though!
21d35ff
to
ebfd562
Compare
After a discussion with Andrew we're suggesting @ahuang11 the tests are now failing, were they passing before? I would also suggest making |
Co-authored-by: maximlt <[email protected]>
Co-authored-by: maximlt <[email protected]>
Added support for downsample |
Thanks a lot for that! I did a little bit of refactoring, in particular I found out that calling I'm going to merge now, don't hesitate opening new PRs to refine the functionality if you thing it needs it. |
Closes #1101
Needs more testing on various types of charts, but this is such a cool feature!!
Screen.Recording.2023-07-13.at.9.54.17.PM.mov