Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a 'copy PNG to clipboard' shortcut #1441

Open
edomt opened this issue May 17, 2022 · 10 comments
Open

Add a 'copy PNG to clipboard' shortcut #1441

edomt opened this issue May 17, 2022 · 10 comments

Comments

@edomt
Copy link
Contributor

edomt commented May 17, 2022

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.

image

Context

Slack thread

@marcelgerber
Copy link
Member

marcelgerber commented May 17, 2022

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.

@marcelgerber
Copy link
Member

marcelgerber commented May 17, 2022

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.

@danyx23
Copy link
Contributor

danyx23 commented May 24, 2022

Probably copy to clipboard is more explicit and should live under the share menu instead of in the download tab?

Copy link

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.

@github-actions github-actions bot added the stale label Apr 30, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
@sophiamersmann sophiamersmann reopened this May 7, 2024
@github-actions github-actions bot removed the stale label May 8, 2024
@danyx23
Copy link
Contributor

danyx23 commented Nov 6, 2024

Closing this issue because the feature has not been requested again and a workaround exists for internal use

@danyx23 danyx23 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2024
@marcelgerber
Copy link
Member

Lucas brought this up again today, in the context of screenshots being suboptimal because they may cut out the logo / source: https://owid.slack.com/archives/C04LNF8LBA8/p1733399018157819?thread_ts=1733395331.870399&cid=C04LNF8LBA8

@lucasrodes
Copy link
Member

lucasrodes commented Dec 5, 2024

I'd find this valuable!

[the dream]: If the user shared the image in the context of a chat or social media post, it'd be super cool if we copied the image and descriptive text. I checked if this is possible at all; I'm unsure, but maybe this addresses the issue. I haven't seen it much around, so would be a nice tech feature imo.

@marcelgerber
Copy link
Member

I'll reopen this and bring it into the triage flow again.

@lucasrodes At least on mobile devices we can do this, yes. On these, we would probably be using the Web Share API (i.e. the OS share sheet), which can handle this (and copying images on mobile devices is somewhere between unintuitive and impossible).

@lucasrodes
Copy link
Member

Thanks, @marcelgerber !

FWIW, I'm less worried about the "cropping logo/source" problem on mobile since people usually screenshot the whole screen (with minor edits). I think it's more of a problem on desktops, where people will 99% not share a screenshot of their entire screen & instead will more likely crop things.

@marcelgerber
Copy link
Member

We believe this is a useful feature, but it won't solve the screenshot problem (of cropped sources or logos).

However, we also think this feature is useful nonetheless. It would be nice to integrate this into the download modal, next to the png download button somewhere. But we need to come up with a design for that.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants