@oliasoft-open-source/charts-library 3.6.4 → 3.6.5-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
@@ -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,
@@ -24197,7 +24183,7 @@ const initializeFormState = ({
24197
24183
  initialAxesRanges,
24198
24184
  axes = []
24199
24185
  }) => {
24200
- return (initialAxesRanges == null ? void 0 : initialAxesRanges.map((initialAxisRange) => {
24186
+ const res = (initialAxesRanges == null ? void 0 : initialAxesRanges.map((initialAxisRange) => {
24201
24187
  const currentAxisRange = axes.find((a2) => a2.id === initialAxisRange.id);
24202
24188
  return {
24203
24189
  id: initialAxisRange.id,
@@ -24206,6 +24192,8 @@ const initializeFormState = ({
24206
24192
  unit: currentAxisRange == null ? void 0 : currentAxisRange.unit
24207
24193
  };
24208
24194
  })) || [];
24195
+ console.log(res);
24196
+ return res;
24209
24197
  };
24210
24198
  const isEmptyString = (value) => value === "";
24211
24199
  const createErrorMessages = (value, compareTo, type) => {
@@ -24273,9 +24261,9 @@ const AxesOptionsPopover = (optionsPopover) => {
24273
24261
  controlsAxesLabels,
24274
24262
  onUpdateAxes,
24275
24263
  onResetAxes,
24276
- close,
24277
24264
  depthType,
24278
- translations
24265
+ translations,
24266
+ close
24279
24267
  } = optionsPopover;
24280
24268
  const [depthTypeState, setDepthTypeState] = useState(
24281
24269
  depthType == null ? void 0 : depthType.selectedDepthType
@@ -24288,6 +24276,7 @@ const AxesOptionsPopover = (optionsPopover) => {
24288
24276
  },
24289
24277
  initializeFormState
24290
24278
  );
24279
+ console.log(formState);
24291
24280
  const { errors, valid } = validateAxes(formState);
24292
24281
  const onEditValue = ({ name, value, id }) => {
24293
24282
  dispatch({
@@ -24551,13 +24540,7 @@ const Controls = ({
24551
24540
  onToggleDragPoints,
24552
24541
  onDisableDragOptions
24553
24542
  } = useToggleHandlers(dispatch);
24554
- const {
24555
- handleDownload,
24556
- controlsAxes,
24557
- controlsAxesLabels,
24558
- onResetAxes,
24559
- onUpdateAxes
24560
- } = useChartFunctions({
24543
+ const { handleDownload, controlsAxesLabels, onResetAxes, onUpdateAxes } = useChartFunctions({
24561
24544
  chartRef,
24562
24545
  state,
24563
24546
  options,
@@ -24575,7 +24558,7 @@ const Controls = ({
24575
24558
  AxesOptions,
24576
24559
  {
24577
24560
  initialAxesRanges,
24578
- axes: controlsAxes,
24561
+ axes: state.axes,
24579
24562
  controlsAxesLabels,
24580
24563
  onUpdateAxes,
24581
24564
  onResetAxes,
@@ -25985,27 +25968,22 @@ const useUpdateAxesRanges = ({
25985
25968
  }
25986
25969
  }, [range]);
25987
25970
  };
25988
- const useSaveInitialAxesRanges = (chartRef, axes, generatedDatasets, dispatch) => {
25989
- const prevGeneratedDatasets = useRef();
25990
- const saveInitialAxesRanges = useCallback(() => {
25991
- if (chartRef && !isEqual(generatedDatasets, prevGeneratedDatasets.current)) {
25971
+ const useSaveInitialAxesRanges = (chartRef, axes, dispatch) => {
25972
+ useEffect(() => {
25973
+ if (chartRef.current) {
25992
25974
  const initialAxesRanges = getAxesRangesFromChart(chartRef, axes);
25975
+ console.log("initialAxesRanges", initialAxesRanges);
25993
25976
  dispatch({
25994
25977
  type: SAVE_INITIAL_AXES_RANGES,
25995
25978
  payload: { initialAxesRanges }
25996
25979
  });
25997
- prevGeneratedDatasets.current = generatedDatasets;
25998
25980
  }
25999
- }, [chartRef, generatedDatasets]);
26000
- useEffect(() => {
26001
- saveInitialAxesRanges();
26002
- }, [saveInitialAxesRanges, generatedDatasets]);
25981
+ }, []);
26003
25982
  };
26004
25983
  const useChartState = ({
26005
25984
  chartRef,
26006
25985
  options,
26007
25986
  state,
26008
- generatedDatasets,
26009
25987
  dispatch,
26010
25988
  persistenceId
26011
25989
  }) => {
@@ -26025,7 +26003,7 @@ const useChartState = ({
26025
26003
  chartRef,
26026
26004
  annotationsData
26027
26005
  });
26028
- useSaveInitialAxesRanges(chartRef, axes, generatedDatasets, dispatch);
26006
+ useSaveInitialAxesRanges(chartRef, axes, dispatch);
26029
26007
  };
26030
26008
  const WORD_SEPARATOR = " ";
26031
26009
  const SEMI_TRANSPARENT = "rgba(0, 0, 0, 0.5)";
@@ -26261,7 +26239,6 @@ const LineChart = (props) => {
26261
26239
  chartRef,
26262
26240
  options,
26263
26241
  state,
26264
- generatedDatasets,
26265
26242
  dispatch,
26266
26243
  persistenceId
26267
26244
  });