-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Add viewport downsample algorithm #6017
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6017 +/- ##
==========================================
- Coverage 88.54% 88.53% -0.02%
==========================================
Files 314 314
Lines 65872 65942 +70
==========================================
+ Hits 58327 58379 +52
- Misses 7545 7563 +18 ☔ View full report in Codecov by Sentry. |
@hoxbro . This would be a really fantastic addition. I want to make sure that it works for all the relevant use cases that we are encountering right now. First, it looks like any type of downsampling does not work with Codeimport holoviews as hv
import numpy as np
from holoviews.operation.downsample import downsample1d
hv.extension("bokeh")
c1 = hv.Curve(np.random.rand(1000), label='c1').opts(subcoordinate_y=True)
c2 = hv.Curve(np.random.rand(1000), label='c2').opts(subcoordinate_y=True)
curves = hv.Overlay(c1*c2).opts(xlim=(5, 10))
downsample1d(curves, algorithm="viewport") Screen.Recording.2023-12-18.at.3.08.26.PM.mov |
screenrecord-2023-12-19_10.23.57.mp4 |
I have added a workaround when having an x limit set on the element ( The problem is the downsampling works by looking at the stream |
We can't send an empty plot either, as this will make the y-axis between 0 and 1, didn't notice this before as I was using random data. So I'm now sending 400 points (200 from the start and 200 from the end) to get an approximation of the range. |
[skip ci]
[skip ci]
#6061 is relevant, given that this PR is primarily about slicing |
Set the stream value during the stream Callback initialization:
|
3df6134
to
d6b654f
Compare
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.
Looks good, thanks!
22e4b5f
to
0e9ca5d
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Use downsample to only send the data in the viewport to the frontend.
screenrecord-2023-12-08_19.17.53.mp4