@oliasoft-open-source/charts-library 3.5.1-beta-6 → 3.5.1-beta-8
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
|
@@ -25413,34 +25413,29 @@ const useStoreChartStateInStorage = (memoState, persistenceId) => {
|
|
|
25413
25413
|
]);
|
|
25414
25414
|
};
|
|
25415
25415
|
const useUpdateAxesRanges = (range, dispatch) => {
|
|
25416
|
-
const
|
|
25417
|
-
|
|
25416
|
+
const prevProps = useRef({
|
|
25417
|
+
range: null,
|
|
25418
|
+
axes: null
|
|
25419
|
+
});
|
|
25420
|
+
console.log("prevRange.current", prevProps.current);
|
|
25418
25421
|
console.log("Range", range);
|
|
25419
|
-
|
|
25420
|
-
|
|
25421
|
-
|
|
25422
|
-
|
|
25423
|
-
|
|
25424
|
-
|
|
25425
|
-
|
|
25426
|
-
|
|
25427
|
-
|
|
25428
|
-
|
|
25429
|
-
|
|
25430
|
-
|
|
25431
|
-
|
|
25432
|
-
|
|
25433
|
-
|
|
25434
|
-
|
|
25435
|
-
|
|
25436
|
-
payload: { axes }
|
|
25437
|
-
});
|
|
25438
|
-
prevRange.current = range;
|
|
25439
|
-
}
|
|
25440
|
-
};
|
|
25441
|
-
useEffect(() => {
|
|
25442
|
-
updateAxesRanges();
|
|
25443
|
-
}, [updateAxesRanges]);
|
|
25422
|
+
const axes = range && isRangeValid(range) && Object.entries(range).map(([key, { min, max }]) => ({
|
|
25423
|
+
id: key,
|
|
25424
|
+
min: min ?? 0,
|
|
25425
|
+
max: max ?? 0
|
|
25426
|
+
}));
|
|
25427
|
+
console.log("RANGE", !isEqual(range, prevProps.current.range));
|
|
25428
|
+
console.log("AXES", !isEqual(axes, prevProps.current.axes));
|
|
25429
|
+
if (!isEqual(axes, prevProps.current.axes)) {
|
|
25430
|
+
console.log("UPDATE_AXES_RANGES");
|
|
25431
|
+
dispatch({
|
|
25432
|
+
type: UPDATE_AXES_RANGES,
|
|
25433
|
+
payload: { axes }
|
|
25434
|
+
});
|
|
25435
|
+
prevProps.current.range = range;
|
|
25436
|
+
prevProps.current.axes = axes;
|
|
25437
|
+
console.log("-----------------------");
|
|
25438
|
+
}
|
|
25444
25439
|
};
|
|
25445
25440
|
const useSaveInitialAxesRanges = (chartRef, axes, generatedDatasets, dispatch) => {
|
|
25446
25441
|
const prevGeneratedDatasets = useRef();
|
|
@@ -25469,11 +25464,9 @@ const useChartState = ({
|
|
|
25469
25464
|
const memoState = useMemo(() => state, [state]);
|
|
25470
25465
|
const memoOptions = useMemo(() => options, [options]);
|
|
25471
25466
|
const {
|
|
25472
|
-
additionalAxesOptions: { range },
|
|
25467
|
+
additionalAxesOptions: { range = null },
|
|
25473
25468
|
axes
|
|
25474
25469
|
} = memoOptions;
|
|
25475
|
-
console.log("state.initialAxesRanges", state == null ? void 0 : state.initialAxesRanges);
|
|
25476
|
-
console.log("memoState.initialAxesRanges", memoState == null ? void 0 : memoState.initialAxesRanges);
|
|
25477
25470
|
useStoreChartStateInStorage(memoState, persistenceId);
|
|
25478
25471
|
useToggleCustomLegendVisibility(memoState, memoOptions);
|
|
25479
25472
|
useUpdateAxesRanges(range, dispatch);
|