@cdc/chart 4.26.4 → 4.26.6

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 (141) hide show
  1. package/CONFIG.md +353 -29
  2. package/LICENSE +201 -0
  3. package/dist/{cdcchart-DQ00cQCm.es.js → cdcchart-BWVIUcAF.es.js} +5 -55
  4. package/dist/cdcchart.js +37885 -35117
  5. package/examples/feature/heatmap/average-age-categorical.json +313 -0
  6. package/examples/feature/heatmap/calendar-heatmap.json +134 -0
  7. package/examples/feature/heatmap/cell-values-bottom-axis.json +181 -0
  8. package/examples/feature/heatmap/sparse-aggregation.json +158 -0
  9. package/examples/private/bad-y-axis.json +543 -0
  10. package/examples/private/bar-chart-negative-value.json +455 -0
  11. package/examples/private/bump-chart.json +1116 -0
  12. package/examples/private/test-123.json +624 -0
  13. package/package.json +4 -3
  14. package/src/CdcChart.tsx +5 -4
  15. package/src/CdcChartComponent.tsx +166 -62
  16. package/src/_stories/Chart.AltText.stories.tsx +136 -0
  17. package/src/_stories/Chart.HeatMap.stories.tsx +187 -0
  18. package/src/_stories/Chart.Sankey.smoke.stories.tsx +62 -0
  19. package/src/_stories/Chart.SeriesColorAssignments.stories.tsx +183 -0
  20. package/src/_stories/Chart.SmallMultiples.smoke.stories.tsx +29 -0
  21. package/src/_stories/Chart.YAxisAutoMaxStrategy.stories.tsx +52 -0
  22. package/src/_stories/Chart.YAxisFilterDomain.stories.tsx +90 -0
  23. package/src/_stories/ChartAnnotation.smoke.stories.tsx +10 -0
  24. package/src/_stories/ChartAxisTitles.smoke.stories.tsx +13 -0
  25. package/src/_stories/ChartBar.Editor.stories.tsx +63 -0
  26. package/src/_stories/ChartBrush.Interaction.stories.tsx +112 -0
  27. package/src/_stories/ChartBrush.smoke.stories.tsx +13 -4
  28. package/src/_stories/_mock/alt_text_metadata.json +38 -0
  29. package/src/_stories/_mock/annotation_event-line_mock.json +1064 -0
  30. package/src/_stories/_mock/heatmap-average-age-categorical.json +315 -0
  31. package/src/_stories/_mock/heatmap.json +156 -0
  32. package/src/_stories/_mock/reported_pertussis_cases.json +1643 -0
  33. package/src/_stories/_mock/sankey_mock.json +78 -0
  34. package/src/_stories/_mock/small_multiples/small_multiples_lines.json +1 -1
  35. package/src/components/Annotations/components/AnnotationDraggable.styles.css +22 -1
  36. package/src/components/Annotations/components/AnnotationDraggable.tsx +220 -120
  37. package/src/components/Annotations/components/AnnotationDropdown.tsx +5 -2
  38. package/src/components/Annotations/tests/AnnotationDraggable.test.tsx +198 -0
  39. package/src/components/Axis/LeftAxis.tsx +17 -11
  40. package/src/components/Axis/LeftAxisGridlines.tsx +22 -12
  41. package/src/components/Axis/RightAxis.tsx +3 -0
  42. package/src/components/Axis/tests/AxisTickValues.test.tsx +86 -0
  43. package/src/components/Brush/BrushSelector.tsx +88 -187
  44. package/src/components/Brush/brushInteraction.ts +22 -0
  45. package/src/components/Brush/tests/brushInteraction.test.ts +38 -0
  46. package/src/components/EditorPanel/EditorPanel.tsx +677 -185
  47. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +114 -52
  48. package/src/components/EditorPanel/components/Panels/Panel.General.tsx +105 -13
  49. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +1 -0
  50. package/src/components/EditorPanel/components/Panels/Panel.Regions.tsx +5 -0
  51. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +2 -2
  52. package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.test.tsx +98 -0
  53. package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.tsx +10 -0
  54. package/src/components/EditorPanel/components/Panels/Panel.Visual.test.tsx +484 -0
  55. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +4 -1
  56. package/src/components/EditorPanel/components/Panels/SeriesColorAssignments.tsx +262 -0
  57. package/src/components/EditorPanel/components/Panels/panelVisual.styles.css +32 -0
  58. package/src/components/EditorPanel/components/panels.scss +10 -0
  59. package/src/components/EditorPanel/editor-panel.scss +47 -0
  60. package/src/components/EditorPanel/helpers/getVisualizationTypeConfigUpdate.ts +61 -0
  61. package/src/components/EditorPanel/helpers/tests/getVisualizationTypeConfigUpdate.test.ts +74 -0
  62. package/src/components/EditorPanel/useEditorPermissions.test.tsx +315 -0
  63. package/src/components/EditorPanel/useEditorPermissions.ts +77 -21
  64. package/src/components/HeatMap/components/HeatMap.tsx +767 -0
  65. package/src/components/HeatMap/components/HeatMapGradientLegend.tsx +128 -0
  66. package/src/components/HeatMap/heatmap.constants.ts +13 -0
  67. package/src/components/HeatMap/heatmap.css +85 -0
  68. package/src/components/HeatMap/helpers/index.ts +261 -0
  69. package/src/components/HeatMap/index.tsx +5 -0
  70. package/src/components/HeatMap/tests/HeatMap.test.tsx +1072 -0
  71. package/src/components/HeatMap/tests/helpers.test.ts +167 -0
  72. package/src/components/Legend/Legend.Component.tsx +2 -2
  73. package/src/components/Legend/helpers/createFormatLabels.test.ts +88 -0
  74. package/src/components/Legend/helpers/createFormatLabels.tsx +6 -1
  75. package/src/components/LineChart/components/LineChart.BumpCircle.tsx +19 -22
  76. package/src/components/LineChart/helpers.test.ts +574 -0
  77. package/src/components/LineChart/helpers.ts +39 -16
  78. package/src/components/LineChart/index.tsx +28 -5
  79. package/src/components/LinearChart/tests/LinearChart.test.tsx +137 -33
  80. package/src/components/LinearChart/tests/mockConfigContext.ts +1 -0
  81. package/src/components/LinearChart.tsx +103 -47
  82. package/src/components/PieChart/PieChart.tsx +4 -1
  83. package/src/components/RadarChart/RadarChart.tsx +3 -1
  84. package/src/components/Regions/components/Regions.tsx +195 -41
  85. package/src/components/Sankey/components/Sankey.tsx +7 -3
  86. package/src/components/Sankey/helpers/getSankeyTooltip.tsx +7 -6
  87. package/src/components/ScatterPlot/ScatterPlot.jsx +3 -3
  88. package/src/components/SmallMultiples/SmallMultipleTile.tsx +33 -3
  89. package/src/components/SmallMultiples/SmallMultiples.css +12 -0
  90. package/src/components/SmallMultiples/SmallMultiples.tsx +50 -15
  91. package/src/components/SmallMultiples/tests/SmallMultipleTile.test.tsx +152 -0
  92. package/src/components/SmallMultiples/tests/SmallMultiples.test.tsx +170 -0
  93. package/src/components/Sparkline/components/SparkLine.tsx +4 -9
  94. package/src/components/WarmingStripes/WarmingStripesGradientLegend.css +1 -1
  95. package/src/components/WarmingStripes/WarmingStripesGradientLegend.tsx +2 -2
  96. package/src/data/initial-state.js +12 -0
  97. package/src/helpers/axisLabelFontSize.ts +8 -0
  98. package/src/helpers/bumpChartTooltip.ts +54 -0
  99. package/src/helpers/calculateLeftYAxisWidth.ts +13 -3
  100. package/src/helpers/colorAssignmentHelpers.ts +102 -0
  101. package/src/helpers/dataHelpers.ts +11 -1
  102. package/src/helpers/ensureSpecialChartAxisTypes.ts +11 -0
  103. package/src/helpers/getAxisMaxOverride.ts +16 -0
  104. package/src/helpers/getCleanTopTickMax.ts +64 -0
  105. package/src/helpers/getColorScale.ts +18 -9
  106. package/src/helpers/getHasBoundarySuppression.ts +26 -0
  107. package/src/helpers/getMinMax.ts +26 -25
  108. package/src/helpers/getYAxisDomainData.ts +38 -0
  109. package/src/helpers/getYAxisFinalizationEligibility.ts +40 -0
  110. package/src/helpers/handleChartAriaLabels.ts +23 -10
  111. package/src/helpers/hasSpacedInlineLabel.ts +10 -0
  112. package/src/helpers/seriesColumnSettings.ts +5 -4
  113. package/src/helpers/seriesHighlight.ts +26 -0
  114. package/src/helpers/smallMultiplesHelpers.ts +5 -0
  115. package/src/helpers/tests/axisLabelFontSize.test.ts +15 -0
  116. package/src/helpers/tests/bumpChartTooltip.test.ts +75 -0
  117. package/src/helpers/tests/calculateLeftYAxisWidth.test.ts +38 -0
  118. package/src/helpers/tests/dataHelpers.test.ts +135 -0
  119. package/src/helpers/tests/ensureSpecialChartAxisTypes.test.ts +30 -0
  120. package/src/helpers/tests/getAxisMaxOverride.test.ts +36 -0
  121. package/src/helpers/tests/getCleanTopTickMax.test.ts +165 -0
  122. package/src/helpers/tests/getColorScale.test.ts +197 -0
  123. package/src/helpers/tests/getMinMax.test.ts +211 -0
  124. package/src/helpers/tests/getYAxisDomainData.test.ts +119 -0
  125. package/src/helpers/tests/getYAxisFinalizationEligibility.test.ts +185 -0
  126. package/src/helpers/tests/handleChartAriaLabels.test.ts +71 -0
  127. package/src/helpers/tests/hasSpacedInlineLabel.test.ts +75 -0
  128. package/src/helpers/tests/seriesColumnSettings.test.ts +16 -2
  129. package/src/helpers/tests/seriesHighlight.test.ts +61 -0
  130. package/src/helpers/tests/smallMultiplesHelpers.test.ts +99 -0
  131. package/src/hooks/tests/useRightAxis.test.tsx +127 -0
  132. package/src/hooks/tests/useScales.test.tsx +383 -0
  133. package/src/hooks/useRightAxis.ts +30 -13
  134. package/src/hooks/useScales.ts +48 -21
  135. package/src/hooks/useTooltip.tsx +3 -1
  136. package/src/index.jsx +5 -2
  137. package/src/scss/main.scss +32 -49
  138. package/src/test/CdcChart.dataTable.test.tsx +122 -0
  139. package/src/types/ChartConfig.ts +24 -1
  140. package/src/types/ChartContext.ts +5 -0
  141. package/src/helpers/getYAxisAutoPadding.ts +0 -53
