@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.
Files changed (80) hide show
  1. package/README.md +5 -5
  2. package/dist/495.js +3 -0
  3. package/dist/703.js +1 -0
  4. package/dist/cdcchart.js +723 -6
  5. package/examples/age-adjusted-rates.json +1486 -1218
  6. package/examples/box-plot-data.json +71 -0
  7. package/examples/box-plot.csv +5 -0
  8. package/examples/{private/yaxis-test.json → box-plot.json} +46 -54
  9. package/examples/case-rate-example-config.json +1 -1
  10. package/examples/covid-confidence-example-config.json +33 -33
  11. package/examples/covid-example-config.json +34 -34
  12. package/examples/covid-example-data-confidence.json +30 -30
  13. package/examples/covid-example-data.json +20 -20
  14. package/examples/cutoff-example-config.json +36 -36
  15. package/examples/cutoff-example-data.json +36 -36
  16. package/examples/date-exclusions-config.json +1 -1
  17. package/examples/dynamic-legends.json +124 -124
  18. package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart-with-numbers-on-bar.json +191 -197
  19. package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart.json +230 -240
  20. package/examples/gallery/bar-chart-horizontal/horizontal-stacked.json +239 -247
  21. package/examples/gallery/bar-chart-vertical/combo-line-chart.json +138 -136
  22. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-categorical.json +79 -79
  23. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-stacked.json +80 -80
  24. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-with-confidence.json +67 -67
  25. package/examples/gallery/bar-chart-vertical/vertical-bar-chart.json +179 -110
  26. package/examples/gallery/lollipop/lollipop-style-horizontal.json +215 -219
  27. package/examples/gallery/paired-bar/paired-bar-chart.json +195 -195
  28. package/examples/horizontal-chart.json +35 -35
  29. package/examples/horizontal-stacked-bar-chart.json +34 -34
  30. package/examples/line-chart.json +75 -75
  31. package/examples/new-data.csv +17 -0
  32. package/examples/newdata.json +90 -0
  33. package/examples/paired-bar-data.json +16 -14
  34. package/examples/paired-bar-example.json +48 -48
  35. package/examples/paired-bar-formatted.json +36 -36
  36. package/examples/planet-chart-horizontal-example-config.json +33 -33
  37. package/examples/planet-combo-example-config.json +34 -31
  38. package/examples/planet-example-config.json +35 -33
  39. package/examples/planet-example-data.json +56 -56
  40. package/examples/planet-pie-example-config.json +28 -28
  41. package/examples/stacked-vertical-bar-example.json +1 -1
  42. package/examples/temp-example-config.json +61 -54
  43. package/examples/temp-example-data.json +1 -1
  44. package/package.json +3 -2
  45. package/src/CdcChart.tsx +449 -434
  46. package/src/components/BarChart.tsx +383 -497
  47. package/src/components/BoxPlot.js +92 -0
  48. package/src/components/DataTable.tsx +182 -197
  49. package/src/components/EditorPanel.js +1068 -722
  50. package/src/components/Filters.js +131 -0
  51. package/src/components/Legend.js +286 -329
  52. package/src/components/LineChart.tsx +143 -81
  53. package/src/components/LinearChart.tsx +432 -451
  54. package/src/components/PairedBarChart.tsx +197 -213
  55. package/src/components/PieChart.tsx +105 -151
  56. package/src/components/SparkLine.js +179 -201
  57. package/src/components/useIntersectionObserver.tsx +19 -20
  58. package/src/context.tsx +3 -3
  59. package/src/data/initial-state.js +44 -17
  60. package/src/hooks/useActiveElement.js +13 -13
  61. package/src/hooks/useChartClasses.js +34 -28
  62. package/src/hooks/useColorPalette.ts +56 -63
  63. package/src/hooks/useLegendClasses.js +18 -10
  64. package/src/hooks/useReduceData.ts +64 -77
  65. package/src/hooks/useRightAxis.js +25 -0
  66. package/src/hooks/useTopAxis.js +6 -0
  67. package/src/index.html +19 -19
  68. package/src/index.tsx +13 -16
  69. package/src/scss/DataTable.scss +6 -5
  70. package/src/scss/editor-panel.scss +71 -69
  71. package/src/scss/main.scss +188 -114
  72. package/src/scss/variables.scss +1 -1
  73. package/examples/private/line-test-data.json +0 -22
  74. package/examples/private/line-test-two.json +0 -216
  75. package/examples/private/line-test.json +0 -102
  76. package/examples/private/newtest.csv +0 -101
  77. package/examples/private/shawn.json +0 -1296
  78. package/examples/private/test.json +0 -10124
  79. package/examples/private/yaxis-testing.csv +0 -27
  80. package/examples/private/yaxis.json +0 -28
