@cdc/chart 4.23.6 → 4.23.8

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 (48) hide show
  1. package/dist/cdcchart.js +29981 -29995
  2. package/examples/feature/__data__/area-chart-date-apple.json +5122 -0
  3. package/examples/feature/__data__/city-temperature.json +2198 -0
  4. package/examples/feature/__data__/planet-example-data.json +1 -1
  5. package/examples/feature/area/area-chart-category.json +45 -45
  6. package/examples/feature/area/area-chart-date-apple.json +10376 -0
  7. package/examples/feature/area/area-chart-date-city-temperature.json +4528 -0
  8. package/examples/feature/area/area-chart-date.json +111 -3
  9. package/examples/feature/combo/right-issues.json +1 -1
  10. package/examples/feature/forecasting/combo-forecasting.json +72 -46
  11. package/examples/feature/forecasting/effective_reproduction.json +57 -8
  12. package/examples/feature/forecasting/forecasting.json +12 -3
  13. package/examples/feature/forest-plot/broken.json +700 -0
  14. package/examples/feature/forest-plot/data.csv +24 -0
  15. package/examples/feature/forest-plot/forest-plot.json +717 -0
  16. package/examples/feature/line/line-chart.json +11 -11
  17. package/examples/feature/pie/planet-pie-example-config.json +1 -1
  18. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-categorical.json +167 -20
  19. package/examples/private/confidence_interval_test.json +248 -0
  20. package/examples/private/tooltip-issue.json +45275 -0
  21. package/index.html +13 -11
  22. package/package.json +4 -3
  23. package/src/CdcChart.jsx +78 -27
  24. package/src/components/AreaChart.jsx +65 -151
  25. package/src/components/BarChart.Horizontal.jsx +251 -0
  26. package/src/components/BarChart.StackedHorizontal.jsx +118 -0
  27. package/src/components/BarChart.StackedVertical.jsx +93 -0
  28. package/src/components/BarChart.Vertical.jsx +204 -0
  29. package/src/components/BarChart.jsx +17 -667
  30. package/src/components/BarChartType.jsx +15 -0
  31. package/src/components/BrushHandle.jsx +17 -0
  32. package/src/components/DataTable.jsx +67 -22
  33. package/src/components/EditorPanel.jsx +426 -358
  34. package/src/components/Forecasting.jsx +23 -86
  35. package/src/components/ForestPlot.jsx +191 -0
  36. package/src/components/ForestPlotSettings.jsx +508 -0
  37. package/src/components/Legend.jsx +10 -8
  38. package/src/components/LineChart.jsx +31 -6
  39. package/src/components/LinearChart.jsx +317 -230
  40. package/src/components/Series.jsx +40 -4
  41. package/src/data/initial-state.js +50 -3
  42. package/src/hooks/useBarChart.js +186 -0
  43. package/src/hooks/useEditorPermissions.js +218 -0
  44. package/src/hooks/useMinMax.js +18 -5
  45. package/src/hooks/useRightAxis.js +2 -1
  46. package/src/hooks/useScales.js +45 -2
  47. package/src/hooks/useTooltip.jsx +407 -0
  48. package/src/scss/main.scss +11 -17
@@ -36,7 +36,7 @@
36
36
  "rightAxisTickLabelColor": "#333",
37
37
  "rightAxisTickColor": "#333",
38
38
  "isLegendValue": false,
39
- "numTicks": "",
39
+ "numTicks": "4",
40
40
  "label": "Y Axis Example Label"
41
41
  },
