@react-magma/charts 14.2.1 → 15.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/charts.js +1511 -111
  2. package/dist/charts.js.map +1 -1
  3. package/dist/charts.modern.module.js +1513 -114
  4. package/dist/charts.modern.module.js.map +1 -1
  5. package/dist/charts.umd.js +48975 -28130
  6. package/dist/charts.umd.js.map +1 -1
  7. package/dist/components/CarbonChart/CarbonChart.d.ts +1 -1
  8. package/dist/components/CarbonChart/CarbonChartArea.stories.d.ts +310 -0
  9. package/dist/components/CarbonChart/CarbonChartAreaStacked.stories.d.ts +136 -0
  10. package/dist/components/CarbonChart/CarbonChartBar.stories.d.ts +232 -0
  11. package/dist/components/CarbonChart/CarbonChartBarFloating.stories.d.ts +82 -0
  12. package/dist/components/CarbonChart/CarbonChartBarGrouped.stories.d.ts +234 -0
  13. package/dist/components/CarbonChart/CarbonChartBarStacked.stories.d.ts +266 -0
  14. package/dist/components/CarbonChart/CarbonChartBoxplot.stories.d.ts +53 -0
  15. package/dist/components/CarbonChart/CarbonChartBubble.stories.d.ts +196 -0
  16. package/dist/components/CarbonChart/CarbonChartBullet.stories.d.ts +35 -0
  17. package/dist/components/CarbonChart/CarbonChartCombo.stories.d.ts +580 -0
  18. package/dist/components/CarbonChart/CarbonChartDonut.stories.d.ts +120 -0
  19. package/dist/components/CarbonChart/CarbonChartGauge.stories.d.ts +43 -0
  20. package/dist/components/CarbonChart/CarbonChartHistogram.stories.d.ts +89 -0
  21. package/dist/components/CarbonChart/CarbonChartLine.stories.d.ts +577 -0
  22. package/dist/components/CarbonChart/CarbonChartLollipop.stories.d.ts +55 -0
  23. package/dist/components/CarbonChart/CarbonChartMeter.stories.d.ts +127 -0
  24. package/dist/components/CarbonChart/CarbonChartPie.stories.d.ts +101 -0
  25. package/dist/components/CarbonChart/CarbonChartRadar.stories.d.ts +98 -0
  26. package/dist/components/CarbonChart/CarbonChartScatter.stories.d.ts +173 -0
  27. package/dist/components/CarbonChart/CarbonChartSparkline.stories.d.ts +51 -0
  28. package/dist/components/CarbonChart/CarbonChartStep.stories.d.ts +38 -0
  29. package/dist/components/ChartTable/ChartTable.stories.d.ts +166 -0
  30. package/dist/components/LineChart/Chart.d.ts +27 -0
  31. package/dist/components/LineChart/ChartDataTable.d.ts +17 -0
  32. package/dist/components/LineChart/CustomAxisComponent.d.ts +3 -0
  33. package/dist/components/LineChart/CustomPointComponent.d.ts +17 -0
  34. package/dist/components/LineChart/DataTable.d.ts +5 -0
  35. package/dist/components/LineChart/GraphTooltip.d.ts +3 -0
  36. package/dist/components/LineChart/LegendButton.d.ts +6 -0
  37. package/dist/components/LineChart/LineChart.d.ts +67 -0
  38. package/dist/components/LineChart/LineChart.stories.d.ts +113 -0
  39. package/dist/components/LineChart/index.d.ts +1 -0
  40. package/dist/components/LineChart/magma-charts.d.ts +1 -0
  41. package/dist/index.d.ts +1 -0
  42. package/package.json +19 -22
  43. package/src/components/CarbonChart/CarbonChart.test.js +185 -172
  44. package/src/components/CarbonChart/CarbonChart.tsx +19 -18
  45. package/src/components/CarbonChart/CarbonChartArea.stories.tsx +5 -3
  46. package/src/components/CarbonChart/CarbonChartAreaStacked.stories.tsx +5 -3
  47. package/src/components/CarbonChart/CarbonChartBar.stories.tsx +5 -3
  48. package/src/components/CarbonChart/CarbonChartBarFloating.stories.tsx +5 -3
  49. package/src/components/CarbonChart/CarbonChartBarGrouped.stories.tsx +5 -3
  50. package/src/components/CarbonChart/CarbonChartBarStacked.stories.tsx +5 -3
  51. package/src/components/CarbonChart/CarbonChartBoxplot.stories.tsx +5 -3
  52. package/src/components/CarbonChart/CarbonChartBubble.stories.tsx +5 -3
  53. package/src/components/CarbonChart/CarbonChartBullet.stories.tsx +5 -3
  54. package/src/components/CarbonChart/CarbonChartCombo.stories.tsx +5 -3
  55. package/src/components/CarbonChart/CarbonChartDonut.stories.tsx +5 -3
  56. package/src/components/CarbonChart/CarbonChartGauge.stories.tsx +5 -3
  57. package/src/components/CarbonChart/CarbonChartHistogram.stories.tsx +5 -3
  58. package/src/components/CarbonChart/CarbonChartLine.stories.tsx +5 -3
  59. package/src/components/CarbonChart/CarbonChartLollipop.stories.tsx +5 -3
  60. package/src/components/CarbonChart/CarbonChartMeter.stories.tsx +5 -3
  61. package/src/components/CarbonChart/CarbonChartPie.stories.tsx +5 -3
  62. package/src/components/CarbonChart/CarbonChartRadar.stories.tsx +5 -3
  63. package/src/components/CarbonChart/CarbonChartScatter.stories.tsx +5 -3
  64. package/src/components/CarbonChart/CarbonChartSparkline.stories.tsx +5 -3
  65. package/src/components/CarbonChart/CarbonChartStep.stories.tsx +5 -3
  66. package/src/components/ChartTable/ChartDataTable.tsx +0 -3
  67. package/src/components/ChartTable/ChartMoreOptionsButton.tsx +0 -1
  68. package/src/components/ChartTable/ChartTable.test.js +0 -8
  69. package/src/components/ChartTable/ChartTableButton.tsx +0 -1
  70. package/src/components/ChartTable/ChartToolbar.tsx +0 -1
  71. package/src/components/ChartTable/chartToolbarI18n.ts +1 -1
  72. package/src/components/LineChart/Chart.tsx +241 -0
  73. package/src/components/LineChart/ChartDataTable.test.js +165 -0
  74. package/src/components/LineChart/ChartDataTable.tsx +135 -0
  75. package/src/components/LineChart/CustomAxisComponent.tsx +30 -0
  76. package/src/components/LineChart/CustomPointComponent.tsx +93 -0
  77. package/src/components/LineChart/DataTable.tsx +57 -0
  78. package/src/components/LineChart/GraphTooltip.tsx +100 -0
  79. package/src/components/LineChart/LegendButton.tsx +77 -0
  80. package/src/components/LineChart/LineChart.stories.tsx +399 -0
  81. package/src/components/LineChart/LineChart.test.js +501 -0
  82. package/src/components/LineChart/LineChart.tsx +669 -0
  83. package/src/components/LineChart/index.ts +1 -0
  84. package/src/components/LineChart/magma-charts.ts +279 -0
  85. package/src/components/LineChart/test/exampleChartData.js +289 -0
  86. package/src/hooks/useCarbonModalFocusManagement.ts +0 -12
  87. package/src/index.ts +1 -0
