@oliasoft-open-source/charts-library 5.11.0 → 5.11.1-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -7
- package/dist/index.js +10 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1193,24 +1193,24 @@ export { }
|
|
|
1193
1193
|
|
|
1194
1194
|
declare module 'chart.js' {
|
|
1195
1195
|
interface PluginOptionsByType<TType extends ChartType> {
|
|
1196
|
-
|
|
1196
|
+
lineMarkersPlugin?: {
|
|
1197
|
+
enabled?: boolean;
|
|
1198
|
+
} | TLineMarkersOptions;
|
|
1197
1199
|
}
|
|
1198
1200
|
}
|
|
1199
1201
|
|
|
1200
1202
|
|
|
1201
1203
|
declare module 'chart.js' {
|
|
1202
1204
|
interface PluginOptionsByType<TType extends ChartType> {
|
|
1203
|
-
|
|
1204
|
-
enableCalloutAnnotation?: boolean;
|
|
1205
|
-
};
|
|
1205
|
+
annotationDraggerPlugin?: AnnotationDraggerPluginOptions;
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
1208
|
|
|
1209
1209
|
|
|
1210
1210
|
declare module 'chart.js' {
|
|
1211
1211
|
interface PluginOptionsByType<TType extends ChartType> {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
}
|
|
1212
|
+
calloutConnectorPlugin?: {
|
|
1213
|
+
enableCalloutAnnotation?: boolean;
|
|
1214
|
+
};
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
package/dist/index.js
CHANGED
|
@@ -19473,14 +19473,17 @@ var downloadPgn = (chartRef) => {
|
|
|
19473
19473
|
if (!chart) return;
|
|
19474
19474
|
const canvasElement = chart?.canvas?.parentElement;
|
|
19475
19475
|
if (!canvasElement) return;
|
|
19476
|
-
const
|
|
19477
|
-
ctx.save();
|
|
19478
|
-
ctx.globalCompositeOperation = "destination-over";
|
|
19479
|
-
ctx.fillStyle = document.body.dataset.theme === "dark" ? "black" : "white";
|
|
19480
|
-
ctx.fillRect(0, 0, chart.width, chart.height);
|
|
19481
|
-
ctx.restore();
|
|
19476
|
+
const isDark = document.body.dataset.theme === "dark";
|
|
19482
19477
|
const fileName = getChartFileName(getAxesLabelsFromChart(chart));
|
|
19483
|
-
|
|
19478
|
+
const toPngOptions = {
|
|
19479
|
+
skipFonts: navigator.userAgent.includes("Firefox"),
|
|
19480
|
+
backgroundColor: isDark ? "black" : "white"
|
|
19481
|
+
};
|
|
19482
|
+
const captureSnapshot = async (previousDataUrl, options) => {
|
|
19483
|
+
const dataUrl = await toPng(canvasElement, toPngOptions);
|
|
19484
|
+
return dataUrl.length !== previousDataUrl.length ? captureSnapshot(dataUrl, options) : dataUrl;
|
|
19485
|
+
};
|
|
19486
|
+
captureSnapshot("", toPngOptions).then((dataUrl) => {
|
|
19484
19487
|
triggerBase64Download(dataUrl, fileName);
|
|
19485
19488
|
}).catch((e) => {
|
|
19486
19489
|
console.error("Could not parse the html: ", e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.1-beta-2",
|
|
4
4
|
"description": "React Chart Library (based on Chart.js and react-chart-js-2)",
|
|
5
5
|
"homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
|
|
6
6
|
"bugs": {
|