@cdc/chart 4.24.1 → 4.24.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.
Files changed (58) hide show
  1. package/dist/cdcchart.js +30014 -29757
  2. package/examples/feature/line/line-chart-preliminary.json +84 -37
  3. package/examples/feature/regions/index.json +9 -5
  4. package/index.html +4 -2
  5. package/package.json +2 -2
  6. package/src/CdcChart.tsx +41 -24
  7. package/src/_stories/ChartEditor.stories.tsx +1 -1
  8. package/src/_stories/_mock/pie_config.json +4 -3
  9. package/src/components/AreaChart/components/AreaChart.jsx +1 -25
  10. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +7 -5
  11. package/src/components/BarChart/components/BarChart.Vertical.tsx +12 -13
  12. package/src/components/BoxPlot/BoxPlot.jsx +9 -8
  13. package/src/components/EditorPanel/EditorPanel.tsx +1563 -1959
  14. package/src/components/EditorPanel/EditorPanelContext.ts +40 -0
  15. package/src/components/EditorPanel/components/Panels/Panel.BoxPlot.tsx +148 -0
  16. package/src/components/EditorPanel/components/{Panel.ForestPlotSettings.tsx → Panels/Panel.ForestPlotSettings.tsx} +16 -7
  17. package/src/components/EditorPanel/components/Panels/Panel.General.tsx +160 -0
  18. package/src/components/EditorPanel/components/{Panel.Regions.tsx → Panels/Panel.Regions.tsx} +5 -5
  19. package/src/components/EditorPanel/components/{Panel.Series.tsx → Panels/Panel.Series.tsx} +4 -4
  20. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +297 -0
  21. package/src/components/EditorPanel/components/Panels/index.tsx +17 -0
  22. package/src/components/EditorPanel/editor-panel.scss +1 -13
  23. package/src/components/EditorPanel/useEditorPermissions.js +5 -0
  24. package/src/components/Legend/Legend.Component.tsx +199 -0
  25. package/src/components/Legend/Legend.tsx +5 -324
  26. package/src/components/Legend/helpers/createFormatLabels.tsx +140 -0
  27. package/src/components/LineChart/LineChartProps.ts +1 -1
  28. package/src/components/LineChart/components/LineChart.Circle.tsx +85 -52
  29. package/src/components/LineChart/helpers.ts +2 -2
  30. package/src/components/LineChart/index.tsx +97 -21
  31. package/src/components/LinearChart.jsx +3 -3
  32. package/src/components/PairedBarChart.jsx +4 -2
  33. package/src/components/PieChart/PieChart.tsx +78 -25
  34. package/src/components/Regions/components/Regions.tsx +14 -5
  35. package/src/data/initial-state.js +5 -2
  36. package/src/helpers/computeMarginBottom.ts +2 -2
  37. package/src/hooks/useHighlightedBars.js +1 -1
  38. package/src/hooks/useMinMax.ts +3 -3
  39. package/src/hooks/useScales.ts +18 -5
  40. package/src/hooks/useTooltip.tsx +11 -7
  41. package/src/scss/main.scss +0 -67
  42. package/src/types/ChartConfig.ts +17 -8
  43. package/src/types/ChartContext.ts +10 -4
  44. package/src/types/Label.ts +7 -0
  45. package/examples/private/chart-t.json +0 -3740
  46. package/examples/private/combo.json +0 -369
  47. package/examples/private/epi-data.csv +0 -13
  48. package/examples/private/epi-data.json +0 -62
  49. package/examples/private/epi.json +0 -403
  50. package/examples/private/occupancy.json +0 -109283
  51. package/examples/private/prod-line-config.json +0 -401
  52. package/examples/private/region-data.json +0 -822
  53. package/examples/private/region-testing.json +0 -312
  54. package/examples/private/scaling.json +0 -45325
  55. package/examples/private/testing-data.json +0 -1739
  56. package/examples/private/testing.json +0 -816
  57. package/src/components/EditorPanel/components/Panel.DateHighlighting.tsx +0 -109
  58. package/src/components/EditorPanel/components/Panels.tsx +0 -13
