@oliasoft-open-source/charts-library 3.4.8 → 3.4.10-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 +3 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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, toNum, displayNumber, isCloseTo } from "@oliasoft-open-source/units";
|
|
10
|
+
import { round as round$2, toNum, displayNumber, isCloseTo, roundByMagnitude } 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";
|
|
@@ -25123,10 +25123,7 @@ const getLineChartToolTips = (options) => {
|
|
|
25123
25123
|
const labels = getTooltipLabels(tooltipItem[0].dataset);
|
|
25124
25124
|
const { titleLabel, titleAxisLabel } = labels;
|
|
25125
25125
|
const formattedValue = titleLabel === TooltipLabel.Y ? tooltipItem[0].parsed.y : tooltipItem[0].parsed.x;
|
|
25126
|
-
const roundedValue =
|
|
25127
|
-
scientific: true,
|
|
25128
|
-
roundScientificCoefficient: 4
|
|
25129
|
-
}) : displayNumber(formattedValue);
|
|
25126
|
+
const roundedValue = displayNumber(roundByMagnitude(formattedValue));
|
|
25130
25127
|
return `${roundedValue} ${titleAxisLabel}`;
|
|
25131
25128
|
};
|
|
25132
25129
|
const labelCallback = (tooltipItem) => {
|
|
@@ -25136,10 +25133,7 @@ const getLineChartToolTips = (options) => {
|
|
|
25136
25133
|
const { valueLabel, valueAxisLabel } = labels;
|
|
25137
25134
|
const getTooltipItemValue = () => {
|
|
25138
25135
|
const labelNumber = valueLabel === TooltipLabel.X ? tooltipItem.parsed.x : tooltipItem.parsed.y;
|
|
25139
|
-
return
|
|
25140
|
-
scientific: true,
|
|
25141
|
-
roundScientificCoefficient: 4
|
|
25142
|
-
}) : displayNumber(labelNumber);
|
|
25136
|
+
return displayNumber(roundByMagnitude(labelNumber));
|
|
25143
25137
|
};
|
|
25144
25138
|
const tooltipItemValue = getTooltipItemValue();
|
|
25145
25139
|
const units = getUnitsFromLabel(valueAxisLabel);
|