@oliasoft-open-source/charts-library 4.3.1 → 4.3.2-beta-1

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
@@ -25477,6 +25477,7 @@ const generateAnnotations = (annotationsData) => {
25477
25477
  const onDragEnd = () => (cord, annotation2) => (ann == null ? void 0 : ann.onDragEnd) ? ann == null ? void 0 : ann.onDragEnd(cord, annotation2) : void 0;
25478
25478
  return {
25479
25479
  ...ann,
25480
+ drawTime: "afterDraw",
25480
25481
  display: ann == null ? void 0 : ann.display,
25481
25482
  annotationIndex: idx,
25482
25483
  id: `${ann == null ? void 0 : ann.label}-${ann == null ? void 0 : ann.value}-${idx}`,
@@ -26224,7 +26225,7 @@ const annotationLabel = (ctx, annotations, scales) => {
26224
26225
  const annotationDraggerPlugin = {
26225
26226
  id: "annotationDraggerPlugin",
26226
26227
  beforeDraw(chart2) {
26227
- var _a2, _b2;
26228
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
26228
26229
  let annotations = ((_b2 = (_a2 = chart2.options.plugins) == null ? void 0 : _a2.annotation) == null ? void 0 : _b2.annotations) ?? {};
26229
26230
  if (!annotations)
26230
26231
  return;
@@ -26233,6 +26234,26 @@ const annotationDraggerPlugin = {
26233
26234
  annotations,
26234
26235
  chart2.scales
26235
26236
  );
26237
+ const pluginOptions = ((_d2 = (_c2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _c2.plugins) == null ? void 0 : _d2.annotationDraggerPlugin) || {
26238
+ enabled: false
26239
+ };
26240
+ if (pluginOptions.enabled) {
26241
+ if ((_f2 = (_e2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _e2.plugins) == null ? void 0 : _f2.tooltip) {
26242
+ chart2.options.plugins.tooltip.enabled = false;
26243
+ }
26244
+ chart2.options.hover = {
26245
+ mode: void 0,
26246
+ intersect: false
26247
+ };
26248
+ } else {
26249
+ if ((_h2 = (_g2 = chart2 == null ? void 0 : chart2.options) == null ? void 0 : _g2.plugins) == null ? void 0 : _h2.tooltip) {
26250
+ chart2.options.plugins.tooltip.enabled = true;
26251
+ }
26252
+ chart2.options.hover = {
26253
+ mode: ChartHoverMode.Nearest,
26254
+ intersect: true
26255
+ };
26256
+ }
26236
26257
  },
26237
26258
  afterUpdate(chart2) {
26238
26259
  var _a2, _b2, _c2, _d2;