42
42
  "topAxis": {
@@ -103,6 +103,60 @@
103
103
  "Data 5": "220",
104
104
  "Data 6": "300",
105
105
  "Date": "6/15/2016"
106
+ },
107
+ {
108
+ "Date": "7/15/2016",
109
+ "Data 1": "900",
110
+ "Data 2": "235",
111
+ "Data 3": "300",
112
+ "Data 4": "195",
113
+ "Data 5": "120",
114
+ "Data 6": "610"
115
+ },
116
+ {
117
+ "Date": "8/15/2016",
118
+ "Data 1": "3000",
119
+ "Data 2": "900",
120
+ "Data 3": "540",
121
+ "Data 4": "600",
122
+ "Data 5": "120",
123
+ "Data 6": "200"
124
+ },
125
+ {
126
+ "Date": "9/15/2016",
127
+ "Data 1": "700",
128
+ "Data 2": "200",
129
+ "Data 3": "590",
130
+ "Data 4": "900",
131
+ "Data 5": "400",
132
+ "Data 6": "650"
133
+ },
134
+ {
135
+ "Date": "10/15/2016",
136
+ "Data 1": "2200",
137
+ "Data 2": "360",
138
+ "Data 3": "930",
139
+ "Data 4": "880",
140
+ "Data 5": "760",
141
+ "Data 6": "420"
142
+ },
143
+ {
144
+ "Date": "11/15/2016",
145
+ "Data 1": "5000",
146
+ "Data 2": "1350",
147
+ "Data 3": "300",
148
+ "Data 4": "1150",
149
+ "Data 5": "230",
150
+ "Data 6": "600"
151
+ },
152
+ {
153
+ "Date": "12/15/2016",
154
+ "Data 1": "6000",
155
+ "Data 2": "3220",
156
+ "Data 3": "540",
157
+ "Data 4": "300",
158
+ "Data 5": "720",
159
+ "Data 6": "3000"
106
160
  }
107
161
  ],
108
162
  "heights": {
@@ -125,7 +179,7 @@
125
179
  "tickLabelColor": "#333",
126
180
  "tickColor": "#333",
127
181
  "isLegendValue": false,
128
- "numTicks": "9",
182
+ "numTicks": "6",
129
183
  "dataKey": "Date",
130
184
  "label": "X Axis Example Label",
131
185
  "dateParseFormat": "%m/%d/%Y",
@@ -230,6 +284,60 @@
230
284
  "Data 4": "100",
231
285
  "Data 5": "220",
232
286
  "Data 6": "300"
287
+ },
288
+ {
289
+ "Date": "7/15/2016",
290
+ "Data 1": "900",
291
+ "Data 2": "235",
292
+ "Data 3": "300",
293
+ "Data 4": "195",
294
+ "Data 5": "120",
295
+ "Data 6": "610"
296
+ },
297
+ {
298
+ "Date": "8/15/2016",
299
+ "Data 1": "3000",
300
+ "Data 2": "900",
301
+ "Data 3": "540",
302
+ "Data 4": "600",
303
+ "Data 5": "120",
304
+ "Data 6": "200"
305
+ },
306
+ {
307
+ "Date": "9/15/2016",
308
+ "Data 1": "700",
309
+ "Data 2": "200",
310
+ "Data 3": "590",
311
+ "Data 4": "900",
312
+ "Data 5": "400",
313
+ "Data 6": "650"
314
+ },
315
+ {
316
+ "Date": "10/15/2016",
317
+ "Data 1": "2200",
318
+ "Data 2": "360",
319
+ "Data 3": "930",
320
+ "Data 4": "880",
321
+ "Data 5": "760",
322
+ "Data 6": "420"
323
+ },
324
+ {
325
+ "Date": "11/15/2016",
326
+ "Data 1": "5000",
327
+ "Data 2": "1350",
328
+ "Data 3": "300",
329
+ "Data 4": "1150",
330
+ "Data 5": "230",
331
+ "Data 6": "600"
332
+ },
333
+ {
334
+ "Date": "12/15/2016",
335
+ "Data 1": "6000",
336
+ "Data 2": "3220",
337
+ "Data 3": "540",
338
+ "Data 4": "300",
339
+ "Data 5": "720",
340
+ "Data 6": "3000"
233
341
  }
234
342
  ],
235
343
  "visualizationType": "Area Chart",
@@ -241,4 +349,4 @@
241
349
  ],
