@oliasoft-open-source/charts-library 5.0.0 → 5.0.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.
Files changed (155) hide show
  1. package/dist/assets/Color-YHDXOIA2-D6i6tiFz.js +1 -0
  2. package/dist/assets/DocsRenderer-CFRXHY34-D88vu1Xb.js +580 -0
  3. package/dist/assets/{bar-chart.stories-BEwhK613.js → bar-chart.stories-D9mtWCnD.js} +35 -35
  4. package/dist/assets/client-9BU5HM4U.js +1 -0
  5. package/dist/assets/entry-preview-D2XJoWVM.js +10 -0
  6. package/dist/assets/entry-preview-docs-z3mMcuG4.js +46 -0
  7. package/dist/assets/get-draggableData-DO0Px5pc.js +2 -0
  8. package/dist/assets/iframe-DLnw2TiW.js +217 -0
  9. package/dist/assets/index-B-BONL6g.js +1 -0
  10. package/dist/assets/index-BGqSdrBK.js +1 -0
  11. package/dist/assets/index-CVdx34fM.js +1 -0
  12. package/dist/assets/index-D3-0uUTW.js +24 -0
  13. package/dist/assets/index-Dytf1aFS.js +8 -0
  14. package/dist/assets/index-eCxJ45ll.js +9 -0
  15. package/dist/assets/jsx-runtime-Y5Ju2SGo.js +9 -0
  16. package/dist/assets/legend-BI53UIaI.js +1346 -0
  17. package/dist/assets/legend-context-BNCYpFYh.js +68 -0
  18. package/dist/assets/line-chart-BdFuLh7N.js +1 -0
  19. package/dist/assets/line-chart.stories-BVsiy8CQ.js +1130 -0
  20. package/dist/assets/{line-chart.test-case.stories-Cq5J45Io.js → line-chart.test-case.stories-DgfMW1VB.js} +2 -2
  21. package/dist/assets/pie-chart.stories-BVurv17M.js +45 -0
  22. package/dist/assets/preview-CLM2f008.js +2 -0
  23. package/dist/assets/preview-DD_OYowb.js +1 -0
  24. package/dist/assets/preview-XObsormK.js +3 -0
  25. package/dist/assets/react-18-DZY5LW1V.js +1 -0
  26. package/dist/assets/react-CxVRKATl.js +1 -0
  27. package/dist/assets/scatter-chart.stories-DnivHhIH.js +41 -0
  28. package/dist/bar-chart/utils/use-bar-chart-config.d.ts +1 -1
  29. package/dist/bar-chart/utils/use-bar-chart-options.d.ts +1 -1
  30. package/dist/common/controls-portal.d.ts +1 -1
  31. package/dist/common/helpers/container.d.ts +1 -1
  32. package/dist/common/helpers/download-pgn.d.ts +1 -1
  33. package/dist/common/hooks/use-generated-labels.d.ts +1 -1
  34. package/dist/common/hooks/use-legend-state.d.ts +1 -1
  35. package/dist/common/hooks/use-reset.d.ts +1 -1
  36. package/dist/common/legend-component/legend-interface.d.ts +1 -1
  37. package/dist/common/legend-component/legend-panel.d.ts +1 -1
  38. package/dist/common/legend-component/state/legend-context.d.ts +1 -1
  39. package/dist/favicon.svg +1 -7
  40. package/dist/iframe.html +259 -51
  41. package/dist/index.html +80 -30
  42. package/dist/index.js.js +411 -574
  43. package/dist/index.js.js.map +1 -1
  44. package/dist/index.json +1 -1
  45. package/dist/line-chart/controls/controls-interfaces.d.ts +1 -1
  46. package/dist/line-chart/hooks/use-chart-functions.d.ts +1 -1
  47. package/dist/line-chart/hooks/use-chart-options.d.ts +1 -1
  48. package/dist/line-chart/hooks/use-chart-state.d.ts +1 -1
  49. package/dist/line-chart/hooks/use-toggle-handler.d.ts +1 -1
  50. package/dist/line-chart/line-chart.interface.d.ts +1 -1
  51. package/dist/line-chart/utils/axis-scales/axis-scales.d.ts +1 -1
  52. package/dist/line-chart/utils/get-axes-ranges-from-chart.d.ts +1 -1
  53. package/dist/line-chart/utils/get-axis-range-by-type.d.ts +1 -1
  54. package/dist/nunito-sans-bold-italic.woff2 +0 -0
  55. package/dist/nunito-sans-bold.woff2 +0 -0
  56. package/dist/nunito-sans-italic.woff2 +0 -0
  57. package/dist/nunito-sans-regular.woff2 +0 -0
  58. package/dist/project.json +1 -1
  59. package/dist/sb-addons/actions-1/manager-bundle.js +3 -0
  60. package/dist/sb-addons/docs-2/manager-bundle.js +242 -0
  61. package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  62. package/dist/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js +5 -0
  63. package/dist/sb-common-assets/favicon.svg +1 -0
  64. package/dist/sb-manager/globals-module-info.js +1051 -1
  65. package/dist/sb-manager/globals-runtime.js +41591 -0
  66. package/dist/sb-manager/globals.js +48 -1
  67. package/dist/sb-manager/runtime.js +12048 -1
  68. package/dist/scatter-chart/hooks/use-scatter-chart-config.d.ts +1 -1
  69. package/dist/src/components/common/helpers/chart-utils.d.ts +1 -0
  70. package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +7 -5
  71. package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +8 -0
  72. package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +1 -1
  73. package/dist/src/components/line-chart/controls/controls.d.ts +1 -4
  74. package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +2 -3
  75. package/dist/src/components/line-chart/line-chart.interface.d.ts +4 -0
  76. package/dist/src/components/line-chart/state/action-types.d.ts +0 -1
  77. package/dist/src/components/line-chart/state/helpers.d.ts +13 -0
  78. package/dist/src/components/line-chart/state/state.interfaces.d.ts +3 -12
  79. package/package.json +1 -1
  80. package/dist/assets/Color-6VNJS4EI-DLbcRNMp.js +0 -1
  81. package/dist/assets/DocsRenderer-NNNQARDV-BOzykHvd.js +0 -1
  82. package/dist/assets/WithTooltip-V3YHNWJZ-BeePhoIB.js +0 -1
  83. package/dist/assets/_getPrototype-Bgn98YsR.js +0 -3
  84. package/dist/assets/chunk-HLWAVYOI-BJEcfeBO.js +0 -364
  85. package/dist/assets/entry-preview-D8lfu5jc.js +0 -1
  86. package/dist/assets/entry-preview-docs-CRyh30bF.js +0 -54
  87. package/dist/assets/formatter-SWP5E3XI-Bj1a9__W.js +0 -156
  88. package/dist/assets/get-draggableData-DhvAHrT5.js +0 -2
  89. package/dist/assets/iframe-BurE_SJm.js +0 -8
  90. package/dist/assets/index-B7LTuyD5.js +0 -1
  91. package/dist/assets/index-BXzfdmYx.js +0 -24
  92. package/dist/assets/index-CZvFZgOq.js +0 -9
  93. package/dist/assets/index-D3eZ-H7s.js +0 -1
  94. package/dist/assets/index-DrFu-skq.js +0 -6
  95. package/dist/assets/index-uubelm5h.js +0 -9
  96. package/dist/assets/isPlainObject-DdO3KXLu.js +0 -1
  97. package/dist/assets/legend-BWpTckOL.js +0 -278
  98. package/dist/assets/legend-context-BAQplG-D.js +0 -71
  99. package/dist/assets/line-chart-L0zq38Nj.js +0 -1
  100. package/dist/assets/line-chart.stories-CurD8upE.js +0 -1130
  101. package/dist/assets/pie-chart.stories-Duex2I6n.js +0 -45
  102. package/dist/assets/preview-BBDnT5_b.js +0 -30
  103. package/dist/assets/preview-D4u66u8a.js +0 -2
  104. package/dist/assets/preview-FHoZfaOb.js +0 -17
  105. package/dist/assets/react-18-Xi5cNDBV.js +0 -1
  106. package/dist/assets/scatter-chart.stories-D0618GGr.js +0 -41
  107. package/dist/assets/syntaxhighlighter-MJWPISIS-Bmhn3z6A.js +0 -1
  108. package/dist/bar-chart/bar-chart.stories.d.ts +0 -807
  109. package/dist/common/helpers/range/estimate-close-values.test.d.ts +0 -1
  110. package/dist/common/helpers/range/range.test.d.ts +0 -1
  111. package/dist/common/plugins/annotation-dragger-plugin/helpers.test.d.ts +0 -1
  112. package/dist/line-chart/__tests__/test-data/app-test-case-1.json.d.ts +0 -8733
  113. package/dist/line-chart/__tests__/test-data/app-test-case-2.json.d.ts +0 -11614
  114. package/dist/line-chart/__tests__/test-data/app-test-case-3.json.d.ts +0 -34
  115. package/dist/line-chart/__tests__/test-data/app-test-case-4.json.d.ts +0 -411
  116. package/dist/line-chart/__tests__/test-data/app-test-case-5.json.d.ts +0 -2734
  117. package/dist/line-chart/__tests__/test-data/app-test-case-6.json.d.ts +0 -2236
  118. package/dist/line-chart/controls/axes-options/axes-options-form-state.test.d.ts +0 -1
  119. package/dist/line-chart/initialize/initialize-line-chart.test.d.ts +0 -1
  120. package/dist/line-chart/line-chart.stories.d.ts +0 -1729
  121. package/dist/line-chart/line-chart.test-case.stories.d.ts +0 -29
  122. package/dist/line-chart/plugins/line-chart.minor-gridlines-plugin.test.d.ts +0 -1
  123. package/dist/line-chart/utils/__tests__/get-annotations-data.test.d.ts +0 -1
  124. package/dist/line-chart/utils/__tests__/get-axes-data-from-metasets.test.d.ts +0 -1
  125. package/dist/line-chart/utils/__tests__/get-axes-type-from-key.test.d.ts +0 -1
  126. package/dist/line-chart/utils/__tests__/get-axis-range-by-type.test.d.ts +0 -1
  127. package/dist/line-chart/utils/__tests__/get-line-chart-tooltips.test.d.ts +0 -1
  128. package/dist/line-chart/utils/axis-formatting/axis-formatting.test.d.ts +0 -1
  129. package/dist/line-chart/utils/axis-scales/axis-scales.test.d.ts +0 -1
  130. package/dist/line-chart/utils/check-custom-option/check-custom-option.test.d.ts +0 -1
  131. package/dist/line-chart/utils/datalabels-alignment/__tests__/get-alignment-condition.test.d.ts +0 -1
  132. package/dist/line-chart/utils/datalabels-alignment/__tests__/get-alignment-data.test.d.ts +0 -1
  133. package/dist/line-chart/utils/datalabels-alignment/__tests__/get-datalabels-position.test.d.ts +0 -1
  134. package/dist/line-chart/utils/translations/get-translations.test.d.ts +0 -1
  135. package/dist/pie-chart/pie-chart.stories.d.ts +0 -263
  136. package/dist/sb-addons/actions-0/manager-bundle.js +0 -3
  137. package/dist/sb-addons/actions-0/manager-bundle.js.LEGAL.txt +0 -0
  138. package/dist/sb-addons/storybook-dark-mode-esm-preset-1/manager-bundle.js +0 -5
  139. package/dist/sb-addons/storybook-dark-mode-esm-preset-1/manager-bundle.js.LEGAL.txt +0 -0
  140. package/dist/sb-common-assets/fonts.css +0 -31
  141. package/dist/sb-manager/WithTooltip-V3YHNWJZ-MXTFSDU5.js +0 -1
  142. package/dist/sb-manager/chunk-5QAFKPS7.js +0 -7
  143. package/dist/sb-manager/chunk-7PRFHFSS.js +0 -9
  144. package/dist/sb-manager/chunk-XE6LDGTE.js +0 -406
  145. package/dist/sb-manager/chunk-YDUB7CS6.js +0 -348
  146. package/dist/sb-manager/chunk-ZEU7PDD3.js +0 -1
  147. package/dist/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js +0 -156
  148. package/dist/sb-manager/index.js +0 -1
  149. package/dist/sb-manager/syntaxhighlighter-MJWPISIS-JOSCT6CQ.js +0 -1
  150. package/dist/sb-preview/globals.js +0 -1
  151. package/dist/sb-preview/runtime.js +0 -112
  152. package/dist/scatter-chart/scatter-chart.stories.d.ts +0 -279
  153. package/dist/src/components/line-chart/controls/axes-options/action-types.d.ts +0 -5
  154. package/dist/src/components/line-chart/controls/axes-options/axes-options-form-state.d.ts +0 -23
  155. package/dist/stories.json +0 -1
package/dist/index.js.js CHANGED
@@ -5,11 +5,11 @@ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
5
5
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
6
6
  import * as React from "react";
7
7
  import React__default, { forwardRef, useRef, useEffect, createContext as createContext$2, memo, useLayoutEffect, useState, useCallback, useMemo, isValidElement, cloneElement, useContext, useReducer } from "react";
8
- import { produce } from "immer";
9
8
  import { round as round$2, displayNumber, isCloseTo, roundByMagnitude } from "@oliasoft-open-source/units";
10
9
  import cx from "classnames";
10
+ import { produce } from "immer";
11
11
  import { Portal, Icon, Menu, Tooltip as Tooltip$2, Button, Popover, Field, InputGroup, NumberInput, InputGroupAddon, Select, ButtonGroup, Spacer, Flex, Text } from "@oliasoft-open-source/react-ui-library";
12
- import { isEmpty, isArray as isArray$2, some, has, isNil, cloneDeep, defaultTo, findIndex, set as set$2, debounce as debounce$3, map as map$3, find, get as get$1, noop as noop$2 } from "lodash";
12
+ import { startCase, isEmpty, isArray as isArray$2, some, has, isNil, cloneDeep, defaultTo, findIndex, set as set$2, debounce as debounce$3, map as map$3, find, get as get$1, noop as noop$2 } from "lodash";
13
13
  /*!
14
14
  * @kurkle/color v0.3.4
15
15
  * https://github.com/kurkle/color#readme
@@ -22424,218 +22424,6 @@ class HTML5BackendImpl {
22424
22424
  const HTML5Backend = function createBackend(manager, context, options) {
22425
22425
  return new HTML5BackendImpl(manager, context, options);
22426
22426
  };
22427
- const chart$3 = "_chart_e3qdd_1";
22428
- const canvas$2 = "_canvas_e3qdd_11";
22429
- const fixedHeight$3 = "_fixedHeight_e3qdd_20";
22430
- const stretchHeight$3 = "_stretchHeight_e3qdd_26";
22431
- const squareAspectRatio$1 = "_squareAspectRatio_e3qdd_32";
22432
- const table = "_table_e3qdd_62";
22433
- const styles$5 = {
22434
- chart: chart$3,
22435
- canvas: canvas$2,
22436
- fixedHeight: fixedHeight$3,
22437
- stretchHeight: stretchHeight$3,
22438
- squareAspectRatio: squareAspectRatio$1,
22439
- table
22440
- };
22441
- const TOGGLE_ZOOM = "TOGGLE_ZOOM";
22442
- const TOGGLE_PAN = "TOGGLE_PAN";
22443
- const TOGGLE_POINTS = "TOGGLE_POINTS";
22444
- const TOGGLE_LINE = "TOGGLE_LINE";
22445
- const TOGGLE_LEGEND = "TOGGLE_LEGEND";
22446
- const TOGGLE_TABLE = "TOGGLE_TABLE";
22447
- const SAVE_INITIAL_AXES_RANGES = "SAVE_INITIAL_AXES_RANGES";
22448
- const RESET_AXES_RANGES = "RESET_AXES_RANGES";
22449
- const UPDATE_AXES_RANGES = "UPDATE_AXES_RANGES";
22450
- const TOGGLE_DRAG_POINTS = "TOGGLE_DRAG_POINTS";
22451
- const TOGGLE_DRAG_ANNOTATION = "TOGGLE_DRAG_ANNOTATION";
22452
- const DISABLE_DRAG_OPTIONS = "DISABLE_DRAG_OPTIONS";
22453
- const reducer$1 = (state, action) => {
22454
- return produce(state, (draft) => {
22455
- switch (action.type) {
22456
- case TOGGLE_ZOOM: {
22457
- draft.zoomEnabled = !draft.zoomEnabled;
22458
- if (draft.panEnabled) {
22459
- draft.panEnabled = false;
22460
- }
22461
- if (draft.enableDragPoints) {
22462
- draft.enableDragPoints = false;
22463
- }
22464
- if (draft.enableDragAnnotation) {
22465
- draft.enableDragAnnotation = false;
22466
- }
22467
- break;
22468
- }
22469
- case TOGGLE_PAN: {
22470
- draft.panEnabled = !draft.panEnabled;
22471
- if (draft.zoomEnabled) {
22472
- draft.zoomEnabled = false;
22473
- }
22474
- if (draft.enableDragPoints) {
22475
- draft.enableDragPoints = false;
22476
- }
22477
- if (draft.enableDragAnnotation) {
22478
- draft.enableDragAnnotation = false;
22479
- }
22480
- break;
22481
- }
22482
- case TOGGLE_POINTS: {
22483
- draft.pointsEnabled = !draft.pointsEnabled;
22484
- break;
22485
- }
22486
- case TOGGLE_LINE: {
22487
- draft.lineEnabled = !draft.lineEnabled;
22488
- break;
22489
- }
22490
- case TOGGLE_LEGEND: {
22491
- draft.legendEnabled = !draft.legendEnabled;
22492
- break;
22493
- }
22494
- case TOGGLE_TABLE: {
22495
- draft.showTable = !draft.showTable;
22496
- break;
22497
- }
22498
- case SAVE_INITIAL_AXES_RANGES: {
22499
- const { initialAxesRanges } = action.payload;
22500
- draft.initialAxesRanges = initialAxesRanges;
22501
- break;
22502
- }
22503
- case UPDATE_AXES_RANGES: {
22504
- const { axes } = action.payload;
22505
- draft.axes = axes;
22506
- break;
22507
- }
22508
- case RESET_AXES_RANGES: {
22509
- const { initialAxesRanges } = draft;
22510
- draft.axes = [...initialAxesRanges];
22511
- break;
22512
- }
22513
- case TOGGLE_DRAG_POINTS: {
22514
- draft.enableDragPoints = !draft.enableDragPoints;
22515
- if (draft.panEnabled) {
22516
- draft.panEnabled = false;
22517
- }
22518
- if (draft.zoomEnabled) {
22519
- draft.zoomEnabled = false;
22520
- }
22521
- if (draft.enableDragAnnotation) {
22522
- draft.enableDragAnnotation = false;
22523
- }
22524
- break;
22525
- }
22526
- case TOGGLE_DRAG_ANNOTATION: {
22527
- draft.enableDragAnnotation = !draft.enableDragAnnotation;
22528
- if (draft.panEnabled) {
22529
- draft.panEnabled = false;
22530
- }
22531
- if (draft.zoomEnabled) {
22532
- draft.zoomEnabled = false;
22533
- }
22534
- break;
22535
- }
22536
- case DISABLE_DRAG_OPTIONS: {
22537
- if (draft.enableDragAnnotation || draft.enableDragPoints || draft.panEnabled || draft.zoomEnabled) {
22538
- draft.enableDragAnnotation = false;
22539
- draft.enableDragPoints = false;
22540
- draft.panEnabled = false;
22541
- draft.zoomEnabled = false;
22542
- }
22543
- break;
22544
- }
22545
- }
22546
- });
22547
- };
22548
- var AxisType = /* @__PURE__ */ ((AxisType2) => {
22549
- AxisType2["X"] = "x";
22550
- AxisType2["Y"] = "y";
22551
- return AxisType2;
22552
- })(AxisType || {});
22553
- var Position = /* @__PURE__ */ ((Position2) => {
22554
- Position2["Bottom"] = "bottom";
22555
- Position2["Top"] = "top";
22556
- Position2["Left"] = "left";
22557
- Position2["Right"] = "right";
22558
- Position2["TopRight"] = "top-right";
22559
- Position2["TopLeft"] = "top-left";
22560
- Position2["BottomLeft"] = "bottom-left";
22561
- Position2["BottomRight"] = "bottom-right";
22562
- return Position2;
22563
- })(Position || {});
22564
- var ChartType$1 = /* @__PURE__ */ ((ChartType2) => {
22565
- ChartType2["Line"] = "line";
22566
- ChartType2["Bar"] = "bar";
22567
- return ChartType2;
22568
- })(ChartType$1 || {});
22569
- var CursorStyle = /* @__PURE__ */ ((CursorStyle2) => {
22570
- CursorStyle2["Pointer"] = "pointer";
22571
- CursorStyle2["Initial"] = "initial";
22572
- CursorStyle2["Grab"] = "grab";
22573
- CursorStyle2["Grabbing"] = "grabbing";
22574
- CursorStyle2["Crosshair"] = "crosshair";
22575
- CursorStyle2["Move"] = "move";
22576
- return CursorStyle2;
22577
- })(CursorStyle || {});
22578
- var ScaleType = /* @__PURE__ */ ((ScaleType2) => {
22579
- ScaleType2["Category"] = "category";
22580
- ScaleType2["Linear"] = "linear";
22581
- ScaleType2["Logarithmic"] = "logarithmic";
22582
- return ScaleType2;
22583
- })(ScaleType || {});
22584
- var ChartDirection$1 = /* @__PURE__ */ ((ChartDirection2) => {
22585
- ChartDirection2["Vertical"] = "vertical";
22586
- return ChartDirection2;
22587
- })(ChartDirection$1 || {});
22588
- var TooltipLabel = /* @__PURE__ */ ((TooltipLabel2) => {
22589
- TooltipLabel2["Y"] = "yLabel";
22590
- TooltipLabel2["X"] = "xLabel";
22591
- return TooltipLabel2;
22592
- })(TooltipLabel || {});
22593
- var AlignOptions = /* @__PURE__ */ ((AlignOptions2) => {
22594
- AlignOptions2["End"] = "end";
22595
- AlignOptions2["Start"] = "start";
22596
- AlignOptions2["Center"] = "center";
22597
- AlignOptions2["Right"] = "right";
22598
- AlignOptions2["Left"] = "left";
22599
- return AlignOptions2;
22600
- })(AlignOptions || {});
22601
- var AnnotationType$1 = /* @__PURE__ */ ((AnnotationType2) => {
22602
- AnnotationType2["Box"] = "box";
22603
- AnnotationType2["Ellipse"] = "ellipse";
22604
- AnnotationType2["Line"] = "line";
22605
- AnnotationType2["Text"] = "text";
22606
- return AnnotationType2;
22607
- })(AnnotationType$1 || {});
22608
- var PointStyle = /* @__PURE__ */ ((PointStyle2) => {
22609
- PointStyle2["Circle"] = "circle";
22610
- PointStyle2["Square"] = "rect";
22611
- PointStyle2["Diamond"] = "rectRot";
22612
- PointStyle2["Triangle"] = "triangle";
22613
- return PointStyle2;
22614
- })(PointStyle || {});
22615
- var ChartHoverMode = /* @__PURE__ */ ((ChartHoverMode2) => {
22616
- ChartHoverMode2["Nearest"] = "nearest";
22617
- return ChartHoverMode2;
22618
- })(ChartHoverMode || {});
22619
- var PanZoomMode = /* @__PURE__ */ ((PanZoomMode2) => {
22620
- PanZoomMode2["X"] = "x";
22621
- PanZoomMode2["Y"] = "y";
22622
- PanZoomMode2["XY"] = "xy";
22623
- PanZoomMode2["Z"] = "z";
22624
- return PanZoomMode2;
22625
- })(PanZoomMode || {});
22626
- var Key = /* @__PURE__ */ ((Key2) => {
22627
- Key2["Shift"] = "Shift";
22628
- return Key2;
22629
- })(Key || {});
22630
- var Events = /* @__PURE__ */ ((Events2) => {
22631
- Events2["Mousemove"] = "mousemove";
22632
- Events2["Mouseout"] = "mouseout";
22633
- Events2["Click"] = "click";
22634
- Events2["Touchstart"] = "touchstart";
22635
- Events2["Touchmove"] = "touchmove";
22636
- Events2["Dblclick"] = "dblclick";
22637
- return Events2;
22638
- })(Events || {});
22639
22427
  const MINOR_TICKS_PER_MAJOR = 10;
22640
22428
  const getLargestMajorTickWidth = (majorTickPositions) => {
22641
22429
  return majorTickPositions.reduce(
@@ -22767,55 +22555,146 @@ const GRADIENT_COLORS = [
22767
22555
  { offset: 0.99, color: "rgba(255,182,193,0.8)" }
22768
22556
  // Light red
22769
22557
  ];
22770
- const chartAreaBorderPlugin = {
22771
- id: "chartAreaBorder",
22772
- beforeDraw(chart2, _2, options) {
22773
- const {
22774
- ctx,
22775
- chartArea: { left: left2, top: top2, width, height }
22776
- } = chart2;
22777
- ctx.save();
22778
- ctx.strokeStyle = options.borderColor;
22779
- ctx.lineWidth = options.borderWidth;
22780
- ctx.setLineDash(options.borderDash || []);
22781
- ctx.lineDashOffset = options.borderDashOffset ?? 0;
22782
- ctx.strokeRect(left2, top2, width, height);
22783
- ctx.restore();
22784
- }
22785
- };
22786
- const getPlugins = (graph, legend2) => {
22787
- var _a2;
22788
- let plugins = [];
22789
- if (graph.showMinorGridlines) {
22790
- plugins.push(chartMinorGridlinesPlugin);
22791
- }
22792
- const customLegend = legend2 == null ? void 0 : legend2.customLegend;
22793
- if ((customLegend == null ? void 0 : customLegend.customLegendPlugin) && (customLegend == null ? void 0 : customLegend.customLegendContainerID)) {
22794
- plugins.push({
22795
- id: CUSTOM_LEGEND_PLUGIN_NAME,
22796
- ...(_a2 = legend2 == null ? void 0 : legend2.customLegend) == null ? void 0 : _a2.customLegendPlugin
22797
- });
22798
- }
22799
- plugins.push(chartAreaBorderPlugin);
22800
- return plugins;
22801
- };
22802
- const generateRandomColor = (colors2) => {
22803
- const color2 = `#${Math.floor(Math.random() * WHITE_COLOR_AS_DECIMAL).toString(
22804
- 16
22805
- )}`;
22806
- if (colors2.includes(color2)) {
22807
- return generateRandomColor(colors2);
22808
- } else {
22809
- colors2.push(color2);
22810
- return colors2;
22811
- }
22812
- };
22813
- const getTitle = (options) => {
22814
- return options.title !== "" ? {
22815
- display: true,
22816
- text: options.title
22817
- } : {};
22818
- };
22558
+ var AxisType = /* @__PURE__ */ ((AxisType2) => {
22559
+ AxisType2["X"] = "x";
22560
+ AxisType2["Y"] = "y";
22561
+ return AxisType2;
22562
+ })(AxisType || {});
22563
+ var Position = /* @__PURE__ */ ((Position2) => {
22564
+ Position2["Bottom"] = "bottom";
22565
+ Position2["Top"] = "top";
22566
+ Position2["Left"] = "left";
22567
+ Position2["Right"] = "right";
22568
+ Position2["TopRight"] = "top-right";
22569
+ Position2["TopLeft"] = "top-left";
22570
+ Position2["BottomLeft"] = "bottom-left";
22571
+ Position2["BottomRight"] = "bottom-right";
22572
+ return Position2;
22573
+ })(Position || {});
22574
+ var ChartType$1 = /* @__PURE__ */ ((ChartType2) => {
22575
+ ChartType2["Line"] = "line";
22576
+ ChartType2["Bar"] = "bar";
22577
+ return ChartType2;
22578
+ })(ChartType$1 || {});
22579
+ var CursorStyle = /* @__PURE__ */ ((CursorStyle2) => {
22580
+ CursorStyle2["Pointer"] = "pointer";
22581
+ CursorStyle2["Initial"] = "initial";
22582
+ CursorStyle2["Grab"] = "grab";
22583
+ CursorStyle2["Grabbing"] = "grabbing";
22584
+ CursorStyle2["Crosshair"] = "crosshair";
22585
+ CursorStyle2["Move"] = "move";
22586
+ return CursorStyle2;
22587
+ })(CursorStyle || {});
22588
+ var ScaleType = /* @__PURE__ */ ((ScaleType2) => {
22589
+ ScaleType2["Category"] = "category";
22590
+ ScaleType2["Linear"] = "linear";
22591
+ ScaleType2["Logarithmic"] = "logarithmic";
22592
+ return ScaleType2;
22593
+ })(ScaleType || {});
22594
+ var ChartDirection$1 = /* @__PURE__ */ ((ChartDirection2) => {
22595
+ ChartDirection2["Vertical"] = "vertical";
22596
+ return ChartDirection2;
22597
+ })(ChartDirection$1 || {});
22598
+ var TooltipLabel = /* @__PURE__ */ ((TooltipLabel2) => {
22599
+ TooltipLabel2["Y"] = "yLabel";
22600
+ TooltipLabel2["X"] = "xLabel";
22601
+ return TooltipLabel2;
22602
+ })(TooltipLabel || {});
22603
+ var AlignOptions = /* @__PURE__ */ ((AlignOptions2) => {
22604
+ AlignOptions2["End"] = "end";
22605
+ AlignOptions2["Start"] = "start";
22606
+ AlignOptions2["Center"] = "center";
22607
+ AlignOptions2["Right"] = "right";
22608
+ AlignOptions2["Left"] = "left";
22609
+ return AlignOptions2;
22610
+ })(AlignOptions || {});
22611
+ var AnnotationType$1 = /* @__PURE__ */ ((AnnotationType2) => {
22612
+ AnnotationType2["Box"] = "box";
22613
+ AnnotationType2["Ellipse"] = "ellipse";
22614
+ AnnotationType2["Line"] = "line";
22615
+ AnnotationType2["Text"] = "text";
22616
+ return AnnotationType2;
22617
+ })(AnnotationType$1 || {});
22618
+ var PointStyle = /* @__PURE__ */ ((PointStyle2) => {
22619
+ PointStyle2["Circle"] = "circle";
22620
+ PointStyle2["Square"] = "rect";
22621
+ PointStyle2["Diamond"] = "rectRot";
22622
+ PointStyle2["Triangle"] = "triangle";
22623
+ return PointStyle2;
22624
+ })(PointStyle || {});
22625
+ var ChartHoverMode = /* @__PURE__ */ ((ChartHoverMode2) => {
22626
+ ChartHoverMode2["Nearest"] = "nearest";
22627
+ return ChartHoverMode2;
22628
+ })(ChartHoverMode || {});
22629
+ var PanZoomMode = /* @__PURE__ */ ((PanZoomMode2) => {
22630
+ PanZoomMode2["X"] = "x";
22631
+ PanZoomMode2["Y"] = "y";
22632
+ PanZoomMode2["XY"] = "xy";
22633
+ PanZoomMode2["Z"] = "z";
22634
+ return PanZoomMode2;
22635
+ })(PanZoomMode || {});
22636
+ var Key = /* @__PURE__ */ ((Key2) => {
22637
+ Key2["Shift"] = "Shift";
22638
+ return Key2;
22639
+ })(Key || {});
22640
+ var Events = /* @__PURE__ */ ((Events2) => {
22641
+ Events2["Mousemove"] = "mousemove";
22642
+ Events2["Mouseout"] = "mouseout";
22643
+ Events2["Click"] = "click";
22644
+ Events2["Touchstart"] = "touchstart";
22645
+ Events2["Touchmove"] = "touchmove";
22646
+ Events2["Dblclick"] = "dblclick";
22647
+ return Events2;
22648
+ })(Events || {});
22649
+ const chartAreaBorderPlugin = {
22650
+ id: "chartAreaBorder",
22651
+ beforeDraw(chart2, _2, options) {
22652
+ const {
22653
+ ctx,
22654
+ chartArea: { left: left2, top: top2, width, height }
22655
+ } = chart2;
22656
+ ctx.save();
22657
+ ctx.strokeStyle = options.borderColor;
22658
+ ctx.lineWidth = options.borderWidth;
22659
+ ctx.setLineDash(options.borderDash || []);
22660
+ ctx.lineDashOffset = options.borderDashOffset ?? 0;
22661
+ ctx.strokeRect(left2, top2, width, height);
22662
+ ctx.restore();
22663
+ }
22664
+ };
22665
+ const getPlugins = (graph, legend2) => {
22666
+ var _a2;
22667
+ let plugins = [];
22668
+ if (graph.showMinorGridlines) {
22669
+ plugins.push(chartMinorGridlinesPlugin);
22670
+ }
22671
+ const customLegend = legend2 == null ? void 0 : legend2.customLegend;
22672
+ if ((customLegend == null ? void 0 : customLegend.customLegendPlugin) && (customLegend == null ? void 0 : customLegend.customLegendContainerID)) {
22673
+ plugins.push({
22674
+ id: CUSTOM_LEGEND_PLUGIN_NAME,
22675
+ ...(_a2 = legend2 == null ? void 0 : legend2.customLegend) == null ? void 0 : _a2.customLegendPlugin
22676
+ });
22677
+ }
22678
+ plugins.push(chartAreaBorderPlugin);
22679
+ return plugins;
22680
+ };
22681
+ const generateRandomColor = (colors2) => {
22682
+ const color2 = `#${Math.floor(Math.random() * WHITE_COLOR_AS_DECIMAL).toString(
22683
+ 16
22684
+ )}`;
22685
+ if (colors2.includes(color2)) {
22686
+ return generateRandomColor(colors2);
22687
+ } else {
22688
+ colors2.push(color2);
22689
+ return colors2;
22690
+ }
22691
+ };
22692
+ const getTitle = (options) => {
22693
+ return options.title !== "" ? {
22694
+ display: true,
22695
+ text: options.title
22696
+ } : {};
22697
+ };
22819
22698
  const isVertical = (direction) => {
22820
22699
  return direction === ChartDirection$1.Vertical;
22821
22700
  };
@@ -22898,28 +22777,121 @@ const isNilOrEmpty = (value) => {
22898
22777
  }
22899
22778
  return false;
22900
22779
  };
22901
- const isLessThanMax = (value, max) => {
22902
- return value === void 0 || max === void 0 || Number(value) < Number(max);
22903
- };
22904
- const isGreaterThanMin = (value, min) => {
22905
- return value === void 0 || min === void 0 || Number(value) > Number(min);
22906
- };
22907
- const generateAxisId = (axisType, index2 = 0, hasMultiAxes = false) => {
22908
- const i2 = hasMultiAxes && index2 !== 0 ? index2 + 1 : "";
22909
- return `${axisType}${i2}`;
22910
- };
22911
- const getAxisTypeFromKey = (string) => {
22912
- var _a2;
22913
- return ((_a2 = string == null ? void 0 : string.match(/[^0-9/]+/gi)) == null ? void 0 : _a2[0]) ?? "";
22914
- };
22915
- const generateKey = (values) => {
22916
- const key = values.join("");
22917
- return key;
22780
+ const isEmptyString = (value) => value === "";
22781
+ const chart$3 = "_chart_e3qdd_1";
22782
+ const canvas$2 = "_canvas_e3qdd_11";
22783
+ const fixedHeight$3 = "_fixedHeight_e3qdd_20";
22784
+ const stretchHeight$3 = "_stretchHeight_e3qdd_26";
22785
+ const squareAspectRatio$1 = "_squareAspectRatio_e3qdd_32";
22786
+ const table = "_table_e3qdd_62";
22787
+ const styles$5 = {
22788
+ chart: chart$3,
22789
+ canvas: canvas$2,
22790
+ fixedHeight: fixedHeight$3,
22791
+ stretchHeight: stretchHeight$3,
22792
+ squareAspectRatio: squareAspectRatio$1,
22793
+ table
22918
22794
  };
22919
- const isPrimitiveValue = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null;
22920
- const isRangeValid = (r2) => {
22921
- if (!r2) return false;
22922
- return Object.values(r2).some((value) => !isNilOrEmpty(value));
22795
+ const TOGGLE_ZOOM = "TOGGLE_ZOOM";
22796
+ const TOGGLE_PAN = "TOGGLE_PAN";
22797
+ const TOGGLE_POINTS = "TOGGLE_POINTS";
22798
+ const TOGGLE_LINE = "TOGGLE_LINE";
22799
+ const TOGGLE_LEGEND = "TOGGLE_LEGEND";
22800
+ const TOGGLE_TABLE = "TOGGLE_TABLE";
22801
+ const RESET_AXES_RANGES = "RESET_AXES_RANGES";
22802
+ const UPDATE_AXES_RANGES = "UPDATE_AXES_RANGES";
22803
+ const TOGGLE_DRAG_POINTS = "TOGGLE_DRAG_POINTS";
22804
+ const TOGGLE_DRAG_ANNOTATION = "TOGGLE_DRAG_ANNOTATION";
22805
+ const DISABLE_DRAG_OPTIONS = "DISABLE_DRAG_OPTIONS";
22806
+ const reducer = (state, action) => {
22807
+ return produce(state, (draft) => {
22808
+ switch (action.type) {
22809
+ case TOGGLE_ZOOM: {
22810
+ draft.zoomEnabled = !draft.zoomEnabled;
22811
+ if (draft.panEnabled) {
22812
+ draft.panEnabled = false;
22813
+ }
22814
+ if (draft.enableDragPoints) {
22815
+ draft.enableDragPoints = false;
22816
+ }
22817
+ if (draft.enableDragAnnotation) {
22818
+ draft.enableDragAnnotation = false;
22819
+ }
22820
+ break;
22821
+ }
22822
+ case TOGGLE_PAN: {
22823
+ draft.panEnabled = !draft.panEnabled;
22824
+ if (draft.zoomEnabled) {
22825
+ draft.zoomEnabled = false;
22826
+ }
22827
+ if (draft.enableDragPoints) {
22828
+ draft.enableDragPoints = false;
22829
+ }
22830
+ if (draft.enableDragAnnotation) {
22831
+ draft.enableDragAnnotation = false;
22832
+ }
22833
+ break;
22834
+ }
22835
+ case TOGGLE_POINTS: {
22836
+ draft.pointsEnabled = !draft.pointsEnabled;
22837
+ break;
22838
+ }
22839
+ case TOGGLE_LINE: {
22840
+ draft.lineEnabled = !draft.lineEnabled;
22841
+ break;
22842
+ }
22843
+ case TOGGLE_LEGEND: {
22844
+ draft.legendEnabled = !draft.legendEnabled;
22845
+ break;
22846
+ }
22847
+ case TOGGLE_TABLE: {
22848
+ draft.showTable = !draft.showTable;
22849
+ break;
22850
+ }
22851
+ case UPDATE_AXES_RANGES: {
22852
+ const { axes } = action.payload;
22853
+ draft.axes = axes;
22854
+ break;
22855
+ }
22856
+ case RESET_AXES_RANGES: {
22857
+ const { axes } = action.payload;
22858
+ draft.axes = axes;
22859
+ break;
22860
+ }
22861
+ case TOGGLE_DRAG_POINTS: {
22862
+ draft.enableDragPoints = !draft.enableDragPoints;
22863
+ if (draft.panEnabled) {
22864
+ draft.panEnabled = false;
22865
+ }
22866
+ if (draft.zoomEnabled) {
22867
+ draft.zoomEnabled = false;
22868
+ }
22869
+ if (draft.enableDragAnnotation) {
22870
+ draft.enableDragAnnotation = false;
22871
+ }
22872
+ break;
22873
+ }
22874
+ case TOGGLE_DRAG_ANNOTATION: {
22875
+ draft.enableDragAnnotation = !draft.enableDragAnnotation;
22876
+ if (draft.panEnabled) {
22877
+ draft.panEnabled = false;
22878
+ }
22879
+ if (draft.zoomEnabled) {
22880
+ draft.zoomEnabled = false;
22881
+ }
22882
+ break;
22883
+ }
22884
+ case DISABLE_DRAG_OPTIONS: {
22885
+ if (draft.enableDragAnnotation || draft.enableDragPoints || draft.panEnabled || draft.zoomEnabled) {
22886
+ draft.enableDragAnnotation = false;
22887
+ draft.enableDragPoints = false;
22888
+ draft.panEnabled = false;
22889
+ draft.zoomEnabled = false;
22890
+ }
22891
+ break;
22892
+ }
22893
+ }
22894
+ });
22923
22895
  };
22924
22896
  const getChartStateFromStorage = (persistenceId) => {
22925
22897
  if (!persistenceId) return null;
@@ -22964,8 +22936,6 @@ const storeChartStateInStorage = (state, persistenceId) => {
22964
22936
  };
22965
22937
  const initialState = ({ options, persistenceId }) => {
22966
22938
  const {
22967
- additionalAxesOptions: { range: customAxesRange = {} },
22968
- axes,
22969
22939
  chartOptions: {
22970
22940
  enableZoom,
22971
22941
  enablePan,
@@ -22976,45 +22946,6 @@ const initialState = ({ options, persistenceId }) => {
22976
22946
  legend: { display },
22977
22947
  dragData
22978
22948
  } = options;
22979
- const getStateAxesByType = (axisType, customAxesRange2) => {
22980
- var _a2, _b2, _c2, _d2, _e2;
22981
- if (!axes[axisType]) {
22982
- return [];
22983
- }
22984
- if (((_a2 = axes[axisType]) == null ? void 0 : _a2.length) > 1) {
22985
- return axes[axisType].map((axisObj, index2) => {
22986
- var _a3, _b3;
22987
- const id = generateAxisId(axisType, index2, axes[axisType].length > 1);
22988
- const customMin = (_a3 = customAxesRange2 == null ? void 0 : customAxesRange2[id]) == null ? void 0 : _a3.min;
22989
- const customMax = (_b3 = customAxesRange2 == null ? void 0 : customAxesRange2[id]) == null ? void 0 : _b3.max;
22990
- const { unit } = axisObj;
22991
- return {
22992
- id,
22993
- //only add custom axis ranges if defined:
22994
- ...customMin ? { min: customMin } : {},
22995
- ...customMax ? { max: customMax } : {},
22996
- ...unit ? { unit } : {}
22997
- };
22998
- });
22999
- } else {
23000
- const id = generateAxisId(axisType);
23001
- const customMin = (_b2 = customAxesRange2 == null ? void 0 : customAxesRange2[id]) == null ? void 0 : _b2.min;
23002
- const customMax = (_c2 = customAxesRange2 == null ? void 0 : customAxesRange2[id]) == null ? void 0 : _c2.max;
23003
- const unit = (_e2 = (_d2 = axes == null ? void 0 : axes[id]) == null ? void 0 : _d2[0]) == null ? void 0 : _e2.unit;
23004
- return [
23005
- {
23006
- id,
23007
- //only add custom axis ranges if defined:
23008
- ...customMin ? { min: customMin } : {},
23009
- ...customMax ? { max: customMax } : {},
23010
- ...unit ? { unit } : {}
23011
- }
23012
- ];
23013
- }
23014
- };
23015
- const xStateAxes = getStateAxesByType(AxisType.X, customAxesRange);
23016
- const yStateAxes = getStateAxesByType(AxisType.Y, customAxesRange);
23017
- const stateAxes = [...xStateAxes, ...yStateAxes];
23018
22949
  const {
23019
22950
  zoomEnabled,
23020
22951
  panEnabled,
@@ -23030,11 +22961,10 @@ const initialState = ({ options, persistenceId }) => {
23030
22961
  pointsEnabled: pointsEnabled ?? showPoints,
23031
22962
  lineEnabled: lineEnabled ?? showLine,
23032
22963
  legendEnabled: legendEnabled ?? display,
23033
- axes: stateAxes,
22964
+ axes: [],
23034
22965
  showTable: false,
23035
22966
  enableDragPoints: (dragData == null ? void 0 : dragData.enableDragData) && enableDragPoints,
23036
- enableDragAnnotation: enableDragAnnotation ?? enableDragAnnotationStorage,
23037
- initialAxesRanges: []
22967
+ enableDragAnnotation: enableDragAnnotation ?? enableDragAnnotationStorage
23038
22968
  };
23039
22969
  };
23040
22970
  const ControlsPortal = ({
@@ -24364,6 +24294,29 @@ const downloadPgn = (chartRef, state) => {
24364
24294
  distExports.triggerBase64Download(dataUrl, fileName);
24365
24295
  });
24366
24296
  };
24297
+ const isLessThanMax = (value, max) => {
24298
+ return value === void 0 || max === void 0 || Number(value) < Number(max);
24299
+ };
24300
+ const isGreaterThanMin = (value, min) => {
24301
+ return value === void 0 || min === void 0 || Number(value) > Number(min);
24302
+ };
24303
+ const generateAxisId = (axisType, index2 = 0, hasMultiAxes = false) => {
24304
+ const i2 = hasMultiAxes && index2 !== 0 ? index2 + 1 : "";
24305
+ return `${axisType}${i2}`;
24306
+ };
24307
+ const getAxisTypeFromKey = (string) => {
24308
+ var _a2;
24309
+ return ((_a2 = string == null ? void 0 : string.match(/[^0-9/]+/gi)) == null ? void 0 : _a2[0]) ?? "";
24310
+ };
24311
+ const generateKey = (values) => {
24312
+ const key = values.join("");
24313
+ return key;
24314
+ };
24315
+ const isPrimitiveValue = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null;
24316
+ const isRangeValid = (r2) => {
24317
+ if (!r2) return false;
24318
+ return Object.values(r2).some((value) => !isNilOrEmpty(value));
24319
+ };
24367
24320
  const useChartFunctions = ({
24368
24321
  chartRef,
24369
24322
  state,
@@ -24378,8 +24331,9 @@ const useChartFunctions = ({
24378
24331
  const resetZoom2 = useCallback(() => {
24379
24332
  const chartInstance = chartRef == null ? void 0 : chartRef.current;
24380
24333
  chartInstance == null ? void 0 : chartInstance.resetZoom();
24381
- dispatch({ type: "RESET_AXES_RANGES" });
24382
- }, [chartRef]);
24334
+ chartInstance == null ? void 0 : chartInstance.reset();
24335
+ dispatch({ type: "RESET_AXES_RANGES", payload: { axes: [] } });
24336
+ }, [chartRef == null ? void 0 : chartRef.current, dispatch]);
24383
24337
  const onHover = useCallback(
24384
24338
  (hoveredPoint, setHoveredPoint) => {
24385
24339
  return (evt, hoveredItems) => {
@@ -24402,7 +24356,7 @@ const useChartFunctions = ({
24402
24356
  );
24403
24357
  const handleDownload = useCallback(
24404
24358
  () => downloadPgn(chartRef, state),
24405
- [chartRef, state.axes]
24359
+ [chartRef == null ? void 0 : chartRef.current, state.axes]
24406
24360
  );
24407
24361
  const handleKeyDown = useCallback(
24408
24362
  (event) => {
@@ -24417,7 +24371,7 @@ const useChartFunctions = ({
24417
24371
  }
24418
24372
  }
24419
24373
  },
24420
- [chartRef]
24374
+ [chartRef == null ? void 0 : chartRef.current]
24421
24375
  );
24422
24376
  const handleKeyUp = useCallback(
24423
24377
  (event) => {
@@ -24432,7 +24386,7 @@ const useChartFunctions = ({
24432
24386
  }
24433
24387
  }
24434
24388
  },
24435
- [chartRef]
24389
+ [chartRef == null ? void 0 : chartRef.current]
24436
24390
  );
24437
24391
  const getControlsAxesLabels = useCallback(
24438
24392
  (propsAxes) => {
@@ -24453,11 +24407,10 @@ const useChartFunctions = ({
24453
24407
  });
24454
24408
  }
24455
24409
  };
24456
- const axesLabels = [
24410
+ return [
24457
24411
  ...getAxesLabels(propsAxes, AxisType.X),
24458
24412
  ...getAxesLabels(propsAxes, AxisType.Y)
24459
24413
  ];
24460
- return axesLabels;
24461
24414
  },
24462
24415
  [axes]
24463
24416
  );
@@ -24477,8 +24430,11 @@ const useChartFunctions = ({
24477
24430
  });
24478
24431
  }, [axes]);
24479
24432
  const onResetAxes = useCallback(() => {
24480
- dispatch({ type: RESET_AXES_RANGES });
24481
- }, []);
24433
+ const chartInstance = chartRef == null ? void 0 : chartRef.current;
24434
+ chartInstance == null ? void 0 : chartInstance.resetZoom();
24435
+ chartInstance == null ? void 0 : chartInstance.reset();
24436
+ dispatch({ type: RESET_AXES_RANGES, payload: { axes: [] } });
24437
+ }, [chartRef == null ? void 0 : chartRef.current]);
24482
24438
  const onUpdateAxes = useCallback(({ axes: axes2 }) => {
24483
24439
  dispatch({ type: UPDATE_AXES_RANGES, payload: { axes: axes2 } });
24484
24440
  }, []);
@@ -24494,27 +24450,6 @@ const useChartFunctions = ({
24494
24450
  onUpdateAxes
24495
24451
  };
24496
24452
  };
24497
- var actionTypes = /* @__PURE__ */ ((actionTypes2) => {
24498
- actionTypes2["Reset"] = "reset";
24499
- actionTypes2["ValueUpdated"] = "valueUpdated";
24500
- actionTypes2["UnitUpdated"] = "unitUpdated";
24501
- return actionTypes2;
24502
- })(actionTypes || {});
24503
- const initializeFormState = ({
24504
- initialAxesRanges,
24505
- axes = []
24506
- }) => {
24507
- return (initialAxesRanges == null ? void 0 : initialAxesRanges.map((initialAxisRange) => {
24508
- const currentAxisRange = axes.find((a2) => a2.id === initialAxisRange.id);
24509
- return {
24510
- id: initialAxisRange.id,
24511
- min: (currentAxisRange == null ? void 0 : currentAxisRange.min) ?? (initialAxisRange == null ? void 0 : initialAxisRange.min),
24512
- max: (currentAxisRange == null ? void 0 : currentAxisRange.max) ?? (initialAxisRange == null ? void 0 : initialAxisRange.max),
24513
- unit: currentAxisRange == null ? void 0 : currentAxisRange.unit
24514
- };
24515
- })) || [];
24516
- };
24517
- const isEmptyString = (value) => value === "";
24518
24453
  const createErrorMessages = (value, compareTo, type) => {
24519
24454
  const errors = [];
24520
24455
  if (isEmptyString(value)) errors.push("mustHaveAValue");
@@ -24525,150 +24460,114 @@ const createErrorMessages = (value, compareTo, type) => {
24525
24460
  }
24526
24461
  return errors;
24527
24462
  };
24528
- const validateAxes = (formState) => {
24529
- return formState.reduce(
24530
- (acc, { id, min, max }) => {
24531
- return produce(acc, (draft) => {
24532
- var _a2;
24533
- const errors = {
24534
- min: createErrorMessages(String(min), String(max), "min"),
24535
- max: createErrorMessages(String(max), String(min), "max")
24536
- };
24537
- (_a2 = draft == null ? void 0 : draft.errors) == null ? void 0 : _a2.push({
24538
- id,
24539
- ...errors
24540
- });
24541
- draft.valid = !(!acc.valid || !!errors.min.length || !!errors.max.length);
24542
- });
24543
- },
24544
- { errors: [], valid: true }
24463
+ const validateAxes = (axes) => {
24464
+ const errors = axes.map(({ id, min, max }) => ({
24465
+ id,
24466
+ min: createErrorMessages(String(min), String(max), "min"),
24467
+ max: createErrorMessages(String(max), String(min), "max")
24468
+ }));
24469
+ const valid = errors.every(
24470
+ (error) => error.min.length === 0 && error.max.length === 0
24545
24471
  );
24472
+ return { errors, valid };
24546
24473
  };
24547
- const reducer = (state, action) => {
24548
- switch (action.type) {
24549
- case actionTypes.Reset: {
24550
- const { initialAxesRanges, axes } = action.payload;
24551
- return initializeFormState({ initialAxesRanges, axes });
24552
- }
24553
- case actionTypes.ValueUpdated:
24554
- return produce(state, (draft) => {
24555
- const { name, value, id } = action.payload;
24556
- const axis = draft.find((a2) => a2.id === id);
24557
- if (axis && value) {
24558
- axis[name] = value;
24559
- }
24560
- });
24561
- case actionTypes.UnitUpdated:
24562
- return produce(state, (draft) => {
24563
- var _a2;
24564
- const { name, value, id } = action.payload;
24565
- const unit = (_a2 = draft.find((a2) => a2.id === id)) == null ? void 0 : _a2.unit;
24566
- if (unit && name) {
24567
- unit[name] = value;
24568
- }
24569
- });
24570
- default:
24571
- return state;
24572
- }
24474
+ const RANGE_GAP$1 = 1;
24475
+ const getInitAxes = ({ chartRef, state }) => {
24476
+ const chart2 = chartRef == null ? void 0 : chartRef.current;
24477
+ if (!chart2) return [];
24478
+ const initScales = (chart2 == null ? void 0 : chart2.getInitialScaleBounds()) ?? {};
24479
+ return Object.entries(initScales).map(([id, { min = "", max = "" }]) => {
24480
+ var _a2;
24481
+ let adjustedMin = Number(min);
24482
+ let adjustedMax = Number(max);
24483
+ if (isNaN(adjustedMin)) adjustedMin = 0;
24484
+ if (isNaN(adjustedMax)) adjustedMax = adjustedMin + RANGE_GAP$1;
24485
+ if (adjustedMin === adjustedMax) {
24486
+ adjustedMax += RANGE_GAP$1;
24487
+ }
24488
+ const { unit } = ((_a2 = state == null ? void 0 : state.axes) == null ? void 0 : _a2.find((axis) => axis.id === id)) ?? {};
24489
+ return {
24490
+ id,
24491
+ min: adjustedMin,
24492
+ max: adjustedMax,
24493
+ unit
24494
+ };
24495
+ });
24573
24496
  };
24574
24497
  const AxesOptionsPopover = (optionsPopover) => {
24575
24498
  var _a2;
24576
24499
  const {
24577
- initialAxesRanges,
24578
- axes,
24500
+ state,
24579
24501
  controlsAxesLabels,
24580
24502
  onUpdateAxes,
24581
24503
  onResetAxes,
24582
24504
  depthType,
24583
24505
  translations,
24584
- close
24585
- } = optionsPopover;
24586
- const [depthTypeState, setDepthTypeState] = useState(
24587
- depthType == null ? void 0 : depthType.selectedDepthType
24588
- );
24589
- const [formState, dispatch] = useReducer(
24590
- reducer,
24591
- {
24592
- axes,
24593
- initialAxesRanges
24594
- },
24595
- initializeFormState
24596
- );
24597
- const { errors, valid } = validateAxes(formState);
24506
+ close,
24507
+ chartRef
24508
+ } = optionsPopover ?? {};
24509
+ const [formState, setFormState] = useState({
24510
+ localAxes: getInitAxes({ chartRef, state }),
24511
+ depthType: depthType == null ? void 0 : depthType.selectedDepthType,
24512
+ edited: false
24513
+ });
24514
+ const { errors, valid } = validateAxes(formState.localAxes);
24598
24515
  const onEditValue = ({ name, value, id }) => {
24599
- dispatch({
24600
- type: actionTypes.ValueUpdated,
24601
- payload: { name, value, id }
24602
- });
24516
+ setFormState((prevState) => ({
24517
+ ...prevState,
24518
+ localAxes: prevState.localAxes.map(
24519
+ (axis) => axis.id === id ? { ...axis, [name]: value } : axis
24520
+ ),
24521
+ edited: true
24522
+ }));
24603
24523
  };
24604
24524
  const onEditUnit = ({ name, value, id }) => {
24605
- dispatch({
24606
- type: actionTypes.UnitUpdated,
24607
- payload: { name, value, id }
24608
- });
24525
+ setFormState((prevState) => ({
24526
+ ...prevState,
24527
+ localAxes: prevState.localAxes.map(
24528
+ (axis) => axis.id === id && typeof axis.unit === "object" ? {
24529
+ ...axis,
24530
+ unit: {
24531
+ ...axis.unit,
24532
+ [name]: value
24533
+ }
24534
+ } : axis
24535
+ ),
24536
+ edited: true
24537
+ }));
24609
24538
  };
24610
24539
  const onDone = (e2) => {
24611
24540
  e2.preventDefault();
24612
24541
  if (valid) {
24613
- const sanitizedFormState = formState.map((axis) => ({
24614
- ...axis,
24615
- min: typeof axis.min === "string" ? Number(axis.min) : axis.min,
24616
- max: typeof axis.max === "string" ? Number(axis.max) : axis.max
24617
- }));
24618
- onUpdateAxes({
24619
- axes: sanitizedFormState
24620
- });
24621
- sanitizedFormState.map((el, i2) => {
24622
- var _a3, _b2, _c2;
24623
- const selectedUnit = (_a3 = el.unit) == null ? void 0 : _a3.selectedUnit;
24624
- if (selectedUnit) {
24625
- (_c2 = (_b2 = axes == null ? void 0 : axes[i2]) == null ? void 0 : _b2.unit) == null ? void 0 : _c2.setSelectedUnit(selectedUnit);
24626
- }
24627
- });
24628
- if (depthType && (depthType == null ? void 0 : depthType.setSelectedDepthType)) {
24629
- depthType == null ? void 0 : depthType.setSelectedDepthType(depthTypeState);
24630
- }
24542
+ onUpdateAxes({ axes: formState.localAxes });
24543
+ close == null ? void 0 : close();
24631
24544
  }
24632
- close == null ? void 0 : close();
24633
24545
  };
24634
24546
  const onReset = () => {
24635
- dispatch({
24636
- type: actionTypes.Reset,
24637
- payload: { axes, initialAxesRanges }
24638
- });
24639
- initialAxesRanges.map((el, i2) => {
24640
- var _a3, _b2, _c2;
24641
- const selectedUnit = (_a3 = el.unit) == null ? void 0 : _a3.selectedUnit;
24642
- if (selectedUnit) {
24643
- (_c2 = (_b2 = axes == null ? void 0 : axes[i2]) == null ? void 0 : _b2.unit) == null ? void 0 : _c2.setSelectedUnit(selectedUnit);
24644
- }
24547
+ setFormState({
24548
+ localAxes: getInitAxes({ chartRef, state }),
24549
+ depthType: depthType == null ? void 0 : depthType.selectedDepthType,
24550
+ edited: false
24645
24551
  });
24646
24552
  onResetAxes();
24647
24553
  close == null ? void 0 : close();
24648
24554
  };
24649
- const isCustomValue = axes.filter((axis) => axis.max || axis.min).length > 0;
24650
24555
  const handleInputFocus = (e2) => e2.target.select();
24651
24556
  return /* @__PURE__ */ jsxs("form", { onSubmit: onDone, children: [
24652
- axes.map((axis, i2) => {
24653
- var _a3, _b2, _c2;
24557
+ formState.localAxes.map((axis) => {
24558
+ var _a3, _b2;
24654
24559
  const axisControl = controlsAxesLabels.find(
24655
24560
  (el) => el.id === axis.id
24656
24561
  );
24657
- const axisLabel = axisControl == null ? void 0 : axisControl.label;
24658
- const axisState = formState.find(
24659
- (a2) => a2.id === axis.id
24660
- );
24661
- const axisErrors = errors == null ? void 0 : errors.find((a2) => a2.id === axis.id);
24662
- const { min, max, unit } = axisState || {};
24663
- const minErrorMsg = ((_a3 = axisErrors == null ? void 0 : axisErrors.min) == null ? void 0 : _a3[0]) ? translations[axisErrors.min[0]] : null;
24664
- const maxErrorMsg = ((_b2 = axisErrors == null ? void 0 : axisErrors.max) == null ? void 0 : _b2[0]) ? translations[axisErrors.max[0]] : null;
24665
- return /* @__PURE__ */ jsx(Field, { label: axisLabel || axis.id || "", children: /* @__PURE__ */ jsxs(InputGroup, { small: true, width: "300px", children: [
24562
+ const axisLabel = (axisControl == null ? void 0 : axisControl.label) || startCase(axis.id);
24563
+ const axisErrors = errors.find((err) => err.id === axis.id);
24564
+ return /* @__PURE__ */ jsx(Field, { label: axisLabel, children: /* @__PURE__ */ jsxs(InputGroup, { small: true, width: "300px", children: [
24666
24565
  /* @__PURE__ */ jsx(
24667
24566
  NumberInput,
24668
24567
  {
24669
24568
  name: "min",
24670
- value: min,
24671
- error: minErrorMsg,
24569
+ value: axis.min,
24570
+ error: ((_a3 = axisErrors == null ? void 0 : axisErrors.min) == null ? void 0 : _a3[0]) ? translations[axisErrors.min[0]] : null,
24672
24571
  width: "100%",
24673
24572
  onChange: (evt) => onEditValue({
24674
24573
  name: evt.target.name,
@@ -24683,8 +24582,8 @@ const AxesOptionsPopover = (optionsPopover) => {
24683
24582
  NumberInput,
24684
24583
  {
24685
24584
  name: "max",
24686
- value: max,
24687
- error: maxErrorMsg,
24585
+ value: axis.max,
24586
+ error: ((_b2 = axisErrors == null ? void 0 : axisErrors.max) == null ? void 0 : _b2[0]) ? translations[axisErrors.max[0]] : null,
24688
24587
  width: "100%",
24689
24588
  onChange: (evt) => onEditValue({
24690
24589
  name: evt.target.name,
@@ -24698,22 +24597,20 @@ const AxesOptionsPopover = (optionsPopover) => {
24698
24597
  Select,
24699
24598
  {
24700
24599
  name: "selectedUnit",
24701
- options: (_c2 = axis == null ? void 0 : axis.unit) == null ? void 0 : _c2.options,
24702
- value: typeof unit !== "string" ? unit == null ? void 0 : unit.selectedUnit : void 0,
24703
- onChange: (e2) => {
24704
- onEditUnit({
24705
- name: e2.target.name,
24706
- value: e2.target.value,
24707
- id: axis.id
24708
- });
24709
- },
24600
+ options: typeof axis.unit !== "string" ? axis.unit.options : [],
24601
+ value: typeof axis.unit !== "string" ? axis.unit.selectedUnit : void 0,
24602
+ onChange: (e2) => onEditUnit({
24603
+ name: e2.target.name,
24604
+ value: e2.target.value,
24605
+ id: axis.id
24606
+ }),
24710
24607
  autoLayerWidth: true,
24711
24608
  width: "15%"
24712
24609
  }
24713
24610
  ) : null
24714
- ] }) }, i2);
24611
+ ] }) }, axis.id);
24715
24612
  }),
24716
- ((_a2 = depthType == null ? void 0 : depthType.options) == null ? void 0 : _a2.length) > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
24613
+ ((_a2 = depthType == null ? void 0 : depthType.options) == null ? void 0 : _a2.length) > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
24717
24614
  /* @__PURE__ */ jsx(
24718
24615
  ButtonGroup,
24719
24616
  {
@@ -24721,15 +24618,16 @@ const AxesOptionsPopover = (optionsPopover) => {
24721
24618
  key: i2,
24722
24619
  label: depth
24723
24620
  })),
24724
- onSelected: (key) => {
24725
- setDepthTypeState(depthType.options[key]);
24726
- },
24621
+ onSelected: (key) => setFormState((prevState) => ({
24622
+ ...prevState,
24623
+ depthType: depthType.options[key]
24624
+ })),
24727
24625
  small: true,
24728
- value: depthType.options.indexOf(depthTypeState)
24626
+ value: depthType.options.indexOf(formState.depthType)
24729
24627
  }
24730
24628
  ),
24731
24629
  /* @__PURE__ */ jsx(Spacer, {})
24732
- ] }) : null,
24630
+ ] }),
24733
24631
  /* @__PURE__ */ jsxs(Flex, { gap: "8px", alignItems: "center", children: [
24734
24632
  /* @__PURE__ */ jsx(
24735
24633
  Button,
@@ -24738,7 +24636,7 @@ const AxesOptionsPopover = (optionsPopover) => {
24738
24636
  small: true,
24739
24637
  colored: true,
24740
24638
  label: translations.done,
24741
- disabled: !valid
24639
+ disabled: !valid || !formState.edited
24742
24640
  }
24743
24641
  ),
24744
24642
  /* @__PURE__ */ jsx(
@@ -24747,8 +24645,7 @@ const AxesOptionsPopover = (optionsPopover) => {
24747
24645
  small: true,
24748
24646
  name: "resetAxes",
24749
24647
  label: translations.resetAxes,
24750
- onClick: onReset,
24751
- disabled: !isCustomValue
24648
+ onClick: onReset
24752
24649
  }
24753
24650
  ),
24754
24651
  /* @__PURE__ */ jsx(Text, { small: true, muted: true, children: translations.orDoubleClickToCanvas })
@@ -24756,36 +24653,16 @@ const AxesOptionsPopover = (optionsPopover) => {
24756
24653
  ] });
24757
24654
  };
24758
24655
  const AxesOptions = (optionsPopover) => {
24759
- const {
24760
- initialAxesRanges,
24761
- axes,
24762
- controlsAxesLabels,
24763
- onUpdateAxes,
24764
- onResetAxes,
24765
- depthType,
24766
- translations
24767
- } = optionsPopover;
24768
24656
  return /* @__PURE__ */ jsx(
24769
24657
  Popover,
24770
24658
  {
24771
24659
  placement: "bottom-start",
24772
24660
  overflowContainer: true,
24773
- content: /* @__PURE__ */ jsx(
24774
- AxesOptionsPopover,
24775
- {
24776
- initialAxesRanges,
24777
- axes,
24778
- controlsAxesLabels,
24779
- onUpdateAxes,
24780
- onResetAxes,
24781
- depthType,
24782
- translations
24783
- }
24784
- ),
24661
+ content: /* @__PURE__ */ jsx(AxesOptionsPopover, { ...optionsPopover }),
24785
24662
  children: /* @__PURE__ */ jsx(
24786
24663
  Tooltip$2,
24787
24664
  {
24788
- text: translations.axesOptions,
24665
+ text: optionsPopover.translations.axesOptions,
24789
24666
  placement: "bottom-start",
24790
24667
  display: "inline-flex",
24791
24668
  children: /* @__PURE__ */ jsx(Button, { small: true, basic: true, colored: "muted", round: true, icon: /* @__PURE__ */ jsx(TbRuler, {}) })
@@ -24795,9 +24672,9 @@ const AxesOptions = (optionsPopover) => {
24795
24672
  );
24796
24673
  };
24797
24674
  const Controls = ({
24675
+ table: table2,
24798
24676
  headerComponent,
24799
24677
  subheaderComponent,
24800
- table: table2,
24801
24678
  chartRef,
24802
24679
  state,
24803
24680
  options,
@@ -24808,7 +24685,6 @@ const Controls = ({
24808
24685
  }) => {
24809
24686
  const {
24810
24687
  enableDragPoints,
24811
- initialAxesRanges,
24812
24688
  lineEnabled,
24813
24689
  panEnabled,
24814
24690
  pointsEnabled,
@@ -24883,8 +24759,8 @@ const Controls = ({
24883
24759
  /* @__PURE__ */ jsx(
24884
24760
  AxesOptions,
24885
24761
  {
24886
- initialAxesRanges,
24887
- axes: state.axes,
24762
+ chartRef,
24763
+ state,
24888
24764
  controlsAxesLabels,
24889
24765
  onUpdateAxes,
24890
24766
  onResetAxes,
@@ -25198,8 +25074,8 @@ const generateLineChartDatasets = (datasets, state, options, { label }) => {
25198
25074
  const { lineEnabled, pointsEnabled, axes = [] } = state ?? {};
25199
25075
  const { lineTension, spanGaps } = graph ?? {};
25200
25076
  if (formation) {
25201
- const axesMin = (_a2 = axes[0]) == null ? void 0 : _a2.min;
25202
- const axesMax = (_b2 = axes[0]) == null ? void 0 : _b2.max;
25077
+ const axesMin = Number((_a2 = axes[0]) == null ? void 0 : _a2.min);
25078
+ const axesMax = Number((_b2 = axes[0]) == null ? void 0 : _b2.max);
25203
25079
  const [startPoint, endPoint] = data;
25204
25080
  if (axesMin && (startPoint == null ? void 0 : startPoint.x)) {
25205
25081
  data[0].x = Math.max(axesMin, startPoint.x);
@@ -26228,7 +26104,7 @@ const useUpdateAxesRanges = ({
26228
26104
  useEffect(() => {
26229
26105
  if (range && isRangeValid(range)) {
26230
26106
  const newAxes = Object.entries(range).map(([key, { min, max }]) => {
26231
- const { min: minFromData = 0, max: maxFromData = 0 } = getAxisRangeByType(chartRef, key, annotationsData) ?? {};
26107
+ const { min: minFromData = void 0, max: maxFromData = void 0 } = getAxisRangeByType(chartRef, key, annotationsData) ?? {};
26232
26108
  let finalMin = min ?? minFromData;
26233
26109
  let finalMax = max ?? maxFromData;
26234
26110
  if (finalMin === finalMax) {
@@ -26254,60 +26130,13 @@ const useUpdateAxesRanges = ({
26254
26130
  }
26255
26131
  }, [range]);
26256
26132
  };
26257
- const useSaveInitialAxesRanges = (chartRef, dispatch, generatedDatasets) => {
26258
- var _a2;
26259
- const prevDatasets = useRef(null);
26260
- const getDatasetsSignature = (datasets) => {
26261
- if (!datasets.length) return "";
26262
- const datasetSignatures = datasets.map((dataset) => {
26263
- const data = dataset.data ?? [];
26264
- if (!data.length) return "empty";
26265
- const firstDataPoint = data.at(0);
26266
- const lastDataPoint = data.at(-1);
26267
- const lengthChecksum = data.length;
26268
- return firstDataPoint && lastDataPoint ? `${firstDataPoint.x},${firstDataPoint.y}-${lastDataPoint.x},${lastDataPoint.y}-${lengthChecksum}` : "invalid";
26269
- });
26270
- return `${datasets.length}-${datasetSignatures.join("|")}`;
26271
- };
26272
- useEffect(() => {
26273
- var _a3;
26274
- if ((_a3 = chartRef == null ? void 0 : chartRef.current) == null ? void 0 : _a3.scales) {
26275
- const prevHash = prevDatasets.current ? getDatasetsSignature(prevDatasets.current) : "";
26276
- const currentHash = getDatasetsSignature(generatedDatasets);
26277
- if (prevHash !== currentHash) {
26278
- const scales = chartRef.current.scales;
26279
- const initialAxesRanges = Object.entries(scales).map(
26280
- ([id, { min, max, _range: range }]) => ({
26281
- id,
26282
- min: (range == null ? void 0 : range.min) ?? min,
26283
- max: (range == null ? void 0 : range.max) ?? max
26284
- })
26285
- );
26286
- dispatch({
26287
- type: SAVE_INITIAL_AXES_RANGES,
26288
- payload: { initialAxesRanges }
26289
- });
26290
- prevDatasets.current = generatedDatasets;
26291
- }
26292
- }
26293
- }, [(_a2 = chartRef == null ? void 0 : chartRef.current) == null ? void 0 : _a2.scales, generatedDatasets]);
26294
- };
26295
26133
  const useChartState = ({
26296
26134
  chartRef,
26297
26135
  options,
26298
26136
  state,
26299
26137
  dispatch,
26300
- persistenceId,
26301
- generatedDatasets
26138
+ persistenceId
26302
26139
  }) => {
26303
- useEffect(() => {
26304
- return () => {
26305
- if (chartRef == null ? void 0 : chartRef.current) {
26306
- const chart2 = chartRef == null ? void 0 : chartRef.current;
26307
- chart2 == null ? void 0 : chart2.destroy();
26308
- }
26309
- };
26310
- }, []);
26311
26140
  const memoState = useMemo(() => state, [state]);
26312
26141
  const memoOptions = useMemo(() => options, [options]);
26313
26142
  const {
@@ -26323,7 +26152,6 @@ const useChartState = ({
26323
26152
  chartRef,
26324
26153
  annotationsData
26325
26154
  });
26326
- useSaveInitialAxesRanges(chartRef, dispatch, generatedDatasets);
26327
26155
  };
26328
26156
  const WORD_SEPARATOR = " ";
26329
26157
  const SEMI_TRANSPARENT = "rgba(0, 0, 0, 0.5)";
@@ -27383,7 +27211,7 @@ const LineChart = (props) => {
27383
27211
  var _a2, _b2;
27384
27212
  setDefaultTheme();
27385
27213
  const chartRef = useRef(null);
27386
- const { table: table2 } = props ?? {};
27214
+ const { table: table2, headerComponent, subheaderComponent } = props ?? {};
27387
27215
  const { translations, languageKey } = getConfig();
27388
27216
  const chart2 = getDefaultProps$3(props);
27389
27217
  const {
@@ -27396,23 +27224,30 @@ const LineChart = (props) => {
27396
27224
  const { annotations, axes, chartStyling, graph } = options ?? {};
27397
27225
  const showCustomLegend = !((_b2 = (_a2 = options == null ? void 0 : options.legend) == null ? void 0 : _a2.customLegend) == null ? void 0 : _b2.customLegendContainerID);
27398
27226
  const [state, dispatch] = useReducer(
27399
- reducer$1,
27227
+ reducer,
27400
27228
  {
27401
27229
  options,
27402
- persistenceId
27230
+ persistenceId,
27231
+ chartRef
27403
27232
  },
27404
27233
  initialState
27405
27234
  );
27406
27235
  const generatedDatasets = useMemo(() => {
27407
27236
  return generateLineChartDatasets(datasets, state, options, translations);
27408
- }, [state.lineEnabled, state.pointsEnabled, axes, annotations, graph]);
27237
+ }, [
27238
+ state.lineEnabled,
27239
+ state.pointsEnabled,
27240
+ datasets,
27241
+ axes,
27242
+ annotations,
27243
+ graph
27244
+ ]);
27409
27245
  useChartState({
27410
27246
  chartRef,
27411
27247
  options,
27412
27248
  state,
27413
27249
  dispatch,
27414
- persistenceId,
27415
- generatedDatasets
27250
+ persistenceId
27416
27251
  });
27417
27252
  const { resetZoom: resetZoom2, handleKeyDown, handleKeyUp } = useChartFunctions({
27418
27253
  chartRef,
@@ -27445,7 +27280,9 @@ const LineChart = (props) => {
27445
27280
  /* @__PURE__ */ jsx(
27446
27281
  Controls,
27447
27282
  {
27448
- ...props,
27283
+ table: table2,
27284
+ headerComponent,
27285
+ subheaderComponent,
27449
27286
  chartRef,
27450
27287
  state,
27451
27288
  options,