MCPcopy
hub / github.com/sallar/github-contributions-chart / download

Function download

src/utils/export.js:9–21  ·  view source on GitHub ↗
(canvas)

Source from the content-addressed store, hash-verified

7}
8
9export function download(canvas) {
10 try {
11 const dataUrl = canvas.toDataURL();
12 const a = document.createElement("a");
13 document.body.insertAdjacentElement("beforeend", a);
14 a.download = "contributions.png";
15 a.href = dataUrl;
16 a.click();
17 document.body.removeChild(a);
18 } catch (err) {
19 console.error(err);
20 }
21}
22
23export function downloadJSON(data) {
24 try {

Callers 1

onDownloadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected