@oliasoft-open-source/charts-library 3.5.1 → 3.5.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
|
@@ -25427,27 +25427,23 @@ const useUpdateAxesRanges = (range, dispatch) => {
|
|
|
25427
25427
|
prevAxes.current = axes;
|
|
25428
25428
|
}
|
|
25429
25429
|
};
|
|
25430
|
-
const useSaveInitialAxesRanges = (chartRef, axes,
|
|
25431
|
-
const
|
|
25432
|
-
const
|
|
25433
|
-
|
|
25434
|
-
|
|
25430
|
+
const useSaveInitialAxesRanges = (chartRef, axes, dispatch) => {
|
|
25431
|
+
const initialAxesRanges = chartRef ? getAxesRangesFromChart(chartRef, axes) : null;
|
|
25432
|
+
const prevAxes = useRef(null);
|
|
25433
|
+
useEffect(() => {
|
|
25434
|
+
if (chartRef && !isEqual(initialAxesRanges, prevAxes.current)) {
|
|
25435
25435
|
dispatch({
|
|
25436
25436
|
type: SAVE_INITIAL_AXES_RANGES,
|
|
25437
25437
|
payload: { initialAxesRanges }
|
|
25438
25438
|
});
|
|
25439
|
-
|
|
25439
|
+
prevAxes.current = initialAxesRanges;
|
|
25440
25440
|
}
|
|
25441
|
-
}, [chartRef,
|
|
25442
|
-
useEffect(() => {
|
|
25443
|
-
saveInitialAxesRanges();
|
|
25444
|
-
}, [saveInitialAxesRanges, generatedDatasets]);
|
|
25441
|
+
}, [chartRef, initialAxesRanges, dispatch]);
|
|
25445
25442
|
};
|
|
25446
25443
|
const useChartState = ({
|
|
25447
25444
|
chartRef,
|
|
25448
25445
|
options,
|
|
25449
25446
|
state,
|
|
25450
|
-
generatedDatasets,
|
|
25451
25447
|
dispatch,
|
|
25452
25448
|
persistenceId
|
|
25453
25449
|
}) => {
|
|
@@ -25460,7 +25456,7 @@ const useChartState = ({
|
|
|
25460
25456
|
useStoreChartStateInStorage(memoState, persistenceId);
|
|
25461
25457
|
useToggleCustomLegendVisibility(memoState, memoOptions);
|
|
25462
25458
|
useUpdateAxesRanges(range, dispatch);
|
|
25463
|
-
useSaveInitialAxesRanges(chartRef, axes,
|
|
25459
|
+
useSaveInitialAxesRanges(chartRef, axes, dispatch);
|
|
25464
25460
|
};
|
|
25465
25461
|
const WORD_SEPARATOR = " ";
|
|
25466
25462
|
const SEMI_TRANSPARENT = "rgba(0, 0, 0, 0.5)";
|
|
@@ -25695,7 +25691,6 @@ const LineChart = (props) => {
|
|
|
25695
25691
|
chartRef,
|
|
25696
25692
|
options,
|
|
25697
25693
|
state,
|
|
25698
|
-
generatedDatasets,
|
|
25699
25694
|
dispatch,
|
|
25700
25695
|
persistenceId
|
|
25701
25696
|
});
|