-
-
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
Update plotly backend to support plotly.py version 3 #3194
Conversation
's' is not a valid plotly symbol string, use 'circle' instead 'plasma' is not a valid plotly colorscale, use 'viridis' instead
The global plotly library object was renamed from 'Plotly' to '_Plotly' in plotly.py 3.4.0 to avoid a naming conflict when a Jupyter Notebook heading contained the text 'Plotly' See: plotly/plotly.py#816 plotly/plotly.py#1250
Graph objects are now structured hierarchically, so go.Marker was deprecated in favor of go.layout.Marker. The use of these classes is fully optional, and they can be replaced by plain dict instances in cases where local validation, tab completions, and docstrings aren't needed.
cannot be mutated in place. Instead, the add_traces method is used to append additional traces to the figure.
rather than lists so they cannot be extended in place. The += operator can be used instead to replace the object array with an extended version of itself.
dict instances with some dict-like methods. The to_plotly_json method is used to convert a graph object into a Python dict.
but when loaded into the notebook it is loaded as _Plotly. (before this commit figures rendered properly in the jupyter notebook but an error was raised when output to an HTML file that _Plotly is not defined)
… timeout. See https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received Prior intermittent CI error: ``` ... $ conda env update -n holoviews -q -f environment.yml Solving environment: ...working... done Preparing transaction: ...working... done Verifying transaction: ...working... done Executing transaction: ...working... dbus post-link :: /etc/machine-id not found .. dbus post-link :: .. using /proc/sys/kernel/random/boot_id No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself. ```
This is brilliant @jonmmease, I really, really appreciate it. I was going to work on this pretty much starting tomorrow in anticipation of releasing next week. |
holoviews/plotting/plotly/element.py
Outdated
figure['data'].extend(fig['data']) | ||
|
||
figure.add_traces(fig.data) | ||
print(type(self), self.projection) |
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.
Would be good to remove this.
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.
Whoops, missed that one. removed in ed65c14
Left one minor comment but once that's resolved I'd be happy to merge this. |
One quick unrelated question, I just merged a PR which let's users map columns in their data directly onto the style attributes of the artist/glyph, but haven't ported this feature to plotly yet. How flexible is plotly with setting vectorized properties, e.g. to control the alpha/linewidth/color per point/simplex/line segment etc.? |
Most of the properties of scatter.marker and bar.marker can be specified as vectors. Off the top of my head, scatter (2D, 2D WebGL, and 3D) supports vectorized color, opacity, size, and symbol and bar supports vectorized height (of course 🙂), baseline, bar width, line width, opacity, bar color, and outline color, plotly.js doesn't really support vectorizing line properties at this point, i.e. you can't currently vary the color or width of a line within the line. Also, I'd like to write out a summary of the areas where I think the plotly renderer could be enhanced by taking advantage of existing plotly.py/plotly.js features. If this is agreeable on your end, would you prefer one large master issue or a bunch of smaller issues (maybe with a plotly label)? |
Thanks, that's really helpful.
Not really surprising, neither does bokeh or matplotlib.
That list of probably very long, the plotly renderer exists mostly as a proof of concept and as quick release valve for us to support interactive 3D plots. Let's start by putting that in one issue and then we can break that up into smaller sub-issues. Once again I'm really impressed by your work on plotly, and really appreciate you taking the time to update this code. I'll merge now to get the basics working again. |
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. |
This PR updates the plotly backend to be compatible with (and require) plotly.py version 3.4+. This closes #2864.
I left a detailed commit trail explaining the updates, but let me know if you have any questions! For more background, see the plotly.py version 3 migration guide.