-
-
Notifications
You must be signed in to change notification settings - Fork 73
📦 serialization support + 🎚️ update OS & python version in test-matrix #87
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #87 +/- ##
==========================================
- Coverage 98.12% 97.95% -0.17%
==========================================
Files 10 10
Lines 746 784 +38
==========================================
+ Hits 732 768 +36
- Misses 14 16 +2
Continue to review full report at Codecov.
|
🔥 add support for figure dict input + propagate _grid_str
Ready for review @jonasvdd |
🙃 add python3.10 (as string)
…ements 🌅 FigureResampler display improvements
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.
Amazing work @jvdd! 👏🏼 💪🏼 🤝, If the comments are resolved, a merge should be fine!
plotly_resampler/figure_resampler/figure_resampler_interface.py
Outdated
Show resolved
Hide resolved
@@ -56,11 +56,33 @@ def __init__( | |||
f = self._get_figure_class(go.FigureWidget)() | |||
f._data_validator.set_uid = False | |||
|
|||
if isinstance(figure, BaseFigure): # go.Figure or go.FigureWidget or AbstractFigureAggregator | |||
# A base figure object, we first copy the layout and grid ref | |||
if isinstance(figure, BaseFigure): |
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.
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.
aha, this is caused by the inheritence of the FigureWidget
class.
Should fix #85
In shot this PR adds the following contributions;
=> serialize the plotly-resampler figure with its
hf_data
and other plotly-resampler properties, allowig pickling & (deep)copy!(the support for pickling allows to start processes that show a plotly-resampler figure via spawning)
This PR does;
FigureResampler(fig.to_dict())
withfig
ago.Figure
)=> this is in line with the vanilla plotly behavior (see
BaseFigure
constructor documentation)_grid_str
in our composable constructorstest_fwr_time_based_data_s
=> this allows starting a
multiprocessing.Process
on Windows & Mac-OS (as these use spawning) https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods(note that this already worked on Unix as for such OS forking is used)
show_dash
forFigureResampler
on_ipython_display_
show_dash_kwargs
toFigureResampler
constructorshow_dash_kwargs