@cdc/chart 4.24.11 → 4.24.12-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 (65) hide show
  1. package/dist/cdcchart.js +32134 -32039
  2. package/examples/feature/sankey/sankey-example-data.json +126 -13
  3. package/examples/feature/tests-date-exclusions/date-exclusions-config.json +372 -12
  4. package/examples/private/DEV-8850-2.json +493 -0
  5. package/examples/private/DEV-9822.json +574 -0
  6. package/examples/private/DEV-9840.json +553 -0
  7. package/examples/private/DEV-9850-3.json +461 -0
  8. package/examples/private/chart.json +1084 -0
  9. package/examples/private/ci_formatted.json +202 -0
  10. package/examples/private/ci_issue.json +3016 -0
  11. package/examples/private/completed.json +634 -0
  12. package/examples/private/dem-data-long.csv +20 -0
  13. package/examples/private/dem-data-long.json +36 -0
  14. package/examples/private/demographic_data.csv +157 -0
  15. package/examples/private/demographic_data.json +2654 -0
  16. package/examples/private/demographic_dynamic.json +443 -0
  17. package/examples/private/demographic_standard.json +560 -0
  18. package/examples/private/ehdi.json +29939 -0
  19. package/examples/private/test.json +448 -20047
  20. package/index.html +9 -6
  21. package/package.json +2 -2
  22. package/src/CdcChart.tsx +62 -82
  23. package/src/_stories/Chart.Anchors.stories.tsx +31 -0
  24. package/src/_stories/Chart.DynamicSeries.stories.tsx +8 -1
  25. package/src/_stories/Chart.stories.tsx +32 -0
  26. package/src/_stories/ChartAxisLabels.stories.tsx +4 -1
  27. package/{examples/feature/area/area-chart-date-city-temperature.json → src/_stories/_mock/area_chart_stacked.json} +125 -27
  28. package/src/_stories/_mock/line_chart_dynamic_ci.json +493 -0
  29. package/src/_stories/_mock/line_chart_non_dynamic_ci.json +522 -0
  30. package/src/_stories/_mock/short_dates.json +288 -0
  31. package/src/components/AreaChart/components/AreaChart.Stacked.jsx +15 -3
  32. package/src/components/Axis/Categorical.Axis.tsx +2 -2
  33. package/src/components/BarChart/components/BarChart.Horizontal.tsx +46 -37
  34. package/src/components/BarChart/components/BarChart.Vertical.tsx +28 -40
  35. package/src/components/BarChart/helpers/getBarData.ts +28 -0
  36. package/src/components/BarChart/helpers/tests/getBarData.test.ts +74 -0
  37. package/src/components/BoxPlot/BoxPlot.tsx +12 -70
  38. package/src/components/BoxPlot/helpers/index.ts +54 -0
  39. package/src/components/BrushChart.tsx +23 -26
  40. package/src/components/EditorPanel/EditorPanel.tsx +55 -79
  41. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +1 -0
  42. package/src/components/EditorPanel/useEditorPermissions.ts +5 -1
  43. package/src/components/Legend/Legend.Component.tsx +2 -2
  44. package/src/{hooks/useLegendClasses.ts → components/Legend/helpers/getLegendClasses.ts} +5 -5
  45. package/src/components/Legend/helpers/index.ts +2 -1
  46. package/src/components/Legend/tests/getLegendClasses.test.ts +115 -0
  47. package/src/components/LineChart/components/LineChart.Circle.tsx +1 -1
  48. package/src/components/LineChart/helpers.ts +1 -0
  49. package/src/components/LineChart/index.tsx +47 -1
  50. package/src/components/LinearChart.tsx +180 -172
  51. package/src/components/PieChart/PieChart.tsx +7 -1
  52. package/src/components/Sankey/components/ColumnList.tsx +19 -0
  53. package/src/components/Sankey/components/Sankey.tsx +479 -0
  54. package/src/components/Sankey/helpers/getSankeyTooltip.tsx +33 -0
  55. package/src/components/Sankey/index.tsx +1 -510
  56. package/src/components/Sankey/sankey.scss +16 -16
  57. package/src/components/Sankey/types/index.ts +1 -1
  58. package/src/data/initial-state.js +4 -3
  59. package/src/helpers/countNumOfTicks.ts +57 -0
  60. package/src/helpers/getQuartiles.ts +15 -18
  61. package/src/hooks/useMinMax.ts +18 -4
  62. package/src/hooks/useScales.ts +38 -4
  63. package/src/hooks/useTooltip.tsx +5 -1
  64. package/src/scss/DataTable.scss +5 -0
  65. package/src/scss/main.scss +6 -2