242
350
  "description": "This example shows a bar chart created in the visualization editor in WCMS",
243
351
  "dataCutoff": "0"
244
- }
352
+ }
@@ -176,7 +176,7 @@
176
176
  "series": [
177
177
  {
178
178
  "dataKey": "Radius",
179
- "type": "Bar"
179
+ "type": "Line"
180
180
  },
181
181
  {
182
182
  "dataKey": "Diameter",
@@ -2,6 +2,7 @@
2
2
  "type": "chart",
3
3
  "title": "Forecasting Chart Example",
4
4
  "showTitle": true,
5
+ "showDownloadMediaButton": false,
5
6
  "theme": "theme-blue",
6
7
  "animate": true,
7
8
  "fontSize": "medium",
@@ -14,6 +15,10 @@
14
15
  "barStyle": "",
15
16
  "roundingStyle": "standard",
16
17
  "tipRounding": "top",
18
+ "isResponsiveTicks": false,
19
+ "general": {
20
+ "showDownloadButton": false
21
+ },
17
22
  "padding": {
18
23
  "left": 0,
19
24
  "right": 0
@@ -41,7 +46,11 @@
41
46
  "numTicks": "",
42
47
  "axisPadding": 0,
43
48
  "tickRotation": 0,
44
- "anchors": [],
49
+ "anchors": [
50
+ {
51
+ "value": "10/15/2022"
52
+ }
53
+ ],
45
54
  "label": "Cases by Date of Report"
46
55
  },
47
56
  "boxplot": {
@@ -84,6 +93,12 @@
84
93
  "horizontal": 750
85
94
  },
86
95
  "xAxis": {
96
+ "anchors": [
97
+ {
98
+ "value": "500",
99
+ "lineStyle": "dashed-md"
100
+ }
101
+ ],
87
102
  "type": "date",
88
103
  "showTargetLabel": true,
89
104
  "targetLabel": "Target",
@@ -101,12 +116,7 @@
101
116
  "labelOffset": 65,
102
117
  "axisPadding": 0,
103
118
  "target": 0,
104
- "anchors": [
105
- {
106
- "value": "10/19/2022",
107
- "lineStyle": "dashed-md"
108
- }
109
- ],
119
+ "maxTickRotation": 0,
110
120
  "label": "",
111
121
  "dataKey": "date",
112
122
  "dateParseFormat": "%m/%d/%Y",
@@ -120,9 +130,14 @@
120
130
  "caption": "",
121
131
  "showDownloadUrl": false,
122
132
  "showDataTableLink": true,
133
+ "indexLabel": "",
134
+ "download": false,
135
+ "showVertical": false,
123
136
  "show": true
124
137
  },
125
138
  "orientation": "vertical",
139
+ "color": "pinkpurple",
140
+ "columns": {},
126
141
  "legend": {
127
142
  "behavior": "isolate",
128
143
  "singleRow": false,
@@ -162,49 +177,19 @@
162
177
  "visual": {
163
178
  "border": true,
164
179
  "accent": true,
165
- "background": true
180
+ "background": true,
181
+ "verticalHoverLine": false,
182
+ "horizontalHoverLine": false
166
183
  },
184
+ "useLogScale": false,
167
185
  "filterBehavior": "Filter Change",
168
- "forecastingChart": {
169
- "showBars": false,
170
- "barColumn": "confirm",
171
- "barColor": "#918e90",
172
- "confidenceIntervals": [
173
- {
174
- "low": "lower_20",
175
- "high": "upper_20"
176
- },
177
- {
178
- "low": "lower_50",
179
- "high": "upper_50"
180
- },
181
- {
182
- "low": "lower_90",
183
- "high": "upper_90"
184
- },
185
- {}
186
- ],
187
- "stages": "type",
188
- "colors": [
189
- "sequential-greenreverse",
190
- "sequential-orange-(MPX)reverse",
191
- "sequential-blue-2-(MPX)reverse"
192
- ],
193
- "groups": [
194
- "estimate",
195
- "estimate based on partial data",
196
- "forecast"
197
- ],
198
- "showBarColumn": true
199
- },
200
- "dataUrl": "./examples/feature/forecasting/case_date_example.csv",
201
- "animateReplay": true,
202
- "visualizationType": "Combo",
186
+ "highlightedBarValues": [],
203
187
  "series": [
204
188
  {
205
189
  "dataKey": "confirm",
206
190
  "type": "Bar",
207
- "axis": "Left"
191
+ "axis": "Left",
192
+ "tooltip": true
208
193
  },
209
194
  {
210
195
  "dataKey": "type",
@@ -239,7 +224,48 @@
239
224
  "key": "forecast",
240
225
  "color": "sequential-blue"
241
226
  }
242
- ]
227
+ ],
228
+ "tooltip": true
243
229
  }
244
- ]
230
+ ],
231
+ "tooltips": {
232
+ "opacity": 90
233
+ },
234
+ "forecastingChart": {
235
+ "showBars": false,
236
+ "barColumn": "confirm",
237
+ "barColor": "#918e90",
238
+ "confidenceIntervals": [
239
+ {
240
+ "low": "lower_20",
241
+ "high": "upper_20"
242
+ },
243
+ {
244
+ "low": "lower_50",
245
+ "high": "upper_50"
246
+ },
247
+ {
248
+ "low": "lower_90",
249
+ "high": "upper_90"
250
+ },
251
+ {}
252
+ ],
253
+ "stages": "type",
254
+ "colors": [
255
+ "sequential-greenreverse",
256
+ "sequential-orange-(MPX)reverse",
257
+ "sequential-blue-2-(MPX)reverse"
258
+ ],
259
+ "groups": [
260
+ "estimate",
261
+ "estimate based on partial data",
262
+ "forecast"
263
+ ],
264
+ "showBarColumn": true
265
+ },
266
+ "dataUrl": "./examples/feature/forecasting/case_date_example.csv",
267
+ "animateReplay": true,
268
+ "visualizationType": "Combo",
269
+ "validated": 4.23,
270
+ "dynamicMarginTop": 0
245
271
  }
