plotly-resampler
plotly-resampler copied to clipboard
Only Update Visible Traces
Ideally closes #21
Kind of tricky to test -- was hoping to get some interactivity with some print statements inside of a dash app, but alas adding a print after the continue statement where I added to the if clause gives me nothing
I assume this is failing because of the visible="legendonly"
in lines 317 and 355 in tests/conftest.py
?
Thanks for this contribution @jayceslesar! Your code looks clean :smile:
I'll manually test it more in depth tomorrow! I would advise to add some tests for both the FigureResampler
& FigureWidgetResampler
(but feel free to let me know if you're not comfortable adding tests - I'll gladly do this myself).
PS: The failing test is because we toggle some traces (making them unvisible) and check whether all traces gets resampled (which since this PR will not be the case anymore :tada:)
Codecov Report
Merging #78 (9828a07) into main (f25cc4e) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## main #78 +/- ##
=======================================
Coverage 98.11% 98.11%
=======================================
Files 10 10
Lines 743 743
=======================================
Hits 729 729
Misses 14 14
Impacted Files | Coverage Δ | |
---|---|---|
...ler/figure_resampler/figure_resampler_interface.py | 99.70% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update f25cc4e...9828a07. Read the comment docs.
Hey @jayceslesar
I experimented today a little bit with your code and found out that it does not work as desired. Our desired behavior is that after toggling traces off in the front-end (i.e., making them invisible), they should not be resampled until they are toggled on again (i.e., making them again visible).
Your implementation does not result in this desired behavior as we have no (currently) access in the back-end to the front-end state. I think fixing this is not really convenient...
(perhaps @jonasvdd could also chime in with his opinion)
Your implementation does not result in this desired behavior as we have no (currently) access in the back-end to the front-end state. I think fixing this is not really convenient...
I wonder what the path forward there is, guess I would need more understanding of where the difference between the back end and the front end state exists
@jayceslesar,
I created a first implementation on this branch https://github.com/predict-idlab/trace-updater/tree/update_visible of trace_updater
. This is a rather naive implementation, as all data still gets resampled at the same time in the back-end.
Will give a more elaborate update sometime later.
@jayceslesar, @jvdd, If you are all okay with this; I will close this (legacy) PR, and we will handle this in a future PR! A thesis student of ours (with some help of us) managed to create this functionality. Ideally, this will be added this summer to plotly-resampler! 🔥
Closing is fine for me! @jonasvdd @jayceslesar
Okay, will close it!