@oliasoft-open-source/charts-library 4.3.3-beta-6 → 4.3.3-beta-8
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.js +17 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26283,7 +26283,7 @@ const annotationDraggerPlugin = {
|
|
|
26283
26283
|
afterUpdate(chart2) {
|
|
26284
26284
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
26285
26285
|
const { canvas: canvas2, scales, hoveredAnnotationId } = chart2;
|
|
26286
|
-
console.log(chart2);
|
|
26286
|
+
console.log("Chart afterUpdate:", chart2);
|
|
26287
26287
|
const pluginOptions = ((_b2 = (_a2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a2.plugins) == null ? void 0 : _b2.annotationDraggerPlugin) || {
|
|
26288
26288
|
enabled: false
|
|
26289
26289
|
};
|
|
@@ -26304,8 +26304,8 @@ const annotationDraggerPlugin = {
|
|
|
26304
26304
|
};
|
|
26305
26305
|
if (!((_f2 = canvas2 == null ? void 0 : canvas2.dataset) == null ? void 0 : _f2.annotationDraggerInitialized) && (pluginOptions == null ? void 0 : pluginOptions.enabled) && hoveredAnnotationId) {
|
|
26306
26306
|
if (!isNil(canvas2) && !isEmpty(canvas2)) {
|
|
26307
|
-
console.log(cloneDeep(canvas2));
|
|
26308
|
-
canvas2
|
|
26307
|
+
console.log("Canvas exists:", cloneDeep(canvas2));
|
|
26308
|
+
canvas2.addEventListener(MouseEvents.MOUSEDOWN, (event) => {
|
|
26309
26309
|
var _a3, _b3, _c3;
|
|
26310
26310
|
handleAnnotationMouseDown(
|
|
26311
26311
|
event,
|
|
@@ -26316,7 +26316,7 @@ const annotationDraggerPlugin = {
|
|
|
26316
26316
|
chart2.hoveredAnnotationId
|
|
26317
26317
|
);
|
|
26318
26318
|
});
|
|
26319
|
-
canvas2
|
|
26319
|
+
canvas2.addEventListener(MouseEvents.MOUSEMOVE, (event) => {
|
|
26320
26320
|
handleAnnotationMouseMove(
|
|
26321
26321
|
event,
|
|
26322
26322
|
canvas2,
|
|
@@ -26328,7 +26328,7 @@ const annotationDraggerPlugin = {
|
|
|
26328
26328
|
chart2
|
|
26329
26329
|
);
|
|
26330
26330
|
});
|
|
26331
|
-
canvas2
|
|
26331
|
+
canvas2.addEventListener(MouseEvents.MOUSEUP, () => {
|
|
26332
26332
|
handleAnnotationMouseUp(
|
|
26333
26333
|
isDragging2,
|
|
26334
26334
|
activeAnnotation,
|
|
@@ -26336,17 +26336,21 @@ const annotationDraggerPlugin = {
|
|
|
26336
26336
|
setDraggingState
|
|
26337
26337
|
);
|
|
26338
26338
|
});
|
|
26339
|
+
canvas2.dataset.annotationDraggerInitialized = "true";
|
|
26340
|
+
} else {
|
|
26341
|
+
console.error("Canvas is null or empty:", canvas2);
|
|
26339
26342
|
}
|
|
26340
|
-
canvas2.dataset.annotationDraggerInitialized = "true";
|
|
26341
26343
|
}
|
|
26342
26344
|
if (!pluginOptions.enabled) {
|
|
26343
|
-
|
|
26344
|
-
|
|
26345
|
-
|
|
26346
|
-
|
|
26347
|
-
|
|
26348
|
-
|
|
26349
|
-
|
|
26345
|
+
if (canvas2) {
|
|
26346
|
+
canvas2.removeEventListener(MouseEvents.MOUSEDOWN, () => {
|
|
26347
|
+
});
|
|
26348
|
+
canvas2.removeEventListener(MouseEvents.MOUSEMOVE, () => {
|
|
26349
|
+
});
|
|
26350
|
+
canvas2.removeEventListener(MouseEvents.MOUSEUP, () => {
|
|
26351
|
+
});
|
|
26352
|
+
canvas2.dataset.annotationDraggerInitialized = "";
|
|
26353
|
+
}
|
|
26350
26354
|
}
|
|
26351
26355
|
}
|
|
26352
26356
|
};
|