@@ -2,6 +2,7 @@
2
2
  "type": "chart",
3
3
  "title": "Forecasting Chart Example",
4
4
  "showTitle": true,
5
+ "showDownloadMediaButton": false,
5
6
  "theme": "theme-blue",
6
7
  "animate": true,
7
8
  "fontSize": "medium",
@@ -14,6 +15,10 @@
14
15
  "barStyle": "",
15
16
  "roundingStyle": "standard",
16
17
  "tipRounding": "top",
18
+ "isResponsiveTicks": false,
19
+ "general": {
20
+ "showDownloadButton": false
21
+ },
17
22
  "padding": {
18
23
  "left": 0,
19
24
  "right": 0
@@ -84,6 +89,12 @@
84
89
  "horizontal": 750
85
90
  },
86
91
  "xAxis": {
92
+ "anchors": [
93
+ {
94
+ "value": "10/19/2022",
95
+ "lineStyle": "dashed-md"
96
+ }
97
+ ],
87
98
  "type": "date",
88
99
  "showTargetLabel": true,
89
100
  "targetLabel": "Target",
@@ -101,12 +112,7 @@
101
112
  "labelOffset": 65,
102
113
  "axisPadding": 0,
103
114
  "target": 0,
104
- "anchors": [
105
- {
106
- "value": "10/19/2022",
107
- "lineStyle": "dashed-md"
108
- }
109
- ],
115
+ "maxTickRotation": 0,
110
116
  "label": "",
111
117
  "dataKey": "date",
112
118
  "dateParseFormat": "%m/%d/%Y",
@@ -120,9 +126,14 @@
120
126
  "caption": "",
121
127
  "showDownloadUrl": false,
122
128
  "showDataTableLink": true,
129
+ "indexLabel": "",
130
+ "download": false,
131
+ "showVertical": false,
123
132
  "show": true
124
133
  },