@@ -0,0 +1,522 @@
1
+ {
2
+ "annotations": [],
3
+ "type": "chart",
4
+ "debugSvg": false,
5
+ "chartMessage": {
6
+ "noData": "No Data Available"
7
+ },
8
+ "title": "",
9
+ "showTitle": true,
10
+ "showDownloadMediaButton": false,
11
+ "theme": "theme-blue",
12
+ "animate": false,
13
+ "fontSize": "medium",
14
+ "lineDatapointStyle": "hover",
15
+ "lineDatapointColor": "Same as Line",
16
+ "barHasBorder": "false",
17
+ "isLollipopChart": false,
18
+ "lollipopShape": "circle",
19
+ "lollipopColorStyle": "two-tone",
20
+ "visualizationSubType": "regular",
21
+ "barStyle": "flat",
22
+ "roundingStyle": "standard",
23
+ "tipRounding": "top",
24
+ "isResponsiveTicks": false,
25
+ "general": {
26
+ "annotationDropdownText": "Annotations",
27
+ "showDownloadButton": false,
28
+ "showMissingDataLabel": true,
29
+ "showSuppressedSymbol": true,
30
+ "showZeroValueData": true,
31
+ "hideNullValue": true
32
+ },
33
+ "padding": {
34
+ "left": 5,
35
+ "right": 5
36
+ },
37
+ "preliminaryData": [],
38
+ "yAxis": {
39
+ "hideAxis": false,
40
+ "displayNumbersOnBar": false,
41
+ "hideLabel": false,
42
+ "hideTicks": false,
43
+ "size": 50,
44
+ "gridLines": false,
45
+ "enablePadding": false,
46
+ "min": "",
47
+ "max": "",
48
+ "labelColor": "#333",
49
+ "tickLabelColor": "#333",
50
+ "tickColor": "#333",
51
+ "rightHideAxis": true,
52
+ "rightAxisSize": 0,
53
+ "rightLabel": "",
54
+ "rightLabelOffsetSize": 0,
55
+ "rightAxisLabelColor": "#333",
56
+ "rightAxisTickLabelColor": "#333",
57
+ "rightAxisTickColor": "#333",
58
+ "numTicks": "",
59
+ "axisPadding": 0,
60
+ "scalePadding": 10,
61
+ "tickRotation": 0,
62
+ "anchors": [],
63
+ "shoMissingDataLabel": true,
64
+ "showMissingDataLine": true,
65
+ "categories": []
66
+ },
67
+ "boxplot": {
68
+ "plots": [],
69
+ "borders": "true",
70
+ "plotOutlierValues": false,
71
+ "plotNonOutlierValues": true,
72
+ "labels": {
73
+ "q1": "Lower Quartile",
74
+ "q2": "q2",
75
+ "q3": "Upper Quartile",
76
+ "q4": "q4",
77
+ "minimum": "Minimum",
78
+ "maximum": "Maximum",
79
+ "mean": "Mean",
80
+ "median": "Median",
81
+ "sd": "Standard Deviation",
82
+ "iqr": "Interquartile Range",
83
+ "count": "Count",
84
+ "outliers": "Outliers",
85
+ "values": "Values",
86
+ "lowerBounds": "Lower Bounds",
87
+ "upperBounds": "Upper Bounds"
88
+ }
89
+ },
90
+ "topAxis": {
91
+ "hasLine": false
92
+ },
93
+ "isLegendValue": false,
94
+ "barThickness": 0.35,
95
+ "barHeight": 25,
96
+ "barSpace": 15,
97
+ "heights": {
98
+ "vertical": 300,
99
+ "horizontal": 750
100
+ },
101
+ "xAxis": {
102
+ "sortDates": false,
103
+ "anchors": [],
104
+ "type": "categorical",
105
+ "showTargetLabel": true,
106
+ "targetLabel": "Target",
107
+ "hideAxis": false,
108
+ "hideLabel": false,
109
+ "hideTicks": false,
110
+ "size": 75,
111
+ "tickRotation": "45",
112
+ "min": "",
113
+ "max": "",
114
+ "labelColor": "#333",
115
+ "tickLabelColor": "#333",
116
+ "tickColor": "#333",
117
+ "numTicks": "",
118
+ "labelOffset": 0,
119
+ "axisPadding": 200,
120
+ "target": 0,
121
+ "maxTickRotation": 0,
122
+ "padding": "0",
123
+ "showYearsOnce": false,
124
+ "sortByRecentDate": false,
125
+ "dataKey": "date",
126
+ "axisBBox": 116.57705688476562,
127
+ "tickWidthMax": 93,
128
+ "dateParseFormat": "%Y-%m-%d",
129
+ "dateDisplayFormat": "%Y-%m-%d",
130
+ "manual": false,
131
+ "label": "Date"
132
+ },
133
+ "table": {
134
+ "label": "Data Table",
135
+ "expanded": true,
136
+ "limitHeight": false,
137
+ "height": "",
138
+ "caption": "",
139
+ "showDownloadUrl": false,
140
+ "showDataTableLink": true,
141
+ "showDownloadLinkBelow": true,
142
+ "indexLabel": "",
143
+ "download": true,
144
+ "showVertical": true,
145
+ "dateDisplayFormat": "%Y-%m-%d",
146
+ "showMissingDataLabel": true,
147
+ "showSuppressedSymbol": true,
148
+ "show": true
149
+ },
150
+ "orientation": "vertical",
151
+ "color": "pinkpurple",
152
+ "columns": {
153
+ "male_ci": {
154
+ "label": "Male (CI)",
155
+ "dataTable": true,
156
+ "tooltips": false,
157
+ "prefix": "",
158
+ "suffix": "",
159
+ "forestPlot": false,
160
+ "startingPoint": "0",
161
+ "forestPlotAlignRight": false,
162
+ "roundToPlace": 0,
163
+ "commas": false,
164
+ "showInViz": false,
165
+ "forestPlotStartingPoint": 0,
166
+ "name": "male_ci"
167
+ },
168
+ "female_ci": {
169
+ "label": "Female (CI)",
170
+ "dataTable": true,
171
+ "tooltips": false,
172
+ "prefix": "",
173
+ "suffix": "",
174
+ "forestPlot": false,
175
+ "startingPoint": "0",
176
+ "forestPlotAlignRight": false,
177
+ "roundToPlace": 0,
178
+ "commas": false,
179
+ "showInViz": false,
180
+ "forestPlotStartingPoint": 0,
181
+ "name": "female_ci"
182
+ },
183
+ "male": {
184
+ "label": "male",
185
+ "dataTable": false,
186
+ "tooltips": false,
187
+ "prefix": "",
188
+ "suffix": "",
189
+ "forestPlot": false,
190
+ "startingPoint": "0",
191
+ "forestPlotAlignRight": false,
192
+ "roundToPlace": 0,
193
+ "commas": false,
194
+ "showInViz": false,
195
+ "forestPlotStartingPoint": 0,
196
+ "name": "male"
197
+ },
198
+ "female": {
199
+ "label": "female",
200
+ "dataTable": false,
201
+ "tooltips": false,
202
+ "prefix": "",
203
+ "suffix": "",
204
+ "forestPlot": false,
205
+ "startingPoint": "0",
206
+ "forestPlotAlignRight": false,
207
+ "roundToPlace": 0,
208
+ "commas": false,
209
+ "showInViz": false,
210
+ "forestPlotStartingPoint": 0,
211
+ "name": "female"
212
+ },
213
+ "date": {
214
+ "label": "Date",
215
+ "dataTable": true,
216
+ "tooltips": false,
217
+ "prefix": "",
218
+ "suffix": "",
219
+ "forestPlot": false,
220
+ "startingPoint": "0",
221
+ "forestPlotAlignRight": false,
222
+ "roundToPlace": 0,
223
+ "commas": false,
224
+ "showInViz": false,
225
+ "forestPlotStartingPoint": 0,
226
+ "name": "date"
227
+ }
228
+ },
229
+ "legend": {
230
+ "hide": false,
231
+ "behavior": "isolate",
232
+ "axisAlign": true,
233
+ "singleRow": true,
234
+ "colorCode": "",
235
+ "reverseLabelOrder": false,
236
+ "description": "",
237
+ "dynamicLegend": false,
238
+ "dynamicLegendDefaultText": "Show All",
239
+ "dynamicLegendItemLimit": 5,
240
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
241
+ "dynamicLegendChartMessage": "Select Options from the Legend",
242
+ "label": "",
243
+ "lineMode": false,
244
+ "verticalSorted": false,
245
+ "highlightOnHover": false,
246
+ "hideSuppressedLabels": false,
247
+ "hideSuppressionLink": false,
248
+ "seriesHighlight": [],
249
+ "style": "circles",
250
+ "subStyle": "linear blocks",
251
+ "tickRotation": "",
252
+ "hideBorder": {
253
+ "side": false,
254
+ "topBottom": true
255
+ },
256
+ "position": "right"
257
+ },
258
+ "brush": {
259
+ "height": 25,
260
+ "active": false
261
+ },
262
+ "exclusions": {
263
+ "active": true,
264
+ "keys": [],
265
+ "dateStart": "2023-01-02",
266
+ "dateEnd": "2023-01-11"
267
+ },
268
+ "palette": "qualitative-bold",
269
+ "isPaletteReversed": false,
270
+ "twoColor": {
271
+ "palette": "monochrome-1",
272
+ "isPaletteReversed": false
273
+ },
274
+ "labels": false,
275
+ "dataFormat": {
276
+ "commas": false,
277
+ "prefix": "",
278
+ "suffix": "",
279
+ "abbreviated": false,
280
+ "bottomSuffix": "",
281
+ "bottomPrefix": "",
282
+ "bottomAbbreviated": false
283
+ },
284
+ "confidenceKeys": {
285
+ "upper": "female_lower",
286
+ "lower": "female_upper"
287
+ },
288
+ "visual": {
289
+ "border": true,
290
+ "accent": true,
291
+ "background": true,
292
+ "verticalHoverLine": false,
293
+ "horizontalHoverLine": false
294
+ },
295
+ "useLogScale": false,
296
+ "filterBehavior": "Filter Change",
297
+ "highlightedBarValues": [],
298
+ "series": [
299
+ {
300
+ "dataKey": "female",
301
+ "type": "Line",
302
+ "axis": "Left",
303
+ "tooltip": true
304
+ }
305
+ ],
306
+ "tooltips": {
307
+ "opacity": 90,
308
+ "singleSeries": false,
309
+ "dateDisplayFormat": ""
310
+ },
311
+ "forestPlot": {
312
+ "startAt": 0,
313
+ "colors": {
314
+ "line": "",
315
+ "shape": ""
316
+ },
317
+ "lineOfNoEffect": {
318
+ "show": true
319
+ },
320
+ "type": "",
321
+ "pooledResult": {
322
+ "diamondHeight": 5,
323
+ "column": ""
324
+ },
325
+ "estimateField": "",
326
+ "estimateRadius": "",
327
+ "shape": "square",
328
+ "rowHeight": 20,
329
+ "description": {
330
+ "show": true,
331
+ "text": "description",
332
+ "location": 0
333
+ },
334
+ "result": {
335
+ "show": true,
336
+ "text": "result",
337
+ "location": 100
338
+ },
339
+ "radius": {
340
+ "min": 2,
341
+ "max": 10,
342
+ "scalingColumn": ""
343
+ },
344
+ "regression": {
345
+ "lower": 0,
346
+ "upper": 0,
347
+ "estimateField": 0
348
+ },
349
+ "leftWidthOffset": 0,
350
+ "rightWidthOffset": 0,
351
+ "showZeroLine": false,
352
+ "leftLabel": "",
353
+ "rightLabel": ""
354
+ },
355
+ "area": {
356
+ "isStacked": false
357
+ },
358
+ "sankey": {
359
+ "title": {
360
+ "defaultColor": "black"
361
+ },
362
+ "iterations": 1,
363
+ "rxValue": 0.9,
364
+ "overallSize": {
365
+ "width": 900,
366
+ "height": 700
367
+ },
368
+ "margin": {
369
+ "margin_y": 25,
370
+ "margin_x": 0
371
+ },
372
+ "nodeSize": {
373
+ "nodeWidth": 26,
374
+ "nodeHeight": 40
375
+ },
376
+ "nodePadding": 55,
377
+ "nodeFontColor": "black",
378
+ "nodeColor": {
379
+ "default": "#ff8500",
380
+ "inactive": "#808080"
381
+ },
382
+ "linkColor": {
383
+ "default": "#ffc900",
384
+ "inactive": "#D3D3D3"
385
+ },
386
+ "opacity": {
387
+ "nodeOpacityDefault": 1,
388
+ "nodeOpacityInactive": 0.1,
389
+ "LinkOpacityDefault": 1,
390
+ "LinkOpacityInactive": 0.1
391
+ },
392
+ "storyNodeFontColor": "#006778",
393
+ "storyNodeText": [],
394
+ "nodeValueStyle": {
395
+ "textBefore": "(",
396
+ "textAfter": ")"
397
+ },
398
+ "data": []
399
+ },
400
+ "visualizationType": "Line",
401
+ "data": [
402
+ {
403
+ "date": "2023-01-01",
404
+ "male": 67,
405
+ "male_lower": 65,
406
+ "male_upper": 69,
407
+ "female": 77,
408
+ "female_lower": 73,
409
+ "female_upper": 81,
410
+ "male_ci": "CI (65, 69)",
411
+ "female_ci": "CI (73, 81)"
412
+ },
413
+ {
414
+ "date": "2023-01-02",
415
+ "male": 11,
416
+ "male_lower": 10,
417
+ "male_upper": 13,
418
+ "female": 21,
419
+ "female_lower": 18,
420
+ "female_upper": 24,
421
+ "male_ci": "CI (10, 13)",
422
+ "female_ci": "CI (18, 24)"
423
+ },
424
+ {
425
+ "date": "2023-01-03",
426
+ "male": 94,
427
+ "male_lower": 92,
428
+ "male_upper": 96,
429
+ "female": 104,
430
+ "female_lower": 100,
431
+ "female_upper": 108,
432
+ "male_ci": "CI (92, 96)",
433
+ "female_ci": "CI (100, 108)"
434
+ },
435
+ {
436
+ "date": "2023-01-04",
437
+ "male": 95,
438
+ "male_lower": 93,
439
+ "male_upper": 97,
440
+ "female": 105,
441
+ "female_lower": 101,
442
+ "female_upper": 109,
443
+ "male_ci": "CI (93, 97)",
444
+ "female_ci": "CI (101, 109)"
445
+ },
446
+ {
447
+ "date": "2023-01-05",
448
+ "male": 79,
449
+ "male_lower": 77,
450
+ "male_upper": 81,
451
+ "female": 89,
452
+ "female_lower": 85,
453
+ "female_upper": 93,
454
+ "male_ci": "CI (77, 81)",
455
+ "female_ci": "CI (85, 93)"
456
+ },
457
+ {
458
+ "date": "2023-01-06",
459
+ "male": 2,
460
+ "male_lower": 1,
461
+ "male_upper": 3,
462
+ "female": 12,
463
+ "female_lower": 9,
464
+ "female_upper": 15,
465
+ "male_ci": "CI (1, 3)",
466
+ "female_ci": "CI (9, 15)"
467
+ },
468
+ {
469
+ "date": "2023-01-07",
470
+ "male": 36,
471
+ "male_lower": 34,
472
+ "male_upper": 38,
473
+ "female": 46,
474
+ "female_lower": 42,
475
+ "female_upper": 50,
476
+ "male_ci": "CI (34, 38)",
477
+ "female_ci": "CI (42, 50)"
478
+ },
479
+ {
480
+ "date": "2023-01-08",
481
+ "male": 9,
482
+ "male_lower": 7,
483
+ "male_upper": 11,
484
+ "female": 19,
485
+ "female_lower": 16,
486
+ "female_upper": 22,
487
+ "male_ci": "CI (7, 11)",
488
+ "female_ci": "CI (16, 22)"
489
+ },
490
+ {
491
+ "date": "2023-01-09",
492
+ "male": 3,
493
+ "male_lower": 2,
494
+ "male_upper": 4,
495
+ "female": 13,
496
+ "female_lower": 10,
497
+ "female_upper": 16,
498
+ "male_ci": "CI (2, 4)",
499
+ "female_ci": "CI (10, 16)"
500
+ },
501
+ {
502
+ "date": "2023-01-10",
503
+ "male": 64,
504
+ "male_lower": 62,
505
+ "male_upper": 66,
506
+ "female": 74,
507
+ "female_lower": 70,
508
+ "female_upper": 78,
509
+ "male_ci": "CI (62, 66)",
510
+ "female_ci": "CI (70, 78)"
511
+ }
512
+ ],
513
+ "dataFileName": "valid-forecast-data.csv",
514
+ "dataFileSourceType": "file",
515
+ "dataDescription": {
516
+ "horizontal": false,
517
+ "series": false
518
+ },
519
+ "version": "4.24.10",
520
+ "dynamicMarginTop": 0,
521
+ "regions": []
522
+ }