MCPcopy Index your code
hub / github.com/bqplot/bqplot / save_png

Method save_png

js/src/Figure.ts:1411–1421  ·  view source on GitHub ↗
(filename, scale)

Source from the content-addressed store, hash-verified

1409 }
1410
1411 save_png(filename, scale) {
1412 // Render a SVG data into a canvas and download as PNG.
1413
1414 this.get_rendered_canvas(scale).then((canvas: any) => {
1415 const a = document.createElement('a');
1416 a.download = filename || 'image.png';
1417 a.href = canvas.toDataURL('image/png');
1418 document.body.appendChild(a);
1419 a.click();
1420 });
1421 }
1422
1423 save_svg(filename: string) {
1424 this.get_svg().then((xml) => {

Callers 1

create_toolbarMethod · 0.95

Calls 2

get_rendered_canvasMethod · 0.95
clickMethod · 0.45

Tested by

no test coverage detected