@redsift/charts 9.4.1 → 9.5.0
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.d.ts +220 -143
- package/index.js +158 -71
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { brush, select, scaleOrdinal, zoom, interpolateRound, interpolate, scaleLinear, sum,
|
|
1
|
+
import { brush, select, scaleOrdinal, zoom, interpolateRound, interpolate, scaleLinear, sum, scaleBand, extent, scaleTime, scalePoint, line, arc, pie, min, descending, scaleSqrt, max } from 'd3';
|
|
2
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, baseContainer, focusRing, Flexbox, warnIfNoAccessibleLabelFound, Heading, Button } from '@redsift/design-system';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useEffect, useMemo, useState, useLayoutEffect, forwardRef, useCallback, useContext } from 'react';
|
|
@@ -304,12 +304,14 @@ const TooltipVariant = {
|
|
|
304
304
|
custom: 'custom'
|
|
305
305
|
};
|
|
306
306
|
/** LEGEND */
|
|
307
|
-
const
|
|
307
|
+
const LegendVariant = {
|
|
308
|
+
none: 'none',
|
|
308
309
|
label: 'label',
|
|
309
310
|
value: 'value',
|
|
310
311
|
percent: 'percent',
|
|
311
312
|
custom: 'custom'
|
|
312
313
|
};
|
|
314
|
+
const LabelVariant = LegendVariant;
|
|
313
315
|
|
|
314
316
|
const ChartSize = {
|
|
315
317
|
small: 'small',
|
|
@@ -343,7 +345,7 @@ var k=/^--/;function I(t,e){return e==null||typeof e=="boolean"||e===""?"":typeo
|
|
|
343
345
|
*/
|
|
344
346
|
const StyledDataPoint = styled(it.g)``;
|
|
345
347
|
|
|
346
|
-
const _excluded$p = ["children", "className", "data", "id", "index", "isSelected", "labelDecorator", "onClick", "role", "tooltipVariant"];
|
|
348
|
+
const _excluded$p = ["children", "className", "data", "id", "index", "isSelected", "labelDecorator", "onClick", "role", "tooltipDecorator", "tooltipVariant"];
|
|
347
349
|
const DataPoint = /*#__PURE__*/forwardRef((props, ref) => {
|
|
348
350
|
const {
|
|
349
351
|
children,
|
|
@@ -355,11 +357,14 @@ const DataPoint = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
355
357
|
labelDecorator,
|
|
356
358
|
onClick,
|
|
357
359
|
role,
|
|
360
|
+
tooltipDecorator,
|
|
358
361
|
tooltipVariant
|
|
359
362
|
} = props,
|
|
360
363
|
forwardedProps = _objectWithoutProperties(props, _excluded$p);
|
|
361
364
|
const [_id] = useId();
|
|
362
365
|
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
366
|
+
console.log(props);
|
|
367
|
+
const isTooltipCustom = tooltipVariant === TooltipVariant.custom && tooltipDecorator;
|
|
363
368
|
const text = labelDecorator ? labelDecorator(data, {
|
|
364
369
|
index,
|
|
365
370
|
isSelected: propsIsSelected,
|
|
@@ -404,7 +409,11 @@ const DataPoint = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
404
409
|
if (showTooltip) {
|
|
405
410
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
406
411
|
placement: "right"
|
|
407
|
-
}, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, DataPointComponent), /*#__PURE__*/React__default.createElement(Tooltip.Content, null,
|
|
412
|
+
}, /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, DataPointComponent), /*#__PURE__*/React__default.createElement(Tooltip.Content, null, isTooltipCustom ? tooltipDecorator(data, {
|
|
413
|
+
index,
|
|
414
|
+
isSelected: propsIsSelected,
|
|
415
|
+
color: props.color
|
|
416
|
+
}) : /*#__PURE__*/React__default.createElement(Text, {
|
|
408
417
|
variant: "caption"
|
|
409
418
|
}, text, hasText && hasValue ? ' - ' : null, hasValue ? /*#__PURE__*/React__default.createElement(Number$1, {
|
|
410
419
|
value: tooltipValue,
|
|
@@ -1303,7 +1312,7 @@ const LoadingBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1303
1312
|
}), "Loading...");
|
|
1304
1313
|
});
|
|
1305
1314
|
|
|
1306
|
-
const _excluded$h = ["areXLabelsRotated", "barProps", "caping", "className", "data", "id", "isBarSelected", "labelDecorator", "onBarClick", "orientation", "others", "size", "sortingMethod", "barRole", "theme", "tooltipVariant"];
|
|
1315
|
+
const _excluded$h = ["areXLabelsRotated", "barProps", "caping", "className", "data", "id", "isBarSelected", "labelDecorator", "onBarClick", "orientation", "others", "size", "sortingMethod", "barRole", "theme", "tooltipVariant", "xAxisVariant", "xAxisPlacement", "xAxisTickFormat", "xAxisTickValues", "yAxisVariant", "yAxisPlacement", "yAxisTickFormat", "yAxisTickValues"];
|
|
1307
1316
|
const RenderedBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
1308
1317
|
const {
|
|
1309
1318
|
areXLabelsRotated,
|
|
@@ -1321,7 +1330,15 @@ const RenderedBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1321
1330
|
sortingMethod,
|
|
1322
1331
|
barRole,
|
|
1323
1332
|
theme,
|
|
1324
|
-
tooltipVariant
|
|
1333
|
+
tooltipVariant,
|
|
1334
|
+
xAxisVariant: propsXAxisVariant,
|
|
1335
|
+
xAxisPlacement,
|
|
1336
|
+
xAxisTickFormat,
|
|
1337
|
+
xAxisTickValues,
|
|
1338
|
+
yAxisVariant: propsYAxisVariant,
|
|
1339
|
+
yAxisPlacement,
|
|
1340
|
+
yAxisTickFormat,
|
|
1341
|
+
yAxisTickValues
|
|
1325
1342
|
} = props,
|
|
1326
1343
|
forwardedProps = _objectWithoutProperties(props, _excluded$h);
|
|
1327
1344
|
const cache = useRef();
|
|
@@ -1339,6 +1356,8 @@ const RenderedBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1339
1356
|
cache.current = data;
|
|
1340
1357
|
});
|
|
1341
1358
|
const isHorizontal = orientation === BarOrientation.horizontal;
|
|
1359
|
+
const xAxisVariant = propsXAxisVariant ? propsXAxisVariant : isHorizontal ? AxisVariant.default : AxisVariant.tickValue;
|
|
1360
|
+
const yAxisVariant = propsYAxisVariant ? propsYAxisVariant : isHorizontal ? AxisVariant.none : AxisVariant.default;
|
|
1342
1361
|
const chartDimensions = sizeToDimension$3(size);
|
|
1343
1362
|
const width = chartDimensions.width;
|
|
1344
1363
|
const height = chartDimensions.height;
|
|
@@ -1361,7 +1380,7 @@ const RenderedBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1361
1380
|
} = _ref;
|
|
1362
1381
|
return value;
|
|
1363
1382
|
}))]).range(isHorizontal ? [0, chartWidth] : [chartHeight, 0]), [size]);
|
|
1364
|
-
const scaleCategory = useMemo(() =>
|
|
1383
|
+
const scaleCategory = useMemo(() => scaleBand().domain(data.filter(datum => datum.value).map(datum => datum.key)).range([0, isHorizontal ? chartHeight : chartWidth]), [size]);
|
|
1365
1384
|
return /*#__PURE__*/React__default.createElement(StyledBarChart, _extends({}, forwardedProps, {
|
|
1366
1385
|
id: id,
|
|
1367
1386
|
className: className,
|
|
@@ -1371,32 +1390,45 @@ const RenderedBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1371
1390
|
height: height
|
|
1372
1391
|
}, /*#__PURE__*/React__default.createElement("g", {
|
|
1373
1392
|
transform: `translate(${margins.left},${margins.top})`
|
|
1374
|
-
},
|
|
1393
|
+
}, ['bottom', 'both'].includes(xAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
|
|
1375
1394
|
position: "bottom",
|
|
1376
1395
|
length: chartWidth,
|
|
1377
|
-
scale: scale,
|
|
1396
|
+
scale: isHorizontal ? scale : scaleCategory,
|
|
1378
1397
|
x: 0,
|
|
1379
1398
|
y: chartHeight,
|
|
1380
|
-
tickValues: 4,
|
|
1399
|
+
tickValues: xAxisTickValues !== null && xAxisTickValues !== void 0 ? xAxisTickValues : 4,
|
|
1400
|
+
variant: xAxisVariant,
|
|
1401
|
+
tickFormat: xAxisTickFormat,
|
|
1402
|
+
tickRotation: areXLabelsRotated ? -45 : 0
|
|
1403
|
+
}) : null, ['top', 'both'].includes(xAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
|
|
1404
|
+
position: "top",
|
|
1405
|
+
length: chartWidth,
|
|
1406
|
+
scale: isHorizontal ? scale : scaleCategory,
|
|
1407
|
+
x: 0,
|
|
1408
|
+
y: 0,
|
|
1409
|
+
tickValues: xAxisTickValues !== null && xAxisTickValues !== void 0 ? xAxisTickValues : 4,
|
|
1410
|
+
variant: xAxisVariant,
|
|
1411
|
+
tickFormat: xAxisTickFormat,
|
|
1381
1412
|
tickRotation: areXLabelsRotated ? -45 : 0
|
|
1382
|
-
}) :
|
|
1413
|
+
}) : null, ['left', 'both'].includes(yAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
|
|
1383
1414
|
position: "left",
|
|
1384
1415
|
length: chartHeight,
|
|
1385
|
-
scale: scale,
|
|
1416
|
+
scale: isHorizontal ? scaleCategory : scale,
|
|
1386
1417
|
x: 0,
|
|
1387
1418
|
y: chartHeight,
|
|
1388
|
-
tickValues: 4,
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1419
|
+
tickValues: yAxisTickValues !== null && yAxisTickValues !== void 0 ? yAxisTickValues : 4,
|
|
1420
|
+
variant: yAxisVariant,
|
|
1421
|
+
tickFormat: yAxisTickFormat
|
|
1422
|
+
}) : null, ['right', 'both'].includes(yAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
|
|
1423
|
+
position: "right",
|
|
1424
|
+
length: chartHeight,
|
|
1425
|
+
scale: isHorizontal ? scaleCategory : scale,
|
|
1426
|
+
x: chartWidth,
|
|
1395
1427
|
y: chartHeight,
|
|
1396
|
-
tickValues: 4,
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
})
|
|
1428
|
+
tickValues: yAxisTickValues !== null && yAxisTickValues !== void 0 ? yAxisTickValues : 4,
|
|
1429
|
+
variant: yAxisVariant,
|
|
1430
|
+
tickFormat: yAxisTickFormat
|
|
1431
|
+
}) : null, data.filter(datum => datum.value).map((datum, index) => {
|
|
1400
1432
|
const percent = datum.value / total;
|
|
1401
1433
|
const to = {
|
|
1402
1434
|
data: _objectSpread2(_objectSpread2({}, datum), {}, {
|
|
@@ -1428,7 +1460,7 @@ const RenderedBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1428
1460
|
}))));
|
|
1429
1461
|
});
|
|
1430
1462
|
|
|
1431
|
-
const _excluded$g = ["areXLabelsRotated", "caping", "chartRef", "className", "data", "emptyComponent", "id", "isBarSelected", "labelDecorator", "localeText", "onBarClick", "orientation", "others", "size", "barRole", "theme", "tooltipVariant"];
|
|
1463
|
+
const _excluded$g = ["areXLabelsRotated", "caping", "chartRef", "className", "data", "emptyComponent", "id", "isBarSelected", "labelDecorator", "localeText", "onBarClick", "orientation", "others", "size", "barRole", "theme", "tooltipDecorator", "tooltipVariant"];
|
|
1432
1464
|
const COMPONENT_NAME$7 = 'BarChart';
|
|
1433
1465
|
const CLASSNAME$7 = 'redsift-barchart';
|
|
1434
1466
|
const DEFAULT_PROPS$7 = {
|
|
@@ -1441,7 +1473,9 @@ const DEFAULT_PROPS$7 = {
|
|
|
1441
1473
|
tooltipVariant: TooltipVariant.value,
|
|
1442
1474
|
localeText: {
|
|
1443
1475
|
emptyChartText: 'No Data'
|
|
1444
|
-
}
|
|
1476
|
+
},
|
|
1477
|
+
xAxisPlacement: 'bottom',
|
|
1478
|
+
yAxisPlacement: 'left'
|
|
1445
1479
|
};
|
|
1446
1480
|
const BarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
1447
1481
|
const {
|
|
@@ -1461,6 +1495,7 @@ const BarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1461
1495
|
size,
|
|
1462
1496
|
barRole,
|
|
1463
1497
|
theme,
|
|
1498
|
+
tooltipDecorator,
|
|
1464
1499
|
tooltipVariant
|
|
1465
1500
|
} = props,
|
|
1466
1501
|
forwardedProps = _objectWithoutProperties(props, _excluded$g);
|
|
@@ -1499,6 +1534,7 @@ const BarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1499
1534
|
others: others,
|
|
1500
1535
|
size: size,
|
|
1501
1536
|
theme: theme,
|
|
1537
|
+
tooltipDecorator: tooltipDecorator,
|
|
1502
1538
|
tooltipVariant: tooltipVariant
|
|
1503
1539
|
}, forwardedProps, {
|
|
1504
1540
|
ref: ref
|
|
@@ -1625,17 +1661,20 @@ const StyledLegendItem = styled.li`
|
|
|
1625
1661
|
gap: 8px;
|
|
1626
1662
|
font-size: var(--redsift-typography-caption-font-size);
|
|
1627
1663
|
|
|
1628
|
-
|
|
1629
|
-
height: 16px;
|
|
1630
|
-
width: 16px;
|
|
1631
|
-
min-width: 16px;
|
|
1632
|
-
background-color: ${_ref => {
|
|
1664
|
+
${_ref => {
|
|
1633
1665
|
let {
|
|
1666
|
+
$variant,
|
|
1634
1667
|
color
|
|
1635
1668
|
} = _ref;
|
|
1636
|
-
return
|
|
1637
|
-
|
|
1638
|
-
|
|
1669
|
+
return $variant !== LegendVariant.custom ? css`
|
|
1670
|
+
> div {
|
|
1671
|
+
height: 16px;
|
|
1672
|
+
width: 16px;
|
|
1673
|
+
min-width: 16px;
|
|
1674
|
+
background-color: ${color};
|
|
1675
|
+
}
|
|
1676
|
+
` : '';
|
|
1677
|
+
}}}
|
|
1639
1678
|
|
|
1640
1679
|
${_ref2 => {
|
|
1641
1680
|
let {
|
|
@@ -1673,6 +1712,7 @@ const LegendItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1673
1712
|
index,
|
|
1674
1713
|
isSelected: propsIsSelected,
|
|
1675
1714
|
labelDecorator,
|
|
1715
|
+
legendDecorator,
|
|
1676
1716
|
onClick,
|
|
1677
1717
|
role
|
|
1678
1718
|
} = props;
|
|
@@ -1686,6 +1726,8 @@ const LegendItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1686
1726
|
forwardedProps = _objectWithoutProperties(props, _excluded$e);
|
|
1687
1727
|
const [_id] = useId();
|
|
1688
1728
|
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
1729
|
+
console.log(props);
|
|
1730
|
+
const isLegendCustom = variant === LegendVariant.custom && legendDecorator;
|
|
1689
1731
|
const text = labelDecorator ? labelDecorator(data, {
|
|
1690
1732
|
index,
|
|
1691
1733
|
isSelected: propsIsSelected,
|
|
@@ -1718,15 +1760,20 @@ const LegendItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1718
1760
|
onKeyDown: onClick ? e => onKeyDown(e) : undefined,
|
|
1719
1761
|
role: role ? role : onClick ? 'button' : undefined,
|
|
1720
1762
|
tabIndex: onClick ? 0 : undefined,
|
|
1721
|
-
$clickable: Boolean(onClick)
|
|
1722
|
-
|
|
1763
|
+
$clickable: Boolean(onClick),
|
|
1764
|
+
$variant: variant
|
|
1765
|
+
}), isLegendCustom ? legendDecorator(data, {
|
|
1766
|
+
index,
|
|
1767
|
+
isSelected: propsIsSelected,
|
|
1768
|
+
color: props.color
|
|
1769
|
+
}) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", null), typeof text === 'string' ? variant === LegendVariant.value ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Number$1, {
|
|
1723
1770
|
as: "b",
|
|
1724
1771
|
maximumFractionDigits: 2,
|
|
1725
1772
|
value: data.data.value,
|
|
1726
1773
|
variant: "inherit"
|
|
1727
1774
|
}), /*#__PURE__*/React__default.createElement(Text, {
|
|
1728
1775
|
variant: "caption"
|
|
1729
|
-
}, text)) : variant ===
|
|
1776
|
+
}, text)) : variant === LegendVariant.percent && data.data.percent ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Number$1, {
|
|
1730
1777
|
as: "b",
|
|
1731
1778
|
maximumFractionDigits: 2,
|
|
1732
1779
|
type: "percent",
|
|
@@ -1736,19 +1783,19 @@ const LegendItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1736
1783
|
variant: "caption"
|
|
1737
1784
|
}, text)) : /*#__PURE__*/React__default.createElement(Text, {
|
|
1738
1785
|
variant: "caption"
|
|
1739
|
-
}, text) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, text));
|
|
1786
|
+
}, text) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, text)));
|
|
1740
1787
|
});
|
|
1741
1788
|
LegendItem.className = CLASSNAME$5;
|
|
1742
1789
|
LegendItem.defaultProps = DEFAULT_PROPS$5;
|
|
1743
1790
|
LegendItem.displayName = COMPONENT_NAME$5;
|
|
1744
1791
|
|
|
1745
|
-
const _excluded$d = ["className", "data", "isLegendItemSelected", "labelDecorator", "legendItemRole", "onLegendItemClick", "variant", "width"],
|
|
1792
|
+
const _excluded$d = ["className", "data", "isLegendItemSelected", "labelDecorator", "legendDecorator", "legendItemRole", "onLegendItemClick", "variant", "width"],
|
|
1746
1793
|
_excluded2 = ["color"];
|
|
1747
1794
|
const COMPONENT_NAME$4 = 'Legend';
|
|
1748
1795
|
const CLASSNAME$4 = 'redsift-chart-legend';
|
|
1749
1796
|
const DEFAULT_PROPS$4 = {
|
|
1750
1797
|
isLegendItemSelected: () => true,
|
|
1751
|
-
variant:
|
|
1798
|
+
variant: LegendVariant.label
|
|
1752
1799
|
};
|
|
1753
1800
|
const Legend = /*#__PURE__*/forwardRef((props, ref) => {
|
|
1754
1801
|
const {
|
|
@@ -1756,6 +1803,7 @@ const Legend = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1756
1803
|
data,
|
|
1757
1804
|
isLegendItemSelected,
|
|
1758
1805
|
labelDecorator,
|
|
1806
|
+
legendDecorator,
|
|
1759
1807
|
legendItemRole,
|
|
1760
1808
|
onLegendItemClick,
|
|
1761
1809
|
variant,
|
|
@@ -1787,6 +1835,7 @@ const Legend = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1787
1835
|
})),
|
|
1788
1836
|
key: `legend-item _${index}`,
|
|
1789
1837
|
labelDecorator: labelDecorator,
|
|
1838
|
+
legendDecorator: legendDecorator,
|
|
1790
1839
|
onClick: onLegendItemClick,
|
|
1791
1840
|
role: legendItemRole
|
|
1792
1841
|
});
|
|
@@ -1851,11 +1900,12 @@ Line.displayName = COMPONENT_NAME$3;
|
|
|
1851
1900
|
/**
|
|
1852
1901
|
* Component's labels variant.
|
|
1853
1902
|
*/
|
|
1854
|
-
const
|
|
1903
|
+
const LineChartLegendVariant = {
|
|
1855
1904
|
none: 'none',
|
|
1856
1905
|
externalLabel: 'externalLabel',
|
|
1857
1906
|
externalLabelValue: 'externalLabelValue',
|
|
1858
|
-
externalLabelPercent: 'externalLabelPercent'
|
|
1907
|
+
externalLabelPercent: 'externalLabelPercent',
|
|
1908
|
+
custom: 'custom'
|
|
1859
1909
|
};
|
|
1860
1910
|
|
|
1861
1911
|
/**
|
|
@@ -2025,7 +2075,7 @@ const EmptyLineChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2025
2075
|
})))));
|
|
2026
2076
|
});
|
|
2027
2077
|
|
|
2028
|
-
const _excluded$9 = ["className", "data", "dotRole", "id", "isDotSelected", "labelDecorator", "
|
|
2078
|
+
const _excluded$9 = ["className", "data", "dotRole", "id", "isDotSelected", "labelDecorator", "legendDecorator", "legendVariant", "legendProps", "onDotClick", "size", "sortingMethod", "theme", "tooltipDecorator", "tooltipVariant", "xAxisVariant", "xAxisPlacement", "xAxisTickFormat", "xAxisTickValues", "yAxisVariant", "yAxisPlacement", "dateParser"];
|
|
2029
2079
|
const isValidDate = value => {
|
|
2030
2080
|
const date = new Date(value);
|
|
2031
2081
|
return date instanceof Date && !isNaN(date) && !isNaN(Date.parse(value));
|
|
@@ -2038,12 +2088,14 @@ const RenderedLineChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2038
2088
|
id,
|
|
2039
2089
|
isDotSelected,
|
|
2040
2090
|
labelDecorator,
|
|
2041
|
-
|
|
2091
|
+
legendDecorator,
|
|
2092
|
+
legendVariant,
|
|
2042
2093
|
legendProps,
|
|
2043
2094
|
onDotClick,
|
|
2044
2095
|
size,
|
|
2045
2096
|
sortingMethod,
|
|
2046
2097
|
theme,
|
|
2098
|
+
tooltipDecorator,
|
|
2047
2099
|
tooltipVariant,
|
|
2048
2100
|
xAxisVariant,
|
|
2049
2101
|
xAxisPlacement,
|
|
@@ -2177,6 +2229,7 @@ const RenderedLineChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2177
2229
|
role: dotRole,
|
|
2178
2230
|
scaleX: scaleX,
|
|
2179
2231
|
scaleY: scaleY,
|
|
2232
|
+
tooltipDecorator: tooltipDecorator,
|
|
2180
2233
|
tooltipVariant: tooltipVariant,
|
|
2181
2234
|
variant: DotVariant.hollow
|
|
2182
2235
|
});
|
|
@@ -2216,19 +2269,20 @@ const RenderedLineChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2216
2269
|
y: chartHeight,
|
|
2217
2270
|
tickValues: 8,
|
|
2218
2271
|
variant: yAxisVariant
|
|
2219
|
-
}) : null))), hasCategory &&
|
|
2272
|
+
}) : null))), hasCategory && legendVariant !== LineChartLegendVariant.none ? /*#__PURE__*/React__default.createElement(Legend, _extends({
|
|
2220
2273
|
data: statsByCategory.map(d => _objectSpread2(_objectSpread2({}, d), {}, {
|
|
2221
2274
|
color: colorScale === null || colorScale === void 0 ? void 0 : colorScale(d.key)
|
|
2222
2275
|
})),
|
|
2223
|
-
variant:
|
|
2276
|
+
variant: legendVariant === LineChartLegendVariant.externalLabelValue ? LegendVariant.value : legendVariant === LineChartLegendVariant.externalLabelPercent ? LegendVariant.percent : legendVariant === LineChartLegendVariant.externalLabel ? LegendVariant.label : LegendVariant.custom,
|
|
2277
|
+
legendDecorator: legendDecorator ? (datum, props) => legendDecorator(datum, props) : undefined
|
|
2224
2278
|
}, legendProps)) : null);
|
|
2225
2279
|
});
|
|
2226
2280
|
|
|
2227
|
-
const _excluded$8 = ["className", "data", "dotRole", "emptyComponent", "id", "isDotSelected", "labelVariant", "localeText", "onDotClick", "size", "theme", "tooltipVariant"];
|
|
2281
|
+
const _excluded$8 = ["className", "data", "dotRole", "emptyComponent", "id", "isDotSelected", "labelDecorator", "legendDecorator", "labelVariant", "legendVariant", "localeText", "onDotClick", "size", "theme", "tooltipDecorator", "tooltipVariant"];
|
|
2228
2282
|
const COMPONENT_NAME$2 = 'LineChart';
|
|
2229
2283
|
const CLASSNAME$2 = 'redsift-line-chart';
|
|
2230
2284
|
const DEFAULT_PROPS$2 = {
|
|
2231
|
-
|
|
2285
|
+
// legendVariant: LineChartLegendVariant.externalLabel,
|
|
2232
2286
|
localeText: {
|
|
2233
2287
|
emptyChartText: 'No Data'
|
|
2234
2288
|
},
|
|
@@ -2242,6 +2296,7 @@ const DEFAULT_PROPS$2 = {
|
|
|
2242
2296
|
yAxisPlacement: 'left'
|
|
2243
2297
|
};
|
|
2244
2298
|
const LineChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
2299
|
+
var _ref;
|
|
2245
2300
|
const {
|
|
2246
2301
|
className,
|
|
2247
2302
|
data: propsData,
|
|
@@ -2249,16 +2304,21 @@ const LineChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2249
2304
|
emptyComponent,
|
|
2250
2305
|
id: propsId,
|
|
2251
2306
|
isDotSelected,
|
|
2307
|
+
labelDecorator,
|
|
2308
|
+
legendDecorator,
|
|
2252
2309
|
labelVariant,
|
|
2310
|
+
legendVariant: propsLegendVariant,
|
|
2253
2311
|
localeText,
|
|
2254
2312
|
onDotClick,
|
|
2255
2313
|
size,
|
|
2256
2314
|
theme,
|
|
2315
|
+
tooltipDecorator,
|
|
2257
2316
|
tooltipVariant
|
|
2258
2317
|
} = props,
|
|
2259
2318
|
forwardedProps = _objectWithoutProperties(props, _excluded$8);
|
|
2260
2319
|
const [_id] = useId();
|
|
2261
2320
|
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
2321
|
+
const legendVariant = (_ref = propsLegendVariant !== null && propsLegendVariant !== void 0 ? propsLegendVariant : labelVariant) !== null && _ref !== void 0 ? _ref : LineChartLegendVariant.externalLabel;
|
|
2262
2322
|
if (propsData === undefined || propsData === null) {
|
|
2263
2323
|
return /*#__PURE__*/React__default.createElement(LoadingLineChart, _extends({
|
|
2264
2324
|
id: id
|
|
@@ -2282,11 +2342,14 @@ const LineChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2282
2342
|
dotRole: dotRole,
|
|
2283
2343
|
id: id,
|
|
2284
2344
|
isDotSelected: isDotSelected,
|
|
2285
|
-
|
|
2345
|
+
labelDecorator: labelDecorator,
|
|
2346
|
+
legendDecorator: legendDecorator,
|
|
2347
|
+
legendVariant: legendVariant,
|
|
2286
2348
|
localeText: localeText,
|
|
2287
2349
|
onDotClick: onDotClick,
|
|
2288
2350
|
size: size,
|
|
2289
2351
|
theme: theme,
|
|
2352
|
+
tooltipDecorator: tooltipDecorator,
|
|
2290
2353
|
tooltipVariant: tooltipVariant
|
|
2291
2354
|
}, forwardedProps, {
|
|
2292
2355
|
ref: ref
|
|
@@ -2308,12 +2371,13 @@ const PieChartVariant = {
|
|
|
2308
2371
|
/**
|
|
2309
2372
|
* Component's labels variant.
|
|
2310
2373
|
*/
|
|
2311
|
-
const
|
|
2374
|
+
const PieChartLegendVariant = {
|
|
2312
2375
|
none: 'none',
|
|
2313
2376
|
internal: 'internal',
|
|
2314
2377
|
externalLabel: 'externalLabel',
|
|
2315
2378
|
externalLabelValue: 'externalLabelValue',
|
|
2316
|
-
externalLabelPercent: 'externalLabelPercent'
|
|
2379
|
+
externalLabelPercent: 'externalLabelPercent',
|
|
2380
|
+
custom: 'custom'
|
|
2317
2381
|
};
|
|
2318
2382
|
|
|
2319
2383
|
/**
|
|
@@ -2571,7 +2635,7 @@ const EmptyPieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2571
2635
|
}))));
|
|
2572
2636
|
});
|
|
2573
2637
|
|
|
2574
|
-
const _excluded$5 = ["caping", "className", "data", "id", "isHalf", "isSliceSelected", "labelDecorator", "
|
|
2638
|
+
const _excluded$5 = ["caping", "className", "data", "id", "isHalf", "isSliceSelected", "labelDecorator", "legendDecorator", "legendVariant", "legendProps", "middleText", "onSliceClick", "others", "size", "sliceProps", "sliceRole", "sortingMethod", "subtext", "text", "theme", "tooltipVariant", "variant"];
|
|
2575
2639
|
const RenderedPieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
2576
2640
|
const {
|
|
2577
2641
|
caping,
|
|
@@ -2581,7 +2645,8 @@ const RenderedPieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2581
2645
|
isHalf,
|
|
2582
2646
|
isSliceSelected,
|
|
2583
2647
|
labelDecorator,
|
|
2584
|
-
|
|
2648
|
+
legendDecorator,
|
|
2649
|
+
legendVariant,
|
|
2585
2650
|
legendProps,
|
|
2586
2651
|
middleText: propsMiddleText,
|
|
2587
2652
|
onSliceClick,
|
|
@@ -2697,7 +2762,7 @@ const RenderedPieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2697
2762
|
data: to
|
|
2698
2763
|
};
|
|
2699
2764
|
}),
|
|
2700
|
-
hasLabels:
|
|
2765
|
+
hasLabels: legendVariant === PieChartLegendVariant.internal,
|
|
2701
2766
|
hasStroke: isSpaced,
|
|
2702
2767
|
labelDecorator: labelDecorator,
|
|
2703
2768
|
onClick: onSliceClick,
|
|
@@ -2705,33 +2770,35 @@ const RenderedPieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2705
2770
|
sliceProps: sliceProps,
|
|
2706
2771
|
tooltipVariant: tooltipVariant,
|
|
2707
2772
|
transform: `translate(${width / 2} ${isHalf ? height : height / 2})`
|
|
2708
|
-
}))),
|
|
2773
|
+
}))), legendVariant !== PieChartLegendVariant.none && legendVariant !== PieChartLegendVariant.internal ? /*#__PURE__*/React__default.createElement(Legend, _extends({
|
|
2709
2774
|
data: data.map(d => _objectSpread2(_objectSpread2({}, d), {}, {
|
|
2710
2775
|
color: colorScale === null || colorScale === void 0 ? void 0 : colorScale(d.key)
|
|
2711
2776
|
})),
|
|
2712
|
-
variant:
|
|
2777
|
+
variant: legendVariant === PieChartLegendVariant.externalLabelValue ? LegendVariant.value : legendVariant === PieChartLegendVariant.externalLabelPercent ? LegendVariant.percent : legendVariant === PieChartLegendVariant.externalLabel ? LegendVariant.label : LegendVariant.custom,
|
|
2713
2778
|
width: legendWidth.current,
|
|
2714
|
-
labelDecorator: labelDecorator ? (datum, props) => labelDecorator(datum, props) : undefined
|
|
2779
|
+
labelDecorator: labelDecorator ? (datum, props) => labelDecorator(datum, props) : undefined,
|
|
2780
|
+
legendDecorator: legendDecorator ? (datum, props) => legendDecorator(datum, props) : undefined
|
|
2715
2781
|
}, legendProps)) : null);
|
|
2716
2782
|
});
|
|
2717
2783
|
|
|
2718
|
-
const _excluded$4 = ["caping", "chartRef", "className", "data", "emptyComponent", "id", "isSliceSelected", "labelDecorator", "labelVariant", "localeText", "middleText", "onSliceClick", "others", "size", "sliceRole", "subtext", "text", "theme", "tooltipVariant", "variant"];
|
|
2784
|
+
const _excluded$4 = ["caping", "chartRef", "className", "data", "emptyComponent", "id", "isSliceSelected", "labelDecorator", "legendDecorator", "labelVariant", "legendVariant", "localeText", "middleText", "onSliceClick", "others", "size", "sliceRole", "subtext", "text", "theme", "tooltipDecorator", "tooltipVariant", "variant"];
|
|
2719
2785
|
const COMPONENT_NAME$1 = 'PieChart';
|
|
2720
2786
|
const CLASSNAME$1 = 'redsift-piechart';
|
|
2721
2787
|
const DEFAULT_PROPS$1 = {
|
|
2722
2788
|
isSliceSelected: () => true,
|
|
2723
|
-
|
|
2789
|
+
// legendVariant: PieChartLegendVariant.none,
|
|
2724
2790
|
others: true,
|
|
2725
2791
|
size: ChartSize.medium,
|
|
2726
2792
|
sortingMethod: 'desc-value',
|
|
2727
2793
|
theme: ColorTheme.default,
|
|
2728
|
-
variant: PieChartVariant.
|
|
2794
|
+
variant: PieChartVariant.spaced,
|
|
2729
2795
|
tooltipVariant: TooltipVariant.value,
|
|
2730
2796
|
localeText: {
|
|
2731
2797
|
emptyChartText: 'No Data'
|
|
2732
2798
|
}
|
|
2733
2799
|
};
|
|
2734
2800
|
const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
2801
|
+
var _ref;
|
|
2735
2802
|
const {
|
|
2736
2803
|
caping,
|
|
2737
2804
|
chartRef,
|
|
@@ -2741,7 +2808,9 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2741
2808
|
id: propsId,
|
|
2742
2809
|
isSliceSelected,
|
|
2743
2810
|
labelDecorator,
|
|
2811
|
+
legendDecorator,
|
|
2744
2812
|
labelVariant,
|
|
2813
|
+
legendVariant: propsLegendVariant,
|
|
2745
2814
|
localeText,
|
|
2746
2815
|
middleText,
|
|
2747
2816
|
onSliceClick,
|
|
@@ -2751,12 +2820,14 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2751
2820
|
subtext,
|
|
2752
2821
|
text,
|
|
2753
2822
|
theme,
|
|
2823
|
+
tooltipDecorator,
|
|
2754
2824
|
tooltipVariant,
|
|
2755
2825
|
variant
|
|
2756
2826
|
} = props,
|
|
2757
2827
|
forwardedProps = _objectWithoutProperties(props, _excluded$4);
|
|
2758
2828
|
const [_id] = useId();
|
|
2759
2829
|
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
2830
|
+
const legendVariant = (_ref = propsLegendVariant !== null && propsLegendVariant !== void 0 ? propsLegendVariant : labelVariant) !== null && _ref !== void 0 ? _ref : PieChartLegendVariant.none;
|
|
2760
2831
|
if (propsData === undefined || propsData === null) {
|
|
2761
2832
|
return /*#__PURE__*/React__default.createElement(LoadingPieChart, _extends({
|
|
2762
2833
|
id: id
|
|
@@ -2784,7 +2855,8 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2784
2855
|
id: id,
|
|
2785
2856
|
isSliceSelected: isSliceSelected,
|
|
2786
2857
|
labelDecorator: labelDecorator,
|
|
2787
|
-
|
|
2858
|
+
legendDecorator: legendDecorator,
|
|
2859
|
+
legendVariant: legendVariant,
|
|
2788
2860
|
middleText: middleText,
|
|
2789
2861
|
onSliceClick: onSliceClick,
|
|
2790
2862
|
others: others,
|
|
@@ -2793,6 +2865,7 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2793
2865
|
subtext: subtext,
|
|
2794
2866
|
text: text,
|
|
2795
2867
|
theme: theme,
|
|
2868
|
+
tooltipDecorator: tooltipDecorator,
|
|
2796
2869
|
tooltipVariant: tooltipVariant,
|
|
2797
2870
|
variant: variant
|
|
2798
2871
|
}, forwardedProps, {
|
|
@@ -2813,11 +2886,12 @@ const ScatterPlotVariant = {
|
|
|
2813
2886
|
/**
|
|
2814
2887
|
* Component's labels variant.
|
|
2815
2888
|
*/
|
|
2816
|
-
const
|
|
2889
|
+
const ScatterPlotLegendVariant = {
|
|
2817
2890
|
none: 'none',
|
|
2818
2891
|
externalLabel: 'externalLabel',
|
|
2819
2892
|
externalLabelValue: 'externalLabelValue',
|
|
2820
|
-
externalLabelPercent: 'externalLabelPercent'
|
|
2893
|
+
externalLabelPercent: 'externalLabelPercent',
|
|
2894
|
+
custom: 'custom'
|
|
2821
2895
|
};
|
|
2822
2896
|
|
|
2823
2897
|
/**
|
|
@@ -2995,7 +3069,7 @@ var mdiChevronDown = "M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z
|
|
|
2995
3069
|
var mdiChevronRight = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";
|
|
2996
3070
|
var mdiMouse = "M11,1.07C7.05,1.56 4,4.92 4,9H11M4,15A8,8 0 0,0 12,23A8,8 0 0,0 20,15V11H4M13,1.07V9H20C20,4.92 16.94,1.56 13,1.07Z";
|
|
2997
3071
|
|
|
2998
|
-
const _excluded$1 = ["isBrushable", "className", "data", "dotRole", "hideControlKeyPanel", "id", "isDotSelected", "labelDecorator", "
|
|
3072
|
+
const _excluded$1 = ["isBrushable", "className", "data", "dotRole", "hideControlKeyPanel", "id", "isDotSelected", "labelDecorator", "legendDecorator", "legendVariant", "legendProps", "onBrush", "onBrushEnd", "onDotClick", "size", "sortingMethod", "theme", "tooltipDecorator", "tooltipVariant", "variant", "xAxisVariant", "xAxisPlacement", "yAxisVariant", "yAxisPlacement"];
|
|
2999
3073
|
const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3000
3074
|
const {
|
|
3001
3075
|
isBrushable,
|
|
@@ -3006,7 +3080,8 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3006
3080
|
id,
|
|
3007
3081
|
isDotSelected,
|
|
3008
3082
|
labelDecorator,
|
|
3009
|
-
|
|
3083
|
+
legendDecorator,
|
|
3084
|
+
legendVariant,
|
|
3010
3085
|
legendProps,
|
|
3011
3086
|
onBrush,
|
|
3012
3087
|
onBrushEnd,
|
|
@@ -3014,6 +3089,7 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3014
3089
|
size,
|
|
3015
3090
|
sortingMethod,
|
|
3016
3091
|
theme,
|
|
3092
|
+
tooltipDecorator,
|
|
3017
3093
|
tooltipVariant,
|
|
3018
3094
|
variant,
|
|
3019
3095
|
xAxisVariant,
|
|
@@ -3185,6 +3261,7 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3185
3261
|
role: dotRole,
|
|
3186
3262
|
scaleX: scaleX,
|
|
3187
3263
|
scaleY: scaleY,
|
|
3264
|
+
tooltipDecorator: tooltipDecorator,
|
|
3188
3265
|
tooltipVariant: tooltipVariant
|
|
3189
3266
|
});
|
|
3190
3267
|
}))), /*#__PURE__*/React__default.createElement("g", {
|
|
@@ -3221,21 +3298,22 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3221
3298
|
y: chartHeight,
|
|
3222
3299
|
tickValues: 8,
|
|
3223
3300
|
variant: yAxisVariant
|
|
3224
|
-
}) : null))), hasCategory &&
|
|
3301
|
+
}) : null))), hasCategory && legendVariant !== ScatterPlotLegendVariant.none ? /*#__PURE__*/React__default.createElement(Legend, _extends({
|
|
3225
3302
|
data: countsByCategory.map(d => _objectSpread2(_objectSpread2({}, d), {}, {
|
|
3226
3303
|
color: colorScale === null || colorScale === void 0 ? void 0 : colorScale(d.key)
|
|
3227
3304
|
})),
|
|
3228
|
-
variant:
|
|
3229
|
-
width: legendWidth.current
|
|
3305
|
+
variant: legendVariant === ScatterPlotLegendVariant.externalLabelValue ? LegendVariant.value : legendVariant === ScatterPlotLegendVariant.externalLabelPercent ? LegendVariant.percent : legendVariant === ScatterPlotLegendVariant.externalLabel ? LegendVariant.label : LegendVariant.custom,
|
|
3306
|
+
width: legendWidth.current,
|
|
3307
|
+
legendDecorator: legendDecorator ? (datum, props) => legendDecorator(datum, props) : undefined
|
|
3230
3308
|
}, legendProps)) : null);
|
|
3231
3309
|
});
|
|
3232
3310
|
|
|
3233
|
-
const _excluded = ["className", "data", "dotRole", "emptyComponent", "id", "isDotSelected", "labelVariant", "localeText", "onBrush", "onBrushEnd", "onDotClick", "size", "theme", "tooltipVariant", "variant"];
|
|
3311
|
+
const _excluded = ["className", "data", "dotRole", "emptyComponent", "id", "isDotSelected", "labelDecorator", "labelVariant", "legendDecorator", "legendVariant", "localeText", "onBrush", "onBrushEnd", "onDotClick", "size", "theme", "tooltipDecorator", "tooltipVariant", "variant"];
|
|
3234
3312
|
const COMPONENT_NAME = 'ScatterPlot';
|
|
3235
3313
|
const CLASSNAME = 'redsift-scatterplot';
|
|
3236
3314
|
const DEFAULT_PROPS = {
|
|
3237
3315
|
hideControlKeyPanel: false,
|
|
3238
|
-
|
|
3316
|
+
// legendVariant: ScatterPlotLegendVariant.externalLabel,
|
|
3239
3317
|
localeText: {
|
|
3240
3318
|
emptyChartText: 'No Data'
|
|
3241
3319
|
},
|
|
@@ -3250,6 +3328,7 @@ const DEFAULT_PROPS = {
|
|
|
3250
3328
|
yAxisPlacement: 'left'
|
|
3251
3329
|
};
|
|
3252
3330
|
const ScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3331
|
+
var _ref;
|
|
3253
3332
|
const {
|
|
3254
3333
|
className,
|
|
3255
3334
|
data: propsData,
|
|
@@ -3257,19 +3336,24 @@ const ScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3257
3336
|
emptyComponent,
|
|
3258
3337
|
id: propsId,
|
|
3259
3338
|
isDotSelected,
|
|
3339
|
+
labelDecorator,
|
|
3260
3340
|
labelVariant,
|
|
3341
|
+
legendDecorator,
|
|
3342
|
+
legendVariant: propsLegendVariant,
|
|
3261
3343
|
localeText,
|
|
3262
3344
|
onBrush,
|
|
3263
3345
|
onBrushEnd,
|
|
3264
3346
|
onDotClick,
|
|
3265
3347
|
size,
|
|
3266
3348
|
theme,
|
|
3349
|
+
tooltipDecorator,
|
|
3267
3350
|
tooltipVariant,
|
|
3268
3351
|
variant
|
|
3269
3352
|
} = props,
|
|
3270
3353
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
3271
3354
|
const [_id] = useId();
|
|
3272
3355
|
const id = propsId !== null && propsId !== void 0 ? propsId : _id;
|
|
3356
|
+
const legendVariant = (_ref = propsLegendVariant !== null && propsLegendVariant !== void 0 ? propsLegendVariant : labelVariant) !== null && _ref !== void 0 ? _ref : ScatterPlotLegendVariant.externalLabel;
|
|
3273
3357
|
if (propsData === undefined || propsData === null) {
|
|
3274
3358
|
return /*#__PURE__*/React__default.createElement(LoadingScatterPlot, _extends({
|
|
3275
3359
|
id: id
|
|
@@ -3293,13 +3377,16 @@ const ScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3293
3377
|
dotRole: dotRole,
|
|
3294
3378
|
id: id,
|
|
3295
3379
|
isDotSelected: isDotSelected,
|
|
3296
|
-
|
|
3380
|
+
labelDecorator: labelDecorator,
|
|
3381
|
+
legendDecorator: legendDecorator,
|
|
3382
|
+
legendVariant: legendVariant,
|
|
3297
3383
|
localeText: localeText,
|
|
3298
3384
|
onBrush: onBrush,
|
|
3299
3385
|
onBrushEnd: onBrushEnd,
|
|
3300
3386
|
onDotClick: onDotClick,
|
|
3301
3387
|
size: size,
|
|
3302
3388
|
theme: theme,
|
|
3389
|
+
tooltipDecorator: tooltipDecorator,
|
|
3303
3390
|
tooltipVariant: tooltipVariant,
|
|
3304
3391
|
variant: variant
|
|
3305
3392
|
}, forwardedProps, {
|
|
@@ -3310,5 +3397,5 @@ ScatterPlot.className = CLASSNAME;
|
|
|
3310
3397
|
ScatterPlot.defaultProps = DEFAULT_PROPS;
|
|
3311
3398
|
ScatterPlot.displayName = COMPONENT_NAME;
|
|
3312
3399
|
|
|
3313
|
-
export { Arc, Arcs, Axis, AxisPosition, AxisVariant, Bar, BarChart, BarOrientation, ChartContainer, ChartSize, ColorTheme, DataPoint, Dot, DotVariant, LabelVariant, Legend, Line, LineChart,
|
|
3400
|
+
export { Arc, Arcs, Axis, AxisPosition, AxisVariant, Bar, BarChart, BarOrientation, ChartContainer, ChartSize, ColorTheme, DataPoint, Dot, DotVariant, LabelVariant, Legend, LegendVariant, Line, LineChart, LineChartLegendVariant, PieChart, PieChartLegendVariant, PieChartVariant, ScatterPlot, ScatterPlotLegendVariant, ScatterPlotVariant, StyledArc, StyledArcs, StyledAxis, StyledBar, StyledBarChart, StyledBarChartEmptyText, StyledChartContainer, StyledChartContainerCaption, StyledChartContainerTitle, StyledDataPoint, StyledDot, StyledLegend, StyledLine, StyledLineChart, StyledLineChartEmptyText, StyledPieChart, StyledPieChartCenterText, StyledPieChartEmptyText, StyledScatterPlot, StyledScatterPlotEmptyText, TooltipVariant, empty, getColorScale, getSortingMethod, monochrome, scheme, successDangerScheme, useBrush, useColor, useFormatCategoricalData, useZoom };
|
|
3314
3401
|
//# sourceMappingURL=index.js.map
|