@@ -0,0 +1,624 @@
1
+ {
2
+ "annotations": [],
3
+ "allowLineToBarGraph": "__​undefined__",
4
+ "type": "chart",
5
+ "debugSvg": false,
6
+ "chartMessage": {
7
+ "noData": "No Data Available"
8
+ },
9
+ "title": "Title",
10
+ "titleStyle": "small",
11
+ "showTitle": true,
12
+ "showDownloadMediaButton": false,
13
+ "theme": "theme-blue",
14
+ "animate": false,
15
+ "lineDatapointStyle": "hover",
16
+ "lineDatapointColor": "Same as Line",
17
+ "barHasBorder": "false",
18
+ "isLollipopChart": false,
19
+ "lollipopShape": "circle",
20
+ "lollipopColorStyle": "two-tone",
21
+ "visualizationSubType": "stacked",
22
+ "barStyle": "",
23
+ "roundingStyle": "standard",
24
+ "tipRounding": "top",
25
+ "isResponsiveTicks": false,
26
+ "general": {
27
+ "annotationDropdownText": "Annotations",
28
+ "showMissingDataLabel": true,
29
+ "showSuppressedSymbol": true,
30
+ "showZeroValueData": true,
31
+ "hideNullValue": true,
32
+ "palette": {
33
+ "isReversed": true,
34
+ "version": "2.0",
35
+ "name": "sequential_purplereverse"
36
+ },
37
+ "useIntelligentLineChartLabels": false,
38
+ "paletteColorCount": 4
39
+ },
40
+ "padding": {
41
+ "left": 5,
42
+ "right": 5
43
+ },
44
+ "preliminaryData": [],
45
+ "yAxis": {
46
+ "hideAxis": true,
47
+ "displayNumbersOnBar": false,
48
+ "hideLabel": false,
49
+ "hideTicks": true,
50
+ "size": 50,
51
+ "gridLines": true,
52
+ "enablePadding": true,
53
+ "min": "",
54
+ "max": "",
55
+ "labelColor": "#1c1d1f",
56
+ "tickLabelColor": "#1c1d1f",
57
+ "tickColor": "#1c1d1f",
58
+ "rightHideAxis": false,
59
+ "rightAxisSize": 0,
60
+ "rightLabel": "",
61
+ "rightLabelOffsetSize": 0,
62
+ "rightAxisLabelColor": "#1c1d1f",
63
+ "rightAxisTickLabelColor": "#1c1d1f",
64
+ "rightAxisTickColor": "#1c1d1f",
65
+ "numTicks": "5",
66
+ "axisPadding": 0,
67
+ "scalePadding": "5",
68
+ "tickRotation": 0,
69
+ "anchors": [],
70
+ "shoMissingDataLabel": true,
71
+ "showMissingDataLine": true,
72
+ "categories": [],
73
+ "label": "Total Cases",
74
+ "labelPlacement": "Below Bar",
75
+ "labelsAboveGridlines": false,
76
+ "type": "__​undefined__"
77
+ },
78
+ "boxplot": {
79
+ "plots": [],
80
+ "borders": "true",
81
+ "plotOutlierValues": false,
82
+ "plotNonOutlierValues": true,
83
+ "labels": {
84
+ "q1": "Lower Quartile",
85
+ "q2": "q2",
86
+ "q3": "Upper Quartile",
87
+ "q4": "q4",
88
+ "minimum": "Minimum",
89
+ "maximum": "Maximum",
90
+ "mean": "Mean",
91
+ "median": "Median",
92
+ "sd": "Standard Deviation",
93
+ "iqr": "Interquartile Range",
94
+ "count": "Count",
95
+ "outliers": "Outliers",
96
+ "values": "Values",
97
+ "lowerBounds": "Lower Bounds",
98
+ "upperBounds": "Upper Bounds"
99
+ }
100
+ },
101
+ "topAxis": {
102
+ "hasLine": false
103
+ },
104
+ "isLegendValue": false,
105
+ "barThickness": 0.35,
106
+ "barHeight": 25,
107
+ "barSpace": 15,
108
+ "heights": {
109
+ "vertical": 300,
110
+ "horizontal": 123.19999999999999
111
+ },
112
+ "xAxis": {
113
+ "anchors": [],
114
+ "type": "categorical",
115
+ "showTargetLabel": true,
116
+ "targetLabel": "Target",
117
+ "hideAxis": true,
118
+ "hideLabel": false,
119
+ "hideTicks": true,
120
+ "size": 75,
121
+ "tickRotation": 0,
122
+ "min": "",
123
+ "max": "",
124
+ "labelColor": "#1c1d1f",
125
+ "tickLabelColor": "#1c1d1f",
126
+ "tickColor": "#1c1d1f",
127
+ "numTicks": 6,
128
+ "dateDisplayFormat": "%b. %-d %Y",
129
+ "labelOffset": 0,
130
+ "axisPadding": 200,
131
+ "target": 0,
132
+ "maxTickRotation": 0,
133
+ "padding": 5,
134
+ "showYearsOnce": false,
135
+ "sortByRecentDate": false,
136
+ "brushActive": false,
137
+ "viewportNumTicks": {
138
+ "xs": 4,
139
+ "xxs": 4
140
+ },
141
+ "sortDates": false,
142
+ "dataKey": "Sex",
143
+ "axisBBox": 54.15333557128906,
144
+ "tickWidthMax": 24
145
+ },
146
+ "table": {
147
+ "label": "Data Table",
148
+ "expanded": false,
149
+ "limitHeight": false,
150
+ "height": "",
151
+ "caption": "",
152
+ "showDownloadUrl": false,
153
+ "showDataTableLink": true,
154
+ "showDownloadLinkBelow": true,
155
+ "indexLabel": "",
156
+ "download": true,
157
+ "showVertical": true,
158
+ "dateDisplayFormat": "%B %-d, %Y",
159
+ "showMissingDataLabel": true,
160
+ "showSuppressedSymbol": true,
161
+ "collapsible": true,
162
+ "show": true
163
+ },
164
+ "orientation": "horizontal",
165
+ "columns": {},
166
+ "legend": {
167
+ "hide": false,
168
+ "behavior": "highlight",
169
+ "axisAlign": true,
170
+ "singleRow": true,
171
+ "colorCode": "",
172
+ "reverseLabelOrder": false,
173
+ "description": "Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup> ",
174
+ "dynamicLegend": false,
175
+ "dynamicLegendDefaultText": "Show All",
176
+ "dynamicLegendItemLimit": 5,
177
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
178
+ "dynamicLegendChartMessage": "Select Options from the Legend",
179
+ "label": "Legend",
180
+ "lineMode": false,
181
+ "verticalSorted": false,
182
+ "highlightOnHover": false,
183
+ "hideSuppressedLabels": false,
184
+ "hideSuppressionLink": false,
185
+ "seriesHighlight": [],
186
+ "style": "circles",
187
+ "subStyle": "linear blocks",
188
+ "groupBy": "",
189
+ "shape": "circle",
190
+ "tickRotation": "",
191
+ "order": "dataColumn",
192
+ "hideBorder": {
193
+ "side": false,
194
+ "topBottom": false
195
+ },
196
+ "position": "top",
197
+ "orderedValues": [],
198
+ "patterns": {},
199
+ "patternField": "",
200
+ "unified": true
201
+ },
202
+ "smallMultiples": {
203
+ "mode": "",
204
+ "tileColumn": "",
205
+ "tilesPerRowDesktop": 3,
206
+ "tilesPerRowMobile": 1,
207
+ "tileOrder": [],
208
+ "tileOrderType": "asc",
209
+ "tileTitles": {},
210
+ "independentYAxis": false,
211
+ "colorMode": "same",
212
+ "synchronizedTooltips": true,
213
+ "showAreaUnderLine": true
214
+ },
215
+ "exclusions": {
216
+ "active": true,
217
+ "keys": [
218
+ "All"
219
+ ]
220
+ },
221
+ "twoColor": {
222
+ "palette": "monochrome-1",
223
+ "isPaletteReversed": false
224
+ },
225
+ "labels": false,
226
+ "dataFormat": {
227
+ "commas": true,
228
+ "prefix": "",
229
+ "suffix": "",
230
+ "abbreviated": true,
231
+ "bottomSuffix": "",
232
+ "bottomPrefix": "",
233
+ "bottomAbbreviated": false
234
+ },
235
+ "filters": [
236
+ {
237
+ "values": [
238
+ "2017",
239
+ "2018",
240
+ "2019",
241
+ "2020"
242
+ ],
243
+ "filterStyle": "dropdown",
244
+ "id": 1773935825487,
245
+ "showDropdown": true,
246
+ "active": "2017",
247
+ "columnName": "Year",
248
+ "orderedValues": [
249
+ "2017",
250
+ "2018",
251
+ "2019",
252
+ "2020"
253
+ ],
254
+ "label": "Year"
255
+ },
256
+ {
257
+ "values": [
258
+ "Male",
259
+ "Female"
260
+ ],
261
+ "filterStyle": "multi-select",
262
+ "id": 1773935988263,
263
+ "showDropdown": true,
264
+ "active": [
265
+ "Female",
266
+ "Male"
267
+ ],
268
+ "columnName": "Sex",
269
+ "orderedValues": [
270
+ "Male",
271
+ "Female"
272
+ ],
273
+ "order": "cust"
274
+ }
275
+ ],
276
+ "confidenceKeys": {},
277
+ "visual": {
278
+ "border": false,
279
+ "borderColorTheme": false,
280
+ "accent": false,
281
+ "background": false,
282
+ "hideBackgroundColor": false,
283
+ "tp5Treatment": false,
284
+ "tp5Background": false,
285
+ "verticalHoverLine": true,
286
+ "horizontalHoverLine": false,
287
+ "lineDatapointSymbol": "none",
288
+ "maximumShapeAmount": 7
289
+ },
290
+ "useLogScale": false,
291
+ "filterBehavior": "Filter Change",
292
+ "highlightedBarValues": [],
293
+ "series": [
294
+ {
295
+ "dataKey": "<15",
296
+ "type": "Bar",
297
+ "axis": "Left",
298
+ "tooltip": true
299
+ },
300
+ {
301
+ "dataKey": "15-24",
302
+ "type": "Bar",
303
+ "axis": "Left",
304
+ "tooltip": true
305
+ },
306
+ {
307
+ "dataKey": "25-34",
308
+ "type": "Bar",
309
+ "axis": "Left",
310
+ "tooltip": true
311
+ },
312
+ {
313
+ "dataKey": "35-44",
314
+ "type": "Bar",
315
+ "axis": "Left",
316
+ "tooltip": true
317
+ },
318
+ {
319
+ "dataKey": "45-54",
320
+ "type": "Bar",
321
+ "axis": "Left",
322
+ "tooltip": true
323
+ },
324
+ {
325
+ "dataKey": "55-64",
326
+ "type": "Bar",
327
+ "axis": "Left",
328
+ "tooltip": true
329
+ },
330
+ {
331
+ "dataKey": "65+",
332
+ "type": "Bar",
333
+ "axis": "Left",
334
+ "tooltip": true
335
+ }
336
+ ],
337
+ "tooltips": {
338
+ "opacity": 90,
339
+ "singleSeries": true,
340
+ "dateDisplayFormat": "%B %-d, %Y"
341
+ },
342
+ "forestPlot": {
343
+ "startAt": 0,
344
+ "colors": {
345
+ "line": "",
346
+ "shape": ""
347
+ },
348
+ "lineOfNoEffect": {
349
+ "show": true
350
+ },
351
+ "type": "",
352
+ "pooledResult": {
353
+ "diamondHeight": 5,
354
+ "column": ""
355
+ },
356
+ "estimateField": "",
357
+ "estimateRadius": "",
358
+ "shape": "square",
359
+ "rowHeight": 20,
360
+ "description": {
361
+ "show": true,
362
+ "text": "description",
363
+ "location": 0
364
+ },
365
+ "result": {
366
+ "show": true,
367
+ "text": "result",
368
+ "location": 100
369
+ },
370
+ "radius": {
371
+ "min": 2,
372
+ "max": 10,
373
+ "scalingColumn": ""
374
+ },
375
+ "regression": {
376
+ "lower": 0,
377
+ "upper": 0,
378
+ "estimateField": 0
379
+ },
380
+ "leftWidthOffset": 0,
381
+ "rightWidthOffset": 0,
382
+ "showZeroLine": false,
383
+ "leftLabel": "",
384
+ "rightLabel": ""
385
+ },
386
+ "area": {
387
+ "isStacked": false
388
+ },
389
+ "radar": {
390
+ "gridRings": 5,
391
+ "showGridRings": true,
392
+ "gridRingStyle": "polygons",
393
+ "scaleMin": 0,
394
+ "scaleMax": "",
395
+ "fillOpacity": 0.3,
396
+ "showPoints": true,
397
+ "pointRadius": 4,
398
+ "strokeWidth": 2,
399
+ "axisLabelOffset": 15
400
+ },
401
+ "sankey": {
402
+ "title": {
403
+ "defaultColor": "black"
404
+ },
405
+ "iterations": 1,
406
+ "rxValue": 0.9,
407
+ "overallSize": {
408
+ "width": 900,
409
+ "height": 700
410
+ },
411
+ "margin": {
412
+ "margin_y": 25,
413
+ "margin_x": 0
414
+ },
415
+ "nodeSize": {
416
+ "nodeWidth": 26,
417
+ "nodeHeight": 40
418
+ },
419
+ "nodePadding": 55,
420
+ "nodeFontColor": "black",
421
+ "nodeColor": {
422
+ "default": "#ff8500",
423
+ "inactive": "#808080"
424
+ },
425
+ "linkColor": {
426
+ "default": "#ffc900",
427
+ "inactive": "#D3D3D3"
428
+ },
429
+ "opacity": {
430
+ "nodeOpacityDefault": 1,
431
+ "nodeOpacityInactive": 0.1,
432
+ "LinkOpacityDefault": 1,
433
+ "LinkOpacityInactive": 0.1
434
+ },
435
+ "storyNodeFontColor": "#006778",
436
+ "storyNodeText": [],
437
+ "nodeValueStyle": {
438
+ "textBefore": "(",
439
+ "textAfter": ")"
440
+ },
441
+ "data": []
442
+ },
443
+ "markupVariables": [],
444
+ "enableMarkupVariables": false,
445
+ "errors": [],
446
+ "currentViewport": "lg",
447
+ "id": 27,
448
+ "category": "Charts",
449
+ "label": "Horizon Chart",
450
+ "subType": "Horizon Chart",
451
+ "icon": {
452
+ "type": {},
453
+ "key": null,
454
+ "ref": null,
455
+ "props": {},
456
+ "_owner": null
457
+ },
458
+ "content": "Display a horizon chart to visualize quantities over time in a smaller space.",
459
+ "visualizationType": "Bar",
460
+ "activeVizButtonID": 27,
461
+ "dataMetadata": {},
462
+ "dataFileName": "https://wwwdev.cdc.gov/wcms/4.0/cdc-wp/data-presentation/data/indexed-data-files/39-chart-year2017-2020-sex-age-totalCases.csv",
463
+ "dataFileSourceType": "url",
464
+ "dataDescription": {
465
+ "horizontal": false,
466
+ "series": true,
467
+ "singleRow": false,
468
+ "seriesKey": "Age Group",
469
+ "xKey": "Sex",
470
+ "valueKeysTallSupport": [
471
+ "Total Cases"
472
+ ]
473
+ },
474
+ "version": "4.26.4",
475
+ "migrations": {
476
+ "addColorMigration": true
477
+ },
478
+ "locale": "en-US",
479
+ "horizon": {
480
+ "numLayers": 4,
481
+ "mode": "offset",
482
+ "bandGap": 15,
483
+ "bottomPadding": 15
484
+ },
485
+ "introText": "Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup> M",
486
+ "description": "Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup> S",
487
+ "legacyFootnotes": "Lorem ipsum dolor sit amet, <em>consectetur adipiscing elit</em>, sed do eiusmod tempor incididunt ut labore et <strong>dolore magna aliqua</strong>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <sup> 40</sup> F",
488
+ "dynamicMarginTop": 0,
489
+ "data": [
490
+ {
491
+ "Sex": "Male",
492
+ "Year": "2017",
493
+ "<15": "1019960",
494
+ "15-24": "700320",
495
+ "25-34": "2393680",
496
+ "35-44": "752920",
497
+ "45-54": "578130",
498
+ "55-64": "326450",
499
+ "65+": "51100"
500
+ },
501
+ {
502
+ "Sex": "Female",
503
+ "Year": "2017",
504
+ "<15": "399980",
505
+ "15-24": "251160",
506
+ "25-34": "238700",
507
+ "35-44": "523460",
508
+ "45-54": "394310",
509
+ "55-64": "56700",
510
+ "65+": "28140"
511
+ },
512
+ {
513
+ "Sex": "All",
514
+ "Year": "2017",
515
+ "<15": "1419940",
516
+ "15-24": "951480",
517
+ "25-34": "2632380",
518
+ "35-44": "1276380",
519
+ "45-54": "972440",
520
+ "55-64": "383150",
521
+ "65+": "79240"
522
+ },
523
+ {
524
+ "Sex": "Male",
525
+ "Year": "2018",
526
+ "<15": "426367",
527
+ "15-24": "297102",
528
+ "25-34": "420000",
529
+ "35-44": "617394",
530
+ "45-54": "474066",
531
+ "55-64": "96078",
532
+ "65+": "41902"
533
+ },
534
+ {
535
+ "Sex": "Female",
536
+ "Year": "2018",
537
+ "<15": "327983",
538
+ "15-24": "205951",
539
+ "25-34": "195734",
540
+ "35-44": "530224",
541
+ "45-54": "323334",
542
+ "55-64": "46494",
543
+ "65+": "23074"
544
+ },
545
+ {
546
+ "Sex": "All",
547
+ "Year": "2018",
548
+ "<15": "754350",
549
+ "15-24": "503053",
550
+ "25-34": "615734",
551
+ "35-44": "1147618",
552
+ "45-54": "797400",
553
+ "55-64": "142572",
554
+ "65+": "64976"
555
+ },
556
+ {
557
+ "Sex": "Male",
558
+ "Year": "2019",
559
+ "<15": "383730",
560
+ "15-24": "320046",
561
+ "25-34": "378000",
562
+ "35-44": "570654",
563
+ "45-54": "426659",
564
+ "55-64": "86470",
565
+ "65+": "37711"
566
+ },
567
+ {
568
+ "Sex": "Female",
569
+ "Year": "2019",
570
+ "<15": "295184",
571
+ "15-24": "211355",
572
+ "25-34": "176160",
573
+ "35-44": "477201",
574
+ "45-54": "224000",
575
+ "55-64": "41844",
576
+ "65+": "20766"
577
+ },
578
+ {
579
+ "Sex": "All",
580
+ "Year": "2019",
581
+ "<15": "678914",
582
+ "15-24": "531401",
583
+ "25-34": "554160",
584
+ "35-44": "1047855",
585
+ "45-54": "650659",
586
+ "55-64": "128314",
587
+ "65+": "58477"
588
+ },
589
+ {
590
+ "Sex": "Male",
591
+ "Year": "2020",
592
+ "<15": "240936",
593
+ "15-24": "236631",
594
+ "25-34": "257040",
595
+ "35-44": "388044",
596
+ "45-54": "290128",
597
+ "55-64": "69799",
598
+ "65+": "25643"
599
+ },
600
+ {
601
+ "Sex": "Female",
602
+ "Year": "2020",
603
+ "<15": "200725",
604
+ "15-24": "143721",
605
+ "25-34": "132788",
606
+ "35-44": "324496",
607
+ "45-54": "152320",
608
+ "55-64": "36453",
609
+ "65+": "21120"
610
+ },
611
+ {
612
+ "Sex": "All",
613
+ "Year": "2020",
614
+ "<15": "441661",
615
+ "15-24": "380352",
616
+ "25-34": "389828",
617
+ "35-44": "712540",
618
+ "45-54": "442448",
619
+ "55-64": "106252",
620
+ "65+": "46763"
621
+ }
622
+ ],
623
+ "datasets": {}
624
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@cdc/chart",
3
- "version": "4.26.4",
3
+ "version": "4.26.6",
4
4
  "description": "React component for visualizing tabular data in various types of charts",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Matthew Pallansch <mpallansch@adittech.com>",
7
7
  "bugs": "https://github.com/CDCgov/cdc-open-viz/issues",
8
8
  "dependencies": {
9
- "@cdc/core": "^4.26.4",
9
+ "@cdc/core": "^4.26.6",
10
10
  "@hello-pangea/dnd": "^16.2.0",
11
11
  "@react-spring/web": "^9.7.5",
12
12
  "@rollup/plugin-dsv": "^3.0.2",
@@ -18,6 +18,7 @@
18
18
  "@visx/event": "^3.12.0",
19
19
  "@visx/glyph": "^3.12.0",
20
20
  "@visx/gradient": "^3.12.0",
21
+ "@visx/heatmap": "^3.12.0",
21
22
  "@visx/legend": "^3.12.0",
22
23
  "@visx/marker": "^3.12.0",
23
24
  "@visx/mock-data": "^3.12.0",
@@ -56,7 +57,7 @@
56
57
  "@types/d3-sankey": "^0.12.4",
57
58
  "@types/d3-time-format": "^4.0.3"
58
59
  },
59
- "gitHead": "9062881d50c824ee6cdd71868bafd016a5e5694d",
60
+ "gitHead": "f4a2a0d4a631a1b60fcf9534589697780e480b58",
60
61
  "main": "dist/cdcchart",
61
62
  "moduleName": "CdcChart",
62
63
  "peerDependencies": {
package/src/CdcChart.tsx CHANGED
@@ -4,7 +4,7 @@ import { ChartConfig } from './types/ChartConfig'
4
4
  import { getFileExtension } from '@cdc/core/helpers/getFileExtension'
5
5
  import { isSolrCsv, isSolrJson } from '@cdc/core/helpers/isSolr'
6
6
  import { parseCsvWithQuotes } from '@cdc/core/helpers/parseCsvWithQuotes'
7
- import cacheBustingString from '@cdc/core/helpers/cacheBustingString'
7
+ import { addCsvCacheBuster } from '@cdc/core/helpers/csvCacheBuster'
8
8
  import { extractDataAndMetadata } from '@cdc/core/helpers/extractDataAndMetadata'
9
9
  import Loading from '@cdc/core/components/Loading'
10
10
  import _ from 'lodash'
@@ -112,11 +112,12 @@ const parseCsv = (responseText: string, delimiter = '|') => {
112
112
 
113
113
  const fetchAndParseData = async (url: string, ext: string) => {
114
114
  try {
115
- const response = await fetch(url)
116
- if (ext === 'csv' || isSolrCsv(url)) {
115
+ if (ext?.toLowerCase() === 'csv' || isSolrCsv(url)) {
116
+ const response = await fetch(addCsvCacheBuster(url))
117
117
  const responseText = await response.text()
118
118
  return { data: parseCsv(responseText), dataMetadata: {} }
119
- } else if (ext === 'json' || isSolrJson(url)) {
119
+ } else if (ext?.toLowerCase() === 'json' || isSolrJson(url)) {
120
+ const response = await fetch(url)
120
121
  const json = await response.json()
121
122
  return extractDataAndMetadata(json)
122
123
  }