@oliasoft-open-source/charts-library 4.7.7-beta-16 → 4.7.7-beta-17

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 CHANGED
@@ -26629,9 +26629,13 @@ const handleAnnotationMouseUp = (isDragging2, activeAnnotation, chart2, canvas2,
26629
26629
  if (activeAnnotation) {
26630
26630
  const annotationId = activeAnnotation == null ? void 0 : activeAnnotation.id;
26631
26631
  setAnnotationBorderWidth(chart2, annotationId, BORDER_WIDTH.ZERO);
26632
- calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
26632
+ const { centerX = -1, centerY = -1 } = calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
26633
26633
  if (!isNil(activeAnnotation == null ? void 0 : activeAnnotation.onDragEnd)) {
26634
26634
  console.log("onDragEnd");
26635
+ activeAnnotation == null ? void 0 : activeAnnotation.onDragEnd(
26636
+ { x: centerX, y: centerY },
26637
+ activeAnnotation
26638
+ );
26635
26639
  }
26636
26640
  if (!isNil(canvas2) && !isNil(canvas2.style)) {
26637
26641
  canvas2.style.cursor = CursorStyle.Pointer;
@@ -26776,13 +26780,17 @@ const annotationDraggerPlugin = {
26776
26780
  });
26777
26781
  canvas2.addEventListener(MouseEvents.MOUSEUP, (event) => {
26778
26782
  const canvasEvent = event.currentTarget;
26779
- handleAnnotationMouseUp(
26780
- isDragging2,
26781
- activeAnnotation,
26782
- chart2,
26783
- canvasEvent,
26784
- setDraggingState
26783
+ const handleAnnotationMouseUpDebounce = debounce$3(
26784
+ () => handleAnnotationMouseUp(
26785
+ isDragging2,
26786
+ activeAnnotation,
26787
+ chart2,
26788
+ canvasEvent,
26789
+ setDraggingState
26790
+ ),
26791
+ 5
26785
26792
  );
26793
+ handleAnnotationMouseUpDebounce();
26786
26794
  });
26787
26795
  canvas2.dataset.annotationDraggerInitialized = "true";
26788
26796
  }