Commit 1864ad15 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

new capture setup/teardown

parent 33a0910c
......@@ -40,8 +40,8 @@
function update() {
scatterplot.update({
values: generateRandomData(1000, -10000, 10000),
categories: { name: 'Gender', 0: 'male', 2: 'female', 1: 'N/A'},
values: generateRandomData(2000, -10000, 10000),
categories: { name: 'Gender', 0: 'male', 1: 'female', 2: 'N/A'},
title: 'Scatterplot',
xAxisLabel: 'X Axis Values',
yAxisLabel: 'Y Axis Values',
......
......@@ -22,8 +22,10 @@ export default class {
this.render(args);
}
prepareSVGForCapture() {
throw Error('prepareSVGForCapture() not implemented.');
captureSetup() {
}
captureTeardown() {
}
get containerWidth() {
......@@ -35,6 +37,7 @@ export default class {
}
toPNG() {
this.captureSetup();
html2canvas(this.container).then((canvas) => {
const img = canvas.toDataURL('image/png');
const a = document.createElement('a');
......@@ -43,6 +46,7 @@ export default class {
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
this.captureTeardown();
});
}
}
......@@ -48,10 +48,6 @@ export default class extends Chart {
return 'heatmap';
}
prepareSVGForCapture() {
return this.svg;
}
prepareValues({ values, rows, cols }) {
this.data = [];
rows.forEach((row, i) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment