@oliasoft-open-source/charts-library 4.7.7-beta-5 → 4.7.7-beta-6
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 +4 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26514,6 +26514,7 @@ const setAnnotationBorderWidth = (chart2, annotationId, borderWidth) => {
|
|
|
26514
26514
|
}
|
|
26515
26515
|
};
|
|
26516
26516
|
const handleAnnotationMouseDown = (event, canvas2, scales, annotations, setDraggingState, hoveredAnnotationId) => {
|
|
26517
|
+
console.log("canvas - handleAnnotationMouseDown", canvas2);
|
|
26517
26518
|
const annotation2 = hoveredAnnotationId ? annotations == null ? void 0 : annotations[hoveredAnnotationId] : null;
|
|
26518
26519
|
if (!annotation2) return;
|
|
26519
26520
|
const { xScaleID = "x", yScaleID = "y" } = annotation2;
|
|
@@ -26539,6 +26540,7 @@ const handleAnnotationMouseDown = (event, canvas2, scales, annotations, setDragg
|
|
|
26539
26540
|
};
|
|
26540
26541
|
const handleAnnotationMouseMove = (event, canvas2, scales, isDragging2, activeAnnotation, dragStartX, dragStartY, chart2) => {
|
|
26541
26542
|
if (isDragging2 && activeAnnotation) {
|
|
26543
|
+
console.log("canvas - handleAnnotationMouseMove", canvas2);
|
|
26542
26544
|
if (!isNil(canvas2) && !isNil(canvas2.style)) {
|
|
26543
26545
|
canvas2.style.cursor = CursorStyle.Move;
|
|
26544
26546
|
}
|
|
@@ -26630,9 +26632,6 @@ const handleAnnotationMouseUp = (isDragging2, activeAnnotation, chart2, canvas2,
|
|
|
26630
26632
|
console.log("Chart", chart2);
|
|
26631
26633
|
console.log("canvas", canvas2);
|
|
26632
26634
|
console.log("canvas.ownerDocument", canvas2.ownerDocument);
|
|
26633
|
-
if (!isNil(canvas2) && !isNil(canvas2.style)) {
|
|
26634
|
-
canvas2.style.cursor = CursorStyle.Pointer;
|
|
26635
|
-
}
|
|
26636
26635
|
setDraggingState(false, null);
|
|
26637
26636
|
chart2.update();
|
|
26638
26637
|
}
|
|
@@ -26677,7 +26676,7 @@ const annotationLabel = (ctx, annotations, scales) => {
|
|
|
26677
26676
|
const annotationDraggerPlugin = {
|
|
26678
26677
|
id: "annotationDraggerPlugin",
|
|
26679
26678
|
beforeDraw(chart2) {
|
|
26680
|
-
var _a2, _b2
|
|
26679
|
+
var _a2, _b2;
|
|
26681
26680
|
let annotations = ((_b2 = (_a2 = chart2.options.plugins) == null ? void 0 : _a2.annotation) == null ? void 0 : _b2.annotations) ?? {};
|
|
26682
26681
|
if (!annotations) return;
|
|
26683
26682
|
annotationLabel(
|
|
@@ -26685,29 +26684,9 @@ const annotationDraggerPlugin = {
|
|
|
26685
26684
|
annotations,
|
|
26686
26685
|
chart2.scales
|
|
26687
26686
|
);
|
|
26688
|
-
const pluginOptions = ((_d2 = (_c2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _c2.plugins) == null ? void 0 : _d2.annotationDraggerPlugin) || {
|
|
26689
|
-
enabled: false
|
|
26690
|
-
};
|
|
26691
|
-
if (pluginOptions.enabled) {
|
|
26692
|
-
if ((_f2 = (_e2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _e2.plugins) == null ? void 0 : _f2.tooltip) {
|
|
26693
|
-
chart2.options.plugins.tooltip.enabled = false;
|
|
26694
|
-
}
|
|
26695
|
-
chart2.options.hover = {
|
|
26696
|
-
mode: void 0,
|
|
26697
|
-
intersect: false
|
|
26698
|
-
};
|
|
26699
|
-
} else {
|
|
26700
|
-
if ((_h2 = (_g2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _g2.plugins) == null ? void 0 : _h2.tooltip) {
|
|
26701
|
-
chart2.options.plugins.tooltip.enabled = true;
|
|
26702
|
-
}
|
|
26703
|
-
chart2.options.hover = {
|
|
26704
|
-
mode: ChartHoverMode.Nearest,
|
|
26705
|
-
intersect: true
|
|
26706
|
-
};
|
|
26707
|
-
}
|
|
26708
26687
|
},
|
|
26709
26688
|
afterUpdate(chart2) {
|
|
26710
|
-
var _a2, _b2, _c2, _d2
|
|
26689
|
+
var _a2, _b2, _c2, _d2;
|
|
26711
26690
|
const { canvas: canvas2, scales, hoveredAnnotationId } = chart2;
|
|
26712
26691
|
const pluginOptions = ((_b2 = (_a2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _a2.plugins) == null ? void 0 : _b2.annotationDraggerPlugin) || {
|
|
26713
26692
|
enabled: false
|
|
@@ -26715,23 +26694,6 @@ const annotationDraggerPlugin = {
|
|
|
26715
26694
|
const typedScales = { ...scales, x: scales.x, y: scales.y };
|
|
26716
26695
|
let annotations = ((_d2 = (_c2 = chart2.options.plugins) == null ? void 0 : _c2.annotation) == null ? void 0 : _d2.annotations) ?? {};
|
|
26717
26696
|
if (!chart2 && !annotations) return;
|
|
26718
|
-
if (pluginOptions.enabled) {
|
|
26719
|
-
if ((_f2 = (_e2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _e2.plugins) == null ? void 0 : _f2.tooltip) {
|
|
26720
|
-
chart2.options.plugins.tooltip.enabled = false;
|
|
26721
|
-
}
|
|
26722
|
-
chart2.options.hover = {
|
|
26723
|
-
mode: void 0,
|
|
26724
|
-
intersect: false
|
|
26725
|
-
};
|
|
26726
|
-
} else {
|
|
26727
|
-
if ((_h2 = (_g2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _g2.plugins) == null ? void 0 : _h2.tooltip) {
|
|
26728
|
-
chart2.options.plugins.tooltip.enabled = true;
|
|
26729
|
-
}
|
|
26730
|
-
chart2.options.hover = {
|
|
26731
|
-
mode: ChartHoverMode.Nearest,
|
|
26732
|
-
intersect: true
|
|
26733
|
-
};
|
|
26734
|
-
}
|
|
26735
26697
|
let isDragging2 = false;
|
|
26736
26698
|
let dragStartX, dragStartY;
|
|
26737
26699
|
let activeAnnotation = null;
|