@oliasoft-open-source/charts-library 3.3.8-beta-1 → 3.3.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
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
7
7
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
8
8
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
9
9
  import React, { forwardRef, useRef, useEffect, createContext as createContext$2, memo, isValidElement, cloneElement, useLayoutEffect, useMemo, useContext, useState, useCallback, useReducer } from "react";
10
- import { round as round$2, to as to$2, toNum, displayNumber, isCloseTo } from "@oliasoft-open-source/units";
10
+ import { round as round$2, toNum, displayNumber, isCloseTo } from "@oliasoft-open-source/units";
11
11
  import cx from "classnames";
12
12
  import { produce } from "immer";
13
13
  import { Icon, Tooltip as Tooltip$2, Button, Flex, Text, Menu, Popover, Field, InputGroup, NumberInput, InputGroupAddon, Select, ButtonGroup, Spacer, Portal } from "@oliasoft-open-source/react-ui-library";
@@ -36030,14 +36030,11 @@ const AxesOptionsPopover = ({
36030
36030
  const onDone = (e2) => {
36031
36031
  e2.preventDefault();
36032
36032
  if (valid) {
36033
- const sanitizedFormState = formState.map((axis, i2) => {
36034
- var _a3, _b2;
36035
- return {
36036
- ...axis,
36037
- min: ((_a3 = axis == null ? void 0 : axis.unit) == null ? void 0 : _a3.selectedUnit) ? to$2(axis.min, axes[i2].unit.selectedUnit, axis.unit.selectedUnit) : toNum(axis.min),
36038
- max: ((_b2 = axis == null ? void 0 : axis.unit) == null ? void 0 : _b2.selectedUnit) ? to$2(axis.max, axes[i2].unit.selectedUnit, axis.unit.selectedUnit) : toNum(axis.max)
36039
- };
36040
- });
36033
+ const sanitizedFormState = formState.map((axis) => ({
36034
+ ...axis,
36035
+ min: toNum(axis.min),
36036
+ max: toNum(axis.max)
36037
+ }));
36041
36038
  onUpdateAxes({
36042
36039
  axes: sanitizedFormState
36043
36040
  });
@@ -37358,8 +37355,8 @@ const getAxesData = (scalesKeys, datasets, annotationsData) => {
37358
37355
  const reduceData = (arr, key) => arr.reduce((acc, { [key]: value }) => [...acc, value], []);
37359
37356
  return datasets.reduce(
37360
37357
  (acc, obj) => {
37361
- const key = Object.values(obj).find((val) => axes.includes(val));
37362
- return {
37358
+ const key = Object.values(obj).find((val) => axes.includes(val)) ?? multiAxesKey;
37359
+ return key ? {
37363
37360
  ...acc,
37364
37361
  [key]: [
37365
37362
  .../* @__PURE__ */ new Set([
@@ -37368,7 +37365,7 @@ const getAxesData = (scalesKeys, datasets, annotationsData) => {
37368
37365
  ...key === multiAxesKey && (data == null ? void 0 : data[multiAxesKey]) || []
37369
37366
  ])
37370
37367
  ]
37371
- };
37368
+ } : acc;
37372
37369
  },
37373
37370
  { [first]: [], [second]: [] }
37374
37371
  );