@redsift/charts 8.0.1 → 8.0.2
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.d.ts → index.d.ts} +8 -0
- package/{dist/index.js → index.js} +97 -25
- package/index.js.map +1 -0
- package/package.json +3 -2
- package/coverage/clover.xml +0 -1070
- package/coverage/coverage-final.json +0 -60
- package/coverage/lcov-report/ChartEmptyState/ChartEmptyState.tsx.html +0 -679
- package/coverage/lcov-report/ChartEmptyState/index.html +0 -146
- package/coverage/lcov-report/ChartEmptyState/index.ts.html +0 -91
- package/coverage/lcov-report/ChartEmptyState/styles.ts.html +0 -184
- package/coverage/lcov-report/HorizontalBarChart/HorizontalBarChart.tsx.html +0 -775
- package/coverage/lcov-report/HorizontalBarChart/HorizontalBarChartAxisBottom.tsx.html +0 -259
- package/coverage/lcov-report/HorizontalBarChart/HorizontalBarChartBar.tsx.html +0 -421
- package/coverage/lcov-report/HorizontalBarChart/index.html +0 -191
- package/coverage/lcov-report/HorizontalBarChart/index.ts.html +0 -94
- package/coverage/lcov-report/HorizontalBarChart/styles.ts.html +0 -451
- package/coverage/lcov-report/HorizontalBarChart/types.ts.html +0 -433
- package/coverage/lcov-report/PieChart/PieChart.tsx.html +0 -1105
- package/coverage/lcov-report/PieChart/PieChartArc.tsx.html +0 -412
- package/coverage/lcov-report/PieChart/index.html +0 -176
- package/coverage/lcov-report/PieChart/index.ts.html +0 -94
- package/coverage/lcov-report/PieChart/styles.ts.html +0 -616
- package/coverage/lcov-report/PieChart/types.ts.html +0 -472
- package/coverage/lcov-report/PieChart.tsx.html +0 -1045
- package/coverage/lcov-report/PieChartArc.tsx.html +0 -271
- package/coverage/lcov-report/StaticPieChart.tsx.html +0 -286
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/components/Arc/Arc.tsx.html +0 -304
- package/coverage/lcov-report/components/Arc/index.html +0 -146
- package/coverage/lcov-report/components/Arc/index.ts.html +0 -94
- package/coverage/lcov-report/components/Arc/styles.ts.html +0 -208
- package/coverage/lcov-report/components/Arcs/Arcs.tsx.html +0 -427
- package/coverage/lcov-report/components/Arcs/index.html +0 -146
- package/coverage/lcov-report/components/Arcs/index.ts.html +0 -94
- package/coverage/lcov-report/components/Arcs/styles.ts.html +0 -106
- package/coverage/lcov-report/components/Axis/Axis.tsx.html +0 -754
- package/coverage/lcov-report/components/Axis/computeTicks.ts.html +0 -481
- package/coverage/lcov-report/components/Axis/index.html +0 -176
- package/coverage/lcov-report/components/Axis/index.ts.html +0 -94
- package/coverage/lcov-report/components/Axis/styles.ts.html +0 -148
- package/coverage/lcov-report/components/Axis/types.ts.html +0 -253
- package/coverage/lcov-report/components/Bar/Bar.tsx.html +0 -421
- package/coverage/lcov-report/components/Bar/index.html +0 -161
- package/coverage/lcov-report/components/Bar/index.ts.html +0 -94
- package/coverage/lcov-report/components/Bar/styles.ts.html +0 -247
- package/coverage/lcov-report/components/Bar/types.ts.html +0 -178
- package/coverage/lcov-report/components/BarChart/BarChart.tsx.html +0 -355
- package/coverage/lcov-report/components/BarChart/EmptyBarChart.tsx.html +0 -259
- package/coverage/lcov-report/components/BarChart/LoadingBarChart.tsx.html +0 -145
- package/coverage/lcov-report/components/BarChart/RenderedBarChart.tsx.html +0 -496
- package/coverage/lcov-report/components/BarChart/index.html +0 -206
- package/coverage/lcov-report/components/BarChart/index.ts.html +0 -94
- package/coverage/lcov-report/components/BarChart/styles.ts.html +0 -190
- package/coverage/lcov-report/components/BarChart/utils.ts.html +0 -145
- package/coverage/lcov-report/components/ChartContainer/ChartContainer.tsx.html +0 -433
- package/coverage/lcov-report/components/ChartContainer/index.html +0 -146
- package/coverage/lcov-report/components/ChartContainer/index.ts.html +0 -94
- package/coverage/lcov-report/components/ChartContainer/intl/index.html +0 -116
- package/coverage/lcov-report/components/ChartContainer/intl/index.ts.html +0 -106
- package/coverage/lcov-report/components/ChartContainer/styles.ts.html +0 -211
- package/coverage/lcov-report/components/DataPoint/DataPoint.tsx.html +0 -442
- package/coverage/lcov-report/components/DataPoint/index.html +0 -146
- package/coverage/lcov-report/components/DataPoint/index.ts.html +0 -94
- package/coverage/lcov-report/components/DataPoint/styles.ts.html +0 -109
- package/coverage/lcov-report/components/Dot/Dot.tsx.html +0 -232
- package/coverage/lcov-report/components/Dot/index.html +0 -146
- package/coverage/lcov-report/components/Dot/index.ts.html +0 -94
- package/coverage/lcov-report/components/Dot/styles.ts.html +0 -184
- package/coverage/lcov-report/components/Legend/Legend.tsx.html +0 -268
- package/coverage/lcov-report/components/Legend/index.html +0 -146
- package/coverage/lcov-report/components/Legend/index.ts.html +0 -94
- package/coverage/lcov-report/components/Legend/styles.ts.html +0 -130
- package/coverage/lcov-report/components/LegendItem/LegendItem.tsx.html +0 -403
- package/coverage/lcov-report/components/LegendItem/index.html +0 -146
- package/coverage/lcov-report/components/LegendItem/index.ts.html +0 -94
- package/coverage/lcov-report/components/LegendItem/styles.ts.html +0 -205
- package/coverage/lcov-report/components/PieChart/EmptyPieChart.tsx.html +0 -343
- package/coverage/lcov-report/components/PieChart/LoadingPieChart.tsx.html +0 -145
- package/coverage/lcov-report/components/PieChart/PieChart.tsx.html +0 -388
- package/coverage/lcov-report/components/PieChart/RenderedPieChart.tsx.html +0 -571
- package/coverage/lcov-report/components/PieChart/index.html +0 -221
- package/coverage/lcov-report/components/PieChart/index.ts.html +0 -94
- package/coverage/lcov-report/components/PieChart/styles.ts.html +0 -376
- package/coverage/lcov-report/components/PieChart/types.ts.html +0 -352
- package/coverage/lcov-report/components/PieChart/utils.ts.html +0 -199
- package/coverage/lcov-report/components/ScatterPlot/EmptyScatterPlot.tsx.html +0 -295
- package/coverage/lcov-report/components/ScatterPlot/LoadingScatterPlot.tsx.html +0 -145
- package/coverage/lcov-report/components/ScatterPlot/RenderedScatterPlot.tsx.html +0 -910
- package/coverage/lcov-report/components/ScatterPlot/ScatterPlot.tsx.html +0 -379
- package/coverage/lcov-report/components/ScatterPlot/index.html +0 -221
- package/coverage/lcov-report/components/ScatterPlot/index.ts.html +0 -94
- package/coverage/lcov-report/components/ScatterPlot/styles.ts.html +0 -196
- package/coverage/lcov-report/components/ScatterPlot/types.ts.html +0 -376
- package/coverage/lcov-report/components/ScatterPlot/utils.ts.html +0 -388
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/hooks/index.html +0 -176
- package/coverage/lcov-report/hooks/index.ts.html +0 -97
- package/coverage/lcov-report/hooks/useBrush.tsx.html +0 -430
- package/coverage/lcov-report/hooks/useColor.tsx.html +0 -163
- package/coverage/lcov-report/hooks/useFormatCategoricalData.tsx.html +0 -289
- package/coverage/lcov-report/hooks/useZoom.tsx.html +0 -235
- package/coverage/lcov-report/index.html +0 -311
- package/coverage/lcov-report/index.ts.html +0 -94
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/styles.ts.html +0 -631
- package/coverage/lcov-report/types.ts.html +0 -457
- package/coverage/lcov.info +0 -2272
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -98
- package/index.ts +0 -1
- package/jest.config.js +0 -3
- package/rollup.config.js +0 -13
- package/src/components/Arc/Arc.test.tsx +0 -92
- package/src/components/Arc/Arc.tsx +0 -73
- package/src/components/Arc/index.ts +0 -3
- package/src/components/Arc/styles.ts +0 -41
- package/src/components/Arc/types.ts +0 -18
- package/src/components/Arcs/Arcs.stories.tsx +0 -177
- package/src/components/Arcs/Arcs.tsx +0 -114
- package/src/components/Arcs/index.ts +0 -3
- package/src/components/Arcs/styles.ts +0 -7
- package/src/components/Arcs/types.ts +0 -26
- package/src/components/Axis/Axis.stories.tsx +0 -297
- package/src/components/Axis/Axis.tsx +0 -223
- package/src/components/Axis/computeTicks.ts +0 -132
- package/src/components/Axis/index.ts +0 -3
- package/src/components/Axis/styles.ts +0 -21
- package/src/components/Axis/types.ts +0 -56
- package/src/components/Bar/Bar.stories.tsx +0 -152
- package/src/components/Bar/Bar.test.tsx +0 -158
- package/src/components/Bar/Bar.tsx +0 -112
- package/src/components/Bar/index.ts +0 -3
- package/src/components/Bar/styles.ts +0 -54
- package/src/components/Bar/types.ts +0 -31
- package/src/components/BarChart/BarChart.stories.tsx +0 -80
- package/src/components/BarChart/BarChart.test.tsx +0 -189
- package/src/components/BarChart/BarChart.tsx +0 -90
- package/src/components/BarChart/EmptyBarChart.tsx +0 -58
- package/src/components/BarChart/LoadingBarChart.tsx +0 -20
- package/src/components/BarChart/RenderedBarChart.tsx +0 -137
- package/src/components/BarChart/__snapshots__/BarChart.test.tsx.snap +0 -6932
- package/src/components/BarChart/index.ts +0 -3
- package/src/components/BarChart/styles.ts +0 -35
- package/src/components/BarChart/types.ts +0 -58
- package/src/components/BarChart/utils.ts +0 -20
- package/src/components/ChartContainer/ChartContainer.stories.tsx +0 -81
- package/src/components/ChartContainer/ChartContainer.test.tsx +0 -75
- package/src/components/ChartContainer/ChartContainer.tsx +0 -116
- package/src/components/ChartContainer/index.ts +0 -3
- package/src/components/ChartContainer/intl/en-US.json +0 -3
- package/src/components/ChartContainer/intl/fr-FR.json +0 -3
- package/src/components/ChartContainer/intl/index.ts +0 -7
- package/src/components/ChartContainer/styles.ts +0 -42
- package/src/components/ChartContainer/types.ts +0 -24
- package/src/components/DataPoint/DataPoint.tsx +0 -119
- package/src/components/DataPoint/index.ts +0 -3
- package/src/components/DataPoint/styles.ts +0 -8
- package/src/components/DataPoint/types.ts +0 -33
- package/src/components/Dot/Dot.stories.tsx +0 -157
- package/src/components/Dot/Dot.test.tsx +0 -136
- package/src/components/Dot/Dot.tsx +0 -49
- package/src/components/Dot/index.ts +0 -3
- package/src/components/Dot/styles.ts +0 -33
- package/src/components/Dot/types.ts +0 -16
- package/src/components/Legend/Legend.stories.tsx +0 -108
- package/src/components/Legend/Legend.tsx +0 -61
- package/src/components/Legend/index.ts +0 -3
- package/src/components/Legend/styles.ts +0 -15
- package/src/components/Legend/types.ts +0 -27
- package/src/components/LegendItem/LegendItem.test.tsx +0 -69
- package/src/components/LegendItem/LegendItem.tsx +0 -106
- package/src/components/LegendItem/index.ts +0 -3
- package/src/components/LegendItem/styles.ts +0 -40
- package/src/components/LegendItem/types.ts +0 -30
- package/src/components/PieChart/EmptyPieChart.tsx +0 -86
- package/src/components/PieChart/LoadingPieChart.tsx +0 -20
- package/src/components/PieChart/PieChart.stories.tsx +0 -91
- package/src/components/PieChart/PieChart.test.tsx +0 -201
- package/src/components/PieChart/PieChart.tsx +0 -101
- package/src/components/PieChart/RenderedPieChart.tsx +0 -162
- package/src/components/PieChart/__snapshots__/PieChart.stories.storyshot +0 -7843
- package/src/components/PieChart/__snapshots__/PieChart.test.tsx.snap +0 -20540
- package/src/components/PieChart/index.ts +0 -3
- package/src/components/PieChart/styles.ts +0 -97
- package/src/components/PieChart/types.ts +0 -89
- package/src/components/PieChart/utils.ts +0 -38
- package/src/components/ScatterPlot/EmptyScatterPlot.tsx +0 -70
- package/src/components/ScatterPlot/LoadingScatterPlot.tsx +0 -20
- package/src/components/ScatterPlot/RenderedScatterPlot.tsx +0 -275
- package/src/components/ScatterPlot/ScatterPlot.stories.tsx +0 -95
- package/src/components/ScatterPlot/ScatterPlot.test.tsx +0 -44
- package/src/components/ScatterPlot/ScatterPlot.tsx +0 -98
- package/src/components/ScatterPlot/__snapshots__/ScatterPlot.test.tsx.snap +0 -88352
- package/src/components/ScatterPlot/index.ts +0 -3
- package/src/components/ScatterPlot/styles.ts +0 -37
- package/src/components/ScatterPlot/types.ts +0 -97
- package/src/components/ScatterPlot/utils.ts +0 -101
- package/src/config.ts +0 -10
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useBrush.tsx +0 -115
- package/src/hooks/useColor.tsx +0 -26
- package/src/hooks/useFormatCategoricalData.tsx +0 -68
- package/src/hooks/useZoom.tsx +0 -50
- package/src/index.ts +0 -15
- package/src/scheme.ts +0 -221
- package/src/types/data.ts +0 -52
- package/src/types/index.ts +0 -5
- package/src/types/legend.ts +0 -19
- package/src/types/scale.ts +0 -79
- package/src/types/size.ts +0 -17
- package/src/types/theme.ts +0 -27
- package/tsconfig.json +0 -3
- /package/{dist/CONTRIBUTING.md → CONTRIBUTING.md} +0 -0
|
@@ -402,6 +402,8 @@ interface ChartContainerProps extends Omit<ComponentProps<'div'>, 'title'>, Styl
|
|
|
402
402
|
chartProps?: ComponentProps<'div'>;
|
|
403
403
|
/** Ref to the chart. */
|
|
404
404
|
chartRef?: RefObject<HTMLDivElement>;
|
|
405
|
+
/** Description. */
|
|
406
|
+
description?: string;
|
|
405
407
|
/** Id. */
|
|
406
408
|
id?: string;
|
|
407
409
|
/** Method called when the Reset button is displayed (defines whether or not the button should be displayed). */
|
|
@@ -659,6 +661,8 @@ interface ScatterPlotProps extends ChartContainerProps {
|
|
|
659
661
|
dotRole?: DotProps['role'];
|
|
660
662
|
/** Component to use if the chart is empty (replacing the default one). */
|
|
661
663
|
emptyComponent?: ReactNode;
|
|
664
|
+
/** Whether the Control Keys panel is displayed or not. */
|
|
665
|
+
hideControlKeyPanel?: boolean;
|
|
662
666
|
/** Whether the scatter plot dots are selectable using brush or not. */
|
|
663
667
|
isBrushable?: boolean;
|
|
664
668
|
/** Method to determine whether a dot is selected or not. */
|
|
@@ -689,8 +693,12 @@ interface ScatterPlotProps extends ChartContainerProps {
|
|
|
689
693
|
variant?: ScatterPlotVariant;
|
|
690
694
|
/** X axis variant. */
|
|
691
695
|
xAxisVariant?: AxisVariant;
|
|
696
|
+
/** X axis placement. */
|
|
697
|
+
xAxisPlacement?: 'bottom' | 'top' | 'both';
|
|
692
698
|
/** Y axis variant. */
|
|
693
699
|
yAxisVariant?: AxisVariant;
|
|
700
|
+
/** Y axis placement. */
|
|
701
|
+
yAxisPlacement?: 'right' | 'left' | 'both';
|
|
694
702
|
}
|
|
695
703
|
type StyledScatterPlotProps = ScatterPlotProps & {};
|
|
696
704
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { brush, select, scaleOrdinal, zoom, interpolateRound, interpolate as interpolate$1, scaleLinear, sum, arc, pie, min, extent, descending, scaleSqrt, max } from 'd3';
|
|
2
|
-
import { RedsiftDataVizColorBlueDefault, RedsiftDataVizColorGreyDark, RedsiftDataVizColorGreenDefault, RedsiftDataVizColorPinkDefault, RedsiftDataVizColorAquaDefault, RedsiftDataVizColorBrownDefault, RedsiftDataVizColorRedDefault, RedsiftDataVizColorYellowDefault, RedsiftDataVizColorPurpleDefault, RedsiftDataVizColorOrangeDefault, RedsiftDataVizColorGreyDefault, RedsiftDataVizColorGreenDark, RedsiftDataVizColorPinkDark, RedsiftDataVizColorAquaDark, RedsiftDataVizColorBrownDark, RedsiftDataVizColorRedDark, RedsiftDataVizColorYellowDark, RedsiftDataVizColorPurpleDark, RedsiftDataVizColorOrangeDark, RedsiftDataVizColorBlueDark, RedsiftDataVizColorGreenDarker, RedsiftDataVizColorPinkDarker, RedsiftDataVizColorAquaDarker, RedsiftDataVizColorBrownDarker, RedsiftDataVizColorRedDarker, RedsiftDataVizColorYellowDarker, RedsiftDataVizColorPurpleDarker, RedsiftDataVizColorOrangeDarker, RedsiftDataVizColorBlueDarker, RedsiftDataVizColorGreyDarker, RedsiftDataVizColorGreenDarkerer, RedsiftDataVizColorPinkDarkerer, RedsiftDataVizColorAquaDarkerer, RedsiftDataVizColorBrownDarkerer, RedsiftDataVizColorRedDarkerer, RedsiftDataVizColorYellowDarkerer, RedsiftDataVizColorPurpleDarkerer, RedsiftDataVizColorOrangeDarkerer, RedsiftDataVizColorBlueDarkerer, RedsiftDataVizColorGreyDarkerer, RedsiftDataVizColorGreenLight, RedsiftDataVizColorPinkLight, RedsiftDataVizColorAquaLight, RedsiftDataVizColorBrownLight, RedsiftDataVizColorRedLight, RedsiftDataVizColorYellowLight, RedsiftDataVizColorPurpleLight, RedsiftDataVizColorOrangeLight, RedsiftDataVizColorBlueLight, RedsiftDataVizColorGreyLight, RedsiftDataVizColorGreenLighter, RedsiftDataVizColorPinkLighter, RedsiftDataVizColorAquaLighter, RedsiftDataVizColorBrownLighter, RedsiftDataVizColorRedLighter, RedsiftDataVizColorYellowLighter, RedsiftDataVizColorPurpleLighter, RedsiftDataVizColorOrangeLighter, RedsiftDataVizColorBlueLighter, RedsiftDataVizColorGreyLighter, RedsiftDataVizColorGreenLighterer, RedsiftDataVizColorPinkLighterer, RedsiftDataVizColorAquaLighterer, RedsiftDataVizColorBrownLighterer, RedsiftDataVizColorRedLighterer, RedsiftDataVizColorYellowLighterer, RedsiftDataVizColorPurpleLighterer, RedsiftDataVizColorOrangeLighterer, RedsiftDataVizColorBlueLighterer, RedsiftDataVizColorGreyLighterer, Text, Number as Number$1, baseStyling, focusRing, Flexbox, warnIfNoAccessibleLabelFound, Heading, Button } from '@redsift/design-system';
|
|
2
|
+
import { RedsiftDataVizColorBlueDefault, RedsiftDataVizColorGreyDark, RedsiftDataVizColorGreenDefault, RedsiftDataVizColorPinkDefault, RedsiftDataVizColorAquaDefault, RedsiftDataVizColorBrownDefault, RedsiftDataVizColorRedDefault, RedsiftDataVizColorYellowDefault, RedsiftDataVizColorPurpleDefault, RedsiftDataVizColorOrangeDefault, RedsiftDataVizColorGreyDefault, RedsiftDataVizColorGreenDark, RedsiftDataVizColorPinkDark, RedsiftDataVizColorAquaDark, RedsiftDataVizColorBrownDark, RedsiftDataVizColorRedDark, RedsiftDataVizColorYellowDark, RedsiftDataVizColorPurpleDark, RedsiftDataVizColorOrangeDark, RedsiftDataVizColorBlueDark, RedsiftDataVizColorGreenDarker, RedsiftDataVizColorPinkDarker, RedsiftDataVizColorAquaDarker, RedsiftDataVizColorBrownDarker, RedsiftDataVizColorRedDarker, RedsiftDataVizColorYellowDarker, RedsiftDataVizColorPurpleDarker, RedsiftDataVizColorOrangeDarker, RedsiftDataVizColorBlueDarker, RedsiftDataVizColorGreyDarker, RedsiftDataVizColorGreenDarkerer, RedsiftDataVizColorPinkDarkerer, RedsiftDataVizColorAquaDarkerer, RedsiftDataVizColorBrownDarkerer, RedsiftDataVizColorRedDarkerer, RedsiftDataVizColorYellowDarkerer, RedsiftDataVizColorPurpleDarkerer, RedsiftDataVizColorOrangeDarkerer, RedsiftDataVizColorBlueDarkerer, RedsiftDataVizColorGreyDarkerer, RedsiftDataVizColorGreenLight, RedsiftDataVizColorPinkLight, RedsiftDataVizColorAquaLight, RedsiftDataVizColorBrownLight, RedsiftDataVizColorRedLight, RedsiftDataVizColorYellowLight, RedsiftDataVizColorPurpleLight, RedsiftDataVizColorOrangeLight, RedsiftDataVizColorBlueLight, RedsiftDataVizColorGreyLight, RedsiftDataVizColorGreenLighter, RedsiftDataVizColorPinkLighter, RedsiftDataVizColorAquaLighter, RedsiftDataVizColorBrownLighter, RedsiftDataVizColorRedLighter, RedsiftDataVizColorYellowLighter, RedsiftDataVizColorPurpleLighter, RedsiftDataVizColorOrangeLighter, RedsiftDataVizColorBlueLighter, RedsiftDataVizColorGreyLighter, RedsiftDataVizColorGreenLighterer, RedsiftDataVizColorPinkLighterer, RedsiftDataVizColorAquaLighterer, RedsiftDataVizColorBrownLighterer, RedsiftDataVizColorRedLighterer, RedsiftDataVizColorYellowLighterer, RedsiftDataVizColorPurpleLighterer, RedsiftDataVizColorOrangeLighterer, RedsiftDataVizColorBlueLighterer, RedsiftDataVizColorGreyLighterer, Text, Number as Number$1, baseStyling, focusRing, Flexbox, warnIfNoAccessibleLabelFound, Heading, Button, Icon } from '@redsift/design-system';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useEffect, useMemo, useState, useLayoutEffect, forwardRef, useCallback, useContext, useId } from 'react';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { Tooltip } from '@redsift/popovers';
|
|
8
|
+
import { Tooltip, Popover } from '@redsift/popovers';
|
|
9
9
|
import { useLocalizedStringFormatter } from 'react-aria';
|
|
10
10
|
|
|
11
11
|
const getRoundedIntermediaryPoint = (selection, scaleX, scaleY) => {
|
|
@@ -4794,9 +4794,10 @@ const StyledChartContainerCaption = styled.p`
|
|
|
4794
4794
|
font-size: var(--redsift-typography-caption-font-size);
|
|
4795
4795
|
font-weight: var(--redsift-typography-caption-font-weight);
|
|
4796
4796
|
line-height: var(--redsift-typography-caption-line-height);
|
|
4797
|
+
margin: 8px;
|
|
4797
4798
|
`;
|
|
4798
4799
|
|
|
4799
|
-
const _excluded$f = ["aria-label", "aria-labelledby", "
|
|
4800
|
+
const _excluded$f = ["aria-label", "aria-labelledby", "description", "chartProps", "chartRef", "children", "className", "id", "title", "onReset"];
|
|
4800
4801
|
const COMPONENT_NAME$6 = 'ChartContainer';
|
|
4801
4802
|
const CLASSNAME$6 = 'redsift-chart-container';
|
|
4802
4803
|
const DEFAULT_PROPS$6 = {};
|
|
@@ -4804,7 +4805,7 @@ const ChartContainer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4804
4805
|
const {
|
|
4805
4806
|
'aria-label': propsAriaLabel,
|
|
4806
4807
|
'aria-labelledby': propsAriaLabelledby,
|
|
4807
|
-
|
|
4808
|
+
description,
|
|
4808
4809
|
chartProps,
|
|
4809
4810
|
chartRef,
|
|
4810
4811
|
children,
|
|
@@ -4835,14 +4836,16 @@ const ChartContainer = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4835
4836
|
color: "question",
|
|
4836
4837
|
variant: "unstyled",
|
|
4837
4838
|
onClick: onReset
|
|
4838
|
-
}, stringFormatter.format('reset')) : null) : null,
|
|
4839
|
+
}, stringFormatter.format('reset')) : null) : null, /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
4840
|
+
flexDirection: "column"
|
|
4841
|
+
}, children ? /*#__PURE__*/React__default.createElement("div", _extends({}, chartProps, {
|
|
4839
4842
|
ref: chartRef,
|
|
4840
4843
|
className: `${ChartContainer.className}__content`,
|
|
4841
4844
|
"aria-label": ariaLabel,
|
|
4842
4845
|
"aria-labelledby": ariaLabelledby
|
|
4843
|
-
}), children) : null,
|
|
4844
|
-
className: `${ChartContainer.className}
|
|
4845
|
-
},
|
|
4846
|
+
}), children) : null, description ? /*#__PURE__*/React__default.createElement(StyledChartContainerCaption, {
|
|
4847
|
+
className: `${ChartContainer.className}__description`
|
|
4848
|
+
}, description) : null));
|
|
4846
4849
|
});
|
|
4847
4850
|
ChartContainer.className = CLASSNAME$6;
|
|
4848
4851
|
ChartContainer.defaultProps = DEFAULT_PROPS$6;
|
|
@@ -6068,13 +6071,20 @@ const EmptyScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
6068
6071
|
})))));
|
|
6069
6072
|
});
|
|
6070
6073
|
|
|
6071
|
-
|
|
6074
|
+
// Material Design Icons v7.2.96
|
|
6075
|
+
var mdiChevronDown = "M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z";
|
|
6076
|
+
var mdiChevronRight = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";
|
|
6077
|
+
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";
|
|
6078
|
+
|
|
6079
|
+
const _excluded$1 = ["isBrushable", "caption", "className", "data", "dotRole", "hideControlKeyPanel", "id", "isDotSelected", "labelDecorator", "labelVariant", "legendProps", "onBrush", "onBrushEnd", "onDotClick", "size", "theme", "tooltipVariant", "variant", "xAxisVariant", "xAxisPlacement", "yAxisVariant", "yAxisPlacement"];
|
|
6072
6080
|
const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
6073
6081
|
const {
|
|
6074
6082
|
isBrushable,
|
|
6083
|
+
caption,
|
|
6075
6084
|
className,
|
|
6076
6085
|
data: propsData,
|
|
6077
6086
|
dotRole,
|
|
6087
|
+
hideControlKeyPanel,
|
|
6078
6088
|
id,
|
|
6079
6089
|
isDotSelected,
|
|
6080
6090
|
labelDecorator,
|
|
@@ -6088,7 +6098,9 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
6088
6098
|
tooltipVariant,
|
|
6089
6099
|
variant,
|
|
6090
6100
|
xAxisVariant,
|
|
6091
|
-
|
|
6101
|
+
xAxisPlacement,
|
|
6102
|
+
yAxisVariant,
|
|
6103
|
+
yAxisPlacement
|
|
6092
6104
|
} = props,
|
|
6093
6105
|
forwardedProps = _objectWithoutProperties(props, _excluded$1);
|
|
6094
6106
|
const cache = useRef();
|
|
@@ -6100,10 +6112,10 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
6100
6112
|
const width = chartDimensions.width;
|
|
6101
6113
|
const height = chartDimensions.height;
|
|
6102
6114
|
const margins = {
|
|
6103
|
-
top:
|
|
6104
|
-
left: 48,
|
|
6105
|
-
right:
|
|
6106
|
-
bottom:
|
|
6115
|
+
top: xAxisVariant === AxisVariant.default || xAxisVariant === AxisVariant.tickValue ? 24 : 8,
|
|
6116
|
+
left: yAxisVariant === AxisVariant.default || yAxisVariant === AxisVariant.tickValue ? 48 : 8,
|
|
6117
|
+
right: yAxisVariant === AxisVariant.default || yAxisVariant === AxisVariant.tickValue ? 48 : 8,
|
|
6118
|
+
bottom: xAxisVariant === AxisVariant.default || xAxisVariant === AxisVariant.tickValue ? 24 : 8
|
|
6107
6119
|
};
|
|
6108
6120
|
const chartHeight = height - margins.top - margins.bottom;
|
|
6109
6121
|
const chartWidth = width - margins.left - margins.right;
|
|
@@ -6174,11 +6186,50 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
6174
6186
|
if (countsByCategory && !legendWidth.current) {
|
|
6175
6187
|
legendWidth.current = `${Math.max(...countsByCategory.map(d => d.key.length + String(d.value).length)) * 8 + 32}px`;
|
|
6176
6188
|
}
|
|
6189
|
+
const [isKeyPanelOpen, setIsKeyPanelOpen] = useState(false);
|
|
6177
6190
|
return /*#__PURE__*/React__default.createElement(StyledScatterPlot, _extends({}, forwardedProps, {
|
|
6178
6191
|
id: id,
|
|
6179
6192
|
className: className,
|
|
6180
6193
|
ref: ref
|
|
6181
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
6194
|
+
}), /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
6195
|
+
flexDirection: "column",
|
|
6196
|
+
alignItems: "center",
|
|
6197
|
+
gap: "8"
|
|
6198
|
+
}, !hideControlKeyPanel ? /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
6199
|
+
width: width,
|
|
6200
|
+
position: "absolute"
|
|
6201
|
+
}, /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
6202
|
+
flexDirection: "column",
|
|
6203
|
+
alignItems: "flex-end",
|
|
6204
|
+
position: "absolute",
|
|
6205
|
+
top: `${margins.top + 16}px`,
|
|
6206
|
+
right: `${margins.right + 16}px`
|
|
6207
|
+
}, /*#__PURE__*/React__default.createElement(Popover, {
|
|
6208
|
+
placement: "bottom-end",
|
|
6209
|
+
isOpen: isKeyPanelOpen,
|
|
6210
|
+
onOpen: setIsKeyPanelOpen
|
|
6211
|
+
}, /*#__PURE__*/React__default.createElement(Popover.Trigger, null, /*#__PURE__*/React__default.createElement(Button, {
|
|
6212
|
+
variant: "secondary",
|
|
6213
|
+
rightIcon: isKeyPanelOpen ? mdiChevronDown : mdiChevronRight,
|
|
6214
|
+
color: "question",
|
|
6215
|
+
style: {
|
|
6216
|
+
border: '1px solid var(--redsift-color-neutral-midgrey)'
|
|
6217
|
+
}
|
|
6218
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
6219
|
+
icon: mdiMouse
|
|
6220
|
+
}))), /*#__PURE__*/React__default.createElement(Popover.Content, {
|
|
6221
|
+
flexDirection: "column",
|
|
6222
|
+
alignItems: "flex-start"
|
|
6223
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
6224
|
+
margin: "8px 16px 0",
|
|
6225
|
+
fontSize: "13px"
|
|
6226
|
+
}, "Zoom - Mouse wheel"), /*#__PURE__*/React__default.createElement(Text, {
|
|
6227
|
+
margin: "0 16px",
|
|
6228
|
+
fontSize: "13px"
|
|
6229
|
+
}, "Pan - Left click and drag"), /*#__PURE__*/React__default.createElement(Text, {
|
|
6230
|
+
margin: "0 16px 8px",
|
|
6231
|
+
fontSize: "13px"
|
|
6232
|
+
}, "Select - Hold shift, left click and drag"))))) : null, /*#__PURE__*/React__default.createElement("svg", {
|
|
6182
6233
|
ref: svgRef,
|
|
6183
6234
|
width: width,
|
|
6184
6235
|
height: height
|
|
@@ -6219,23 +6270,41 @@ const RenderedScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
6219
6270
|
});
|
|
6220
6271
|
}))), /*#__PURE__*/React__default.createElement("g", {
|
|
6221
6272
|
transform: `translate(${margins.left},${margins.top})`
|
|
6222
|
-
}, /*#__PURE__*/React__default.createElement(Axis, {
|
|
6223
|
-
position: "
|
|
6224
|
-
length:
|
|
6225
|
-
scale:
|
|
6273
|
+
}, ['bottom', 'both'].includes(xAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
|
|
6274
|
+
position: "bottom",
|
|
6275
|
+
length: chartWidth,
|
|
6276
|
+
scale: scaleX,
|
|
6226
6277
|
x: 0,
|
|
6227
|
-
y:
|
|
6278
|
+
y: chartHeight,
|
|
6228
6279
|
tickValues: 8,
|
|
6229
6280
|
variant: xAxisVariant
|
|
6230
|
-
}), /*#__PURE__*/React__default.createElement(Axis, {
|
|
6231
|
-
position: "
|
|
6281
|
+
}) : null, ['top', 'both'].includes(xAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
|
|
6282
|
+
position: "top",
|
|
6232
6283
|
length: chartWidth,
|
|
6233
6284
|
scale: scaleX,
|
|
6234
6285
|
x: 0,
|
|
6235
|
-
y:
|
|
6286
|
+
y: 0,
|
|
6287
|
+
tickValues: 8,
|
|
6288
|
+
variant: xAxisVariant
|
|
6289
|
+
}) : null, ['left', 'both'].includes(yAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
|
|
6290
|
+
position: "left",
|
|
6291
|
+
length: chartHeight,
|
|
6292
|
+
scale: scaleY,
|
|
6293
|
+
x: 0,
|
|
6294
|
+
y: 0,
|
|
6295
|
+
tickValues: 8,
|
|
6296
|
+
variant: yAxisVariant
|
|
6297
|
+
}) : null, ['right', 'both'].includes(yAxisPlacement) ? /*#__PURE__*/React__default.createElement(Axis, {
|
|
6298
|
+
position: "right",
|
|
6299
|
+
length: chartHeight,
|
|
6300
|
+
scale: scaleY,
|
|
6301
|
+
x: chartWidth,
|
|
6302
|
+
y: 0,
|
|
6236
6303
|
tickValues: 8,
|
|
6237
6304
|
variant: yAxisVariant
|
|
6238
|
-
}))),
|
|
6305
|
+
}) : null)), /*#__PURE__*/React__default.createElement(StyledChartContainerCaption, {
|
|
6306
|
+
width: chartWidth - 48
|
|
6307
|
+
}, caption)), hasCategory && labelVariant !== ScatterPlotLabelVariant.none ? /*#__PURE__*/React__default.createElement(Legend, _extends({
|
|
6239
6308
|
data: countsByCategory.map(d => _objectSpread2(_objectSpread2({}, d), {}, {
|
|
6240
6309
|
color: colorScale === null || colorScale === void 0 ? void 0 : colorScale(d.key)
|
|
6241
6310
|
})),
|
|
@@ -6248,6 +6317,7 @@ const _excluded = ["className", "data", "dotRole", "emptyComponent", "id", "isDo
|
|
|
6248
6317
|
const COMPONENT_NAME = 'ScatterPlot';
|
|
6249
6318
|
const CLASSNAME = 'redsift-scatterplot';
|
|
6250
6319
|
const DEFAULT_PROPS = {
|
|
6320
|
+
hideControlKeyPanel: false,
|
|
6251
6321
|
labelVariant: ScatterPlotLabelVariant.externalLabel,
|
|
6252
6322
|
localeText: {
|
|
6253
6323
|
emptyChartText: 'No Data'
|
|
@@ -6257,7 +6327,9 @@ const DEFAULT_PROPS = {
|
|
|
6257
6327
|
tooltipVariant: TooltipVariant.none,
|
|
6258
6328
|
variant: ScatterPlotVariant.default,
|
|
6259
6329
|
xAxisVariant: AxisVariant.default,
|
|
6260
|
-
|
|
6330
|
+
xAxisPlacement: 'bottom',
|
|
6331
|
+
yAxisVariant: AxisVariant.default,
|
|
6332
|
+
yAxisPlacement: 'left'
|
|
6261
6333
|
};
|
|
6262
6334
|
const ScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
6263
6335
|
const {
|