@redsift/charts 11.6.0-muiv5-alpha.4 → 11.6.0-muiv5-alpha.5
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/_internal/Arc.js +10 -0
- package/_internal/Arc.js.map +1 -0
- package/{components/Arc/Arc.js → _internal/Arc2.js} +52 -9
- package/_internal/Arc2.js.map +1 -0
- package/_internal/Arcs.js +10 -0
- package/_internal/Arcs.js.map +1 -0
- package/{components/Arcs/Arcs.js → _internal/Arcs2.js} +12 -8
- package/_internal/Arcs2.js.map +1 -0
- package/_internal/Axis.js +8 -0
- package/_internal/Axis.js.map +1 -0
- package/{types/axis.d.ts → _internal/Axis2.js} +2 -2
- package/_internal/Axis2.js.map +1 -0
- package/_internal/Bar.js +10 -0
- package/_internal/Bar.js.map +1 -0
- package/{components/Bar/Bar.js → _internal/Bar2.js} +85 -10
- package/_internal/Bar2.js.map +1 -0
- package/_internal/BarChart.js +17 -0
- package/_internal/BarChart.js.map +1 -0
- package/_internal/BarChart2.js +1419 -0
- package/_internal/BarChart2.js.map +1 -0
- package/_internal/ChartContainer.js +5 -0
- package/_internal/ChartContainer.js.map +1 -0
- package/{components/ChartContainer/ChartContainer.js → _internal/ChartContainer2.js} +105 -6
- package/_internal/ChartContainer2.js.map +1 -0
- package/_internal/DataPoint.js +7 -0
- package/_internal/DataPoint.js.map +1 -0
- package/{components/DataPoint/DataPoint.js → _internal/DataPoint2.js} +11 -5
- package/_internal/DataPoint2.js.map +1 -0
- package/_internal/Dot.js +10 -0
- package/_internal/Dot.js.map +1 -0
- package/{components/Dot/Dot.js → _internal/Dot2.js} +61 -6
- package/_internal/Dot2.js.map +1 -0
- package/_internal/Legend.js +10 -0
- package/_internal/Legend.js.map +1 -0
- package/{components/Legend/Legend.js → _internal/Legend3.js} +17 -6
- package/_internal/Legend3.js.map +1 -0
- package/_internal/LegendItem.js +21 -0
- package/_internal/LegendItem.js.map +1 -0
- package/{components/LegendItem/LegendItem.js → _internal/LegendItem2.js} +64 -7
- package/_internal/LegendItem2.js.map +1 -0
- package/_internal/Line.js +10 -0
- package/_internal/Line.js.map +1 -0
- package/{components/Line/Line.js → _internal/Line2.js} +12 -8
- package/_internal/Line2.js.map +1 -0
- package/_internal/LineChart.js +17 -0
- package/_internal/LineChart.js.map +1 -0
- package/{components/LineChart/RenderedLineChart.js → _internal/LineChart2.js} +317 -20
- package/_internal/LineChart2.js.map +1 -0
- package/_internal/PieChart.js +14 -0
- package/_internal/PieChart.js.map +1 -0
- package/_internal/PieChart2.js +605 -0
- package/_internal/PieChart2.js.map +1 -0
- package/_internal/ScatterPlot.js +17 -0
- package/_internal/ScatterPlot.js.map +1 -0
- package/_internal/ScatterPlot2.js +743 -0
- package/_internal/ScatterPlot2.js.map +1 -0
- package/{_virtual → _internal}/_rollupPluginBabelHelpers.js +1 -1
- package/_internal/config.js +13 -0
- package/_internal/config.js.map +1 -0
- package/{types/data.d.ts → _internal/data.js} +1 -1
- package/{types/legend.js → _internal/legend2.js} +2 -2
- package/_internal/legend2.js.map +1 -0
- package/{components/Axis/types.d.ts → _internal/scale.js} +47 -2
- package/{scheme.js → _internal/scheme.js} +1 -1
- package/_internal/scheme.js.map +1 -0
- package/{components/Arc/styles.d.ts → _internal/styles.js} +7 -5
- package/{components/Line/types.d.ts → _internal/styles10.js} +14 -5
- package/{components/LineChart/types.d.ts → _internal/styles11.js} +23 -12
- package/{components/PieChart/types.d.ts → _internal/styles12.js} +29 -11
- package/{components/ScatterPlot/types.d.ts → _internal/styles13.js} +23 -12
- package/{components/Arcs/types.d.ts → _internal/styles2.js} +11 -2
- package/{components/Axis/styles.d.ts → _internal/styles3.js} +6 -3
- package/{components/Bar/styles.d.ts → _internal/styles4.js} +7 -5
- package/{components/BarChart/types.d.ts → _internal/styles5.js} +49 -14
- package/{components/ChartContainer/styles.d.ts → _internal/styles6.js} +8 -3
- package/{components/DataPoint/styles.d.ts → _internal/styles7.js} +5 -2
- package/{components/Dot/styles.d.ts → _internal/styles8.js} +7 -4
- package/{components/Legend/styles.d.ts → _internal/styles9.js} +5 -2
- package/{utils/index.js → _internal/theme.js} +37 -2
- package/_internal/theme.js.map +1 -0
- package/{components/Arc/types.d.ts → _internal/types.js} +3 -3
- package/{components/Bar/types.d.ts → _internal/types2.js} +3 -3
- package/{components/ChartContainer/types.d.ts → _internal/types3.js} +1 -1
- package/{components/DataPoint/types.d.ts → _internal/types4.js} +29 -3
- package/{components/Dot/types.d.ts → _internal/types5.js} +3 -3
- package/{components/Legend/types.d.ts → _internal/types6.js} +4 -4
- package/{components/LegendItem/types.d.ts → _internal/types7.js} +8 -4
- package/{hooks → _internal}/useFormatCategoricalData.js +3 -4
- package/{hooks → _internal}/useFormatCategoricalData.js.map +1 -1
- package/index.js +129 -43
- package/index.js.map +1 -1
- package/index2.js +49 -0
- package/index2.js.map +1 -0
- package/package.json +2 -2
- package/components/Arc/Arc.d.ts +0 -6
- package/components/Arc/Arc.js.map +0 -1
- package/components/Arc/styles.js +0 -49
- package/components/Arc/styles.js.map +0 -1
- package/components/Arcs/Arcs.d.ts +0 -6
- package/components/Arcs/Arcs.js.map +0 -1
- package/components/Arcs/styles.d.ts +0 -9
- package/components/Arcs/styles.js +0 -9
- package/components/Arcs/styles.js.map +0 -1
- package/components/Axis/Axis.d.ts +0 -7
- package/components/Axis/Axis.js +0 -211
- package/components/Axis/Axis.js.map +0 -1
- package/components/Axis/computeTicks.js +0 -117
- package/components/Axis/computeTicks.js.map +0 -1
- package/components/Axis/styles.js +0 -51
- package/components/Axis/styles.js.map +0 -1
- package/components/Axis/types.js +0 -24
- package/components/Axis/types.js.map +0 -1
- package/components/Bar/Bar.d.ts +0 -6
- package/components/Bar/Bar.js.map +0 -1
- package/components/Bar/styles.js +0 -66
- package/components/Bar/styles.js.map +0 -1
- package/components/Bar/types.js +0 -18
- package/components/Bar/types.js.map +0 -1
- package/components/BarChart/BarChart.d.ts +0 -29
- package/components/BarChart/BarChart.js +0 -141
- package/components/BarChart/BarChart.js.map +0 -1
- package/components/BarChart/BarChartBars.js +0 -168
- package/components/BarChart/BarChartBars.js.map +0 -1
- package/components/BarChart/BarChartSection.js +0 -139
- package/components/BarChart/BarChartSection.js.map +0 -1
- package/components/BarChart/EmptyBarChart.js +0 -57
- package/components/BarChart/EmptyBarChart.js.map +0 -1
- package/components/BarChart/LoadingBarChart.js +0 -18
- package/components/BarChart/LoadingBarChart.js.map +0 -1
- package/components/BarChart/RenderedLinearBarChart.js +0 -549
- package/components/BarChart/RenderedLinearBarChart.js.map +0 -1
- package/components/BarChart/RenderedOrdinalBarChart.js +0 -236
- package/components/BarChart/RenderedOrdinalBarChart.js.map +0 -1
- package/components/BarChart/context.js +0 -13
- package/components/BarChart/context.js.map +0 -1
- package/components/BarChart/intl/en-US.json.js +0 -17
- package/components/BarChart/intl/en-US.json.js.map +0 -1
- package/components/BarChart/intl/fr-FR.json.js +0 -17
- package/components/BarChart/intl/fr-FR.json.js.map +0 -1
- package/components/BarChart/intl/index.js +0 -10
- package/components/BarChart/intl/index.js.map +0 -1
- package/components/BarChart/styles.d.ts +0 -19
- package/components/BarChart/styles.js +0 -71
- package/components/BarChart/styles.js.map +0 -1
- package/components/BarChart/types.js +0 -17
- package/components/BarChart/types.js.map +0 -1
- package/components/BarChart/utils.js +0 -69
- package/components/BarChart/utils.js.map +0 -1
- package/components/ChartContainer/ChartContainer.d.ts +0 -9
- package/components/ChartContainer/ChartContainer.js.map +0 -1
- package/components/ChartContainer/context.js +0 -6
- package/components/ChartContainer/context.js.map +0 -1
- package/components/ChartContainer/intl/en-US.json.js +0 -14
- package/components/ChartContainer/intl/en-US.json.js.map +0 -1
- package/components/ChartContainer/intl/fr-FR.json.js +0 -14
- package/components/ChartContainer/intl/fr-FR.json.js.map +0 -1
- package/components/ChartContainer/intl/index.js +0 -10
- package/components/ChartContainer/intl/index.js.map +0 -1
- package/components/ChartContainer/styles.js +0 -76
- package/components/ChartContainer/styles.js.map +0 -1
- package/components/DataPoint/DataPoint.d.ts +0 -6
- package/components/DataPoint/DataPoint.js.map +0 -1
- package/components/DataPoint/styles.js +0 -10
- package/components/DataPoint/styles.js.map +0 -1
- package/components/Dot/Dot.d.ts +0 -6
- package/components/Dot/Dot.js.map +0 -1
- package/components/Dot/styles.js +0 -49
- package/components/Dot/styles.js.map +0 -1
- package/components/Dot/types.js +0 -14
- package/components/Dot/types.js.map +0 -1
- package/components/Legend/Legend.d.ts +0 -6
- package/components/Legend/Legend.js.map +0 -1
- package/components/Legend/styles.js +0 -15
- package/components/Legend/styles.js.map +0 -1
- package/components/LegendItem/LegendItem.js.map +0 -1
- package/components/LegendItem/styles.js +0 -63
- package/components/LegendItem/styles.js.map +0 -1
- package/components/Line/Line.d.ts +0 -6
- package/components/Line/Line.js.map +0 -1
- package/components/Line/styles.d.ts +0 -9
- package/components/Line/styles.js +0 -9
- package/components/Line/styles.js.map +0 -1
- package/components/LineChart/EmptyLineChart.js +0 -58
- package/components/LineChart/EmptyLineChart.js.map +0 -1
- package/components/LineChart/LineChart.d.ts +0 -6
- package/components/LineChart/LineChart.js +0 -96
- package/components/LineChart/LineChart.js.map +0 -1
- package/components/LineChart/LoadingLineChart.js +0 -18
- package/components/LineChart/LoadingLineChart.js.map +0 -1
- package/components/LineChart/RenderedLineChart.js.map +0 -1
- package/components/LineChart/intl/en-US.json.js +0 -17
- package/components/LineChart/intl/en-US.json.js.map +0 -1
- package/components/LineChart/intl/fr-FR.json.js +0 -17
- package/components/LineChart/intl/fr-FR.json.js.map +0 -1
- package/components/LineChart/intl/index.js +0 -10
- package/components/LineChart/intl/index.js.map +0 -1
- package/components/LineChart/styles.d.ts +0 -17
- package/components/LineChart/styles.js +0 -53
- package/components/LineChart/styles.js.map +0 -1
- package/components/LineChart/types.js +0 -17
- package/components/LineChart/types.js.map +0 -1
- package/components/LineChart/utils.js +0 -67
- package/components/LineChart/utils.js.map +0 -1
- package/components/PieChart/EmptyPieChart.js +0 -85
- package/components/PieChart/EmptyPieChart.js.map +0 -1
- package/components/PieChart/LoadingPieChart.js +0 -18
- package/components/PieChart/LoadingPieChart.js.map +0 -1
- package/components/PieChart/PieChart.d.ts +0 -6
- package/components/PieChart/PieChart.js +0 -98
- package/components/PieChart/PieChart.js.map +0 -1
- package/components/PieChart/RenderedPieChart.js +0 -198
- package/components/PieChart/RenderedPieChart.js.map +0 -1
- package/components/PieChart/intl/en-US.json.js +0 -9
- package/components/PieChart/intl/en-US.json.js.map +0 -1
- package/components/PieChart/intl/fr-FR.json.js +0 -9
- package/components/PieChart/intl/fr-FR.json.js.map +0 -1
- package/components/PieChart/intl/index.js +0 -10
- package/components/PieChart/intl/index.js.map +0 -1
- package/components/PieChart/styles.d.ts +0 -24
- package/components/PieChart/styles.js +0 -168
- package/components/PieChart/styles.js.map +0 -1
- package/components/PieChart/types.js +0 -27
- package/components/PieChart/types.js.map +0 -1
- package/components/PieChart/utils.js +0 -37
- package/components/PieChart/utils.js.map +0 -1
- package/components/ScatterPlot/EmptyScatterPlot.js +0 -58
- package/components/ScatterPlot/EmptyScatterPlot.js.map +0 -1
- package/components/ScatterPlot/LoadingScatterPlot.js +0 -18
- package/components/ScatterPlot/LoadingScatterPlot.js.map +0 -1
- package/components/ScatterPlot/RenderedScatterPlot.js +0 -352
- package/components/ScatterPlot/RenderedScatterPlot.js.map +0 -1
- package/components/ScatterPlot/ScatterPlot.d.ts +0 -6
- package/components/ScatterPlot/ScatterPlot.js +0 -105
- package/components/ScatterPlot/ScatterPlot.js.map +0 -1
- package/components/ScatterPlot/intl/en-US.json.js +0 -12
- package/components/ScatterPlot/intl/en-US.json.js.map +0 -1
- package/components/ScatterPlot/intl/fr-FR.json.js +0 -17
- package/components/ScatterPlot/intl/fr-FR.json.js.map +0 -1
- package/components/ScatterPlot/intl/index.js +0 -10
- package/components/ScatterPlot/intl/index.js.map +0 -1
- package/components/ScatterPlot/styles.d.ts +0 -17
- package/components/ScatterPlot/styles.js +0 -53
- package/components/ScatterPlot/styles.js.map +0 -1
- package/components/ScatterPlot/types.js +0 -24
- package/components/ScatterPlot/types.js.map +0 -1
- package/components/ScatterPlot/utils.js +0 -70
- package/components/ScatterPlot/utils.js.map +0 -1
- package/config.js +0 -15
- package/config.js.map +0 -1
- package/design-system/src/react-aria/react-aria/i18n/useMessageFormatter.d.ts +0 -5
- package/hooks/useBrush.d.ts +0 -17
- package/hooks/useBrush.js +0 -48
- package/hooks/useBrush.js.map +0 -1
- package/hooks/useColor.d.ts +0 -18
- package/hooks/useColor.js +0 -20
- package/hooks/useColor.js.map +0 -1
- package/hooks/useFormatCategoricalData.d.ts +0 -26
- package/hooks/useZoom.d.ts +0 -26
- package/hooks/useZoom.js +0 -39
- package/hooks/useZoom.js.map +0 -1
- package/index.d.ts +0 -51
- package/scheme.d.ts +0 -32
- package/scheme.js.map +0 -1
- package/types/legend.d.ts +0 -30
- package/types/legend.js.map +0 -1
- package/types/scale.d.ts +0 -48
- package/types/size.d.ts +0 -20
- package/types/size.js +0 -8
- package/types/size.js.map +0 -1
- package/types/theme.d.ts +0 -23
- package/types/theme.js +0 -13
- package/types/theme.js.map +0 -1
- package/utils/index.d.ts +0 -11
- package/utils/index.js.map +0 -1
- /package/{_virtual → _internal}/_rollupPluginBabelHelpers.js.map +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { ChartContainer } from '../ChartContainer/ChartContainer.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Component style.
|
|
6
|
-
*/
|
|
7
|
-
const StyledScatterPlot = styled(ChartContainer)``;
|
|
8
|
-
const StyledScatterPlotEmptyText = styled.div`
|
|
9
|
-
position: absolute;
|
|
10
|
-
top: 0;
|
|
11
|
-
left: 0;
|
|
12
|
-
height: 100%;
|
|
13
|
-
width: 100%;
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
align-items: center;
|
|
18
|
-
pointer-events: none;
|
|
19
|
-
|
|
20
|
-
> * {
|
|
21
|
-
max-width: ${_ref => {
|
|
22
|
-
let {
|
|
23
|
-
$maxWidth
|
|
24
|
-
} = _ref;
|
|
25
|
-
return $maxWidth;
|
|
26
|
-
}}px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
> span {
|
|
30
|
-
font-family: var(--redsift-typography-font-family-poppins);
|
|
31
|
-
color: ${_ref2 => {
|
|
32
|
-
let {
|
|
33
|
-
$theme
|
|
34
|
-
} = _ref2;
|
|
35
|
-
return `var(--redsift-color-${$theme}-components-text-primary)`;
|
|
36
|
-
}};
|
|
37
|
-
font-size: ${_ref3 => {
|
|
38
|
-
let {
|
|
39
|
-
$textSize
|
|
40
|
-
} = _ref3;
|
|
41
|
-
return $textSize;
|
|
42
|
-
}}px;
|
|
43
|
-
line-height: ${_ref4 => {
|
|
44
|
-
let {
|
|
45
|
-
$textSize
|
|
46
|
-
} = _ref4;
|
|
47
|
-
return $textSize;
|
|
48
|
-
}}px;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
|
|
52
|
-
export { StyledScatterPlot, StyledScatterPlotEmptyText };
|
|
53
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/components/ScatterPlot/styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { StyledScatterPlotProps } from './types';\nimport { ChartContainer } from '../ChartContainer';\nimport { Theme } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledScatterPlot = styled(ChartContainer)<StyledScatterPlotProps>``;\n\nexport const StyledScatterPlotEmptyText = styled.div<{\n $maxWidth: number;\n $textSize: number;\n $theme: Theme;\n}>`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n\n > * {\n max-width: ${({ $maxWidth }) => $maxWidth}px;\n }\n\n > span {\n font-family: var(--redsift-typography-font-family-poppins);\n color: ${({ $theme }) => `var(--redsift-color-${$theme}-components-text-primary)`};\n font-size: ${({ $textSize }) => $textSize}px;\n line-height: ${({ $textSize }) => $textSize}px;\n }\n`;\n"],"names":["StyledScatterPlot","styled","ChartContainer","StyledScatterPlotEmptyText","div","_ref","$maxWidth","_ref2","$theme","_ref3","$textSize","_ref4"],"mappings":";;;AAKA;AACA;AACA;MACaA,iBAAiB,GAAGC,MAAM,CAACC,cAAc,CAA0B,CAAC,EAAA;AAEpEC,MAAAA,0BAA0B,GAAGF,MAAM,CAACG,GAI9C,CAAA;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,EAAiBC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,SAAAA;AAAU,GAAC,GAAAD,IAAA,CAAA;AAAA,EAAA,OAAKC,SAAS,CAAA;AAAA,CAAC,CAAA;AAC9C;AACA;AACA;AACA;AACA,WAAA,EAAaC,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAD,KAAA,CAAA;EAAA,OAAM,CAAA,oBAAA,EAAsBC,MAAO,CAA0B,yBAAA,CAAA,CAAA;AAAA,CAAC,CAAA;AACtF,eAAA,EAAiBC,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,SAAAA;AAAU,GAAC,GAAAD,KAAA,CAAA;AAAA,EAAA,OAAKC,SAAS,CAAA;AAAA,CAAC,CAAA;AAC9C,iBAAA,EAAmBC,KAAA,IAAA;EAAA,IAAC;AAAED,IAAAA,SAAAA;AAAU,GAAC,GAAAC,KAAA,CAAA;AAAA,EAAA,OAAKD,SAAS,CAAA;AAAA,CAAC,CAAA;AAChD;AACA;;;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component variant.
|
|
3
|
-
*/
|
|
4
|
-
const ScatterPlotVariant = {
|
|
5
|
-
default: 'default',
|
|
6
|
-
gridded: 'gridded'
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Component's labels variant.
|
|
10
|
-
*/
|
|
11
|
-
const ScatterPlotLegendVariant = {
|
|
12
|
-
none: 'none',
|
|
13
|
-
externalLabel: 'externalLabel',
|
|
14
|
-
externalLabelValue: 'externalLabelValue',
|
|
15
|
-
externalLabelPercent: 'externalLabelPercent',
|
|
16
|
-
custom: 'custom'
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Component props.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export { ScatterPlotLegendVariant, ScatterPlotVariant };
|
|
24
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/components/ScatterPlot/types.ts"],"sourcesContent":["import {\n ChartDimensions,\n ChartSize,\n ChartTheme,\n TooltipVariant,\n DotDatum,\n CoordinatesCategoryData,\n ChartAxesProps,\n MarginProps,\n Statistics,\n} from '../../types';\nimport { Theme, ValueOf } from '@redsift/design-system';\nimport { ChartContainerProps } from '../ChartContainer';\nimport { MutableRefObject, ReactElement, ReactNode } from 'react';\nimport { DotProps } from '../Dot';\nimport { ScaleLinear as d3ScaleLinear } from 'd3';\nimport { LegendProps } from '../Legend';\nimport { SortingMethod } from '../../utils';\nimport { AnchorProps } from '../DataPoint';\n\n/**\n * Component variant.\n */\nexport const ScatterPlotVariant = {\n default: 'default',\n gridded: 'gridded',\n} as const;\nexport type ScatterPlotVariant = ValueOf<typeof ScatterPlotVariant>;\n\n/**\n * Component's labels variant.\n */\nexport const ScatterPlotLegendVariant = {\n none: 'none',\n externalLabel: 'externalLabel',\n externalLabelValue: 'externalLabelValue',\n externalLabelPercent: 'externalLabelPercent',\n custom: 'custom',\n} as const;\nexport type ScatterPlotLegendVariant = ValueOf<typeof ScatterPlotLegendVariant>;\n\ninterface LocaleText {\n emptyChartText: string;\n}\n\nexport type ScatterPlotDimensions = ChartDimensions & {\n fontSize: number;\n};\n\n/**\n * Component props.\n */\nexport interface ScatterPlotProps extends ChartContainerProps, ChartAxesProps {\n /** Dataset to use to generate the chart. */\n data?: CoordinatesCategoryData;\n /** Method used to define the anchor props to use when the dot is a navigation link. */\n getDotAnchorProps?: (datum: DotDatum) => AnchorProps;\n /** Dot role. If an onClick is provided, the dots will have the role `button`. For a navigation link, please use `getDotAnchorProps` instead. */\n dotRole?: DotProps['role'];\n /** Component to use if the chart is empty (replacing the default one). */\n emptyComponent?: ReactNode;\n /** Whether the Control Keys panel is displayed or not. */\n hideControlKeyPanel?: boolean;\n /** Whether the scatter plot dots are selectable using brush or not. */\n isBrushable?: boolean;\n /** Method to determine whether a dot is selected or not. */\n isDotSelected?: (datum: DotDatum) => boolean | undefined;\n /** Method to override the data point labels. */\n labelDecorator?: (\n datum: DotDatum,\n props?: { index?: number; isSelected?: boolean; color?: string }\n ) => string | ReactElement;\n /** Method modifying what's displayed within the legend when the legendVariant is \"custom\". */\n legendDecorator?: (\n datum: DotDatum,\n props?: { index?: number; isSelected?: boolean; color?: string }\n ) => string | ReactElement;\n /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. If set to \"custom\", use `legendDecorator` to customize it. */\n legendVariant?: ScatterPlotLegendVariant;\n /** Props to forward to the Legend block. Can be used to make the legend selectable. */\n legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant' | 'width'> & {\n extraLegendItems?: Statistics;\n };\n /** Labels and texts. */\n localeText?: LocaleText;\n /** Custom margins, used to give more space for axes labels and legend for instance. */\n margins?: MarginProps;\n /** Method called on brush. */\n onBrush?: (\n selection: [[number, number], [number, number]] | null,\n scaleX: d3ScaleLinear<number, number>,\n scaleY: d3ScaleLinear<number, number>\n ) => void;\n /** Method called on brush end. */\n onBrushEnd?: (\n selection: [[number, number], [number, number]] | null,\n scaleX?: d3ScaleLinear<number, number>,\n scaleY?: d3ScaleLinear<number, number>\n ) => void;\n /** Method to be called on a click on a dot. For a navigation link, please use `getDotAnchorProps` instead. */\n onDotClick?: (datum: DotDatum) => void;\n /** ScatterPlot size. */\n size?: ChartSize | ScatterPlotDimensions;\n /** Define how to sort categories. */\n sortingMethod?: SortingMethod;\n /** Reference to the SVG tag. */\n svgRef?: MutableRefObject<SVGSVGElement>;\n /** Color palette to use. You can choose among the list of available color palette or also choose to use the success/warning/danger theme for which you have to specify which key corresponds to which status. */\n colorTheme?: ChartTheme;\n /** Method modifying what's displayed within the tooltip when the tooltipVariant is \"custom\". */\n tooltipDecorator?: (\n data: DotDatum,\n props?: { index?: number; isSelected?: boolean; color?: string }\n ) => string | ReactElement;\n /** Tooltip variant. */\n tooltipVariant?: TooltipVariant;\n /** Variant. */\n variant?: ScatterPlotVariant;\n /** Theme. */\n theme?: Theme;\n}\n\nexport type StyledScatterPlotProps = ScatterPlotProps & {};\n"],"names":["ScatterPlotVariant","default","gridded","ScatterPlotLegendVariant","none","externalLabel","externalLabelValue","externalLabelPercent","custom"],"mappings":"AAoBA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAG;AAChCC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,OAAO,EAAE,SAAA;AACX,EAAU;AAGV;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG;AACtCC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,aAAa,EAAE,eAAe;AAC9BC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,oBAAoB,EAAE,sBAAsB;AAC5CC,EAAAA,MAAM,EAAE,QAAA;AACV,EAAU;;AAWV;AACA;AACA;;;;"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { getSortingMethod } from '../../utils/index.js';
|
|
2
|
-
import { ChartSize } from '../../types/size.js';
|
|
3
|
-
|
|
4
|
-
const sizeToDimension = size => {
|
|
5
|
-
if (typeof size !== 'string') {
|
|
6
|
-
return size;
|
|
7
|
-
}
|
|
8
|
-
switch (size) {
|
|
9
|
-
case ChartSize.small:
|
|
10
|
-
return {
|
|
11
|
-
width: 600,
|
|
12
|
-
height: 300,
|
|
13
|
-
fontSize: 30
|
|
14
|
-
};
|
|
15
|
-
case ChartSize.medium:
|
|
16
|
-
default:
|
|
17
|
-
return {
|
|
18
|
-
width: 750,
|
|
19
|
-
height: 375,
|
|
20
|
-
fontSize: 34
|
|
21
|
-
};
|
|
22
|
-
case ChartSize.large:
|
|
23
|
-
return {
|
|
24
|
-
width: 900,
|
|
25
|
-
height: 450,
|
|
26
|
-
fontSize: 38
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const BASE_NUMBER_OF_TICKS = 20;
|
|
31
|
-
const getClosestLineIndex = (value, scale) => {
|
|
32
|
-
const ticks = scale.ticks(BASE_NUMBER_OF_TICKS);
|
|
33
|
-
const delta = ticks[1] - ticks[0];
|
|
34
|
-
const index = Math.round(value / delta);
|
|
35
|
-
const roundValue = index * delta;
|
|
36
|
-
return [index, roundValue];
|
|
37
|
-
};
|
|
38
|
-
const group = (data, x, y) => {
|
|
39
|
-
const groupDict = {};
|
|
40
|
-
data.forEach(d => {
|
|
41
|
-
const [i, rx] = getClosestLineIndex(d.key[0], x);
|
|
42
|
-
const [j, ry] = getClosestLineIndex(d.key[1], y);
|
|
43
|
-
const key = `${i}_${j}_${d.key[2]}`;
|
|
44
|
-
if (!(key in groupDict)) {
|
|
45
|
-
groupDict[key] = {
|
|
46
|
-
category: d.key[2],
|
|
47
|
-
x: rx,
|
|
48
|
-
y: ry,
|
|
49
|
-
data: {
|
|
50
|
-
key: d.key,
|
|
51
|
-
value: 0
|
|
52
|
-
},
|
|
53
|
-
points: []
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
groupDict[key].points.push(d);
|
|
57
|
-
groupDict[key].data.value += 1;
|
|
58
|
-
});
|
|
59
|
-
return Object.values(groupDict);
|
|
60
|
-
};
|
|
61
|
-
const countBy = (arr, sortingMethod) => {
|
|
62
|
-
const counts = arr.reduce((prev, curr) => (prev[curr.key[2]] = ++prev[curr.key[2]] || 1, prev), {});
|
|
63
|
-
return Object.keys(counts).map(key => ({
|
|
64
|
-
key: key,
|
|
65
|
-
value: counts[key]
|
|
66
|
-
})).sort(getSortingMethod(sortingMethod));
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export { BASE_NUMBER_OF_TICKS, countBy, getClosestLineIndex, group, sizeToDimension };
|
|
70
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/ScatterPlot/utils.ts"],"sourcesContent":["import { ScaleLinear as d3ScaleLinear } from 'd3';\n\nimport { CoordinatesCategoryData, CoordinatesCategoryDatum } from '../../types';\n\nimport { ChartSize } from '../../types';\nimport { ScatterPlotDimensions } from './types';\nimport { SortingMethod, getSortingMethod } from '../../utils';\n\nexport const sizeToDimension = (size: ChartSize | ScatterPlotDimensions): ScatterPlotDimensions => {\n if (typeof size !== 'string') {\n return size;\n }\n\n switch (size) {\n case ChartSize.small:\n return { width: 600, height: 300, fontSize: 30 };\n case ChartSize.medium:\n default:\n return { width: 750, height: 375, fontSize: 34 };\n case ChartSize.large:\n return { width: 900, height: 450, fontSize: 38 };\n }\n};\n\nexport const BASE_NUMBER_OF_TICKS = 20;\n\nexport const getClosestLineIndex = (value: number, scale: d3ScaleLinear<number, number, never>) => {\n const ticks = scale.ticks(BASE_NUMBER_OF_TICKS);\n const delta = ticks[1] - ticks[0];\n const index = Math.round(value / delta);\n const roundValue = index * delta;\n return [index, roundValue];\n};\n\nexport const group = (\n data: CoordinatesCategoryData,\n x: d3ScaleLinear<number, number, never>,\n y: d3ScaleLinear<number, number, never>\n) => {\n const groupDict: Record<\n string,\n {\n category: string;\n x: number;\n y: number;\n data: CoordinatesCategoryDatum;\n points: CoordinatesCategoryData;\n }\n > = {};\n\n data.forEach((d) => {\n const [i, rx] = getClosestLineIndex(d.key[0], x);\n const [j, ry] = getClosestLineIndex(d.key[1], y);\n\n const key = `${i}_${j}_${d.key[2]}`;\n if (!(key in groupDict)) {\n groupDict[key] = {\n category: d.key[2] as string,\n x: rx,\n y: ry,\n data: {\n key: d.key,\n value: 0,\n },\n points: [],\n };\n }\n\n groupDict[key].points.push(d);\n groupDict[key].data.value += 1;\n });\n\n return Object.values(groupDict);\n};\n\nexport const countBy = (arr: CoordinatesCategoryData, sortingMethod: SortingMethod) => {\n const counts = arr.reduce(\n (prev, curr) => ((prev[curr.key[2] as string] = ++(prev[curr.key[2] as string] as number) || 1), prev),\n {} as Record<string, number>\n );\n\n return Object.keys(counts)\n .map((key) => ({ key: key, value: counts[key] as number }))\n .sort(getSortingMethod(sortingMethod));\n};\n"],"names":["sizeToDimension","size","ChartSize","small","width","height","fontSize","medium","large","BASE_NUMBER_OF_TICKS","getClosestLineIndex","value","scale","ticks","delta","index","Math","round","roundValue","group","data","x","y","groupDict","forEach","d","i","rx","key","j","ry","category","points","push","Object","values","countBy","arr","sortingMethod","counts","reduce","prev","curr","keys","map","sort","getSortingMethod"],"mappings":";;;AAQaA,MAAAA,eAAe,GAAIC,IAAuC,IAA4B;AACjG,EAAA,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;AAC5B,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,QAAQA,IAAI;IACV,KAAKC,SAAS,CAACC,KAAK;MAClB,OAAO;AAAEC,QAAAA,KAAK,EAAE,GAAG;AAAEC,QAAAA,MAAM,EAAE,GAAG;AAAEC,QAAAA,QAAQ,EAAE,EAAA;OAAI,CAAA;IAClD,KAAKJ,SAAS,CAACK,MAAM,CAAA;AACrB,IAAA;MACE,OAAO;AAAEH,QAAAA,KAAK,EAAE,GAAG;AAAEC,QAAAA,MAAM,EAAE,GAAG;AAAEC,QAAAA,QAAQ,EAAE,EAAA;OAAI,CAAA;IAClD,KAAKJ,SAAS,CAACM,KAAK;MAClB,OAAO;AAAEJ,QAAAA,KAAK,EAAE,GAAG;AAAEC,QAAAA,MAAM,EAAE,GAAG;AAAEC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AEN,CAAC,CAACG,GAAG,CAAC,CAAC,CAAW;AAC5BP,QAAAA,CAAC,EAAEM,EAAE;AACLL,QAAAA,CAAC,EAAEQ,EAAE;AACLV,QAAAA,IAAI,EAAE;UACJQ,GAAG,EAAEH,CAAC,CAACG,GAAG;AACVjB,UAAAA,KAAK,EAAE,CAAA;SACR;AACDqB,QAAAA,MAAM,EAAE,EAAA;OACT,CAAA;AACH,KAAA;IAEAT,SAAS,CAACK,GAAG,CAAC,CAACI,MAAM,CAACC,IAAI,CAACR,CAAC,CAAC,CAAA;IAC7BF,SAAS,CAACK,GAAG,CAAC,CAACR,IAAI,CAACT,KAAK,IAAI,CAAC,CAAA;AAChC,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOuB,MAAM,CAACC,MAAM,CAACZ,SAAS,CAAC,CAAA;AACjC,EAAC;MAEYa,OAAO,GAAGA,CAACC,GAA4B,EAAEC,aAA4B,KAAK;AACrF,EAAA,MAAMC,MAAM,GAAGF,GAAG,CAACG,MAAM,CACvB,CAACC,IAAI,EAAEC,IAAI,MAAOD,IAAI,CAACC,IAAI,CAACd,GAAG,CAAC,CAAC,CAAC,CAAW,GAAG,EAAGa,IAAI,CAACC,IAAI,CAACd,GAAG,CAAC,CAAC,CAAC,CAAsB,IAAI,CAAC,EAAGa,IAAI,CAAC,EACtG,EACF,CAAC,CAAA;EAED,OAAOP,MAAM,CAACS,IAAI,CAACJ,MAAM,CAAC,CACvBK,GAAG,CAAEhB,GAAG,KAAM;AAAEA,IAAAA,GAAG,EAAEA,GAAG;IAAEjB,KAAK,EAAE4B,MAAM,CAACX,GAAG,CAAA;GAAa,CAAC,CAAC,CAC1DiB,IAAI,CAACC,gBAAgB,CAACR,aAAa,CAAC,CAAC,CAAA;AAC1C;;;;"}
|
package/config.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import './node_modules/@react-spring/web/dist/esm/index.js';
|
|
2
|
-
import { easings as Lt } from './node_modules/@react-spring/shared/dist/esm/index.js';
|
|
3
|
-
import './node_modules/@react-spring/core/dist/esm/index.js';
|
|
4
|
-
|
|
5
|
-
const config = (() => ({
|
|
6
|
-
config: {
|
|
7
|
-
duration: 700,
|
|
8
|
-
easing: Lt.easeInOutQuad
|
|
9
|
-
},
|
|
10
|
-
reset: true,
|
|
11
|
-
immediate: false
|
|
12
|
-
}))();
|
|
13
|
-
|
|
14
|
-
export { config };
|
|
15
|
-
//# sourceMappingURL=config.js.map
|
package/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../src/config.ts"],"sourcesContent":["import { easings } from '@react-spring/web';\n\nexport const config = (() => ({\n config: {\n duration: 700,\n easing: easings.easeInOutQuad,\n },\n reset: true,\n immediate: false,\n}))();\n"],"names":["config","duration","easing","easings","easeInOutQuad","reset","immediate"],"mappings":";;;;AAEaA,MAAAA,MAAM,GAAG,CAAC,OAAO;AAC5BA,EAAAA,MAAM,EAAE;AACNC,IAAAA,QAAQ,EAAE,GAAG;IACbC,MAAM,EAAEC,EAAO,CAACC,aAAAA;GACjB;AACDC,EAAAA,KAAK,EAAE,IAAI;AACXC,EAAAA,SAAS,EAAE,KAAA;AACb,CAAC,CAAC;;;;"}
|
package/hooks/useBrush.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import { BrushBehavior, ScaleLinear } from 'd3';
|
|
3
|
-
|
|
4
|
-
interface UseBrushProps {
|
|
5
|
-
brushRef: MutableRefObject<BrushBehavior<unknown> | undefined>;
|
|
6
|
-
svgRef: MutableRefObject<SVGSVGElement | SVGGElement | undefined>;
|
|
7
|
-
extent?: [[number, number], [number, number]];
|
|
8
|
-
scaleX: ScaleLinear<number, number>;
|
|
9
|
-
scaleY: ScaleLinear<number, number>;
|
|
10
|
-
isBrushable?: boolean;
|
|
11
|
-
isGridded?: boolean;
|
|
12
|
-
onBrush?: (selection: [[number, number], [number, number]] | null, scaleX: ScaleLinear<number, number>, scaleY: ScaleLinear<number, number>) => void;
|
|
13
|
-
onBrushEnd?: (selection: [[number, number], [number, number]] | null, scaleX: ScaleLinear<number, number>, scaleY: ScaleLinear<number, number>) => void;
|
|
14
|
-
}
|
|
15
|
-
declare const useBrush: ({ brushRef: propsBrushRef, svgRef, extent, scaleX, scaleY, isBrushable, isGridded, onBrush, onBrushEnd, }: UseBrushProps) => void;
|
|
16
|
-
|
|
17
|
-
export { UseBrushProps, useBrush };
|
package/hooks/useBrush.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect } from 'react';
|
|
2
|
-
import { brush, select } from 'd3';
|
|
3
|
-
|
|
4
|
-
const getRoundedIntermediaryPoint = (selection, scaleX, scaleY) => {
|
|
5
|
-
if (!selection) {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
const xTicks = scaleX.ticks(20);
|
|
9
|
-
const xDelta = xTicks[1] - xTicks[0];
|
|
10
|
-
const yTicks = scaleY.ticks(20);
|
|
11
|
-
const yDelta = yTicks[1] - yTicks[0];
|
|
12
|
-
return [[scaleX(Math.round(scaleX.invert(selection[0][0]) / xDelta) * xDelta - xDelta / 2), scaleY(Math.round(scaleY.invert(selection[0][1]) / yDelta) * yDelta - yDelta / 2)], [scaleX(Math.round(scaleX.invert(selection[1][0]) / xDelta) * xDelta - xDelta / 2), scaleY(Math.round(scaleY.invert(selection[1][1]) / yDelta) * yDelta - yDelta / 2)]];
|
|
13
|
-
};
|
|
14
|
-
const useBrush = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
brushRef: propsBrushRef,
|
|
17
|
-
svgRef,
|
|
18
|
-
extent,
|
|
19
|
-
scaleX,
|
|
20
|
-
scaleY,
|
|
21
|
-
isBrushable,
|
|
22
|
-
isGridded,
|
|
23
|
-
onBrush,
|
|
24
|
-
onBrushEnd
|
|
25
|
-
} = _ref;
|
|
26
|
-
const brushRef = propsBrushRef || useRef();
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (svgRef.current && isBrushable) {
|
|
29
|
-
brushRef.current = brush().extent(extent).keyModifiers(false).filter(event => event.shiftKey).on('brush', event => {
|
|
30
|
-
if (!event.sourceEvent || !brushRef.current || !svgRef.current) return;
|
|
31
|
-
if (isGridded) {
|
|
32
|
-
const selection = getRoundedIntermediaryPoint(event.selection, scaleX, scaleY);
|
|
33
|
-
select(svgRef.current).call(brushRef.current.move, selection);
|
|
34
|
-
onBrush === null || onBrush === void 0 ? void 0 : onBrush(selection, scaleX, scaleY);
|
|
35
|
-
} else {
|
|
36
|
-
onBrush === null || onBrush === void 0 ? void 0 : onBrush(event.selection, scaleX, scaleY);
|
|
37
|
-
}
|
|
38
|
-
}).on('end', event => {
|
|
39
|
-
if (!event.sourceEvent || !brushRef.current || !svgRef.current) return;
|
|
40
|
-
onBrushEnd === null || onBrushEnd === void 0 ? void 0 : onBrushEnd(event.selection, scaleX, scaleY);
|
|
41
|
-
});
|
|
42
|
-
select(svgRef.current).call(brushRef.current);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export { useBrush };
|
|
48
|
-
//# sourceMappingURL=useBrush.js.map
|
package/hooks/useBrush.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBrush.js","sources":["../../src/hooks/useBrush.tsx"],"sourcesContent":["import { MutableRefObject, useEffect, useRef } from 'react';\nimport {\n BrushBehavior as d3BrushBehavior,\n brush as d3brush,\n ScaleLinear as d3ScaleLinear,\n select as d3select,\n} from 'd3';\n\nexport interface UseBrushProps {\n brushRef: MutableRefObject<d3BrushBehavior<unknown> | undefined>;\n svgRef: MutableRefObject<SVGSVGElement | SVGGElement | undefined>;\n extent?: [[number, number], [number, number]];\n scaleX: d3ScaleLinear<number, number>;\n scaleY: d3ScaleLinear<number, number>;\n isBrushable?: boolean;\n isGridded?: boolean;\n onBrush?: (\n selection: [[number, number], [number, number]] | null,\n scaleX: d3ScaleLinear<number, number>,\n scaleY: d3ScaleLinear<number, number>\n ) => void;\n onBrushEnd?: (\n selection: [[number, number], [number, number]] | null,\n scaleX: d3ScaleLinear<number, number>,\n scaleY: d3ScaleLinear<number, number>\n ) => void;\n}\n\nconst getRoundedIntermediaryPoint = (\n selection: [[number, number], [number, number]],\n scaleX: d3ScaleLinear<number, number>,\n scaleY: d3ScaleLinear<number, number>\n) => {\n if (!selection) {\n return null;\n }\n\n const xTicks = scaleX.ticks(20);\n const xDelta = xTicks[1] - xTicks[0];\n const yTicks = scaleY.ticks(20);\n const yDelta = yTicks[1] - yTicks[0];\n\n return [\n [\n scaleX(\n Math.round(scaleX.invert(selection[0][0]) / xDelta) * xDelta -\n xDelta / 2\n ),\n scaleY(\n Math.round(scaleY.invert(selection[0][1]) / yDelta) * yDelta -\n yDelta / 2\n ),\n ],\n [\n scaleX(\n Math.round(scaleX.invert(selection[1][0]) / xDelta) * xDelta -\n xDelta / 2\n ),\n\n scaleY(\n Math.round(scaleY.invert(selection[1][1]) / yDelta) * yDelta -\n yDelta / 2\n ),\n ],\n ] as [[number, number], [number, number]];\n};\n\nexport const useBrush = ({\n brushRef: propsBrushRef,\n svgRef,\n extent,\n scaleX,\n scaleY,\n isBrushable,\n isGridded,\n onBrush,\n onBrushEnd,\n}: UseBrushProps) => {\n const brushRef = propsBrushRef || useRef<d3BrushBehavior<unknown>>();\n\n useEffect(() => {\n if (svgRef.current && isBrushable) {\n brushRef.current = d3brush()\n .extent(extent!)\n .keyModifiers(false)\n .filter((event) => event.shiftKey)\n .on('brush', (event) => {\n if (!event.sourceEvent || !brushRef.current || !svgRef.current)\n return;\n\n if (isGridded) {\n const selection = getRoundedIntermediaryPoint(\n event.selection,\n scaleX,\n scaleY\n );\n d3select(svgRef.current).call(\n brushRef.current.move as any,\n selection\n );\n onBrush?.(selection, scaleX, scaleY);\n } else {\n onBrush?.(event.selection, scaleX, scaleY);\n }\n })\n .on('end', (event) => {\n if (!event.sourceEvent || !brushRef.current || !svgRef.current)\n return;\n\n onBrushEnd?.(event.selection, scaleX, scaleY);\n });\n d3select(svgRef.current).call(brushRef.current as any);\n }\n });\n};\n"],"names":["getRoundedIntermediaryPoint","selection","scaleX","scaleY","xTicks","ticks","xDelta","yTicks","yDelta","Math","round","invert","useBrush","_ref","brushRef","propsBrushRef","svgRef","extent","isBrushable","isGridded","onBrush","onBrushEnd","useRef","useEffect","current","d3brush","keyModifiers","filter","event","shiftKey","on","sourceEvent","d3select","call","move"],"mappings":";;;AA4BA,MAAMA,2BAA2B,GAAGA,CAClCC,SAA+C,EAC/CC,MAAqC,EACrCC,MAAqC,KAClC;EACH,IAAI,CAACF,SAAS,EAAE;AACd,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,MAAMG,MAAM,GAAGF,MAAM,CAACG,KAAK,CAAC,EAAE,CAAC,CAAA;EAC/B,MAAMC,MAAM,GAAGF,MAAM,CAAC,CAAC,CAAC,GAAGA,MAAM,CAAC,CAAC,CAAC,CAAA;AACpC,EAAA,MAAMG,MAAM,GAAGJ,MAAM,CAACE,KAAK,CAAC,EAAE,CAAC,CAAA;EAC/B,MAAMG,MAAM,GAAGD,MAAM,CAAC,CAAC,CAAC,GAAGA,MAAM,CAAC,CAAC,CAAC,CAAA;EAEpC,OAAO,CACL,CACEL,MAAM,CACJO,IAAI,CAACC,KAAK,CAACR,MAAM,CAACS,MAAM,CAACV,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGK,MAAM,CAAC,GAAGA,MAAM,GAC1DA,MAAM,GAAG,CACb,CAAC,EACDH,MAAM,CACJM,IAAI,CAACC,KAAK,CAACP,MAAM,CAACQ,MAAM,CAACV,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGO,MAAM,CAAC,GAAGA,MAAM,GAC1DA,MAAM,GAAG,CACb,CAAC,CACF,EACD,CACEN,MAAM,CACJO,IAAI,CAACC,KAAK,CAACR,MAAM,CAACS,MAAM,C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CAACS,IAAI,CAC3BnB,QAAQ,CAACU,OAAO,CAACU,IAAI,EACrBjC,SACF,CAAC,CAAA;UACDmB,OAAO,KAAA,IAAA,IAAPA,OAAO,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAPA,OAAO,CAAGnB,SAAS,EAAEC,MAAM,EAAEC,MAAM,CAAC,CAAA;AACtC,SAAC,MAAM;AACLiB,UAAAA,OAAO,KAAPA,IAAAA,IAAAA,OAAO,KAAPA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,OAAO,CAAGQ,KAAK,CAAC3B,SAAS,EAAEC,MAAM,EAAEC,MAAM,CAAC,CAAA;AAC5C,SAAA;AACF,OAAC,CAAC,CACD2B,EAAE,CAAC,KAAK,EAAGF,KAAK,IAAK;AACpB,QAAA,IAAI,CAACA,KAAK,CAACG,WAAW,IAAI,CAACjB,QAAQ,CAACU,OAAO,IAAI,CAACR,MAAM,CAACQ,OAAO,EAC5D,OAAA;AAEFH,QAAAA,UAAU,KAAVA,IAAAA,IAAAA,UAAU,KAAVA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,UAAU,CAAGO,KAAK,CAAC3B,SAAS,EAAEC,MAAM,EAAEC,MAAM,CAAC,CAAA;AAC/C,OAAC,CAAC,CAAA;MACJ6B,MAAQ,CAAChB,MAAM,CAACQ,OAAO,CAAC,CAACS,IAAI,CAACnB,QAAQ,CAACU,OAAc,CAAC,CAAA;AACxD,KAAA;AACF,GAAC,CAAC,CAAA;AACJ;;;;"}
|
package/hooks/useColor.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ScaleOrdinal } from 'd3';
|
|
2
|
-
import { Theme } from '@redsift/design-system';
|
|
3
|
-
import { JSONArray, JSONObject } from '../types/data.js';
|
|
4
|
-
import { ChartTheme } from '../types/theme.js';
|
|
5
|
-
|
|
6
|
-
interface UseColorProps {
|
|
7
|
-
/** Dataset to use to generate the chart. */
|
|
8
|
-
data: JSONArray;
|
|
9
|
-
/** Color palette to use. */
|
|
10
|
-
colorTheme: ChartTheme;
|
|
11
|
-
/** Name of the field that will be used to categorize the data. */
|
|
12
|
-
category: string | ((d: JSONObject) => string);
|
|
13
|
-
/** Theme */
|
|
14
|
-
theme: Theme;
|
|
15
|
-
}
|
|
16
|
-
declare const useColor: ({ data, colorTheme, category, theme }: UseColorProps) => ScaleOrdinal<string, string, never>;
|
|
17
|
-
|
|
18
|
-
export { UseColorProps, useColor };
|
package/hooks/useColor.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { getColorScale } from '../scheme.js';
|
|
3
|
-
|
|
4
|
-
const useColor = _ref => {
|
|
5
|
-
let {
|
|
6
|
-
data,
|
|
7
|
-
colorTheme,
|
|
8
|
-
category,
|
|
9
|
-
theme
|
|
10
|
-
} = _ref;
|
|
11
|
-
const colorScale = useMemo(() => getColorScale({
|
|
12
|
-
colorTheme,
|
|
13
|
-
domain: data.map(d => typeof category === 'string' ? d[category] : category(d)),
|
|
14
|
-
theme
|
|
15
|
-
}), [colorTheme]);
|
|
16
|
-
return colorScale;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { useColor };
|
|
20
|
-
//# sourceMappingURL=useColor.js.map
|
package/hooks/useColor.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useColor.js","sources":["../../src/hooks/useColor.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { ScaleOrdinal as d3ScaleOrdinal } from 'd3';\nimport { getColorScale } from '../scheme';\nimport { ChartTheme, JSONArray, JSONObject } from '../types';\nimport { Theme } from '@redsift/design-system';\n\nexport interface UseColorProps {\n /** Dataset to use to generate the chart. */\n data: JSONArray;\n /** Color palette to use. */\n colorTheme: ChartTheme;\n /** Name of the field that will be used to categorize the data. */\n category: string | ((d: JSONObject) => string);\n /** Theme */\n theme: Theme;\n}\n\nexport const useColor = ({ data, colorTheme, category, theme }: UseColorProps) => {\n const colorScale = useMemo<d3ScaleOrdinal<string, string>>(\n () =>\n getColorScale({\n colorTheme,\n domain: data.map((d) => (typeof category === 'string' ? (d[category] as string) : category(d))),\n theme,\n }),\n [colorTheme]\n );\n\n return colorScale;\n};\n"],"names":["useColor","_ref","data","colorTheme","category","theme","colorScale","useMemo","getColorScale","domain","map","d"],"mappings":";;;AAiBaA,MAAAA,QAAQ,GAAGC,IAAA,IAA0D;EAAA,IAAzD;IAAEC,IAAI;IAAEC,UAAU;IAAEC,QAAQ;AAAEC,IAAAA,KAAAA;AAAqB,GAAC,GAAAJ,IAAA,CAAA;AAC3E,EAAA,MAAMK,UAAU,GAAGC,OAAO,CACxB,MACEC,aAAa,CAAC;IACZL,UAAU;IACVM,MAAM,EAAEP,IAAI,CAACQ,GAAG,CAAEC,CAAC,IAAM,OAAOP,QAAQ,KAAK,QAAQ,GAAIO,CAAC,CAACP,QAAQ,CAAC,GAAcA,QAAQ,CAACO,CAAC,CAAE,CAAC;AAC/FN,IAAAA,KAAAA;AACF,GAAC,CAAC,EACJ,CAACF,UAAU,CACb,CAAC,CAAA;AAED,EAAA,OAAOG,UAAU,CAAA;AACnB;;;;"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as d3_scale from 'd3-scale';
|
|
2
|
-
import { SortingMethod } from '../utils/index.js';
|
|
3
|
-
import { Theme } from '@redsift/design-system';
|
|
4
|
-
import { CategoryData } from '../types/data.js';
|
|
5
|
-
import { ChartTheme } from '../types/theme.js';
|
|
6
|
-
|
|
7
|
-
interface UseFormatCategoricalDataProps {
|
|
8
|
-
/** Dataset to use to generate the chart, should be a list of objects containing a key and a value. */
|
|
9
|
-
data: CategoryData;
|
|
10
|
-
/** Color palette to use. */
|
|
11
|
-
colorTheme: ChartTheme;
|
|
12
|
-
/** Define how to sort categories. */
|
|
13
|
-
sortingMethod: SortingMethod;
|
|
14
|
-
/** Number of categories to use, the rest being put into a new category called "Others". */
|
|
15
|
-
caping?: number;
|
|
16
|
-
/** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */
|
|
17
|
-
others?: boolean | string;
|
|
18
|
-
/** Theme */
|
|
19
|
-
theme: Theme;
|
|
20
|
-
}
|
|
21
|
-
declare const useFormatCategoricalData: ({ data, caping, sortingMethod, others, colorTheme, theme, }: UseFormatCategoricalDataProps) => {
|
|
22
|
-
data: CategoryData;
|
|
23
|
-
colorScale: d3_scale.ScaleOrdinal<string, string, never>;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { UseFormatCategoricalDataProps, useFormatCategoricalData };
|
package/hooks/useZoom.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import { ScaleLinear } from 'd3';
|
|
3
|
-
|
|
4
|
-
interface UseZoomProps {
|
|
5
|
-
svgRef: MutableRefObject<SVGSVGElement | undefined>;
|
|
6
|
-
scaleX: ScaleLinear<number, number>;
|
|
7
|
-
scaleY: ScaleLinear<number, number>;
|
|
8
|
-
defaultTransform?: {
|
|
9
|
-
k: number;
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
};
|
|
13
|
-
size?: any;
|
|
14
|
-
onZoom?: () => void;
|
|
15
|
-
}
|
|
16
|
-
declare const useZoom: ({ svgRef, scaleX, scaleY, defaultTransform, size, onZoom, }: UseZoomProps) => {
|
|
17
|
-
transform: {
|
|
18
|
-
k: number;
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
};
|
|
22
|
-
scaleX: ScaleLinear<number, number, never>;
|
|
23
|
-
scaleY: ScaleLinear<number, number, never>;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { UseZoomProps, useZoom };
|
package/hooks/useZoom.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { zoom, interpolateRound, select } from 'd3';
|
|
3
|
-
|
|
4
|
-
const useZoom = _ref => {
|
|
5
|
-
let {
|
|
6
|
-
svgRef,
|
|
7
|
-
scaleX,
|
|
8
|
-
scaleY,
|
|
9
|
-
defaultTransform = {
|
|
10
|
-
k: 1,
|
|
11
|
-
x: 0,
|
|
12
|
-
y: 0
|
|
13
|
-
},
|
|
14
|
-
size,
|
|
15
|
-
onZoom
|
|
16
|
-
} = _ref;
|
|
17
|
-
const zx = useRef(scaleX);
|
|
18
|
-
const zy = useRef(scaleY);
|
|
19
|
-
const [transform, setTransform] = useState(defaultTransform);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (svgRef.current) {
|
|
22
|
-
const zoom$1 = zoom().filter(event => !event.shiftKey).scaleExtent([1 / 2 ** 3, 2 ** 3]).on('zoom', event => {
|
|
23
|
-
onZoom === null || onZoom === void 0 ? void 0 : onZoom();
|
|
24
|
-
zx.current = event.transform.rescaleX(scaleX).interpolate(interpolateRound);
|
|
25
|
-
zy.current = event.transform.rescaleY(scaleY).interpolate(interpolateRound);
|
|
26
|
-
setTransform(event.transform);
|
|
27
|
-
});
|
|
28
|
-
select(svgRef.current).call(zoom$1);
|
|
29
|
-
}
|
|
30
|
-
}, [svgRef.current, size]);
|
|
31
|
-
return {
|
|
32
|
-
transform,
|
|
33
|
-
scaleX: zx.current,
|
|
34
|
-
scaleY: zy.current
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { useZoom };
|
|
39
|
-
//# sourceMappingURL=useZoom.js.map
|
package/hooks/useZoom.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useZoom.js","sources":["../../src/hooks/useZoom.tsx"],"sourcesContent":["import { MutableRefObject, useEffect, useRef, useState } from 'react';\nimport {\n zoom as d3zoom,\n interpolateRound as d3interpolateRound,\n ScaleLinear as d3ScaleLinear,\n select as d3select,\n} from 'd3';\n\nexport interface UseZoomProps {\n svgRef: MutableRefObject<SVGSVGElement | undefined>;\n scaleX: d3ScaleLinear<number, number>;\n scaleY: d3ScaleLinear<number, number>;\n defaultTransform?: { k: number; x: number; y: number };\n size?: any;\n onZoom?: () => void;\n}\n\nexport const useZoom = ({\n svgRef,\n scaleX,\n scaleY,\n defaultTransform = { k: 1, x: 0, y: 0 },\n size,\n onZoom,\n}: UseZoomProps) => {\n const zx = useRef<d3ScaleLinear<number, number>>(scaleX);\n const zy = useRef<d3ScaleLinear<number, number>>(scaleY);\n const [transform, setTransform] = useState(defaultTransform);\n\n useEffect(() => {\n if (svgRef.current) {\n const zoom = d3zoom()\n .filter((event) => !event.shiftKey)\n .scaleExtent([1 / 2 ** 3, 2 ** 3])\n .on('zoom', (event) => {\n onZoom?.();\n zx.current = event.transform\n .rescaleX(scaleX)\n .interpolate(d3interpolateRound);\n zy.current = event.transform\n .rescaleY(scaleY)\n .interpolate(d3interpolateRound);\n setTransform(event.transform);\n });\n d3select(svgRef.current).call(zoom as any);\n }\n }, [svgRef.current, size]);\n\n return { transform, scaleX: zx.current, scaleY: zy.current };\n};\n"],"names":["useZoom","_ref","svgRef","scaleX","scaleY","defaultTransform","k","x","y","size","onZoom","zx","useRef","zy","transform","setTransform","useState","useEffect","current","zoom","d3zoom","filter","event","shiftKey","scaleExtent","on","rescaleX","interpolate","d3interpolateRound","rescaleY","d3select","call"],"mappings":";;;AAiBaA,MAAAA,OAAO,GAAGC,IAAA,IAOH;EAAA,IAPI;IACtBC,MAAM;IACNC,MAAM;IACNC,MAAM;AACNC,IAAAA,gBAAgB,GAAG;AAAEC,MAAAA,CAAC,EAAE,CAAC;AAAEC,MAAAA,CAAC,EAAE,CAAC;AAAEC,MAAAA,CAAC,EAAE,CAAA;KAAG;IACvCC,IAAI;AACJC,IAAAA,MAAAA;AACY,GAAC,GAAAT,IAAA,CAAA;AACb,EAAA,MAAMU,EAAE,GAAGC,MAAM,CAAgCT,MAAM,CAAC,CAAA;AACxD,EAAA,MAAMU,EAAE,GAAGD,MAAM,CAAgCR,MAAM,CAAC,CAAA;EACxD,M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angerScheme } from './scheme.js';
|
|
2
|
-
export { SortingMethod, getSortingMethod, isValidDate, mergeLegends } from './utils/index.js';
|
|
3
|
-
export { UseBrushProps, useBrush } from './hooks/useBrush.js';
|
|
4
|
-
export { UseColorProps, useColor } from './hooks/useColor.js';
|
|
5
|
-
export { UseFormatCategoricalDataProps, useFormatCategoricalData } from './hooks/useFormatCategoricalData.js';
|
|
6
|
-
export { UseZoomProps, useZoom } from './hooks/useZoom.js';
|
|
7
|
-
export { ChartAxesProps } from './types/axis.js';
|
|
8
|
-
export { ArcDatum, BarDatum, CategoricalOrLinearDim, CategoryData, CategoryDatum, CategoryDim, CoordinatesCategoryData, CoordinatesCategoryDatum, CoordinatesCategoryDim, Datum, DotDatum, EmptyDatum, JSONArray, JSONObject, JSONValue, LegendItemDatum, LinePointDatum, LinearData, LinearDatum, LinearDim, Statistic, Statistics, TwoCategoryData, TwoCategoryDatum, TwoCategoryDim } from './types/data.js';
|
|
9
|
-
export { LabelVariant, LegendVariant, TooltipVariant } from './types/legend.js';
|
|
10
|
-
export { AnyScale, Coordinates, NumericValue, Scale, ScaleBand, ScaleLinear, ScaleLog, ScalePoint, ScaleSymlog, ScaleTime, ScaleTypeToScale, ScaleValue, ScaleWithBandwidth, StringValue, TicksSpec } from './types/scale.js';
|
|
11
|
-
export { ChartDimensions, ChartSize, MarginProps } from './types/size.js';
|
|
12
|
-
export { ChartTheme, ColorTheme, CustomColorTheme, SuccessDangerColorTheme } from './types/theme.js';
|
|
13
|
-
export { Arc } from './components/Arc/Arc.js';
|
|
14
|
-
export { ArcProps, StyledArcProps } from './components/Arc/types.js';
|
|
15
|
-
export { StyledArc } from './components/Arc/styles.js';
|
|
16
|
-
export { Arcs } from './components/Arcs/Arcs.js';
|
|
17
|
-
export { ArcsProps, StyledArcsProps } from './components/Arcs/types.js';
|
|
18
|
-
export { StyledArcs } from './components/Arcs/styles.js';
|
|
19
|
-
export { Axis, getAxisType } from './components/Axis/Axis.js';
|
|
20
|
-
export { AxisPosition, AxisProps, AxisVariant, StyledAxisProps } from './components/Axis/types.js';
|
|
21
|
-
export { StyledAxis } from './components/Axis/styles.js';
|
|
22
|
-
export { Bar } from './components/Bar/Bar.js';
|
|
23
|
-
export { BarDirection, BarOrientation, BarProps, StyledBarProps } from './components/Bar/types.js';
|
|
24
|
-
export { StyledBar } from './components/Bar/styles.js';
|
|
25
|
-
export { BarChart, BaseBarChart } from './components/BarChart/BarChart.js';
|
|
26
|
-
export { BarChartBarsProps, BarChartDimensions, BarChartLegendVariant, BarChartProps, BarChartSectionProps, BarChartState, ComputedBarProps, RenderedLinearBarChartProps, StyledBarChartBarsProps, StyledBarChartProps, StyledBarChartSectionProps, XScaleType } from './components/BarChart/types.js';
|
|
27
|
-
export { StyledBarChart, StyledBarChartBars, StyledBarChartEmptyText, StyledBarChartSection } from './components/BarChart/styles.js';
|
|
28
|
-
export { ChartContainer, ChartContainerDescription, ChartContainerTitle } from './components/ChartContainer/ChartContainer.js';
|
|
29
|
-
export { ChartContainerProps, StyledChartContainerProps } from './components/ChartContainer/types.js';
|
|
30
|
-
export { StyledChartContainer, StyledChartContainerCaption, StyledChartContainerTitle } from './components/ChartContainer/styles.js';
|
|
31
|
-
export { DataPoint } from './components/DataPoint/DataPoint.js';
|
|
32
|
-
export { AnchorProps, DataPointProps, StyledDataPointProps } from './components/DataPoint/types.js';
|
|
33
|
-
export { StyledDataPoint } from './components/DataPoint/styles.js';
|
|
34
|
-
export { Dot } from './components/Dot/Dot.js';
|
|
35
|
-
export { DotProps, DotVariant, StyledDotProps } from './components/Dot/types.js';
|
|
36
|
-
export { StyledDot } from './components/Dot/styles.js';
|
|
37
|
-
export { Legend } from './components/Legend/Legend.js';
|
|
38
|
-
export { LegendProps, StyledLegendProps } from './components/Legend/types.js';
|
|
39
|
-
export { StyledLegend } from './components/Legend/styles.js';
|
|
40
|
-
export { Line } from './components/Line/Line.js';
|
|
41
|
-
export { LineProps, StyledLineProps } from './components/Line/types.js';
|
|
42
|
-
export { StyledLine } from './components/Line/styles.js';
|
|
43
|
-
export { LineChart } from './components/LineChart/LineChart.js';
|
|
44
|
-
export { LineChartDimensions, LineChartLegendVariant, LineChartProps, StyledLineChartProps } from './components/LineChart/types.js';
|
|
45
|
-
export { StyledLineChart, StyledLineChartEmptyText } from './components/LineChart/styles.js';
|
|
46
|
-
export { PieChart } from './components/PieChart/PieChart.js';
|
|
47
|
-
export { PieChartDimensions, PieChartLegendVariant, PieChartProps, PieChartVariant, StyledPieChartProps } from './components/PieChart/types.js';
|
|
48
|
-
export { StyledPieChart, StyledPieChartCenterText, StyledPieChartEmptyText } from './components/PieChart/styles.js';
|
|
49
|
-
export { ScatterPlot } from './components/ScatterPlot/ScatterPlot.js';
|
|
50
|
-
export { ScatterPlotDimensions, ScatterPlotLegendVariant, ScatterPlotProps, ScatterPlotVariant, StyledScatterPlotProps } from './components/ScatterPlot/types.js';
|
|
51
|
-
export { StyledScatterPlot, StyledScatterPlotEmptyText } from './components/ScatterPlot/styles.js';
|
package/scheme.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ScaleOrdinal } from 'd3';
|
|
2
|
-
import { Theme } from '@redsift/design-system';
|
|
3
|
-
import { ChartTheme } from './types/theme.js';
|
|
4
|
-
|
|
5
|
-
declare const monochrome = "#73C5EB";
|
|
6
|
-
declare const empty = "#BFBFBF";
|
|
7
|
-
declare const scheme: {
|
|
8
|
-
default: string[];
|
|
9
|
-
dark: string[];
|
|
10
|
-
darker: string[];
|
|
11
|
-
darkerer: string[];
|
|
12
|
-
light: string[];
|
|
13
|
-
lighter: string[];
|
|
14
|
-
lighterer: string[];
|
|
15
|
-
monochrome: string[];
|
|
16
|
-
empty: string[];
|
|
17
|
-
};
|
|
18
|
-
declare const successDangerScheme: {
|
|
19
|
-
success: string;
|
|
20
|
-
warning: string;
|
|
21
|
-
danger: string;
|
|
22
|
-
neutralLight: string;
|
|
23
|
-
neutralDark: string;
|
|
24
|
-
};
|
|
25
|
-
declare const getColorScale: ({ colorTheme, domain, isEmpty, theme, }: {
|
|
26
|
-
colorTheme: ChartTheme;
|
|
27
|
-
domain?: string[] | undefined;
|
|
28
|
-
isEmpty?: boolean | undefined;
|
|
29
|
-
theme: Theme;
|
|
30
|
-
}) => ScaleOrdinal<string, string>;
|
|
31
|
-
|
|
32
|
-
export { empty, getColorScale, monochrome, scheme, successDangerScheme };
|
package/scheme.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheme.js","sources":["../src/scheme.ts"],"sourcesContent":["import { scaleOrdinal as d3scaleOrdinal, ScaleOrdinal as d3ScaleOrdinal } from 'd3';\nimport { ChartTheme } from './types';\n\nimport {\n RedsiftColorPresentationAquaDark,\n RedsiftColorPresentationAquaDarker,\n RedsiftColorPresentationAquaDarkerer,\n RedsiftColorPresentationAquaDefault,\n RedsiftColorPresentationAquaLight,\n RedsiftColorPresentationAquaLighter,\n RedsiftColorPresentationAquaLighterer,\n RedsiftColorPresentationBlueDark,\n RedsiftColorPresentationBlueDarker,\n RedsiftColorPresentationBlueDarkerer,\n RedsiftColorPresentationBlueDefault,\n RedsiftColorPresentationBlueLight,\n RedsiftColorPresentationBlueLighter,\n RedsiftColorPresentationBlueLighterer,\n RedsiftColorPresentationBrownDark,\n RedsiftColorPresentationBrownDarker,\n RedsiftColorPresentationBrownDarkerer,\n RedsiftColorPresentationBrownDefault,\n RedsiftColorPresentationBrownLight,\n RedsiftColorPresentationBrownLighter,\n RedsiftColorPresentationBrownLighterer,\n RedsiftColorPresentationGreenDark,\n RedsiftColorPresentationGreenDarker,\n RedsiftColorPresentationGreenDarkerer,\n RedsiftColorPresentationGreenDefault,\n RedsiftColorPresentationGreenLight,\n RedsiftColorPresentationGreenLighter,\n RedsiftColorPresentationGreenLighterer,\n RedsiftColorPresentationGreyDark,\n RedsiftColorPresentationGreyDarker,\n RedsiftColorPresentationGreyDarkerer,\n RedsiftColorPresentationGreyDefault,\n RedsiftColorPresentationGreyLight,\n RedsiftColorPresentationGreyLighter,\n RedsiftColorPresentationGreyLighterer,\n RedsiftColorPresentationOrangeDark,\n RedsiftColorPresentationOrangeDarker,\n RedsiftColorPresentationOrangeDarkerer,\n RedsiftColorPresentationOrangeDefault,\n RedsiftColorPresentationOrangeLight,\n RedsiftColorPresentationOrangeLighter,\n RedsiftColorPresentationOrangeLighterer,\n RedsiftColorPresentationPinkDark,\n RedsiftColorPresentationPinkDarker,\n RedsiftColorPresentationPinkDarkerer,\n RedsiftColorPresentationPinkDefault,\n RedsiftColorPresentationPinkLight,\n RedsiftColorPresentationPinkLighter,\n RedsiftColorPresentationPinkLighterer,\n RedsiftColorPresentationPurpleDark,\n RedsiftColorPresentationPurpleDarker,\n RedsiftColorPresentationPurpleDarkerer,\n RedsiftColorPresentationPurpleDefault,\n RedsiftColorPresentationPurpleLight,\n RedsiftColorPresentationPurpleLighter,\n RedsiftColorPresentationPurpleLighterer,\n RedsiftColorPresentationRedDark,\n RedsiftColorPresentationRedDarker,\n RedsiftColorPresentationRedDarkerer,\n RedsiftColorPresentationRedDefault,\n RedsiftColorPresentationRedLight,\n RedsiftColorPresentationRedLighter,\n RedsiftColorPresentationRedLighterer,\n RedsiftColorPresentationYellowDark,\n RedsiftColorPresentationYellowDarker,\n RedsiftColorPresentationYellowDarkerer,\n RedsiftColorPresentationYellowDefault,\n RedsiftColorPresentationYellowLight,\n RedsiftColorPresentationYellowLighter,\n RedsiftColorPresentationYellowLighterer,\n Theme,\n} from '@redsift/design-system';\n\nexport const monochrome = RedsiftColorPresentationBlueDefault;\nexport const empty = RedsiftColorPresentationGreyDark;\n\nexport const scheme = {\n default: [\n RedsiftColorPresentationBlueDefault,\n RedsiftColorPresentationAquaDefault,\n RedsiftColorPresentationPinkDefault,\n RedsiftColorPresentationGreyDefault,\n RedsiftColorPresentationYellowDefault,\n RedsiftColorPresentationPurpleDefault,\n RedsiftColorPresentationGreenDefault,\n RedsiftColorPresentationBrownDefault,\n RedsiftColorPresentationRedDefault,\n RedsiftColorPresentationOrangeDefault,\n ],\n dark: [\n RedsiftColorPresentationGreenDark,\n RedsiftColorPresentationPinkDark,\n RedsiftColorPresentationAquaDark,\n RedsiftColorPresentationBrownDark,\n RedsiftColorPresentationRedDark,\n RedsiftColorPresentationYellowDark,\n RedsiftColorPresentationPurpleDark,\n RedsiftColorPresentationOrangeDark,\n RedsiftColorPresentationBlueDark,\n RedsiftColorPresentationGreyDark,\n ],\n darker: [\n RedsiftColorPresentationGreenDarker,\n RedsiftColorPresentationPinkDarker,\n RedsiftColorPresentationAquaDarker,\n RedsiftColorPresentationBrownDarker,\n RedsiftColorPresentationRedDarker,\n RedsiftColorPresentationYellowDarker,\n RedsiftColorPresentationPurpleDarker,\n RedsiftColorPresentationOrangeDarker,\n RedsiftColorPresentationBlueDarker,\n RedsiftColorPresentationGreyDarker,\n ],\n darkerer: [\n RedsiftColorPresentationGreenDarkerer,\n RedsiftColorPresentationPinkDarkerer,\n RedsiftColorPresentationAquaDarkerer,\n RedsiftColorPresentationBrownDarkerer,\n RedsiftColorPresentationRedDarkerer,\n RedsiftColorPresentationYellowDarkerer,\n RedsiftColorPresentationPurpleDarkerer,\n RedsiftColorPresentationOrangeDarkerer,\n RedsiftColorPresentationBlueDarkerer,\n RedsiftColorPresentationGreyDarkerer,\n ],\n light: [\n RedsiftColorPresentationGreenLight,\n RedsiftColorPresentationPinkLight,\n RedsiftColorPresentationAquaLight,\n RedsiftColorPresentationBrownLight,\n RedsiftColorPresentationRedLight,\n RedsiftColorPresentationYellowLight,\n RedsiftColorPresentationPurpleLight,\n RedsiftColorPresentationOrangeLight,\n RedsiftColorPresentationBlueLight,\n RedsiftColorPresentationGreyLight,\n ],\n lighter: [\n RedsiftColorPresentationGreenLighter,\n RedsiftColorPresentationPinkLighter,\n RedsiftColorPresentationAquaLighter,\n RedsiftColorPresentationBrownLighter,\n RedsiftColorPresentationRedLighter,\n RedsiftColorPresentationYellowLighter,\n RedsiftColorPresentationPurpleLighter,\n RedsiftColorPresentationOrangeLighter,\n RedsiftColorPresentationBlueLighter,\n RedsiftColorPresentationGreyLighter,\n ],\n lighterer: [\n RedsiftColorPresentationGreenLighterer,\n RedsiftColorPresentationPinkLighterer,\n RedsiftColorPresentationAquaLighterer,\n RedsiftColorPresentationBrownLighterer,\n RedsiftColorPresentationRedLighterer,\n RedsiftColorPresentationYellowLighterer,\n RedsiftColorPresentationPurpleLighterer,\n RedsiftColorPresentationOrangeLighterer,\n RedsiftColorPresentationBlueLighterer,\n RedsiftColorPresentationGreyLighterer,\n ],\n monochrome: [monochrome],\n empty: [empty],\n};\n\nexport const successDangerScheme = {\n success: RedsiftColorPresentationGreenDefault,\n warning: RedsiftColorPresentationOrangeDefault,\n danger: RedsiftColorPresentationRedDefault,\n neutralLight: RedsiftColorPresentationGreyDefault,\n neutralDark: RedsiftColorPresentationGreyDarkerer,\n};\n\nexport const getColorScale = ({\n colorTheme,\n domain,\n isEmpty,\n theme,\n}: {\n colorTheme: ChartTheme;\n domain?: string[];\n isEmpty?: boolean;\n theme: Theme;\n}): d3ScaleOrdinal<string, string> => {\n let d3colors = d3scaleOrdinal(scheme.default);\n\n if (isEmpty) {\n d3colors = d3scaleOrdinal(scheme.empty);\n } else if (typeof colorTheme === 'string') {\n d3colors = d3scaleOrdinal().domain(domain!).range(scheme[colorTheme]).unknown(monochrome) as d3ScaleOrdinal<\n string,\n string\n >;\n } else if (typeof colorTheme === 'object') {\n if (\n Object.keys(colorTheme).includes('success') ||\n Object.keys(colorTheme).includes('danger') ||\n Object.keys(colorTheme).includes('warning')\n ) {\n d3colors = d3scaleOrdinal()\n .domain([\n ...(colorTheme.success ? [colorTheme.success] : []),\n ...(colorTheme.warning ? [colorTheme.warning] : []),\n ...(colorTheme.danger ? [colorTheme.danger] : []),\n ...(colorTheme.neutral ? [colorTheme.neutral] : []),\n ])\n .range([\n ...(colorTheme.success ? [successDangerScheme.success] : []),\n ...(colorTheme.warning ? [successDangerScheme.warning] : []),\n ...(colorTheme.danger ? [successDangerScheme.danger] : []),\n ...(colorTheme.neutral\n ? [theme === Theme.dark ? successDangerScheme.neutralDark : successDangerScheme.neutralLight]\n : []),\n ])\n .unknown(monochrome) as d3ScaleOrdinal<string, string>;\n } else {\n d3colors = d3scaleOrdinal()\n .domain(Object.keys(colorTheme))\n .range(Object.values(colorTheme))\n .unknown(monochrome) as d3ScaleOrdinal<string, string>;\n }\n }\n\n return d3colors;\n};\n"],"names":["monochrome","RedsiftColorPresentationBlueDefault","empty","RedsiftColorPresentationGreyDark","scheme","default","RedsiftColorPresentationAquaDefault","RedsiftColorPresentationPinkDefault","RedsiftColorPresentationGreyDefault","RedsiftColorPresentationYellowDefault","RedsiftColorPresentationPurpleDefault","RedsiftColorPresentationGreenDefault","RedsiftColorPresentationBrownDefault","RedsiftColorPresentationRedDefault","RedsiftColorPresentationOrangeDefault","dark","RedsiftColorPresentationGreenDark","RedsiftColorPresentationPinkDark","RedsiftColorPresentationAquaDark","RedsiftColorPresentationBrownDark","RedsiftColorPresentationRedDark","RedsiftColorPresentationYellowDark","RedsiftColorPresentationPurpleDark","RedsiftColorPresentationOrangeDark","RedsiftColorPresentationBlueDark","darker","RedsiftColorPresentationGreenDarker","RedsiftColorPresentationPinkDarker","RedsiftColorPresentationAquaDarker","RedsiftColorPresentationBrownDarker","RedsiftColorPresentationRedDarker","RedsiftColorPresentationYellowDarker","RedsiftColorPresentationPurpleDarker","RedsiftColorPresentationOrangeDarker","RedsiftColorPresentationBlueDarker","RedsiftColorPresentationGreyDarker","darkerer","RedsiftColorPresentationGreenDarkerer","RedsiftColorPresentationPinkDarkerer","RedsiftColorPresentationAquaDarkerer","RedsiftColorPresentationBrownDarkerer","RedsiftColorPresentationRedDarkerer","RedsiftColorPresentationYellowDarkerer","RedsiftColorPresentationPurpleDarkerer","RedsiftColorPresentationOrangeDarkerer","RedsiftColorPresentationBlueDarkerer","RedsiftColorPresentationGreyDarkerer","light","RedsiftColorPresentationGreenLight","RedsiftColorPresentationPinkLight","RedsiftColorPresentationAquaLight","RedsiftColorPresentationBrownLight","RedsiftColorPresentationRedLight","RedsiftColorPresentationYellowLight","RedsiftColorPresentationPurpleLight","RedsiftColorPresentationOrangeLight","RedsiftColorPresentationBlueLight","RedsiftColorPresentationGreyLight","lighter","RedsiftColorPresentationGreenLighter","RedsiftColorPresentationPinkLighter","RedsiftColorPresentationAquaLighter","RedsiftColorPresentationBrownLighter","RedsiftColorPresentationRedLighter","RedsiftColorPresentationYellowLighter","RedsiftColorPresentationPurpleLighter","RedsiftColorPresentationOrangeLighter","RedsiftColorPresentationBlueLighter","RedsiftColorPresentationGreyLighter","lighterer","RedsiftColorPresentationGreenLighterer","RedsiftColorPresentationPinkLighterer","RedsiftColorPresentationAquaLighterer","RedsiftColorPresentationBrownLighterer","RedsiftColorPresentationRedLighterer","RedsiftColorPresentationYellowLighterer","RedsiftColorPresentationPurpleLighterer","RedsiftColorPresentationOrangeLighterer","RedsiftColorPresentationBlueLighterer","RedsiftColorPresentationGreyLighterer","successDangerScheme","success","warning","danger","neutralLight","neutralDark","getColorScale","_ref","colorTheme","domain","isEmpty","theme","d3colors","d3scaleOrdinal","range","unknown","Object","keys","includes","neutral","Theme","values"],"mappings":";;;AA6EO,MAAMA,UAAU,GAAGC,oCAAmC;AACtD,MAAMC,KAAK,GAAGC,iCAAgC;AAE9C,MAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE,CACPJ,mCAAmC,EACnCK,mCAAmC,EACnCC,mCAAmC,EACnCC,mCAAmC,EACnCC,qCAAqC,EACrCC,qCAAqC,EACrCC,oCAAoC,EACpCC,oCAAoC,EACpCC,kCAAkC,EAClCC,qCAAqC,CACtC;EACDC,IAAI,EAAE,CACJC,iCAAiC,EACjCC,gCAAgC,EAChCC,gCAAgC,EAChCC,iCAAiC,EACjCC,+BAA+B,EAC/BC,kCAAkC,EAClCC,kCAAkC,EAClCC,kCAAkC,EAClCC,gCAAgC,EAChCrB,gCAAgC,CACjC;EACDsB,MAAM,EAAE,CACNC,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,CACL,IAAIN,UAAU,CAACP,OAAO,GAAG,CAACD,mBAAmB,CAACC,OAAO,CAAC,GAAG,EAAE,CAAC,EAC5D,IAAIO,UAAU,CAACN,OAAO,GAAG,CAACF,mBAAmB,CAACE,OAAO,CAAC,GAAG,EAAE,CAAC,EAC5D,IAAIM,UAAU,CAACL,MAAM,GAAG,CAACH,mBAAmB,CAACG,MAAM,CAAC,GAAG,EAAE,CAAC,EAC1D,IAAIK,UAAU,CAACW,OAAO,GAClB,CAACR,KAAK,KAAKS,KAAK,CAACrF,IAAI,GAAGiE,mBAAmB,CAACK,WAAW,GAAGL,mBAAmB,CAACI,YAAY,CAAC,GAC3F,EAAE,CAAC,CACR,CAAC,CACDW,OAAO,CAAC/F,UAAU,CAAmC,CAAA;AAC1D,KAAC,MAAM;AACL4F,MAAAA,QAAQ,GAAGC,YAAc,EAAE,CACxBJ,MAAM,CAACO,MAAM,CAACC,IAAI,CAACT,UAAU,CAAC,CAAC,CAC/BM,KAAK,CAACE,MAAM,CAACK,MAAM,CAACb,UAAU,CAAC,CAAC,CAChCO,OAAO,CAAC/F,UAAU,CAAmC,CAAA;AAC1D,KAAA;AACF,GAAA;AAEA,EAAA,OAAO4F,QAAQ,CAAA;AACjB;;;;"}
|
package/types/legend.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ValueOf } from '@redsift/design-system';
|
|
2
|
-
|
|
3
|
-
/** TOOLTIP */
|
|
4
|
-
declare const TooltipVariant: {
|
|
5
|
-
none: string;
|
|
6
|
-
label: string;
|
|
7
|
-
value: string;
|
|
8
|
-
percent: string;
|
|
9
|
-
custom: string;
|
|
10
|
-
};
|
|
11
|
-
type TooltipVariant = ValueOf<typeof TooltipVariant>;
|
|
12
|
-
/** LEGEND */
|
|
13
|
-
declare const LegendVariant: {
|
|
14
|
-
readonly none: "none";
|
|
15
|
-
readonly label: "label";
|
|
16
|
-
readonly value: "value";
|
|
17
|
-
readonly percent: "percent";
|
|
18
|
-
readonly custom: "custom";
|
|
19
|
-
};
|
|
20
|
-
type LegendVariant = ValueOf<typeof LegendVariant>;
|
|
21
|
-
declare const LabelVariant: {
|
|
22
|
-
readonly none: "none";
|
|
23
|
-
readonly label: "label";
|
|
24
|
-
readonly value: "value";
|
|
25
|
-
readonly percent: "percent";
|
|
26
|
-
readonly custom: "custom";
|
|
27
|
-
};
|
|
28
|
-
type LabelVariant = LegendVariant;
|
|
29
|
-
|
|
30
|
-
export { LabelVariant, LegendVariant, TooltipVariant };
|
package/types/legend.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legend.js","sources":["../../src/types/legend.ts"],"sourcesContent":["import { ValueOf } from '@redsift/design-system';\n\n/** TOOLTIP */\n\nexport const TooltipVariant = {\n none: 'none',\n label: 'label',\n value: 'value',\n percent: 'percent',\n custom: 'custom',\n};\nexport type TooltipVariant = ValueOf<typeof TooltipVariant>;\n\n/** LEGEND */\nexport const LegendVariant = {\n none: 'none',\n label: 'label',\n value: 'value',\n percent: 'percent',\n custom: 'custom',\n} as const;\nexport const LabelVariant = LegendVariant;\nexport type LegendVariant = ValueOf<typeof LegendVariant>;\nexport type LabelVariant = LegendVariant;\n"],"names":["TooltipVariant","none","label","value","percent","custom","LegendVariant","LabelVariant"],"mappings":"AAEA;;AAEO,MAAMA,cAAc,GAAG;AAC5BC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,MAAM,EAAE,QAAA;AACV,EAAC;AAGD;AACO,MAAMC,aAAa,GAAG;AAC3BL,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,MAAM,EAAE,QAAA;AACV,EAAU;AACH,MAAME,YAAY,GAAGD;;;;"}
|