@oliasoft-open-source/charts-library 3.5.1-beta-5 → 3.5.1-beta-7

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
@@ -13417,6 +13417,9 @@ const setDefaultTheme = () => {
13417
13417
  defaults$2.color = DEFAULT_COLOR;
13418
13418
  defaults$2.borderColor = BORDER_COLOR;
13419
13419
  };
13420
+ const isNilOrEmpty = (value) => {
13421
+ return value === null || value === void 0 || value === "";
13422
+ };
13420
13423
  const chart$3 = "_chart_1v6ps_1";
13421
13424
  const styles$5 = {
13422
13425
  chart: chart$3
@@ -22204,6 +22207,11 @@ const generateKey = (values) => {
22204
22207
  return key;
22205
22208
  };
22206
22209
  const isPrimitiveValue = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null;
22210
+ const isRangeValid = (r2) => {
22211
+ if (!r2)
22212
+ return false;
22213
+ return Object.values(r2).every((value) => !isNilOrEmpty(value));
22214
+ };
22207
22215
  const getChartStateFromStorage = (persistenceId) => {
22208
22216
  if (!persistenceId)
22209
22217
  return null;
@@ -25406,12 +25414,10 @@ const useStoreChartStateInStorage = (memoState, persistenceId) => {
25406
25414
  };
25407
25415
  const useUpdateAxesRanges = (range, dispatch) => {
25408
25416
  const prevRange = useRef(null);
25417
+ console.log("prevRange.current", prevRange.current);
25409
25418
  console.log("Range", range);
25410
25419
  const updateAxesRanges = () => {
25411
- console.log(
25412
- range && range.x && range.y && !isEqual(range, prevRange.current)
25413
- );
25414
- if (range && range.x && range.y && !isEqual(range, prevRange.current)) {
25420
+ if (range && isRangeValid(range)) {
25415
25421
  console.log("UPDATE_AXES_RANGES", range);
25416
25422
  const axes = Object.entries(range).map(([key, { min, max }]) => ({
25417
25423
  id: key,
@@ -25427,7 +25433,7 @@ const useUpdateAxesRanges = (range, dispatch) => {
25427
25433
  };
25428
25434
  useEffect(() => {
25429
25435
  updateAxesRanges();
25430
- }, [updateAxesRanges]);
25436
+ }, [range]);
25431
25437
  };
25432
25438
  const useSaveInitialAxesRanges = (chartRef, axes, generatedDatasets, dispatch) => {
25433
25439
  const prevGeneratedDatasets = useRef();