@@ -1,312 +0,0 @@
1
- {
2
- "type": "chart",
3
- "debugSvg": false,
4
- "chartMessage": {
5
- "noData": "No Data Available"
6
- },
7
- "title": "",
8
- "showTitle": true,
9
- "showDownloadMediaButton": false,
10
- "theme": "theme-blue",
11
- "animate": false,
12
- "fontSize": "small",
13
- "lineDatapointStyle": "hover",
14
- "lineDatapointColor": "Same as Line",
15
- "barHasBorder": "false",
16
- "isLollipopChart": false,
17
- "lollipopShape": "circle",
18
- "lollipopColorStyle": "two-tone",
19
- "visualizationSubType": "stacked",
20
- "barStyle": "rounded",
21
- "roundingStyle": "finger",
22
- "tipRounding": "top",
23
- "isResponsiveTicks": false,
24
- "general": {
25
- "showDownloadButton": false
26
- },
27
- "padding": {
28
- "left": 5,
29
- "right": 5
30
- },
31
- "suppressedData": [],
32
- "yAxis": {
33
- "hideAxis": false,
34
- "displayNumbersOnBar": false,
35
- "hideLabel": false,
36
- "hideTicks": false,
37
- "size": "66",
38
- "gridLines": true,
39
- "enablePadding": false,
40
- "min": "",
41
- "max": "8",
42
- "labelColor": "#333",
43
- "tickLabelColor": "#333",
44
- "tickColor": "#333",
45
- "rightHideAxis": true,
46
- "rightAxisSize": 0,
47
- "rightLabel": "",
48
- "rightLabelOffsetSize": 0,
49
- "rightAxisLabelColor": "#333",
50
- "rightAxisTickLabelColor": "#333",
51
- "rightAxisTickColor": "#333",
52
- "numTicks": "",
53
- "axisPadding": 0,
54
- "tickRotation": 0,
55
- "anchors": [],
56
- "label": "Percent of Deaths"
57
- },
58
- "boxplot": {
59
- "plots": [],
60
- "borders": "true",
61
- "firstQuartilePercentage": 25,
62
- "thirdQuartilePercentage": 75,
63
- "boxWidthPercentage": 40,
64
- "plotOutlierValues": false,
65
- "plotNonOutlierValues": true,
66
- "legend": {
67
- "showHowToReadText": false,
68
- "howToReadText": ""
69
- },
70
- "labels": {
71
- "q1": "Lower Quartile",
72
- "q2": "q2",
73
- "q3": "Upper Quartile",
74
- "q4": "q4",
75
- "minimum": "Minimum",
76
- "maximum": "Maximum",
77
- "mean": "Mean",
78
- "median": "Median",
79
- "sd": "Standard Deviation",
80
- "iqr": "Interquartile Range",
81
- "total": "Total",
82
- "outliers": "Outliers",
83
- "values": "Values",
84
- "lowerBounds": "Lower Bounds",
85
- "upperBounds": "Upper Bounds"
86
- }
87
- },
88
- "topAxis": {
89
- "hasLine": false
90
- },
91
- "isLegendValue": false,
92
- "barThickness": "0.65",
93
- "barHeight": 25,
94
- "barSpace": 15,
95
- "heights": {
96
- "vertical": "375",
97
- "horizontal": 750
98
- },
99
- "xAxis": {
100
- "sortDates": false,
101
- "anchors": [],
102
- "type": "date",
103
- "showTargetLabel": true,
104
- "targetLabel": "Target",
105
- "hideAxis": false,
106
- "hideLabel": false,
107
- "hideTicks": false,
108
- "size": "85",
109
- "tickRotation": "45",
110
- "min": "",
111
- "max": "",
112
- "labelColor": "#333",
113
- "tickLabelColor": "#333",
114
- "tickColor": "#333",
115
- "numTicks": "13",
116
- "labelOffset": 65,
117
- "axisPadding": 0,
118
- "target": 0,
119
- "maxTickRotation": 0,
120
- "dataKey": "week_end",
121
- "dateParseFormat": "%Y-%m-%d",
122
- "dateDisplayFormat": "%m/%d/%Y",
123
- "label": "Week Ending",
124
- "tickWidthMax": 81
125
- },
126
- "table": {
127
- "label": "Data Table",
128
- "expanded": false,
129
- "limitHeight": false,
130
- "height": "",
131
- "caption": "",
132
- "showDownloadUrl": false,
133
- "showDataTableLink": true,
134
- "indexLabel": "Week Ending",
135
- "download": false,
136
- "showVertical": true,
137
- "show": true
138
- },
139
- "orientation": "vertical",
140
- "color": "pinkpurple",
141
- "columns": {},
142
- "legend": {
143
- "hide": false,
144
- "behavior": "isolate",
145
- "singleRow": true,
146
- "colorCode": "",
147
- "reverseLabelOrder": false,
148
- "description": "",
149
- "dynamicLegend": false,
150
- "dynamicLegendDefaultText": "Show All",
151
- "dynamicLegendItemLimit": 5,
152
- "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
153
- "dynamicLegendChartMessage": "Select Options from the Legend",
154
- "lineMode": false,
155
- "verticalSorted": false,
156
- "highlightOnHover": false,
157
- "position": "bottom"
158
- },
159
- "brush": {
160
- "height": 25,
161
- "data": [],
162
- "active": false,
163
- "pattern_id": "brush_pattern",
164
- "accent_color": "#ddd"
165
- },
166
- "exclusions": {
167
- "active": false,
168
- "keys": []
169
- },
170
- "palette": "qualitative-bold",
171
- "isPaletteReversed": false,
172
- "twoColor": {
173
- "palette": "monochrome-1",
174
- "isPaletteReversed": false
175
- },
176
- "labels": false,
177
- "dataFormat": {
178
- "commas": false,
179
- "prefix": "",
180
- "suffix": "%",
181
- "abbreviated": false,
182
- "bottomSuffix": "",
183
- "bottomPrefix": "",
184
- "bottomAbbreviated": false,
185
- "roundTo": "1"
186
- },
187
- "confidenceKeys": {},
188
- "visual": {
189
- "border": true,
190
- "accent": true,
191
- "background": true,
192
- "verticalHoverLine": true,
193
- "horizontalHoverLine": false
194
- },
195
- "useLogScale": false,
196
- "filterBehavior": "Filter Change",
197
- "highlightedBarValues": [],
198
- "series": [
199
- {
200
- "dataKey": "COVID-19",
201
- "type": "Bar",
202
- "axis": "Left",
203
- "tooltip": true
204
- },
205
- {
206
- "dataKey": "Influenza",
207
- "type": "Bar",
208
- "axis": "Left",
209
- "tooltip": true
210
- },
211
- {
212
- "dataKey": "RSV",
213
- "type": "Bar",
214
- "axis": "Left",
215
- "tooltip": true
216
- }
217
- ],
218
- "tooltips": {
219
- "opacity": 90,
220
- "singleSeries": false
221
- },
222
- "forestPlot": {
223
- "startAt": 0,
224
- "colors": {
225
- "line": "",
226
- "shape": ""
227
- },
228
- "lineOfNoEffect": {
229
- "show": true
230
- },
231
- "type": "",
232
- "pooledResult": {
233
- "diamondHeight": 5,
234
- "column": ""
235
- },
236
- "estimateField": "",
237
- "estimateRadius": "",
238
- "shape": "",
239
- "rowHeight": 20,
240
- "description": {
241
- "show": true,
242
- "text": "description",
243
- "location": 0
244
- },
245
- "result": {
246
- "show": true,
247
- "text": "result",
248
- "location": 100
249
- },
250
- "radius": {
251
- "min": 1,
252
- "max": 8,
253
- "scalingColumn": ""
254
- },
255
- "regression": {
256
- "lower": 0,
257
- "upper": 0,
258
- "estimateField": 0
259
- },
260
- "leftWidthOffset": 0,
261
- "rightWidthOffset": 0,
262
- "showZeroLine": false,
263
- "hideDateCategoryCol": false,
264
- "leftLabel": "",
265
- "rightLabel": "",
266
- "width": "auto",
267
- "lowerCiField": "",
268
- "upperCiField": ""
269
- },
270
- "area": {
271
- "isStacked": false
272
- },
273
- "showChartBrush": false,
274
- "datasets": {},
275
- "visualizationType": "Combo",
276
- "dataUrl": "/examples/private/region-data.json",
277
- "customColors": [
278
- "#f06f19",
279
- "#0a58d6",
280
- "#890664",
281
- "#000000",
282
- "#0A6C75",
283
- "#00a089",
284
- "#87b6f9",
285
- "#867a77",
286
- "#000000"
287
- ],
288
- "dataFileName": "/wcms/vizdata/Respitory_Viruses/NVSSConsolidatedNationalDataAggregated.json",
289
- "dataFileSourceType": "url",
290
- "dataDescription": {
291
- "horizontal": false,
292
- "series": true,
293
- "singleRow": false,
294
- "seriesKey": "pathogen",
295
- "xKey": "week_end",
296
- "valueKeys": [
297
- "percent_deaths_selected_pathogen_currentweek"
298
- ]
299
- },
300
- "validated": 4.23,
301
- "dynamicMarginTop": 0,
302
- "description": "<p class=\"fnote\">One or more data points are based on death counts between 1-9 and have been suppressed in accordance with National Center for Health Statistics confidentiality standards. </p><br/><div class=\"fnote text-left\">Data presented through: <span class=\"date_max_3\"></span>; Data as of: <span class=\"date_min_3\"></span></div><a href=\"https://data.cdc.gov/Health-Statistics/Provisional-Percent-of-Deaths-for-COVID-19-Influen/4bc2-bbpq\">Dataset on data.cdc.gov</a> | <a href=\"/wcms/vizdata/Respitory_Viruses/NVSSConsolidatedNationalDataAggregated.json\">Link to Dataset</a>",
303
- "regions": [
304
- {
305
- "from": "2023-12-09",
306
- "to": "2023-12-30",
307
- "background": "#cccccc",
308
- "color": "",
309
- "label": ""
310
- }
311
- ]
312
- }