owid-grapher
owid-grapher copied to clipboard
Add a 'copy PNG to clipboard' shortcut
Core problem
Currently, the option for users to re-use a 'pretty' version of a chart is to click Download > Image (PNG) > the PNG is downloaded > upload somewhere else (e.g. social media). This feels a bit cumbersome and results in users who often take screenshots of our charts; this can reduce image quality and/or remove some elements (e.g. footnotes).
Proposed solution
Add a "Copy chart" shortcut in the sharing menu, that would directly copy the PNG version of our chart to the clipboard.
Context
Technical note: Something like this could work, but haven't tried it
const clipboardItem = new ClipboardItem(
{ "image/png": this.pngBlob }
)
navigator.clipboard.write([ clipboardItem ])
It uses the relatively modern Clipboard API, which is supported in most recent browser versions.
I've tried this now - this definitely works using the above piece of code. So all we need for this is a working design for the download tab, and then afterwards I would estimate this to be 2-3 hours of work.
Probably copy to clipboard is more explicit and should live under the share menu instead of in the download tab?
This issue has had no activity within 10 months. It is considered stale and will be closed in 7 days unless it is worked on or tagged as pinned.