@@ -0,0 +1,399 @@
1
+ import * as React from 'react';
2
+
3
+ import { StoryFn, Meta } from '@storybook/react/types-6-0';
4
+
5
+ import {
6
+ historyOfTexas as historyOfTexasData,
7
+ spendingRevenue as spendingRevenueData,
8
+ votingParticipation as votingParticipationData,
9
+ } from './test/exampleChartData';
10
+
11
+ import { Chart, ChartProps } from './index';
12
+
13
+ const data = [
14
+ {
15
+ name: 'Team 1',
16
+ data: [
17
+ { x: 1, y: 39, label: 'Team 1, January, $39k' },
18
+ { x: 2, y: 28, label: 'Team 1, February, $28k' },
19
+ { x: 3, y: 35, label: 'Team 1, March, $35k' },
20
+ { x: 4, y: 44, label: 'Team 1, April, $44k' },
21
+ { x: 5, y: 21, label: 'Team 1, May, $21k' },
22
+ ],
23
+ },
24
+ {
25
+ name: 'Team 2',
26
+ data: [
27
+ { x: 1, y: 27, label: 'Team 2, January, $27k' },
28
+ { x: 2, y: 33, label: 'Team 2, February, $33k' },
29
+ { x: 3, y: 39, label: 'Team 2, March, $39k' },
30
+ { x: 4, y: 28, label: 'Team 2, April, $28k' },
31
+ { x: 5, y: 19, label: 'Team 2, May, $19k' },
32
+ ],
33
+ },
34
+ {
35
+ name: 'Team 3',
36
+ data: [
37
+ { x: 1, y: 32, label: 'Team 3, January, $32k' },
38
+ { x: 2, y: 41, label: 'Team 3, February, $41k' },
39
+ { x: 3, y: 45, label: 'Team 3, March, $45k' },
40
+ { x: 4, y: 56, label: 'Team 3, April, $56k' },
41
+ { x: 5, y: 48, label: 'Team 3, May, $48k' },
42
+ ],
43
+ },
44
+ {
45
+ name: 'Team 4',
46
+ data: [
47
+ { x: 1, y: 48, label: 'Team 4, January, $48k' },
48
+ { x: 2, y: 66, label: 'Team 4, February, $66k' },
49
+ { x: 3, y: 52, label: 'Team 4, March, $52k' },
50
+ { x: 4, y: 36, label: 'Team 4, April, $36k' },
51
+ { x: 5, y: 10, label: 'Team 4, May, $10k' },
52
+ ],
53
+ },
54
+ ];
55
+
56
+ export default {
57
+ title: 'Chart',
58
+ component: Chart,
59
+ } as Meta;
60
+
61
+ const title = 'Annual sales figures for 2019';
62
+
63
+ const description =
64
+ 'description - Lorem ipsum dolor sitamet, consectetur adipiscing elit.';
65
+
66
+ export const Default = {
67
+ args: {
68
+ data: data,
69
+ description,
70
+ title,
71
+ type: 'line',
72
+ componentProps: {
73
+ xAxis: {
74
+ label: '2019 Annual Sales Figures',
75
+ tickFormat: ['Jan', 'Feb', 'March', 'April', 'May'],
76
+ },
77
+ yAxis: {
78
+ domain: [10, 80],
79
+ label: 'Conversion Rate',
80
+ tickFormat: t => `$${t}k`,
81
+ tickValues: [10, 20, 30, 40, 50, 60, 70, 80],
82
+ },
83
+ },
84
+ },
85
+ };
86
+
87
+ interface ExplicitDataInterface {
88
+ month: string | number;
89
+ sales: string | number;
90
+ [key: string]: any;
91
+ }
92
+
93
+ const explicitData = [
94
+ {
95
+ name: 'Team 1',
96
+ data: [
97
+ { month: 1, sales: 39, label: 'Team 1, January, $39k' },
98
+ { month: 2, sales: 28, label: 'Team 1, February, $28k' },
99
+ { month: 3, sales: 35, label: 'Team 1, March, $35k' },
100
+ { month: 4, sales: 44, label: 'Team 1, April, $44k' },
101
+ { month: 5, sales: 21, label: 'Team 1, May, $21k' },
102
+ { month: 6, sales: 22, label: 'Team 1, June, $22k' },
103
+ { month: 7, sales: 67, label: 'Team 1, July, $67k' },
104
+ { month: 8, sales: 110, label: 'Team 1, August, $110k' },
105
+ { month: 9, sales: 90, label: 'Team 1, September, $90k' },
106
+ { month: 10, sales: 47, label: 'Team 1, October, $47k' },
107
+ { month: 11, sales: 17, label: 'Team 1, November, $17k' },
108
+ { month: 12, sales: 24, label: 'Team 1, December, $24k' },
109
+ ],
110
+ },
111
+ {
112
+ name: 'Team 2',
113
+ data: [
114
+ { month: 1, sales: 27, label: 'Team 2, January, $27k' },
115
+ { month: 2, sales: 33, label: 'Team 2, February, $33k' },
116
+ { month: 3, sales: 39, label: 'Team 2, March, $39k' },
117
+ { month: 4, sales: 28, label: 'Team 2, April, $28k' },
118
+ { month: 5, sales: 19, label: 'Team 2, May, $19k' },
119
+ { month: 6, sales: 22, label: 'Team 2, June, $22k' },
120
+ { month: 7, sales: 27, label: 'Team 2, July, $27k' },
121
+ { month: 8, sales: 21, label: 'Team 2, August, $21k' },
122
+ { month: 9, sales: 30, label: 'Team 2, September, $30k' },
123
+ { month: 10, sales: 29, label: 'Team 2, October, $29k' },
124
+ { month: 11, sales: 34, label: 'Team 2, November, $34k' },
125
+ { month: 12, sales: 36, label: 'Team 2, December, $36k' },
126
+ ],
127
+ },
128
+ {
129
+ name: 'Team 3',
130
+ data: [
131
+ { month: 1, sales: 39, label: 'Team 3, January, $39k' },
132
+ { month: 2, sales: 39, label: 'Team 3, February, $39k' },
133
+ { month: 3, sales: 39, label: 'Team 3, March, $39k' },
134
+ { month: 4, sales: 39, label: 'Team 3, April, $39k' },
135
+ { month: 5, sales: 39, label: 'Team 3, May, $39k' },
136
+ { month: 6, sales: 39, label: 'Team 3, June, $39k' },
137
+ { month: 7, sales: 39, label: 'Team 3, July, $39k' },
138
+ { month: 8, sales: 39, label: 'Team 3, August, $39k' },
139
+ { month: 9, sales: 39, label: 'Team 3, September, $39k' },
140
+ { month: 10, sales: 39, label: 'Team 3, October, $39k' },
141
+ { month: 11, sales: 39, label: 'Team 3, November, $39k' },
142
+ { month: 12, sales: 39, label: 'Team 3, December, $39k' },
143
+ ],
144
+ },
145
+ {
146
+ name: 'Team 4',
147
+ data: [
148
+ { month: 1, sales: 48, label: 'Team 4, January, $48k' },
149
+ { month: 2, sales: 66, label: 'Team 4, February, $66k' },
150
+ { month: 3, sales: 52, label: 'Team 4, March, $52k' },
151
+ { month: 4, sales: 36, label: 'Team 4, April, $36k' },
152
+ { month: 5, sales: 10, label: 'Team 4, May, $10k' },
153
+ { month: 6, sales: 15, label: 'Team 4, June, $15k' },
154
+ { month: 7, sales: 100, label: 'Team 4, July, $100k' },
155
+ { month: 8, sales: 12, label: 'Team 4, August, $12k' },
156
+ { month: 9, sales: 54, label: 'Team 4, September, $54k' },
157
+ { month: 10, sales: 48, label: 'Team 4, October, $48k' },
158
+ { month: 11, sales: 76, label: 'Team 4, November, $76k' },
159
+ { month: 12, sales: 32, label: 'Team 4, December, $32k' },
160
+ ],
161
+ },
162
+ {
163
+ name: 'Team 5',
164
+ data: [
165
+ { month: 1, sales: 24, label: 'Team 5, January, $24k' },
166
+ { month: 2, sales: 9, label: 'Team 5, February, $9k' },
167
+ { month: 3, sales: 17, label: 'Team 5, March, $17k' },
168
+ { month: 4, sales: 28, label: 'Team 5, April, $28k' },
169
+ { month: 5, sales: 31, label: 'Team 5, May, $31k' },
170
+ { month: 6, sales: 68, label: 'Team 5, June, $68k' },
171
+ { month: 7, sales: 70, label: 'Team 5, July, $70k' },
172
+ { month: 8, sales: 81, label: 'Team 5, August, $81k' },
173
+ { month: 9, sales: 81, label: 'Team 5, September, $81k' },
174
+ { month: 10, sales: 81, label: 'Team 5, October, $81k' },
175
+ { month: 11, sales: 84, label: 'Team 5, November, $84k' },
176
+ { month: 12, sales: 76, label: 'Team 5, December, $76k' },
177
+ ],
178
+ },
179
+ {
180
+ name: 'Team 6',
181
+ data: [
182
+ { month: 1, sales: 75, label: 'Team 6, January, $75k' },
183
+ { month: 2, sales: 43, label: 'Team 6, February, $43k' },
184
+ { month: 3, sales: 72, label: 'Team 6, March, $72k' },
185
+ { month: 4, sales: 38, label: 'Team 6, April, $38k' },
186
+ { month: 5, sales: 81, label: 'Team 6, May, $81k' },
187
+ { month: 6, sales: 21, label: 'Team 6, June, $21k' },
188
+ { month: 7, sales: 74, label: 'Team 6, July, $74k' },
189
+ { month: 8, sales: 64, label: 'Team 6, August, $64k' },
190
+ { month: 9, sales: 42, label: 'Team 6, September, $42k' },
191
+ { month: 10, sales: 72, label: 'Team 6, October, $72k' },
192
+ { month: 11, sales: 34, label: 'Team 6, November, $34k' },
193
+ { month: 12, sales: 90, label: 'Team 6, December, $90k' },
194
+ ],
195
+ },
196
+ {
197
+ name: 'Team 7',
198
+ data: [
199
+ { month: 1, sales: 53, label: 'Team 7, January, $53k' },
200
+ { month: 2, sales: 43, label: 'Team 7, February, $43k' },
201
+ { month: 3, sales: 43, label: 'Team 7, March, $43k' },
202
+ { month: 4, sales: 43, label: 'Team 7, April, $43k' },
203
+ { month: 5, sales: 49, label: 'Team 7, May, $49k' },
204
+ { month: 6, sales: 51, label: 'Team 7, June, $51k' },
205
+ { month: 7, sales: 32, label: 'Team 7, July, $32k' },
206
+ { month: 8, sales: 32, label: 'Team 7, August, $32k' },
207
+ { month: 9, sales: 32, label: 'Team 7, September, $32k' },
208
+ { month: 10, sales: 57, label: 'Team 7, October, $57k' },
209
+ { month: 11, sales: 50, label: 'Team 7, November, $50k' },
210
+ { month: 12, sales: 64, label: 'Team 7, December, $64k' },
211
+ ],
212
+ },
213
+ {
214
+ name: 'Team 8',
215
+ data: [
216
+ { month: 1, sales: 60, label: 'Team 8, January, $60k' },
217
+ { month: 2, sales: 24, label: 'Team 8, February, $24k' },
218
+ { month: 3, sales: 55, label: 'Team 8, March, $55k' },
219
+ { month: 4, sales: 61, label: 'Team 8, April, $61k' },
220
+ { month: 5, sales: 78, label: 'Team 8, May, $78k' },
221
+ { month: 6, sales: 26, label: 'Team 8, June, $26k' },
222
+ { month: 7, sales: 38, label: 'Team 8, July, $38k' },
223
+ { month: 8, sales: 39, label: 'Team 8, August, $39k' },
224
+ { month: 9, sales: 59, label: 'Team 8, September, $59k' },
225
+ { month: 10, sales: 51, label: 'Team 8, October, $51k' },
226
+ { month: 11, sales: 17, label: 'Team 8, November, $17k' },
227
+ { month: 12, sales: 22, label: 'Team 8, December, $22k' },
228
+ ],
229
+ },
230
+ {
231
+ name: 'Team 9',
232
+ data: [
233
+ { month: 1, sales: 103, label: 'Team 9, January, $103k' },
234
+ { month: 2, sales: 99, label: 'Team 9, February, $99k' },
235
+ { month: 3, sales: 78, label: 'Team 9, March, $78k' },
236
+ { month: 4, sales: 63, label: 'Team 9, April, $63k' },
237
+ { month: 5, sales: 68, label: 'Team 9, May, $68k' },
238
+ { month: 6, sales: 112, label: 'Team 9, June, $112k' },
239
+ { month: 7, sales: 97, label: 'Team 9, July, $97k' },
240
+ { month: 8, sales: 37, label: 'Team 9, August, $37k' },
241
+ { month: 9, sales: 49, label: 'Team 9, September, $49k' },
242
+ { month: 10, sales: 58, label: 'Team 9, October, $58k' },
243
+ { month: 11, sales: 78, label: 'Team 9, November, $78k' },
244
+ { month: 12, sales: 92, label: 'Team 9, December, $92k' },
245
+ ],
246
+ },
247
+ {
248
+ name: 'Team 10',
249
+ data: [
250
+ { month: 1, sales: 36, label: 'Team 10, January, $36k' },
251
+ { month: 2, sales: 22, label: 'Team 10, February, $22k' },
252
+ { month: 3, sales: 3, label: 'Team 10, March, $3k' },
253
+ { month: 4, sales: 7, label: 'Team 10, April, $7k' },
254
+ { month: 5, sales: 14, label: 'Team 10, May, $14k' },
255
+ { month: 6, sales: 30, label: 'Team 10, June, $30k' },
256
+ { month: 7, sales: 33, label: 'Team 10, July, $33k' },
257
+ { month: 8, sales: 54, label: 'Team 10, August, $54k' },
258
+ { month: 9, sales: 61, label: 'Team 10, September, $61k' },
259
+ { month: 10, sales: 77, label: 'Team 10, October, $77k' },
260
+ { month: 11, sales: 75, label: 'Team 10, November, $75k' },
261
+ { month: 12, sales: 88, label: 'Team 10, December, $88k' },
262
+ ],
263
+ },
264
+ {
265
+ name: 'Team 11',
266
+ data: [
267
+ { month: 1, sales: 12, label: 'Team 11, January, $12k' },
268
+ { month: 2, sales: 19, label: 'Team 11, February, $19k' },
269
+ { month: 3, sales: 57, label: 'Team 11, March, $57k' },
270
+ { month: 4, sales: 96, label: 'Team 11, April, $96k' },
271
+ { month: 5, sales: 82, label: 'Team 11, May, $82k' },
272
+ { month: 6, sales: 82, label: 'Team 11, June, $82k' },
273
+ { month: 7, sales: 82, label: 'Team 11, July, $82k' },
274
+ { month: 8, sales: 99, label: 'Team 11, August, $99k' },
275
+ { month: 9, sales: 52, label: 'Team 11, September, $52k' },
276
+ { month: 10, sales: 81, label: 'Team 11, October, $81k' },
277
+ { month: 11, sales: 73, label: 'Team 11, November, $73k' },
278
+ { month: 12, sales: 8, label: 'Team 11, December, $8k' },
279
+ ],
280
+ },
281
+ {
282
+ name: 'Team 12',
283
+ data: [
284
+ { month: 1, sales: 0, label: 'Team 12, January, $0k' },
285
+ { month: 2, sales: 0, label: 'Team 12, February, $0k' },
286
+ { month: 3, sales: 0, label: 'Team 12, March, $0k' },
287
+ { month: 4, sales: 0, label: 'Team 12, April, $0k' },
288
+ { month: 5, sales: 0, label: 'Team 12, May, $0k' },
289
+ { month: 6, sales: 3, label: 'Team 12, June, $3k' },
290
+ { month: 7, sales: 7, label: 'Team 12, July, $7k' },
291
+ { month: 8, sales: 5, label: 'Team 12, August, $5k' },
292
+ { month: 9, sales: 1, label: 'Team 12, September, $1k' },
293
+ { month: 10, sales: 0, label: 'Team 12, October, $0k' },
294
+ { month: 11, sales: 0, label: 'Team 12, November, $0k' },
295
+ { month: 12, sales: 0, label: 'Team 12, December, $0k' },
296
+ ],
297
+ },
298
+ ];
299
+
300
+ export const ExplicitData = {
301
+ args: {
302
+ ...Default.args,
303
+ componentProps: {
304
+ ...Default.args.componentProps,
305
+ xAxis: {
306
+ ...Default.args.componentProps.xAxis,
307
+ tickFormat: [
308
+ 'Jan',
309
+ 'Feb',
310
+ 'March',
311
+ 'April',
312
+ 'May',
313
+ 'June',
314
+ 'July',
315
+ 'Aug',
316
+ 'Sept',
317
+ 'Oct',
318
+ 'Nov',
319
+ 'Dec',
320
+ ],
321
+ },
322
+ },
323
+ data: explicitData,
324
+ x: 'month',
325
+ y: 'sales',
326
+ },
327
+ };
328
+
329
+ interface HistoryOfTexasInterface {
330
+ year: number;
331
+ number: number;
332
+ label: string;
333
+ }
334
+
335
+ export const HistoryOfTexas = {
336
+ args: {
337
+ ...Default.args,
338
+ description: 'Number of enslaved people in Texas',
339
+ title: 'History of Texas',
340
+ componentProps: {
341
+ xAxis: {
342
+ label: 'Number of enslaved people',
343
+ tickValues: [1830, 1835, 1840, 1845, 1850, 1855, 1860, 1865],
344
+ },
345
+ yAxis: {
346
+ label: 'Year',
347
+ tickFormat: t => t.toLocaleString(),
348
+ tickValues: [
349
+ 0, 20000, 40000, 60000, 80000, 100000, 120000, 140000, 160000, 180000,
350
+ ],
351
+ },
352
+ },
353
+ data: historyOfTexasData,
354
+ x: 'year',
355
+ y: 'number',
356
+ },
357
+ };
358
+
359
+ export const SpendingRevenue = {
360
+ args: {
361
+ data: spendingRevenueData,
362
+ title: 'Spending Revenue',
363
+ type: 'line',
364
+ componentProps: {
365
+ xAxis: {
366
+ label: '',
367
+ },
368
+ yAxis: {
369
+ label: 'Average %',
370
+ tickValues: [0, 2, 4, 6, 8, 10, 12, 14],
371
+ },
372
+ },
373
+ },
374
+ };
375
+
376
+ interface VotingParticipationInterface {
377
+ year: number;
378
+ percent: number;
379
+ label: string;
380
+ }
381
+
382
+ export const VotingParticipation = {
383
+ args: {
384
+ data: votingParticipationData,
385
+ title: 'Turnout in elections since 2000: US and Texas',
386
+ type: 'line',
387
+ componentProps: {
388
+ xAxis: {
389
+ label: 'Year',
390
+ },
391
+ yAxis: {
392
+ domain: [10, 80],
393
+ label: 'Percent',
394
+ },
395
+ },
396
+ x: 'year',
397
+ y: 'percent',
398
+ },
399
+ };