@oliasoft-open-source/charts-library 4.7.7-beta-15 → 4.7.7-beta-16
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 +11 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26203,6 +26203,15 @@ const useChartState = ({
|
|
|
26203
26203
|
persistenceId,
|
|
26204
26204
|
generatedDatasets
|
|
26205
26205
|
}) => {
|
|
26206
|
+
useEffect(() => {
|
|
26207
|
+
return () => {
|
|
26208
|
+
if (chartRef == null ? void 0 : chartRef.current) {
|
|
26209
|
+
const chart2 = chartRef == null ? void 0 : chartRef.current;
|
|
26210
|
+
console.log("DESTROY");
|
|
26211
|
+
chart2 == null ? void 0 : chart2.destroy();
|
|
26212
|
+
}
|
|
26213
|
+
};
|
|
26214
|
+
}, []);
|
|
26206
26215
|
const memoState = useMemo(() => state, [state]);
|
|
26207
26216
|
const memoOptions = useMemo(() => options, [options]);
|
|
26208
26217
|
const {
|
|
@@ -26620,23 +26629,9 @@ const handleAnnotationMouseUp = (isDragging2, activeAnnotation, chart2, canvas2,
|
|
|
26620
26629
|
if (activeAnnotation) {
|
|
26621
26630
|
const annotationId = activeAnnotation == null ? void 0 : activeAnnotation.id;
|
|
26622
26631
|
setAnnotationBorderWidth(chart2, annotationId, BORDER_WIDTH.ZERO);
|
|
26623
|
-
|
|
26632
|
+
calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
|
|
26624
26633
|
if (!isNil(activeAnnotation == null ? void 0 : activeAnnotation.onDragEnd)) {
|
|
26625
|
-
|
|
26626
|
-
console.log("Invoking onDragEnd:", {
|
|
26627
|
-
centerX,
|
|
26628
|
-
centerY,
|
|
26629
|
-
activeAnnotation
|
|
26630
|
-
});
|
|
26631
|
-
activeAnnotation.onDragEnd(
|
|
26632
|
-
{ x: centerX, y: centerY },
|
|
26633
|
-
activeAnnotation
|
|
26634
|
-
);
|
|
26635
|
-
} catch (error) {
|
|
26636
|
-
console.error("Error in onDragEnd:", error, activeAnnotation);
|
|
26637
|
-
}
|
|
26638
|
-
} else {
|
|
26639
|
-
console.warn("onDragEnd is undefined or null:", activeAnnotation);
|
|
26634
|
+
console.log("onDragEnd");
|
|
26640
26635
|
}
|
|
26641
26636
|
if (!isNil(canvas2) && !isNil(canvas2.style)) {
|
|
26642
26637
|
canvas2.style.cursor = CursorStyle.Pointer;
|