plotly / orca

Command line application for generating static images of interactive plotly charts
MIT License
296 stars 39 forks source link

"json" format #283

Closed nicolaskruchten closed 4 years ago

nicolaskruchten commented 4 years ago

It would be really helpful for Python users to be able to ask Orca for the "full" version of the figure: https://github.com/plotly/plotly.py/issues/1967

etpinard commented 4 years ago

Yeah, I'd be ok with adding a new format value for Plotly.toImage (and Plotly.downloadImage).

Calling format: 'full-json' would probably be safer if ever we want to have Orca export just the user data/layout specification (this could be useful to e.g. get the axis range after interaction or an annotation position after an edit) without all the "full" keys.

Here's the (very) old function we have in our codebase that cleans fullData and fullLayout :

https://github.com/plotly/plotly.js/blob/3cb1652f1c2ee1eaf20e226813bef6863c15ed90/src/plots/plots.js#L2017-L2127

Fun fact: Plots.graphJson is used in the sendDataToCloud modebar button handler.