-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Make compatible with plotly 3.0 #2864
Comments
Hi @philippjfr , let me know if you all have any migration questions. Glad to see you're interested in making the jump! Also, I'm not very familiar with how holoviews pulls off its interactive magic, but I wonder what it would take to display plotly figures in the notebook using the new I don't expect anyone to have time to work on this in the near future, but I'd be interested to get your take on it and maybe sketch out a high-level outline of what it could look like. |
That's tricky, as FigureWidget is an ipywidget, and thus ties everything to Jupyter notebooks. In general we use mechanisms that work in or outside of a Jupyter context. @philippjfr can comment on the details in a week or so from now, but in the meantime, is there a lower-level interface to what FigureWidget does that does not depend explicitly on Jupyter? |
The Python portion of The JavaScript portion of FigureWidget is mostly concerned with accepting these messages, calling the appropriate Plotly.js methods, and then doing a bunch of work to keep the single model in sync with potentially multiple views. Here's what I was imagining: A |
Thanks for chiming in here @jonmmease I suspect your help will be immensely helpful. We've had the concept of Jupyter based renderer modes in the past, e.g. to support nbagg in matplotlib, so I have no particular objection to providing both notebook based and static export rendering capabilities. One question I have is how easy it will be to switch between a regular static Figure and a FigureWidget, are the APIs identical such that I can simply switch one out for the other, at least when creating the initial figure? I suspect when updating an existing plot the FigureWidget based approach will make things a lot easier while the Figure based approach will probably just rerender the whole plot each time (which I think is what it is doing now). |
Thanks for your thoughts @philippjfr. Is the idea that a Jupyter-based capability would use paramnb to generate ipywidgets controls, and then put them in an ipywidgets layout with a Yes, the version 3 In this case, do you think most of the plotly.py logic could be common between the static and notebook modes? Again, I don't have time to do much more than talk about the idea at this point. But I could definitely see a full-featured Plotly ipywidget backend for HoloViews being pretty exciting and valuable to the Plotly, PyViz, and Jupyter communities. So let's at least keep talking about it 🙂 As a side note: for updating the entire figure with the static approach, the (relatively) new |
Thanks for the quick reply!
No this would be independent of any work in paramnb and parambokeh, although we should of course figure out how they will integrate there.
That's definitely one option but we also have the concept of renderer modes which let you set how the rendering should work. This would look something like this: # static renderering
hv.extension('plotly')
# widget based rendering
hv.extension('plotly:nb')
Yes I think so, the plot classes would simply instantiate either a I'd have to look at the new Plotly.react code but by the sound of it I think we can make all this work pretty cleanly. |
Ok, yeah, the rendering mode approach makes a lot of sense (at lease from an end-user perspective). For syncing in the notebook mode I'm guessing that it would be helpful to have a import plotly.graph_objs as go
fig = go.FigureWidget(...)
# Do stuff
new_fig = go.Figure({'data': [...], 'layout': {...}})
fig.reset(new_fig) We don't have this yet (our focus so far has been on syncing modifications to nested sub-properties), but it wouldn't be hard to add and would be useful in other contexts as well. If you have a chance, could you point out where HoloViews performs (or requests) this synchronization for the Bokeh backend in |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
No description provided.
The text was updated successfully, but these errors were encountered: