plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Name png exports using plot title

Open daviddekoning opened this issue 4 years ago • 3 comments

Currently, when you export a png from a plotly figure, it is saved as newplot.png. Since most plots (the good ones anyways :) ) have titles specified, it would be great if the file could take its name from the figure title. E.G. if there is a figure with the title Daily Active Users, it could be saved as Daily Active Users.png.

This is particularly helpful when working in a jupyter notebook with multiple figures - at the moment, exporting multiple figures just yields a bunch of files called newplot.png, newplot (1).png, etc...

It might be a quick fix here: https://github.com/plotly/plotly.js/blob/b896b19aeb488e19b1cc038e8d9a50c40230c5d9/src/snapshot/download.js#L53, but the question of escaping / sanitizing the plot title into a filename might need some thought.

daviddekoning avatar Sep 04 '20 02:09 daviddekoning