-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add to/from/read/write json functions to the plotly.io module #1188
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
Note: failures seem to be due to npmjs being down: https://twitter.com/npmstatus/status/1042543988274692096
plotly/io/_json.py
Outdated
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.
missing quote character
plotly/io/_json.py
Outdated
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.
and "True if invalid figure properties should be silently ignored."
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.
Add newline
plotly/io/_json.py
Outdated
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.
Update description as above
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.
Add newline
@JavascriptMick
JavascriptMick
Oct 2, 2018
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.
one of my traces was a Heatmap... which does not have a pop method
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.
Hmm, did you set validate=False? If not, then validate_coerce_fig_to_dict() should have made sure that the traces were converted into dicts.
@JavascriptMick
JavascriptMick
Oct 2, 2018
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.
I ended up using validate=False and remove_uids=False
This PR introduces 4 new functions to the
plotly.iomodule for converting figures to and from JSON strings and files.These functions follow the
plotly.iomodule conventions described in #1098Pending bug fixes in jupyterlab/jupyter-renderers#159, the JSON files written by
plotly.io.write_jsonwill be compatible with the@jupyterlab/plotly-extensionJupyterLab extension. This means it will be possible to create a figure in plotly.py, write it to afig.plotly.jsonfile, then double click the file in JupyterLab to view the figure right inside JupyterLab.