@cdc/chart 4.22.10 → 4.23.1
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/README.md +5 -5
- package/dist/495.js +3 -0
- package/dist/703.js +1 -0
- package/dist/cdcchart.js +723 -6
- package/examples/age-adjusted-rates.json +1486 -1218
- package/examples/box-plot-data.json +71 -0
- package/examples/box-plot.csv +5 -0
- package/examples/{private/yaxis-test.json → box-plot.json} +46 -54
- package/examples/case-rate-example-config.json +1 -1
- package/examples/covid-confidence-example-config.json +33 -33
- package/examples/covid-example-config.json +34 -34
- package/examples/covid-example-data-confidence.json +30 -30
- package/examples/covid-example-data.json +20 -20
- package/examples/cutoff-example-config.json +36 -36
- package/examples/cutoff-example-data.json +36 -36
- package/examples/date-exclusions-config.json +1 -1
- package/examples/dynamic-legends.json +124 -124
- package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart-with-numbers-on-bar.json +191 -197
- package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart.json +230 -240
- package/examples/gallery/bar-chart-horizontal/horizontal-stacked.json +239 -247
- package/examples/gallery/bar-chart-vertical/combo-line-chart.json +138 -136
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-categorical.json +79 -79
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-stacked.json +80 -80
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-with-confidence.json +67 -67
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart.json +179 -110
- package/examples/gallery/lollipop/lollipop-style-horizontal.json +215 -219
- package/examples/gallery/paired-bar/paired-bar-chart.json +195 -195
- package/examples/horizontal-chart.json +35 -35
- package/examples/horizontal-stacked-bar-chart.json +34 -34
- package/examples/line-chart.json +75 -75
- package/examples/new-data.csv +17 -0
- package/examples/newdata.json +90 -0
- package/examples/paired-bar-data.json +16 -14
- package/examples/paired-bar-example.json +48 -48
- package/examples/paired-bar-formatted.json +36 -36
- package/examples/planet-chart-horizontal-example-config.json +33 -33
- package/examples/planet-combo-example-config.json +34 -31
- package/examples/planet-example-config.json +35 -33
- package/examples/planet-example-data.json +56 -56
- package/examples/planet-pie-example-config.json +28 -28
- package/examples/stacked-vertical-bar-example.json +1 -1
- package/examples/temp-example-config.json +61 -54
- package/examples/temp-example-data.json +1 -1
- package/package.json +3 -2
- package/src/CdcChart.tsx +449 -434
- package/src/components/BarChart.tsx +383 -497
- package/src/components/BoxPlot.js +92 -0
- package/src/components/DataTable.tsx +182 -197
- package/src/components/EditorPanel.js +1068 -722
- package/src/components/Filters.js +131 -0
- package/src/components/Legend.js +286 -329
- package/src/components/LineChart.tsx +143 -81
- package/src/components/LinearChart.tsx +432 -451
- package/src/components/PairedBarChart.tsx +197 -213
- package/src/components/PieChart.tsx +105 -151
- package/src/components/SparkLine.js +179 -201
- package/src/components/useIntersectionObserver.tsx +19 -20
- package/src/context.tsx +3 -3
- package/src/data/initial-state.js +44 -17
- package/src/hooks/useActiveElement.js +13 -13
- package/src/hooks/useChartClasses.js +34 -28
- package/src/hooks/useColorPalette.ts +56 -63
- package/src/hooks/useLegendClasses.js +18 -10
- package/src/hooks/useReduceData.ts +64 -77
- package/src/hooks/useRightAxis.js +25 -0
- package/src/hooks/useTopAxis.js +6 -0
- package/src/index.html +19 -19
- package/src/index.tsx +13 -16
- package/src/scss/DataTable.scss +6 -5
- package/src/scss/editor-panel.scss +71 -69
- package/src/scss/main.scss +188 -114
- package/src/scss/variables.scss +1 -1
- package/examples/private/line-test-data.json +0 -22
- package/examples/private/line-test-two.json +0 -216
- package/examples/private/line-test.json +0 -102
- package/examples/private/newtest.csv +0 -101
- package/examples/private/shawn.json +0 -1296
- package/examples/private/test.json +0 -10124
- package/examples/private/yaxis-testing.csv +0 -27
- package/examples/private/yaxis.json +0 -28
|
@@ -1,196 +1,196 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
2
|
+
"type": "chart",
|
|
3
|
+
"title": "Example Paired Bar Chart",
|
|
4
|
+
"theme": "theme-slate",
|
|
5
|
+
"fontSize": "small",
|
|
6
|
+
"lineDatapointStyle": "hover",
|
|
7
|
+
"barHasBorder": "false",
|
|
8
|
+
"isLollipopChart": false,
|
|
9
|
+
"lollipopShape": "circle",
|
|
10
|
+
"lollipopColorStyle": "two-tone",
|
|
11
|
+
"visualizationSubType": null,
|
|
12
|
+
"padding": {
|
|
13
|
+
"left": 5,
|
|
14
|
+
"right": 5
|
|
15
|
+
},
|
|
16
|
+
"yAxis": {
|
|
17
|
+
"hideAxis": true,
|
|
18
|
+
"hideLabel": false,
|
|
19
|
+
"hideTicks": false,
|
|
20
|
+
"size": "75",
|
|
21
|
+
"gridLines": false,
|
|
22
|
+
"label": "Value Axis",
|
|
23
|
+
"numTicks": "6"
|
|
24
|
+
},
|
|
25
|
+
"barThickness": 0.35,
|
|
26
|
+
"height": "400",
|
|
27
|
+
"xAxis": {
|
|
28
|
+
"type": "categorical",
|
|
29
|
+
"hideAxis": false,
|
|
30
|
+
"hideLabel": false,
|
|
31
|
+
"hideTicks": false,
|
|
32
|
+
"size": "56",
|
|
33
|
+
"tickRotation": "0",
|
|
34
|
+
"max": "15000",
|
|
35
|
+
"dataKey": "Age Group",
|
|
36
|
+
"label": "Age Group"
|
|
37
|
+
},
|
|
38
|
+
"table": {
|
|
39
|
+
"label": "Data Table",
|
|
40
|
+
"expanded": false,
|
|
41
|
+
"show": true,
|
|
42
|
+
"indexLabel": "Region"
|
|
43
|
+
},
|
|
44
|
+
"orientation": "horizontal",
|
|
45
|
+
"legend": {
|
|
46
|
+
"behavior": "isolate",
|
|
47
|
+
"position": "right",
|
|
48
|
+
"reverseLabelOrder": false,
|
|
49
|
+
"hide": false,
|
|
50
|
+
"label": "Region "
|
|
51
|
+
},
|
|
52
|
+
"exclusions": {
|
|
53
|
+
"active": false,
|
|
54
|
+
"keys": []
|
|
55
|
+
},
|
|
56
|
+
"palette": "qualitative-soft",
|
|
57
|
+
"isPaletteReversed": false,
|
|
58
|
+
"labels": false,
|
|
59
|
+
"dataFormat": {
|
|
60
|
+
"commas": true,
|
|
61
|
+
"suffix": " per 100k"
|
|
62
|
+
},
|
|
63
|
+
"confidenceKeys": {},
|
|
64
|
+
"data": [
|
|
65
|
+
{
|
|
66
|
+
"Region": "West Coast",
|
|
67
|
+
"Age Group": "<15",
|
|
68
|
+
"Cases Per 100K": "7428"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"Region": "West Coast",
|
|
72
|
+
"Age Group": "15-24",
|
|
73
|
+
"Cases Per 100K": "5176"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"Region": "West Coast",
|
|
77
|
+
"Age Group": "25-34",
|
|
78
|
+
"Cases Per 100K": "5624"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"Region": "West Coast",
|
|
82
|
+
"Age Group": "35-44",
|
|
83
|
+
"Cases Per 100K": "10756"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"Region": "West Coast",
|
|
87
|
+
"Age Group": "45-54",
|
|
88
|
+
"Cases Per 100K": "8256"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"Region": "West Coast",
|
|
92
|
+
"Age Group": "55-64",
|
|
93
|
+
"Cases Per 100K": "1235"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"Region": "West Coast",
|
|
97
|
+
"Age Group": "65+",
|
|
98
|
+
"Cases Per 100K": "730"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"Region": "East Coast",
|
|
102
|
+
"Age Group": "<15",
|
|
103
|
+
"Cases Per 100K": "5714"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"Region": "East Coast",
|
|
107
|
+
"Age Group": "15-24",
|
|
108
|
+
"Cases Per 100K": "3588"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"Region": "East Coast",
|
|
112
|
+
"Age Group": "25-34",
|
|
113
|
+
"Cases Per 100K": "3410"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"Region": "East Coast",
|
|
117
|
+
"Age Group": "35-44",
|
|
118
|
+
"Cases Per 100K": "7478"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"Region": "East Coast",
|
|
122
|
+
"Age Group": "45-54",
|
|
123
|
+
"Cases Per 100K": "5633"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"Region": "East Coast",
|
|
127
|
+
"Age Group": "55-64",
|
|
128
|
+
"Cases Per 100K": "810"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"Region": "East Coast",
|
|
132
|
+
"Age Group": "65+",
|
|
133
|
+
"Cases Per 100K": "402"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"dataFileName": "Paired-Bar-Chart-Example-Data.csv",
|
|
137
|
+
"dataFileSourceType": "file",
|
|
138
|
+
"dataDescription": {
|
|
139
|
+
"horizontal": false,
|
|
140
|
+
"series": true,
|
|
141
|
+
"singleRow": false,
|
|
142
|
+
"seriesKey": "Region",
|
|
143
|
+
"xKey": "Age Group",
|
|
144
|
+
"valueKey": "Cases Per 100K"
|
|
145
|
+
},
|
|
146
|
+
"formattedData": [
|
|
147
|
+
{
|
|
148
|
+
"Age Group": "<15",
|
|
149
|
+
"West Coast": "7428",
|
|
150
|
+
"East Coast": "5714"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"Age Group": "15-24",
|
|
154
|
+
"West Coast": "5176",
|
|
155
|
+
"East Coast": "3588"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"Age Group": "25-34",
|
|
159
|
+
"West Coast": "5624",
|
|
160
|
+
"East Coast": "3410"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"Age Group": "35-44",
|
|
164
|
+
"West Coast": "10756",
|
|
165
|
+
"East Coast": "7478"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"Age Group": "45-54",
|
|
169
|
+
"West Coast": "8256",
|
|
170
|
+
"East Coast": "5633"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"Age Group": "55-64",
|
|
174
|
+
"West Coast": "1235",
|
|
175
|
+
"East Coast": "810"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"Age Group": "65+",
|
|
179
|
+
"West Coast": "730",
|
|
180
|
+
"East Coast": "402"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"visualizationType": "Paired Bar",
|
|
184
|
+
"series": [
|
|
185
|
+
{
|
|
186
|
+
"dataKey": "West Coast",
|
|
187
|
+
"type": "Bar"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"dataKey": "East Coast",
|
|
191
|
+
"type": "Bar"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"filters": [],
|
|
195
|
+
"barHeight": "23"
|
|
196
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"title": "Planet Radius (Combo Example)",
|
|
3
|
+
"dataUrl": "/examples/planet-example-data.json",
|
|
4
|
+
"animate": true,
|
|
5
|
+
"animateReplay": true,
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
7
|
+
"visualizationType": "Bar",
|
|
8
|
+
"visualizationSubType": "horizontal",
|
|
9
|
+
"isLollipopChart": false,
|
|
10
|
+
"barHasBorder": "true",
|
|
11
|
+
"series": [{ "dataKey": "Radius" }, { "dataKey": "Diameter" }],
|
|
12
|
+
"fontSize": "small",
|
|
13
|
+
"dataFormat": {
|
|
14
|
+
"roundTo": 1,
|
|
15
|
+
"commas": false,
|
|
16
|
+
"prefix": "",
|
|
17
|
+
"suffix": "km"
|
|
18
|
+
},
|
|
19
|
+
"padding": {
|
|
20
|
+
"left": 0,
|
|
21
|
+
"right": 0
|
|
22
|
+
},
|
|
23
|
+
"yAxis": {
|
|
24
|
+
"label": "Measurement (1000km)",
|
|
25
|
+
"displayNumbersOnBar": false,
|
|
26
|
+
"labelPlacement": "On Date/Category Axis"
|
|
27
|
+
},
|
|
28
|
+
"xAxis": {
|
|
29
|
+
"label": "Planet",
|
|
30
|
+
"dataKey": "name",
|
|
31
|
+
"size": 75
|
|
32
|
+
},
|
|
33
|
+
"table": {
|
|
34
|
+
"label": "Data Table",
|
|
35
|
+
"expanded": false
|
|
36
|
+
},
|
|
37
|
+
"lollipopShape": "circle"
|
|
38
38
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
2
|
+
"title": "Planet Radius (Bar Example)",
|
|
3
|
+
"dataUrl": "/examples/planet-example-data.json",
|
|
4
|
+
"visualizationType": "Bar",
|
|
5
|
+
"visualizationSubType": "stacked",
|
|
6
|
+
"series": [{ "dataKey": "Radius" }],
|
|
7
|
+
"fontSize": "medium",
|
|
8
|
+
"dataCutoff": "0.5",
|
|
9
|
+
"orientation": "horizontal",
|
|
10
|
+
"dataFormat": {
|
|
11
|
+
"roundTo": 1,
|
|
12
|
+
"commas": false,
|
|
13
|
+
"prefix": "",
|
|
14
|
+
"suffix": "km"
|
|
15
|
+
},
|
|
16
|
+
"padding": {
|
|
17
|
+
"left": 5,
|
|
18
|
+
"right": 5
|
|
19
|
+
},
|
|
20
|
+
"yAxis": {
|
|
21
|
+
"label": "Measurement (1000km)"
|
|
22
|
+
},
|
|
23
|
+
"xAxis": {
|
|
24
|
+
"label": "Planet",
|
|
25
|
+
"dataKey": "name",
|
|
26
|
+
"tickRotation": 30
|
|
27
|
+
},
|
|
28
|
+
"legend": {
|
|
29
|
+
"hide": false
|
|
30
|
+
},
|
|
31
|
+
"table": {
|
|
32
|
+
"label": "Data Table",
|
|
33
|
+
"expanded": false
|
|
34
|
+
},
|
|
35
|
+
"displayNumbersOnBar": true
|
|
36
36
|
}
|