Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ability to style download image for chart #2098

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

Closed
AlexVvx opened this issue Oct 18, 2017 · 5 comments
Closed

Ability to style download image for chart #2098

AlexVvx opened this issue Oct 18, 2017 · 5 comments

Comments

@AlexVvx
Copy link

AlexVvx commented Oct 18, 2017

Hi, what do you think about adding ability to style downloaded image differently, then original chart? E.g. margins, borders - update appearance of chart exported to image.

@etpinard
Copy link
Contributor

See https://codepen.io/etpinard/pen/BwvENX?editors=0010

Since #1939 released in 1.30.0, Plotly.downloadImage and Plotly.toImage accept {"data":[], "layout":{}} objects as well as graph div as first argument.

So one could extend a graph's data and/or layout before calling Plotly.downloadImage to apply custom download styles to a graph. I don't see the need to add a style option to Plotly.toImage.

@AlexVvx
Copy link
Author

AlexVvx commented Oct 18, 2017

Sounds good. A couple of questions:

  • does it mean, that arguments list probably won't change and it's ok to use {data, layout, config} ?
  • _snapshotInProgress probably won't work. It's possible to update it manually in your app code, but is it ok to use property with underscore, since it supposed to be used internally?

@etpinard
Copy link
Contributor

etpinard commented Oct 18, 2017

does it mean, that arguments list probably won't change and it's ok to use {data, layout, config} ?

The api is the following, so yes, it isn't the same as newPlot.

_snapshotInProgress probably won't work

I don't know what that is. It's probably always a bad idea to rely on _ properties.

@AlexVvx
Copy link
Author

AlexVvx commented Oct 18, 2017

_snapshotInProgress - from plotly.js/src/snapshot/download.js,
true - if snapshotting already in progress, will cancel next download process when first one is not finished
false - if not in progress

@etpinard
Copy link
Contributor

It should.

Alright, I'm closing this thing as it won't result in a PR of any sort. Please use https://community.plot.ly/ if you have other questions of the likes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants