@oliasoft-open-source/charts-library 3.6.4 → 3.6.5-beta-2

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
@@ -24004,7 +24004,6 @@ const useChartFunctions = ({
24004
24004
  onHover: onPointHover,
24005
24005
  onUnhover: onPointUnhover
24006
24006
  },
24007
- additionalAxesOptions,
24008
24007
  axes
24009
24008
  } = options;
24010
24009
  const legendClick = useCallback(
@@ -24111,18 +24110,6 @@ const useChartFunctions = ({
24111
24110
  },
24112
24111
  [chartRef]
24113
24112
  );
24114
- const controlsAxes = state.axes.map((axis, i2) => {
24115
- var _a2, _b2, _c2, _d2;
24116
- const axisType = i2 ? AxisType.Y : AxisType.X;
24117
- const min = axis.min ?? ((_b2 = (_a2 = additionalAxesOptions == null ? void 0 : additionalAxesOptions.range) == null ? void 0 : _a2[axisType]) == null ? void 0 : _b2.min);
24118
- const max = axis.max ?? ((_d2 = (_c2 = additionalAxesOptions == null ? void 0 : additionalAxesOptions.range) == null ? void 0 : _c2[axisType]) == null ? void 0 : _d2.max);
24119
- return {
24120
- ...axis,
24121
- // only add min and max properties if they are defined:
24122
- ...min ? { min } : {},
24123
- ...max ? { max } : {}
24124
- };
24125
- });
24126
24113
  const getControlsAxesLabels = useCallback(
24127
24114
  (propsAxes) => {
24128
24115
  var _a2;
@@ -24180,7 +24167,6 @@ const useChartFunctions = ({
24180
24167
  handleDownload,
24181
24168
  handleKeyDown,
24182
24169
  handleKeyUp,
24183
- controlsAxes,
24184
24170
  controlsAxesLabels: getControlsAxesLabels(axes),
24185
24171
  updateAxesRangesFromChart,
24186
24172
  onResetAxes,
@@ -24273,9 +24259,9 @@ const AxesOptionsPopover = (optionsPopover) => {
24273
24259
  controlsAxesLabels,
24274
24260
  onUpdateAxes,
24275
24261
  onResetAxes,
24276
- close,
24277
24262
  depthType,
24278
- translations
24263
+ translations,
24264
+ close
24279
24265
  } = optionsPopover;
24280
24266
  const [depthTypeState, setDepthTypeState] = useState(
24281
24267
  depthType == null ? void 0 : depthType.selectedDepthType
@@ -24551,13 +24537,7 @@ const Controls = ({
24551
24537
  onToggleDragPoints,
24552
24538
  onDisableDragOptions
24553
24539
  } = useToggleHandlers(dispatch);
24554
- const {
24555
- handleDownload,
24556
- controlsAxes,
24557
- controlsAxesLabels,
24558
- onResetAxes,
24559
- onUpdateAxes
24560
- } = useChartFunctions({
24540
+ const { handleDownload, controlsAxesLabels, onResetAxes, onUpdateAxes } = useChartFunctions({
24561
24541
  chartRef,
24562
24542
  state,
24563
24543
  options,
@@ -24575,7 +24555,7 @@ const Controls = ({
24575
24555
  AxesOptions,
24576
24556
  {
24577
24557
  initialAxesRanges,
24578
- axes: controlsAxes,
24558
+ axes: state.axes,
24579
24559
  controlsAxesLabels,
24580
24560
  onUpdateAxes,
24581
24561
  onResetAxes,
@@ -25985,27 +25965,21 @@ const useUpdateAxesRanges = ({
25985
25965
  }
25986
25966
  }, [range]);
25987
25967
  };
25988
- const useSaveInitialAxesRanges = (chartRef, axes, generatedDatasets, dispatch) => {
25989
- const prevGeneratedDatasets = useRef();
25990
- const saveInitialAxesRanges = useCallback(() => {
25991
- if (chartRef && !isEqual(generatedDatasets, prevGeneratedDatasets.current)) {
25968
+ const useSaveInitialAxesRanges = (chartRef, axes, dispatch) => {
25969
+ useEffect(() => {
25970
+ if (chartRef.current) {
25992
25971
  const initialAxesRanges = getAxesRangesFromChart(chartRef, axes);
25993
25972
  dispatch({
25994
25973
  type: SAVE_INITIAL_AXES_RANGES,
25995
25974
  payload: { initialAxesRanges }
25996
25975
  });
25997
- prevGeneratedDatasets.current = generatedDatasets;
25998
25976
  }
25999
- }, [chartRef, generatedDatasets]);
26000
- useEffect(() => {
26001
- saveInitialAxesRanges();
26002
- }, [saveInitialAxesRanges, generatedDatasets]);
25977
+ }, []);
26003
25978
  };
26004
25979
  const useChartState = ({
26005
25980
  chartRef,
26006
25981
  options,
26007
25982
  state,
26008
- generatedDatasets,
26009
25983
  dispatch,
26010
25984
  persistenceId
26011
25985
  }) => {
@@ -26025,7 +25999,7 @@ const useChartState = ({
26025
25999
  chartRef,
26026
26000
  annotationsData
26027
26001
  });
26028
- useSaveInitialAxesRanges(chartRef, axes, generatedDatasets, dispatch);
26002
+ useSaveInitialAxesRanges(chartRef, axes, dispatch);
26029
26003
  };
26030
26004
  const WORD_SEPARATOR = " ";
26031
26005
  const SEMI_TRANSPARENT = "rgba(0, 0, 0, 0.5)";
@@ -26261,7 +26235,6 @@ const LineChart = (props) => {
26261
26235
  chartRef,
26262
26236
  options,
26263
26237
  state,
26264
- generatedDatasets,
26265
26238
  dispatch,
26266
26239
  persistenceId
26267
26240
  });