@redsift/charts 9.0.0-alpha.0 → 9.0.0-alpha.10
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/index.js +16 -9
- package/index.js.map +1 -1
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { brush, select, scaleOrdinal, zoom, interpolateRound, interpolate, scaleLinear, sum, arc, pie, min, extent, descending, scaleSqrt, max } from 'd3';
|
|
2
|
-
import { RedsiftColorPresentationBlueDefault, RedsiftColorPresentationGreyDark, RedsiftColorPresentationGreenDefault, RedsiftColorPresentationPinkDefault, RedsiftColorPresentationAquaDefault, RedsiftColorPresentationBrownDefault, RedsiftColorPresentationRedDefault, RedsiftColorPresentationYellowDefault, RedsiftColorPresentationPurpleDefault, RedsiftColorPresentationOrangeDefault, RedsiftColorPresentationGreyDefault, RedsiftColorPresentationGreenDark, RedsiftColorPresentationPinkDark, RedsiftColorPresentationAquaDark, RedsiftColorPresentationBrownDark, RedsiftColorPresentationRedDark, RedsiftColorPresentationYellowDark, RedsiftColorPresentationPurpleDark, RedsiftColorPresentationOrangeDark, RedsiftColorPresentationBlueDark, RedsiftColorPresentationGreenDarker, RedsiftColorPresentationPinkDarker, RedsiftColorPresentationAquaDarker, RedsiftColorPresentationBrownDarker, RedsiftColorPresentationRedDarker, RedsiftColorPresentationYellowDarker, RedsiftColorPresentationPurpleDarker, RedsiftColorPresentationOrangeDarker, RedsiftColorPresentationBlueDarker, RedsiftColorPresentationGreyDarker, RedsiftColorPresentationGreenDarkerer, RedsiftColorPresentationPinkDarkerer, RedsiftColorPresentationAquaDarkerer, RedsiftColorPresentationBrownDarkerer, RedsiftColorPresentationRedDarkerer, RedsiftColorPresentationYellowDarkerer, RedsiftColorPresentationPurpleDarkerer, RedsiftColorPresentationOrangeDarkerer, RedsiftColorPresentationBlueDarkerer, RedsiftColorPresentationGreyDarkerer, RedsiftColorPresentationGreenLight, RedsiftColorPresentationPinkLight, RedsiftColorPresentationAquaLight, RedsiftColorPresentationBrownLight, RedsiftColorPresentationRedLight, RedsiftColorPresentationYellowLight, RedsiftColorPresentationPurpleLight, RedsiftColorPresentationOrangeLight, RedsiftColorPresentationBlueLight, RedsiftColorPresentationGreyLight, RedsiftColorPresentationGreenLighter, RedsiftColorPresentationPinkLighter, RedsiftColorPresentationAquaLighter, RedsiftColorPresentationBrownLighter, RedsiftColorPresentationRedLighter, RedsiftColorPresentationYellowLighter, RedsiftColorPresentationPurpleLighter, RedsiftColorPresentationOrangeLighter, RedsiftColorPresentationBlueLighter, RedsiftColorPresentationGreyLighter, RedsiftColorPresentationGreenLighterer, RedsiftColorPresentationPinkLighterer, RedsiftColorPresentationAquaLighterer, RedsiftColorPresentationBrownLighterer, RedsiftColorPresentationRedLighterer, RedsiftColorPresentationYellowLighterer, RedsiftColorPresentationPurpleLighterer, RedsiftColorPresentationOrangeLighterer, RedsiftColorPresentationBlueLighterer, RedsiftColorPresentationGreyLighterer, Text, Number as Number$1, baseStyling, focusRing, Flexbox, warnIfNoAccessibleLabelFound, Heading, Button } from '@redsift/design-system';
|
|
2
|
+
import { RedsiftColorPresentationBlueDefault, RedsiftColorPresentationGreyDark, RedsiftColorPresentationGreenDefault, RedsiftColorPresentationPinkDefault, RedsiftColorPresentationAquaDefault, RedsiftColorPresentationBrownDefault, RedsiftColorPresentationRedDefault, RedsiftColorPresentationYellowDefault, RedsiftColorPresentationPurpleDefault, RedsiftColorPresentationOrangeDefault, RedsiftColorPresentationGreyDefault, RedsiftColorPresentationGreenDark, RedsiftColorPresentationPinkDark, RedsiftColorPresentationAquaDark, RedsiftColorPresentationBrownDark, RedsiftColorPresentationRedDark, RedsiftColorPresentationYellowDark, RedsiftColorPresentationPurpleDark, RedsiftColorPresentationOrangeDark, RedsiftColorPresentationBlueDark, RedsiftColorPresentationGreenDarker, RedsiftColorPresentationPinkDarker, RedsiftColorPresentationAquaDarker, RedsiftColorPresentationBrownDarker, RedsiftColorPresentationRedDarker, RedsiftColorPresentationYellowDarker, RedsiftColorPresentationPurpleDarker, RedsiftColorPresentationOrangeDarker, RedsiftColorPresentationBlueDarker, RedsiftColorPresentationGreyDarker, RedsiftColorPresentationGreenDarkerer, RedsiftColorPresentationPinkDarkerer, RedsiftColorPresentationAquaDarkerer, RedsiftColorPresentationBrownDarkerer, RedsiftColorPresentationRedDarkerer, RedsiftColorPresentationYellowDarkerer, RedsiftColorPresentationPurpleDarkerer, RedsiftColorPresentationOrangeDarkerer, RedsiftColorPresentationBlueDarkerer, RedsiftColorPresentationGreyDarkerer, RedsiftColorPresentationGreenLight, RedsiftColorPresentationPinkLight, RedsiftColorPresentationAquaLight, RedsiftColorPresentationBrownLight, RedsiftColorPresentationRedLight, RedsiftColorPresentationYellowLight, RedsiftColorPresentationPurpleLight, RedsiftColorPresentationOrangeLight, RedsiftColorPresentationBlueLight, RedsiftColorPresentationGreyLight, RedsiftColorPresentationGreenLighter, RedsiftColorPresentationPinkLighter, RedsiftColorPresentationAquaLighter, RedsiftColorPresentationBrownLighter, RedsiftColorPresentationRedLighter, RedsiftColorPresentationYellowLighter, RedsiftColorPresentationPurpleLighter, RedsiftColorPresentationOrangeLighter, RedsiftColorPresentationBlueLighter, RedsiftColorPresentationGreyLighter, RedsiftColorPresentationGreenLighterer, RedsiftColorPresentationPinkLighterer, RedsiftColorPresentationAquaLighterer, RedsiftColorPresentationBrownLighterer, RedsiftColorPresentationRedLighterer, RedsiftColorPresentationYellowLighterer, RedsiftColorPresentationPurpleLighterer, RedsiftColorPresentationOrangeLighterer, RedsiftColorPresentationBlueLighterer, RedsiftColorPresentationGreyLighterer, useId, Text, Number as Number$1, baseStyling, focusRing, Flexbox, warnIfNoAccessibleLabelFound, Heading, Button } from '@redsift/design-system';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import React__default, { useRef, useEffect, useMemo, useState, useLayoutEffect, forwardRef, useCallback, useContext
|
|
4
|
+
import React__default, { useRef, useEffect, useMemo, useState, useLayoutEffect, forwardRef, useCallback, useContext } from 'react';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
@@ -330,7 +330,8 @@ const DataPoint = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
330
330
|
tooltipVariant
|
|
331
331
|
} = props,
|
|
332
332
|
forwardedProps = _objectWithoutProperties(props, _excluded$k);
|
|
333
|
-
const
|
|
333
|
+
const [_id] = useId();
|
|
334
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
334
335
|
const text = labelDecorator ? labelDecorator(data) : data.data.key;
|
|
335
336
|
const hasText = text && tooltipVariant !== TooltipVariant.none;
|
|
336
337
|
const tooltipValue = tooltipVariant === TooltipVariant.value ? data.data.value : tooltipVariant === TooltipVariant.percent && data.data.percent ? data.data.percent : undefined;
|
|
@@ -518,7 +519,8 @@ const Arcs = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
518
519
|
tooltipVariant
|
|
519
520
|
} = props,
|
|
520
521
|
forwardedProps = _objectWithoutProperties(props, _excluded$i);
|
|
521
|
-
const
|
|
522
|
+
const [_id] = useId();
|
|
523
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
522
524
|
const animatedProps = J(_objectSpread2(_objectSpread2({}, config), {}, {
|
|
523
525
|
to: async next => {
|
|
524
526
|
await next({
|
|
@@ -1095,7 +1097,8 @@ const ChartContainer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1095
1097
|
onReset
|
|
1096
1098
|
} = props,
|
|
1097
1099
|
forwardedProps = _objectWithoutProperties(props, _excluded$f);
|
|
1098
|
-
const
|
|
1100
|
+
const [_id] = useId();
|
|
1101
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
1099
1102
|
warnIfNoAccessibleLabelFound(props, [title]);
|
|
1100
1103
|
const stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
1101
1104
|
const ariaLabel = propsAriaLabel ? propsAriaLabel : propsAriaLabelledby || title ? undefined : undefined;
|
|
@@ -1390,7 +1393,8 @@ const BarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1390
1393
|
tooltipVariant
|
|
1391
1394
|
} = props,
|
|
1392
1395
|
forwardedProps = _objectWithoutProperties(props, _excluded$b);
|
|
1393
|
-
const
|
|
1396
|
+
const [_id] = useId();
|
|
1397
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
1394
1398
|
if (propsData === undefined || propsData === null) {
|
|
1395
1399
|
return /*#__PURE__*/React__default.createElement(LoadingBarChart, _extends({
|
|
1396
1400
|
id: id
|
|
@@ -1589,7 +1593,8 @@ const LegendItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1589
1593
|
variant
|
|
1590
1594
|
} = props,
|
|
1591
1595
|
forwardedProps = _objectWithoutProperties(props, _excluded$9);
|
|
1592
|
-
const
|
|
1596
|
+
const [_id] = useId();
|
|
1597
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
1593
1598
|
const text = labelDecorator ? labelDecorator(data) : data.data.key;
|
|
1594
1599
|
const isEmpty = data.data.value === 0;
|
|
1595
1600
|
const isSelectable = role === 'option';
|
|
@@ -2147,7 +2152,8 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2147
2152
|
variant
|
|
2148
2153
|
} = props,
|
|
2149
2154
|
forwardedProps = _objectWithoutProperties(props, _excluded$4);
|
|
2150
|
-
const
|
|
2155
|
+
const [_id] = useId();
|
|
2156
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
2151
2157
|
if (propsData === undefined || propsData === null) {
|
|
2152
2158
|
return /*#__PURE__*/React__default.createElement(LoadingPieChart, _extends({
|
|
2153
2159
|
id: id
|
|
@@ -2660,7 +2666,8 @@ const ScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2660
2666
|
variant
|
|
2661
2667
|
} = props,
|
|
2662
2668
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
2663
|
-
const
|
|
2669
|
+
const [_id] = useId();
|
|
2670
|
+
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
2664
2671
|
if (propsData === undefined || propsData === null) {
|
|
2665
2672
|
return /*#__PURE__*/React__default.createElement(LoadingScatterPlot, _extends({
|
|
2666
2673
|
id: id
|