@@ -1,241 +1,231 @@
1
1
  {
2
- "type": "chart",
3
- "title": "Example Horizontal Bar Chart",
4
- "theme": "theme-teal",
5
- "fontSize": "small",
6
- "lineDatapointStyle": "hover",
7
- "barHasBorder": "false",
8
- "padding": {
9
- "left": 5,
10
- "right": 5
11
- },
12
- "yAxis": {
13
- "size": 50,
14
- "gridLines": false,
15
- "type": "chart",
16
- "title": "Example Horizontal Bar Chart",
17
- "theme": "theme-teal",
18
- "fontSize": "small",
19
- "lineDatapointStyle": "hover",
20
- "barHasBorder": "false",
21
- "padding": {
22
- "left": 5,
23
- "right": 5
24
- },
25
- "yAxis": {
26
- "size": 50,
27
- "gridLines": false,
28
- "label": "X-Axis Example Label",
29
- "numTicks": "10"
30
- },
31
- "barThickness": "0.7",
32
- "height": 560,
33
- "xAxis": {
34
- "type": "categorical",
35
- "size": "0",
36
- "tickRotation": 0,
37
- "dataKey": "Group",
38
- "label": ""
39
- },
40
- "table": {
41
- "label": "Data Table",
42
- "expanded": true,
43
- "download": false,
44
- "show": true
45
- },
46
- "legend": {
47
- "behavior": "isolate",
48
- "position": "right",
49
- "label": "Type of Data"
50
- },
51
- "exclusions": {
52
- "active": false,
53
- "keys": []
54
- },
55
- "palette": "qualitative-soft",
56
- "labels": false,
57
- "dataFormat": {},
58
- "confidenceKeys": {},
59
- "data": [
60
- {
61
- "Group": "Combined Total of Group A",
62
- "Vehicle": "100",
63
- "Home": "120",
64
- "Work": "140",
65
- "Office": "120"
66
- },
67
- {
68
- "Group": "Combined Total of Group B",
69
- "Vehicle": "150",
70
- "Home": "140",
71
- "Work": "100",
72
- "Office": "90"
73
- },
74
- {
75
- "Group": "Combined Total of Group C",
76
- "Vehicle": "90",
77
- "Home": "90",
78
- "Work": "80",
79
- "Office": "80"
80
- },
81
- {
82
- "Group": "Combined Total of Group D",
83
- "Vehicle": "70",
84
- "Home": "60",
85
- "Work": "50",
86
- "Office": "70"
87
- }
88
- ],
89
- "visualizationType": "Bar",
90
- "visualizationSubType": "horizontal",
91
- "series": [
92
- {
93
- "dataKey": "Vehicle",
94
- "type": "Bar"
95
- },
96
- {
97
- "dataKey": "Home",
98
- "type": "Bar"
99
- },
100
- {
101
- "dataKey": "Work",
102
- "type": "Bar"
103
- },
104
- {
105
- "dataKey": "Office",
106
- "type": "Bar"
107
- }
108
- ],
109
- "description": "This example shows a horizontal bar chart created in the visualization editor in WCMS",
110
- "runtime": {
111
- "seriesLabels": {
112
- "Vehicle": "Vehicle",
113
- "Home": "Home",
114
- "Work": "Work",
115
- "Office": "Office"
116
- },
117
- "seriesLabelsAll": [
118
- "Vehicle",
119
- "Home",
120
- "Work",
121
- "Office"
122
- ],
123
- "originalXAxis": {
124
- "type": "categorical",
125
- "size": "0",
126
- "tickRotation": 0,
127
- "dataKey": "Group",
128
- "label": ""
129
- },
130
- "seriesKeys": [
131
- "Vehicle",
132
- "Home",
133
- "Work",
134
- "Office"
135
- ],
136
- "xAxis": {
137
- "size": 50,
138
- "gridLines": false,
139
- "label": "X-Axis Example Label",
140
- "numTicks": "10"
141
- },
142
- "yAxis": {
143
- "type": "categorical",
144
- "size": "0",
145
- "tickRotation": 0,
146
- "dataKey": "Group",
147
- "label": ""
148
- },
149
- "horizontal": true,
150
- "uniqueId": 1644353484184,
151
- "editorErrorMessage": ""
152
- },
153
- "barPadding": 40,
154
- "barHeight": 25,
155
- "labelPlacement": "Below Bar",
156
- "label": "Accidents"
157
- },
158
- "barThickness": "0.7",
159
- "height": 560,
160
- "xAxis": {
161
- "type": "categorical",
162
- "size": "0",
163
- "tickRotation": 0,
164
- "dataKey": "Group",
165
- "label": ""
166
- },
167
- "table": {
168
- "label": "Data Table",
169
- "expanded": true,
170
- "download": false,
171
- "show": true
172
- },
173
- "legend": {
174
- "behavior": "isolate",
175
- "position": "right",
176
- "label": "Location"
177
- },
178
- "exclusions": {
179
- "active": false,
180
- "keys": []
181
- },
182
- "palette": "qualitative-soft",
183
- "labels": false,
184
- "dataFormat": {},
185
- "confidenceKeys": {},
186
- "data": [
187
- {
188
- "Group": "Group A Survey Results",
189
- "Vehicle": "100",
190
- "Home": "120",
191
- "Work": "140",
192
- "Office": "120"
193
- },
194
- {
195
- "Group": "Group B Survey Results",
196
- "Vehicle": "150",
197
- "Home": "140",
198
- "Work": "100",
199
- "Office": "90"
200
- },
201
- {
202
- "Group": "Group C Survey Results",
203
- "Vehicle": "90",
204
- "Home": "90",
205
- "Work": "80",
206
- "Office": "80"
207
- },
208
- {
209
- "Group": "Group D Survey Results",
210
- "Vehicle": "70",
211
- "Home": "60",
212
- "Work": "50",
213
- "Office": "70"
214
- }
215
- ],
216
- "visualizationType": "Bar",
217
- "visualizationSubType": "horizontal",
218
- "series": [
219
- {
220
- "dataKey": "Vehicle",
221
- "type": "Bar"
222
- },
223
- {
224
- "dataKey": "Home",
225
- "type": "Bar"
226
- },
227
- {
228
- "dataKey": "Work",
229
- "type": "Bar"
230
- },
231
- {
232
- "dataKey": "Office",
233
- "type": "Bar"
234
- }
235
- ],
236
- "description": "This example shows a horizontal bar chart created in the visualization editor in WCMS",
237
- "barPadding": 40,
238
- "barHeight": 25,
239
- "dataFileName": "3-CSV_Source_Example_for_Horizontal_Bar_viz - Fixed.csv",
240
- "dataFileSourceType": "file"
241
- }
2
+ "type": "chart",
3
+ "title": "Example Horizontal Bar Chart",
4
+ "theme": "theme-teal",
5
+ "fontSize": "small",
6
+ "lineDatapointStyle": "hover",
7
+ "barHasBorder": "false",
8
+ "padding": {
9
+ "left": 5,
10
+ "right": 5
11
+ },
12
+ "yAxis": {
13
+ "size": 50,
14
+ "gridLines": false,
15
+ "type": "chart",
16
+ "title": "Example Horizontal Bar Chart",
17
+ "theme": "theme-teal",
18
+ "fontSize": "small",
19
+ "lineDatapointStyle": "hover",
20
+ "barHasBorder": "false",
21
+ "padding": {
22
+ "left": 5,
23
+ "right": 5
24
+ },
25
+ "yAxis": {
26
+ "size": 50,
27
+ "gridLines": false,
28
+ "label": "X-Axis Example Label",
29
+ "numTicks": "10"
30
+ },
31
+ "barThickness": "0.7",
32
+ "height": 560,
33
+ "xAxis": {
34
+ "type": "categorical",
35
+ "size": "0",
36
+ "tickRotation": 0,
37
+ "dataKey": "Group",
38
+ "label": ""
39
+ },
40
+ "table": {
41
+ "label": "Data Table",
42
+ "expanded": true,
43
+ "download": false,
44
+ "show": true
45
+ },
46
+ "legend": {
47
+ "behavior": "isolate",
48
+ "position": "right",
49
+ "label": "Type of Data"
50
+ },
51
+ "exclusions": {
52
+ "active": false,
53
+ "keys": []
54
+ },
55
+ "palette": "qualitative-soft",
56
+ "labels": false,
57
+ "dataFormat": {},
58
+ "confidenceKeys": {},
59
+ "data": [
60
+ {
61
+ "Group": "Combined Total of Group A",
62
+ "Vehicle": "100",
63
+ "Home": "120",
64
+ "Work": "140",
65
+ "Office": "120"
66
+ },
67
+ {
68
+ "Group": "Combined Total of Group B",
69
+ "Vehicle": "150",
70
+ "Home": "140",
71
+ "Work": "100",
72
+ "Office": "90"
73
+ },
74
+ {
75
+ "Group": "Combined Total of Group C",
76
+ "Vehicle": "90",
77
+ "Home": "90",
78
+ "Work": "80",
79
+ "Office": "80"
80
+ },
81
+ {
82
+ "Group": "Combined Total of Group D",
83
+ "Vehicle": "70",
84
+ "Home": "60",
85
+ "Work": "50",
86
+ "Office": "70"
87
+ }
88
+ ],
89
+ "visualizationType": "Bar",
90
+ "visualizationSubType": "horizontal",
91
+ "series": [
92
+ {
93
+ "dataKey": "Vehicle",
94
+ "type": "Bar"
95
+ },
96
+ {
97
+ "dataKey": "Home",
98
+ "type": "Bar"
99
+ },
100
+ {
101
+ "dataKey": "Work",
102
+ "type": "Bar"
103
+ },
104
+ {
105
+ "dataKey": "Office",
106
+ "type": "Bar"
107
+ }
108
+ ],
109
+ "description": "This example shows a horizontal bar chart created in the visualization editor in WCMS",
110
+ "runtime": {
111
+ "seriesLabels": {
112
+ "Vehicle": "Vehicle",
113
+ "Home": "Home",
114
+ "Work": "Work",
115
+ "Office": "Office"
116
+ },
117
+ "seriesLabelsAll": ["Vehicle", "Home", "Work", "Office"],
118
+ "originalXAxis": {
119
+ "type": "categorical",
120
+ "size": "0",
121
+ "tickRotation": 0,
122
+ "dataKey": "Group",
123
+ "label": ""
124
+ },
125
+ "seriesKeys": ["Vehicle", "Home", "Work", "Office"],
126
+ "xAxis": {
127
+ "size": 50,
128
+ "gridLines": false,
129
+ "label": "X-Axis Example Label",
130
+ "numTicks": "10"
131
+ },
132
+ "yAxis": {
133
+ "type": "categorical",
134
+ "size": "0",
135
+ "tickRotation": 0,
136
+ "dataKey": "Group",
137
+ "label": ""
138
+ },
139
+ "horizontal": true,
140
+ "uniqueId": 1644353484184,
141
+ "editorErrorMessage": ""
142
+ },
143
+ "barPadding": 40,
144
+ "barHeight": 25,
145
+ "labelPlacement": "Below Bar",
146
+ "label": "Accidents"
147
+ },
148
+ "barThickness": "0.7",
149
+ "height": 560,
150
+ "xAxis": {
151
+ "type": "categorical",
152
+ "size": "0",
153
+ "tickRotation": 0,
154
+ "dataKey": "Group",
155
+ "label": ""
156
+ },
157
+ "table": {
158
+ "label": "Data Table",
159
+ "expanded": true,
160
+ "download": false,
161
+ "show": true
162
+ },
163
+ "legend": {
164
+ "behavior": "isolate",
165
+ "position": "right",
166
+ "label": "Location"
167
+ },
168
+ "exclusions": {
169
+ "active": false,
170
+ "keys": []
171
+ },
172
+ "palette": "qualitative-soft",
173
+ "labels": false,
174
+ "dataFormat": {},
175
+ "confidenceKeys": {},
176
+ "data": [
177
+ {
178
+ "Group": "Group A Survey Results",
179
+ "Vehicle": "100",
180
+ "Home": "120",
181
+ "Work": "140",
182
+ "Office": "120"
183
+ },
184
+ {
185
+ "Group": "Group B Survey Results",
186
+ "Vehicle": "150",
187
+ "Home": "140",
188
+ "Work": "100",
189
+ "Office": "90"
190
+ },
191
+ {
192
+ "Group": "Group C Survey Results",
193
+ "Vehicle": "90",
194
+ "Home": "90",
195
+ "Work": "80",
196
+ "Office": "80"
197
+ },
198
+ {
199
+ "Group": "Group D Survey Results",
200
+ "Vehicle": "70",
201
+ "Home": "60",
202
+ "Work": "50",
203
+ "Office": "70"
204
+ }
205
+ ],
206
+ "visualizationType": "Bar",
207
+ "visualizationSubType": "horizontal",
208
+ "series": [
209
+ {
210
+ "dataKey": "Vehicle",
211
+ "type": "Bar"
212
+ },
213
+ {
214
+ "dataKey": "Home",
215
+ "type": "Bar"
216
+ },
217
+ {
218
+ "dataKey": "Work",
219
+ "type": "Bar"
220
+ },
221
+ {
222
+ "dataKey": "Office",
223
+ "type": "Bar"
224
+ }
225
+ ],
226
+ "description": "This example shows a horizontal bar chart created in the visualization editor in WCMS",
227
+ "barPadding": 40,
228
+ "barHeight": 25,
229
+ "dataFileName": "3-CSV_Source_Example_for_Horizontal_Bar_viz - Fixed.csv",
230
+ "dataFileSourceType": "file"
231
+ }