125
134
  "orientation": "vertical",
135
+ "color": "pinkpurple",
136
+ "columns": {},
126
137
  "legend": {
127
138
  "behavior": "isolate",
128
139
  "singleRow": false,
@@ -162,9 +173,45 @@
162
173
  "visual": {
163
174
  "border": true,
164
175
  "accent": true,
165
- "background": true
176
+ "background": true,
177
+ "verticalHoverLine": false,
178
+ "horizontalHoverLine": false
166
179
  },
180
+ "useLogScale": false,
167
181
  "filterBehavior": "Filter Change",
182
+ "highlightedBarValues": [],
183
+ "series": [
184
+ {
185
+ "dataKey": "type",
186
+ "type": "Forecasting",
187
+ "stages": [
188
+ {
189
+ "key": "estimate",
190
+ "color": "qualitative1reverse"
191
+ },
192
+ {
193
+ "key": "estimate based on partial data",
194
+ "color": "qualitative1"
195
+ },
196
+ {
197
+ "key": "forecast",
198
+ "color": "sequential-orange-(MPX)reverse"
199
+ }
200
+ ],
201
+ "stageColumn": "type",
202
+ "axis": "Left",
203
+ "tooltip": true,
204
+ "confidenceIntervals": [
205
+ {
206
+ "high": "upper_90",
207
+ "low": "lower_90"
208
+ }
209
+ ]
210
+ }
211
+ ],
212
+ "tooltips": {
213
+ "opacity": 90
214
+ },
168
215
  "forecastingChart": {
169
216
  "showBars": false,
170
217
  "barColumn": "confirm",
@@ -198,5 +245,7 @@
198
245
  },
199
246
  "dataUrl": "./examples/feature/forecasting/r_data.csv",
200
247
  "animateReplay": true,
201
- "visualizationType": "Forecasting"
248
+ "visualizationType": "Forecasting",
249
+ "validated": 4.23,
250
+ "dynamicMarginTop": 0
202
251
  }
@@ -15,6 +15,7 @@
15
15
  "barStyle": "",
16
16
  "roundingStyle": "standard",
17
17
  "tipRounding": "top",
18
+ "isResponsiveTicks": false,
18
19
  "general": {
19
20
  "showDownloadButton": false
20
21
  },
@@ -30,6 +31,8 @@
30
31
  "size": 50,
31
32
  "gridLines": false,
32
33
  "enablePadding": false,
34
+ "min": "",
35
+ "max": "",
33
36
  "labelColor": "#333",
34
37
  "tickLabelColor": "#333",
35
38
  "tickColor": "#333",
@@ -105,6 +108,7 @@
105
108
  "labelOffset": 65,
106
109
  "axisPadding": 0,
107
110
  "target": 0,
111
+ "maxTickRotation": 0,
108
112
  "dataKey": "date",
109
113
  "dateParseFormat": "%m/%d/%Y",
110
114
  "dateDisplayFormat": "%m/%d/%Y"
@@ -184,11 +188,11 @@
184
188
  },
185
189
  {
186
190
  "key": "quarter three",
187
- "color": "qualitative1reverse"
191
+ "color": "qualitative-softreverse"
188
192
  },
189
193
  {
190
194
  "key": "quarter four",
191
- "color": "qualitative1reverse"
195
+ "color": "qualitative4reverse"
192
196
  }
193
197
  ],
194
198
  "stageColumn": "quarter",
@@ -200,6 +204,9 @@
200
204
  ]
201
205
  }
202
206
  ],
207
+ "tooltips": {
208
+ "opacity": 90
209
+ },
203
210
  "datasets": {},
204
211
  "visualizationType": "Forecasting",
205
212
  "data": [
@@ -5321,5 +5328,7 @@
5321
5328
  "dataDescription": {
5322
5329
  "horizontal": false,
5323
5330
  "series": false
5324
- }
5331
+ },
5332
+ "validated": 4.23,
5333
+ "dynamicMarginTop": 0
5325
5334
  }