@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
package/src/scheme.ts
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
scaleOrdinal as d3scaleOrdinal,
|
|
3
|
-
ScaleOrdinal as d3ScaleOrdinal,
|
|
4
|
-
} from 'd3';
|
|
5
|
-
import { ChartTheme } from './types';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
RedsiftDataVizColorAquaDark,
|
|
9
|
-
RedsiftDataVizColorAquaDarker,
|
|
10
|
-
RedsiftDataVizColorAquaDarkerer,
|
|
11
|
-
RedsiftDataVizColorAquaDefault,
|
|
12
|
-
RedsiftDataVizColorAquaLight,
|
|
13
|
-
RedsiftDataVizColorAquaLighter,
|
|
14
|
-
RedsiftDataVizColorAquaLighterer,
|
|
15
|
-
RedsiftDataVizColorBlueDark,
|
|
16
|
-
RedsiftDataVizColorBlueDarker,
|
|
17
|
-
RedsiftDataVizColorBlueDarkerer,
|
|
18
|
-
RedsiftDataVizColorBlueDefault,
|
|
19
|
-
RedsiftDataVizColorBlueLight,
|
|
20
|
-
RedsiftDataVizColorBlueLighter,
|
|
21
|
-
RedsiftDataVizColorBlueLighterer,
|
|
22
|
-
RedsiftDataVizColorBrownDark,
|
|
23
|
-
RedsiftDataVizColorBrownDarker,
|
|
24
|
-
RedsiftDataVizColorBrownDarkerer,
|
|
25
|
-
RedsiftDataVizColorBrownDefault,
|
|
26
|
-
RedsiftDataVizColorBrownLight,
|
|
27
|
-
RedsiftDataVizColorBrownLighter,
|
|
28
|
-
RedsiftDataVizColorBrownLighterer,
|
|
29
|
-
RedsiftDataVizColorGreenDark,
|
|
30
|
-
RedsiftDataVizColorGreenDarker,
|
|
31
|
-
RedsiftDataVizColorGreenDarkerer,
|
|
32
|
-
RedsiftDataVizColorGreenDefault,
|
|
33
|
-
RedsiftDataVizColorGreenLight,
|
|
34
|
-
RedsiftDataVizColorGreenLighter,
|
|
35
|
-
RedsiftDataVizColorGreenLighterer,
|
|
36
|
-
RedsiftDataVizColorGreyDark,
|
|
37
|
-
RedsiftDataVizColorGreyDarker,
|
|
38
|
-
RedsiftDataVizColorGreyDarkerer,
|
|
39
|
-
RedsiftDataVizColorGreyDefault,
|
|
40
|
-
RedsiftDataVizColorGreyLight,
|
|
41
|
-
RedsiftDataVizColorGreyLighter,
|
|
42
|
-
RedsiftDataVizColorGreyLighterer,
|
|
43
|
-
RedsiftDataVizColorOrangeDark,
|
|
44
|
-
RedsiftDataVizColorOrangeDarker,
|
|
45
|
-
RedsiftDataVizColorOrangeDarkerer,
|
|
46
|
-
RedsiftDataVizColorOrangeDefault,
|
|
47
|
-
RedsiftDataVizColorOrangeLight,
|
|
48
|
-
RedsiftDataVizColorOrangeLighter,
|
|
49
|
-
RedsiftDataVizColorOrangeLighterer,
|
|
50
|
-
RedsiftDataVizColorPinkDark,
|
|
51
|
-
RedsiftDataVizColorPinkDarker,
|
|
52
|
-
RedsiftDataVizColorPinkDarkerer,
|
|
53
|
-
RedsiftDataVizColorPinkDefault,
|
|
54
|
-
RedsiftDataVizColorPinkLight,
|
|
55
|
-
RedsiftDataVizColorPinkLighter,
|
|
56
|
-
RedsiftDataVizColorPinkLighterer,
|
|
57
|
-
RedsiftDataVizColorPurpleDark,
|
|
58
|
-
RedsiftDataVizColorPurpleDarker,
|
|
59
|
-
RedsiftDataVizColorPurpleDarkerer,
|
|
60
|
-
RedsiftDataVizColorPurpleDefault,
|
|
61
|
-
RedsiftDataVizColorPurpleLight,
|
|
62
|
-
RedsiftDataVizColorPurpleLighter,
|
|
63
|
-
RedsiftDataVizColorPurpleLighterer,
|
|
64
|
-
RedsiftDataVizColorRedDark,
|
|
65
|
-
RedsiftDataVizColorRedDarker,
|
|
66
|
-
RedsiftDataVizColorRedDarkerer,
|
|
67
|
-
RedsiftDataVizColorRedDefault,
|
|
68
|
-
RedsiftDataVizColorRedLight,
|
|
69
|
-
RedsiftDataVizColorRedLighter,
|
|
70
|
-
RedsiftDataVizColorRedLighterer,
|
|
71
|
-
RedsiftDataVizColorYellowDark,
|
|
72
|
-
RedsiftDataVizColorYellowDarker,
|
|
73
|
-
RedsiftDataVizColorYellowDarkerer,
|
|
74
|
-
RedsiftDataVizColorYellowDefault,
|
|
75
|
-
RedsiftDataVizColorYellowLight,
|
|
76
|
-
RedsiftDataVizColorYellowLighter,
|
|
77
|
-
RedsiftDataVizColorYellowLighterer,
|
|
78
|
-
} from '@redsift/design-system';
|
|
79
|
-
|
|
80
|
-
export const monochrome = RedsiftDataVizColorBlueDefault;
|
|
81
|
-
export const empty = RedsiftDataVizColorGreyDark;
|
|
82
|
-
|
|
83
|
-
export const scheme = {
|
|
84
|
-
default: [
|
|
85
|
-
RedsiftDataVizColorGreenDefault,
|
|
86
|
-
RedsiftDataVizColorPinkDefault,
|
|
87
|
-
RedsiftDataVizColorAquaDefault,
|
|
88
|
-
RedsiftDataVizColorBrownDefault,
|
|
89
|
-
RedsiftDataVizColorRedDefault,
|
|
90
|
-
RedsiftDataVizColorYellowDefault,
|
|
91
|
-
RedsiftDataVizColorPurpleDefault,
|
|
92
|
-
RedsiftDataVizColorOrangeDefault,
|
|
93
|
-
RedsiftDataVizColorBlueDefault,
|
|
94
|
-
RedsiftDataVizColorGreyDefault,
|
|
95
|
-
],
|
|
96
|
-
dark: [
|
|
97
|
-
RedsiftDataVizColorGreenDark,
|
|
98
|
-
RedsiftDataVizColorPinkDark,
|
|
99
|
-
RedsiftDataVizColorAquaDark,
|
|
100
|
-
RedsiftDataVizColorBrownDark,
|
|
101
|
-
RedsiftDataVizColorRedDark,
|
|
102
|
-
RedsiftDataVizColorYellowDark,
|
|
103
|
-
RedsiftDataVizColorPurpleDark,
|
|
104
|
-
RedsiftDataVizColorOrangeDark,
|
|
105
|
-
RedsiftDataVizColorBlueDark,
|
|
106
|
-
RedsiftDataVizColorGreyDark,
|
|
107
|
-
],
|
|
108
|
-
darker: [
|
|
109
|
-
RedsiftDataVizColorGreenDarker,
|
|
110
|
-
RedsiftDataVizColorPinkDarker,
|
|
111
|
-
RedsiftDataVizColorAquaDarker,
|
|
112
|
-
RedsiftDataVizColorBrownDarker,
|
|
113
|
-
RedsiftDataVizColorRedDarker,
|
|
114
|
-
RedsiftDataVizColorYellowDarker,
|
|
115
|
-
RedsiftDataVizColorPurpleDarker,
|
|
116
|
-
RedsiftDataVizColorOrangeDarker,
|
|
117
|
-
RedsiftDataVizColorBlueDarker,
|
|
118
|
-
RedsiftDataVizColorGreyDarker,
|
|
119
|
-
],
|
|
120
|
-
darkerer: [
|
|
121
|
-
RedsiftDataVizColorGreenDarkerer,
|
|
122
|
-
RedsiftDataVizColorPinkDarkerer,
|
|
123
|
-
RedsiftDataVizColorAquaDarkerer,
|
|
124
|
-
RedsiftDataVizColorBrownDarkerer,
|
|
125
|
-
RedsiftDataVizColorRedDarkerer,
|
|
126
|
-
RedsiftDataVizColorYellowDarkerer,
|
|
127
|
-
RedsiftDataVizColorPurpleDarkerer,
|
|
128
|
-
RedsiftDataVizColorOrangeDarkerer,
|
|
129
|
-
RedsiftDataVizColorBlueDarkerer,
|
|
130
|
-
RedsiftDataVizColorGreyDarkerer,
|
|
131
|
-
],
|
|
132
|
-
light: [
|
|
133
|
-
RedsiftDataVizColorGreenLight,
|
|
134
|
-
RedsiftDataVizColorPinkLight,
|
|
135
|
-
RedsiftDataVizColorAquaLight,
|
|
136
|
-
RedsiftDataVizColorBrownLight,
|
|
137
|
-
RedsiftDataVizColorRedLight,
|
|
138
|
-
RedsiftDataVizColorYellowLight,
|
|
139
|
-
RedsiftDataVizColorPurpleLight,
|
|
140
|
-
RedsiftDataVizColorOrangeLight,
|
|
141
|
-
RedsiftDataVizColorBlueLight,
|
|
142
|
-
RedsiftDataVizColorGreyLight,
|
|
143
|
-
],
|
|
144
|
-
lighter: [
|
|
145
|
-
RedsiftDataVizColorGreenLighter,
|
|
146
|
-
RedsiftDataVizColorPinkLighter,
|
|
147
|
-
RedsiftDataVizColorAquaLighter,
|
|
148
|
-
RedsiftDataVizColorBrownLighter,
|
|
149
|
-
RedsiftDataVizColorRedLighter,
|
|
150
|
-
RedsiftDataVizColorYellowLighter,
|
|
151
|
-
RedsiftDataVizColorPurpleLighter,
|
|
152
|
-
RedsiftDataVizColorOrangeLighter,
|
|
153
|
-
RedsiftDataVizColorBlueLighter,
|
|
154
|
-
RedsiftDataVizColorGreyLighter,
|
|
155
|
-
],
|
|
156
|
-
lighterer: [
|
|
157
|
-
RedsiftDataVizColorGreenLighterer,
|
|
158
|
-
RedsiftDataVizColorPinkLighterer,
|
|
159
|
-
RedsiftDataVizColorAquaLighterer,
|
|
160
|
-
RedsiftDataVizColorBrownLighterer,
|
|
161
|
-
RedsiftDataVizColorRedLighterer,
|
|
162
|
-
RedsiftDataVizColorYellowLighterer,
|
|
163
|
-
RedsiftDataVizColorPurpleLighterer,
|
|
164
|
-
RedsiftDataVizColorOrangeLighterer,
|
|
165
|
-
RedsiftDataVizColorBlueLighterer,
|
|
166
|
-
RedsiftDataVizColorGreyLighterer,
|
|
167
|
-
],
|
|
168
|
-
monochrome: [monochrome],
|
|
169
|
-
empty: [empty],
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export const successDangerScheme = {
|
|
173
|
-
success: RedsiftDataVizColorGreenDefault,
|
|
174
|
-
warning: RedsiftDataVizColorOrangeDefault,
|
|
175
|
-
danger: RedsiftDataVizColorRedDefault,
|
|
176
|
-
neutral: RedsiftDataVizColorGreyDefault,
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
export const getColorScale = (
|
|
180
|
-
theme: ChartTheme,
|
|
181
|
-
domain?: string[],
|
|
182
|
-
isEmpty?: boolean
|
|
183
|
-
): d3ScaleOrdinal<string, string> => {
|
|
184
|
-
let d3colors = d3scaleOrdinal(scheme.default);
|
|
185
|
-
if (isEmpty) {
|
|
186
|
-
d3colors = d3scaleOrdinal(scheme.empty);
|
|
187
|
-
} else if (typeof theme === 'string') {
|
|
188
|
-
d3colors = d3scaleOrdinal()
|
|
189
|
-
.domain(domain!)
|
|
190
|
-
.range(scheme[theme])
|
|
191
|
-
.unknown(monochrome) as d3ScaleOrdinal<string, string>;
|
|
192
|
-
} else if (typeof theme === 'object') {
|
|
193
|
-
if (
|
|
194
|
-
Object.keys(theme).includes('success') &&
|
|
195
|
-
Object.keys(theme).includes('danger') &&
|
|
196
|
-
Object.keys(theme).includes('warning')
|
|
197
|
-
) {
|
|
198
|
-
d3colors = d3scaleOrdinal()
|
|
199
|
-
.domain([
|
|
200
|
-
theme.success,
|
|
201
|
-
theme.warning,
|
|
202
|
-
theme.danger,
|
|
203
|
-
...(theme.neutral ? [theme.neutral] : []),
|
|
204
|
-
])
|
|
205
|
-
.range([
|
|
206
|
-
successDangerScheme.success,
|
|
207
|
-
successDangerScheme.warning,
|
|
208
|
-
successDangerScheme.danger,
|
|
209
|
-
...(theme.neutral ? [successDangerScheme.neutral] : []),
|
|
210
|
-
])
|
|
211
|
-
.unknown(monochrome) as d3ScaleOrdinal<string, string>;
|
|
212
|
-
} else {
|
|
213
|
-
d3colors = d3scaleOrdinal()
|
|
214
|
-
.domain(Object.keys(theme))
|
|
215
|
-
.range(Object.values(theme))
|
|
216
|
-
.unknown(monochrome) as d3ScaleOrdinal<string, string>;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return d3colors;
|
|
221
|
-
};
|
package/src/types/data.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { PieArcDatum as d3PieArcDatum } from 'd3-shape';
|
|
2
|
-
|
|
3
|
-
export type JSONValue =
|
|
4
|
-
| string
|
|
5
|
-
| number
|
|
6
|
-
| boolean
|
|
7
|
-
| { [x: string]: JSONValue }
|
|
8
|
-
| Array<JSONValue>
|
|
9
|
-
| undefined
|
|
10
|
-
| null;
|
|
11
|
-
|
|
12
|
-
export type JSONObject = { [x: string]: JSONValue };
|
|
13
|
-
|
|
14
|
-
export type JSONArray = Array<JSONObject>;
|
|
15
|
-
|
|
16
|
-
export type Datum<T> = {
|
|
17
|
-
key: T;
|
|
18
|
-
value: number;
|
|
19
|
-
percent?: number;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type CategoryDim = string;
|
|
23
|
-
export type CoordinatesCategoryDim = [
|
|
24
|
-
number,
|
|
25
|
-
number,
|
|
26
|
-
string | undefined | null
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
export type CategoryDatum = Datum<CategoryDim>;
|
|
30
|
-
export type CoordinatesCategoryDatum = Datum<CoordinatesCategoryDim>;
|
|
31
|
-
|
|
32
|
-
export type CategoryData = CategoryDatum[];
|
|
33
|
-
export type CoordinatesCategoryData = CoordinatesCategoryDatum[];
|
|
34
|
-
|
|
35
|
-
export type ArcDatum = d3PieArcDatum<CategoryDatum>;
|
|
36
|
-
|
|
37
|
-
export type BarDatum = {
|
|
38
|
-
data: CategoryDatum;
|
|
39
|
-
height?: number;
|
|
40
|
-
width?: number;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type DotDatum = {
|
|
44
|
-
data: CoordinatesCategoryDatum;
|
|
45
|
-
x: number;
|
|
46
|
-
y: number;
|
|
47
|
-
r: number;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export type LegendItemDatum = {
|
|
51
|
-
data: CategoryDatum;
|
|
52
|
-
};
|
package/src/types/index.ts
DELETED
package/src/types/legend.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ValueOf } from '@redsift/design-system';
|
|
2
|
-
|
|
3
|
-
/** TOOLTIP */
|
|
4
|
-
|
|
5
|
-
export const TooltipVariant = {
|
|
6
|
-
none: 'none',
|
|
7
|
-
label: 'label',
|
|
8
|
-
value: 'value',
|
|
9
|
-
percent: 'percent',
|
|
10
|
-
};
|
|
11
|
-
export type TooltipVariant = ValueOf<typeof TooltipVariant>;
|
|
12
|
-
|
|
13
|
-
/** LEGEND */
|
|
14
|
-
export const LabelVariant = {
|
|
15
|
-
label: 'label',
|
|
16
|
-
value: 'value',
|
|
17
|
-
percent: 'percent',
|
|
18
|
-
} as const;
|
|
19
|
-
export type LabelVariant = ValueOf<typeof LabelVariant>;
|
package/src/types/scale.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ScaleLinear as d3ScaleLinear,
|
|
3
|
-
ScalePoint as d3ScalePoint,
|
|
4
|
-
ScaleBand as d3ScaleBand,
|
|
5
|
-
ScaleLogarithmic as d3ScaleLogarithmic,
|
|
6
|
-
ScaleSymLog as d3ScaleSymLog,
|
|
7
|
-
ScaleTime as d3ScaleTime,
|
|
8
|
-
} from 'd3-scale';
|
|
9
|
-
|
|
10
|
-
export type Coordinates = {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type NumericValue = { valueOf(): number };
|
|
16
|
-
|
|
17
|
-
export type StringValue = { toString(): string };
|
|
18
|
-
|
|
19
|
-
export type ScaleValue = NumericValue | StringValue | Date;
|
|
20
|
-
|
|
21
|
-
export interface ScaleLinear<Output>
|
|
22
|
-
extends d3ScaleLinear<number, Output, never> {
|
|
23
|
-
type: 'linear';
|
|
24
|
-
// default to `false`
|
|
25
|
-
stacked: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ScaleLog extends d3ScaleLogarithmic<number, number> {
|
|
29
|
-
type: 'log';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ScaleSymlog extends d3ScaleSymLog<number, number> {
|
|
33
|
-
type: 'symlog';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface ScalePoint<Input extends StringValue>
|
|
37
|
-
extends d3ScalePoint<Input> {
|
|
38
|
-
type: 'point';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ScaleBand<Input extends StringValue>
|
|
42
|
-
extends d3ScaleBand<Input> {
|
|
43
|
-
type: 'band';
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface ScaleTime<Input> extends d3ScaleTime<Input, number> {
|
|
47
|
-
type: 'time';
|
|
48
|
-
useUTC: boolean;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface ScaleTypeToScale<Input, Output> {
|
|
52
|
-
linear: Input extends NumericValue ? ScaleLinear<Output> : never;
|
|
53
|
-
log: Input extends NumericValue ? ScaleLog : never;
|
|
54
|
-
symlog: Input extends NumericValue ? ScaleSymlog : never;
|
|
55
|
-
point: Input extends StringValue ? ScalePoint<Input> : never;
|
|
56
|
-
band: Input extends StringValue ? ScaleBand<Input> : never;
|
|
57
|
-
time: Input extends StringValue | Date ? ScaleTime<Input> : never;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type Scale<Input, Output> = ScaleTypeToScale<
|
|
61
|
-
Input,
|
|
62
|
-
Output
|
|
63
|
-
>[keyof ScaleTypeToScale<Input, Output>];
|
|
64
|
-
|
|
65
|
-
export type AnyScale = Scale<any, any>;
|
|
66
|
-
|
|
67
|
-
export type ScaleWithBandwidth = ScaleBand<any> | ScalePoint<any>;
|
|
68
|
-
|
|
69
|
-
export type TicksSpec =
|
|
70
|
-
// exact number of ticks, please note that
|
|
71
|
-
// depending on the current range of values,
|
|
72
|
-
// you might not get this exact count
|
|
73
|
-
| number
|
|
74
|
-
// string is used for Date based scales,
|
|
75
|
-
// it can express a time interval,
|
|
76
|
-
// for example: every 2 weeks
|
|
77
|
-
| string
|
|
78
|
-
// override scale ticks with custom explicit values
|
|
79
|
-
| ScaleValue[];
|
package/src/types/size.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ValueOf } from '@redsift/design-system';
|
|
2
|
-
|
|
3
|
-
export type ChartDimensions = {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
marginTop?: number;
|
|
7
|
-
marginRight?: number;
|
|
8
|
-
marginBottom?: number;
|
|
9
|
-
marginLeft?: number;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const ChartSize = {
|
|
13
|
-
small: 'small',
|
|
14
|
-
medium: 'medium',
|
|
15
|
-
large: 'large',
|
|
16
|
-
} as const;
|
|
17
|
-
export type ChartSize = ValueOf<typeof ChartSize>;
|
package/src/types/theme.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ValueOf } from '@redsift/design-system';
|
|
2
|
-
|
|
3
|
-
export const ColorTheme = {
|
|
4
|
-
default: 'default',
|
|
5
|
-
dark: 'dark',
|
|
6
|
-
darker: 'darker',
|
|
7
|
-
darkerer: 'darkerer',
|
|
8
|
-
light: 'light',
|
|
9
|
-
lighter: 'lighter',
|
|
10
|
-
lighterer: 'lighterer',
|
|
11
|
-
monochrome: 'monochrome',
|
|
12
|
-
} as const;
|
|
13
|
-
export type ColorTheme = ValueOf<typeof ColorTheme>;
|
|
14
|
-
|
|
15
|
-
export type SuccessDangerColorTheme = {
|
|
16
|
-
success: string;
|
|
17
|
-
warning: string;
|
|
18
|
-
danger: string;
|
|
19
|
-
neutral?: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type CustomColorTheme = Record<string, string>;
|
|
23
|
-
|
|
24
|
-
export type ChartTheme =
|
|
25
|
-
| ColorTheme
|
|
26
|
-
| SuccessDangerColorTheme
|
|
27
|
-
| CustomColorTheme;
|
package/tsconfig.json
DELETED
|
File without changes
|