@oliasoft-open-source/charts-library 4.3.3-beta-9 → 4.3.3-beta-10
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 +49 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26212,11 +26212,10 @@ const handleAnnotationMouseUp = (isDragging2, activeAnnotation, chart2, setDragg
|
|
|
26212
26212
|
chart2.canvas.style.cursor = CursorStyle.Pointer;
|
|
26213
26213
|
}
|
|
26214
26214
|
}
|
|
26215
|
+
console.log("chart?.canvas MOUSE UP", chart2 == null ? void 0 : chart2.canvas);
|
|
26215
26216
|
if (chart2 == null ? void 0 : chart2.canvas) {
|
|
26216
26217
|
setDraggingState(false, null);
|
|
26217
26218
|
chart2 == null ? void 0 : chart2.update();
|
|
26218
|
-
} else {
|
|
26219
|
-
console.error("Canvas is not available during mouse up");
|
|
26220
26219
|
}
|
|
26221
26220
|
}
|
|
26222
26221
|
};
|
|
@@ -26284,13 +26283,12 @@ const annotationDraggerPlugin = {
|
|
|
26284
26283
|
}
|
|
26285
26284
|
},
|
|
26286
26285
|
afterRender(chart2) {
|
|
26287
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
26288
|
-
const { canvas: canvas2, scales, hoveredAnnotationId } = chart2;
|
|
26286
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;
|
|
26289
26287
|
const pluginOptions = ((_b2 = (_a2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a2.plugins) == null ? void 0 : _b2.annotationDraggerPlugin) || {
|
|
26290
26288
|
enabled: false
|
|
26291
26289
|
};
|
|
26292
|
-
const typedScales = { x: scales.x, y: scales.y };
|
|
26293
|
-
let annotations = ((
|
|
26290
|
+
const typedScales = { x: (_c2 = chart2 == null ? void 0 : chart2.scales) == null ? void 0 : _c2.x, y: (_d2 = chart2 == null ? void 0 : chart2.scales) == null ? void 0 : _d2.y };
|
|
26291
|
+
let annotations = ((_g2 = (_f2 = (_e2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _e2.plugins) == null ? void 0 : _f2.annotation) == null ? void 0 : _g2.annotations) ?? {};
|
|
26294
26292
|
if (!annotations)
|
|
26295
26293
|
return;
|
|
26296
26294
|
let isDragging2 = false;
|
|
@@ -26304,39 +26302,45 @@ const annotationDraggerPlugin = {
|
|
|
26304
26302
|
dragStartY = startY;
|
|
26305
26303
|
}
|
|
26306
26304
|
};
|
|
26307
|
-
if (!((
|
|
26305
|
+
if (!((_i2 = (_h2 = chart2 == null ? void 0 : chart2.canvas) == null ? void 0 : _h2.dataset) == null ? void 0 : _i2.annotationDraggerInitialized) && (pluginOptions == null ? void 0 : pluginOptions.enabled) && (chart2 == null ? void 0 : chart2.hoveredAnnotationId)) {
|
|
26308
26306
|
console.group("Condition");
|
|
26309
|
-
console.log("addEventListener", (
|
|
26310
|
-
console.log("nil", !isNil(
|
|
26311
|
-
console.log("isEmpty", !isEmpty(
|
|
26312
|
-
console.log("isFunction", isFunction$2(
|
|
26307
|
+
console.log("addEventListener", (_j2 = chart2 == null ? void 0 : chart2.canvas) == null ? void 0 : _j2.addEventListener);
|
|
26308
|
+
console.log("nil", !isNil(chart2 == null ? void 0 : chart2.canvas));
|
|
26309
|
+
console.log("isEmpty", !isEmpty(chart2 == null ? void 0 : chart2.canvas));
|
|
26310
|
+
console.log("isFunction", isFunction$2(chart2 == null ? void 0 : chart2.canvas.addEventListener));
|
|
26313
26311
|
console.groupEnd();
|
|
26314
|
-
if (!isNil(
|
|
26315
|
-
console.log("Canvas exists and has addEventListener:",
|
|
26316
|
-
|
|
26317
|
-
|
|
26318
|
-
|
|
26319
|
-
|
|
26320
|
-
|
|
26321
|
-
|
|
26322
|
-
|
|
26323
|
-
|
|
26324
|
-
|
|
26325
|
-
|
|
26326
|
-
|
|
26327
|
-
|
|
26328
|
-
|
|
26329
|
-
|
|
26330
|
-
|
|
26331
|
-
|
|
26332
|
-
|
|
26333
|
-
|
|
26334
|
-
|
|
26335
|
-
|
|
26336
|
-
|
|
26337
|
-
|
|
26338
|
-
|
|
26339
|
-
|
|
26312
|
+
if (!isNil(chart2 == null ? void 0 : chart2.canvas) && !isEmpty(chart2 == null ? void 0 : chart2.canvas) && isFunction$2(chart2 == null ? void 0 : chart2.canvas.addEventListener)) {
|
|
26313
|
+
console.log("Canvas exists and has addEventListener:", chart2 == null ? void 0 : chart2.canvas);
|
|
26314
|
+
(_k2 = chart2 == null ? void 0 : chart2.canvas) == null ? void 0 : _k2.addEventListener(
|
|
26315
|
+
MouseEvents.MOUSEDOWN,
|
|
26316
|
+
(event) => {
|
|
26317
|
+
var _a3, _b3, _c3;
|
|
26318
|
+
handleAnnotationMouseDown(
|
|
26319
|
+
event,
|
|
26320
|
+
chart2 == null ? void 0 : chart2.canvas,
|
|
26321
|
+
typedScales,
|
|
26322
|
+
(_c3 = (_b3 = (_a3 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a3.plugins) == null ? void 0 : _b3.annotation) == null ? void 0 : _c3.annotations,
|
|
26323
|
+
setDraggingState,
|
|
26324
|
+
chart2.hoveredAnnotationId
|
|
26325
|
+
);
|
|
26326
|
+
}
|
|
26327
|
+
);
|
|
26328
|
+
(_l2 = chart2 == null ? void 0 : chart2.canvas) == null ? void 0 : _l2.addEventListener(
|
|
26329
|
+
MouseEvents.MOUSEMOVE,
|
|
26330
|
+
(event) => {
|
|
26331
|
+
handleAnnotationMouseMove(
|
|
26332
|
+
event,
|
|
26333
|
+
chart2 == null ? void 0 : chart2.canvas,
|
|
26334
|
+
typedScales,
|
|
26335
|
+
isDragging2,
|
|
26336
|
+
activeAnnotation,
|
|
26337
|
+
dragStartX,
|
|
26338
|
+
dragStartY,
|
|
26339
|
+
chart2
|
|
26340
|
+
);
|
|
26341
|
+
}
|
|
26342
|
+
);
|
|
26343
|
+
chart2 == null ? void 0 : chart2.canvas.addEventListener(MouseEvents.MOUSEUP, () => {
|
|
26340
26344
|
handleAnnotationMouseUp(
|
|
26341
26345
|
isDragging2,
|
|
26342
26346
|
activeAnnotation,
|
|
@@ -26344,24 +26348,24 @@ const annotationDraggerPlugin = {
|
|
|
26344
26348
|
setDraggingState
|
|
26345
26349
|
);
|
|
26346
26350
|
});
|
|
26347
|
-
|
|
26351
|
+
chart2.canvas.dataset.annotationDraggerInitialized = "true";
|
|
26348
26352
|
} else {
|
|
26349
26353
|
console.error(
|
|
26350
26354
|
"Canvas is null, empty, or does not support addEventListener:",
|
|
26351
|
-
|
|
26355
|
+
chart2 == null ? void 0 : chart2.canvas
|
|
26352
26356
|
);
|
|
26353
26357
|
}
|
|
26354
26358
|
}
|
|
26355
26359
|
if (!pluginOptions.enabled) {
|
|
26356
|
-
if (
|
|
26357
|
-
console.log("Removing event listeners from canvas:",
|
|
26358
|
-
|
|
26360
|
+
if ((chart2 == null ? void 0 : chart2.canvas) && isFunction$2(chart2 == null ? void 0 : chart2.canvas.removeEventListener)) {
|
|
26361
|
+
console.log("Removing event listeners from canvas:", chart2 == null ? void 0 : chart2.canvas);
|
|
26362
|
+
chart2 == null ? void 0 : chart2.canvas.removeEventListener(MouseEvents.MOUSEDOWN, () => {
|
|
26359
26363
|
});
|
|
26360
|
-
|
|
26364
|
+
chart2 == null ? void 0 : chart2.canvas.removeEventListener(MouseEvents.MOUSEMOVE, () => {
|
|
26361
26365
|
});
|
|
26362
|
-
|
|
26366
|
+
chart2 == null ? void 0 : chart2.canvas.removeEventListener(MouseEvents.MOUSEUP, () => {
|
|
26363
26367
|
});
|
|
26364
|
-
|
|
26368
|
+
chart2.canvas.dataset.annotationDraggerInitialized = "";
|
|
26365
26369
|
}
|
|
26366
26370
|
}
|
|
26367
26371
|
}
|