-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Snapshot routines should allow users to specify image width/height #83
Comments
Ping, any update on this? |
We're still doing experiments with potential APIs. No serious work has gone into this to date. That said, once we figure out how to expose things to the users, this should be a 2-day project. |
Once we're comfortable with the API, we should expose the Moreover, we'll need |
Is there a way to get raw PNG data from a plot snapshot? We would like to do this so that we can generate a PNG output in an IPython notebook so that when viewing the .ipynb file in Github or elsewhere where Javascript is not executed there is a static fallback version that gets displayed. (and we need to do this in the Javascript code, not Python) |
You should be able to do |
Thanks. I don't see docs on Plotly promises. I tried this:
but I get:
What am I missing? |
Ah, I see. I need to use |
I think that for the user it would be really interesting to be able to choose the image size. But also it could be too much features on the plot and reduce simplicity... I would suggest that the coder who is buiding the plot could choose if the users (the ones who will be watching the plot) are capable to change or not the PNG image from the plot. To do so I would suggest to add inside the layout variable an option which involves the modebar, and where it could be such a variable like "snapshotsize" which could admit a vector including a fixed size: Regarding the With this implementation the current way that snapshots are being done right now can be kept (as the coder can decide the output size) but also the new feature of being able to choose the plot size can be implemented. |
Unfortunately other obligations came up for the plotly.js team members and this issue will remain on hold until at least April 1. Our apologies. |
Related discussion: http://community.plot.ly/t/use-plotly-offline-to-save-chart-as-image-file/408/8 |
For what it is worth, in PlotlyJS.jl I can get true vector image pdf/eps/svg export as well as configurable png/jpeg exporting by getting the svg data from plotly, using librsvg to load that into cairo, and using cairo to render to the desired file type. |
@timelyportfolio have you made any progress on this one? |
Yes, I just started working through this. Here is the very preliminary set of thoughts. By the end of the week, I hope to have a full plan to address this. Is that ok? |
timelyportfolio#1 (comment) is my first attempt, and it seems we now have both 2) promises and 3) resize. I would appreciate any thoughts. |
done in #446 |
Motivated by #42 (comment)
At the moment, the
Snapshot.toImage
has hard-codedwidth
andheight
parameters.Something like:
Moreover, maybe the on-success handler used by the modebar
toImage
button could be used as the default on-success handler toSnapshot.toImage
The text was updated successfully, but these errors were encountered: