@cdc/chart 4.25.3-6 → 4.25.3

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 (32) hide show
  1. package/dist/cdcchart-1a1724a1.es.js +4886 -0
  2. package/dist/cdcchart.js +51921 -76151
  3. package/index.html +1 -1
  4. package/package.json +2 -2
  5. package/src/CdcChart.tsx +1 -22
  6. package/src/CdcChartComponent.tsx +27 -13
  7. package/src/_stories/Chart.CI.stories.tsx +33 -0
  8. package/src/_stories/Chart.Legend.Gradient.stories.tsx +6 -0
  9. package/src/_stories/Chart.stories.tsx +0 -16
  10. package/src/_stories/_mock/bar_chart_ci_labels.json +620 -0
  11. package/src/_stories/_mock/legend_groupBy_mock.json +474 -0
  12. package/src/components/BarChart/components/BarChart.Horizontal.tsx +1 -1
  13. package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +1 -1
  14. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +1 -1
  15. package/src/components/BarChart/components/BarChart.Vertical.tsx +2 -2
  16. package/src/components/EditorPanel/EditorPanel.tsx +60 -24
  17. package/src/components/EditorPanel/helpers/updateFieldRankByValue.ts +4 -3
  18. package/src/components/Legend/Legend.Component.tsx +69 -58
  19. package/src/components/Legend/Legend.tsx +3 -1
  20. package/src/components/Legend/LegendGroup/LegendGroup.styles.css +40 -0
  21. package/src/components/Legend/LegendGroup/LegendGroup.tsx +103 -0
  22. package/src/components/Legend/LegendGroup/index.tsx +3 -0
  23. package/src/components/LineChart/components/LineChart.Circle.tsx +14 -9
  24. package/src/components/LineChart/index.tsx +18 -7
  25. package/src/components/LinearChart.tsx +38 -30
  26. package/src/data/initial-state.js +1 -1
  27. package/src/helpers/dataHelpers.ts +10 -0
  28. package/src/helpers/sizeHelpers.ts +23 -0
  29. package/src/hooks/useBarChart.ts +2 -1
  30. package/src/hooks/useScales.ts +2 -8
  31. package/src/store/chart.actions.ts +1 -1
  32. package/src/types/ChartConfig.ts +2 -1
@@ -0,0 +1,620 @@
1
+ {
2
+ "annotations": [],
3
+ "type": "chart",
4
+ "debugSvg": false,
5
+ "chartMessage": {
6
+ "noData": "No Data Available"
7
+ },
8
+ "title": "",
9
+ "showTitle": false,
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": true,
25
+ "general": {
26
+ "annotationDropdownText": "Annotations",
27
+ "showDownloadButton": false,
28
+ "showMissingDataLabel": false,
29
+ "showSuppressedSymbol": true,
30
+ "showZeroValueData": false,
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": "75",
44
+ "gridLines": false,
45
+ "enablePadding": false,
46
+ "min": "0.1",
47
+ "max": "3",
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": "6",
59
+ "axisPadding": 0,
60
+ "scalePadding": 10,
61
+ "tickRotation": 0,
62
+ "anchors": [],
63
+ "shoMissingDataLabel": true,
64
+ "showMissingDataLine": true,
65
+ "categories": [],
66
+ "label": "Reported cases per 100,000 Population",
67
+ "type": "linear"
68
+ },
69
+ "boxplot": {
70
+ "plots": [],
71
+ "borders": "true",
72
+ "plotOutlierValues": false,
73
+ "plotNonOutlierValues": true,
74
+ "labels": {
75
+ "q1": "Lower Quartile",
76
+ "q2": "q2",
77
+ "q3": "Upper Quartile",
78
+ "q4": "q4",
79
+ "minimum": "Minimum",
80
+ "maximum": "Maximum",
81
+ "mean": "Mean",
82
+ "median": "Median",
83
+ "sd": "Standard Deviation",
84
+ "iqr": "Interquartile Range",
85
+ "count": "Count",
86
+ "outliers": "Outliers",
87
+ "values": "Values",
88
+ "lowerBounds": "Lower Bounds",
89
+ "upperBounds": "Upper Bounds"
90
+ }
91
+ },
92
+ "topAxis": {
93
+ "hasLine": false
94
+ },
95
+ "isLegendValue": false,
96
+ "barThickness": "0.66",
97
+ "barHeight": 25,
98
+ "barSpace": 15,
99
+ "heights": {
100
+ "vertical": 300,
101
+ "horizontal": 750
102
+ },
103
+ "xAxis": {
104
+ "sortDates": false,
105
+ "anchors": [],
106
+ "type": "categorical",
107
+ "showTargetLabel": true,
108
+ "targetLabel": "Target",
109
+ "hideAxis": false,
110
+ "hideLabel": false,
111
+ "hideTicks": false,
112
+ "size": 75,
113
+ "tickRotation": 0,
114
+ "min": "",
115
+ "max": "",
116
+ "labelColor": "#333",
117
+ "tickLabelColor": "#333",
118
+ "tickColor": "#333",
119
+ "numTicks": "",
120
+ "labelOffset": 0,
121
+ "axisPadding": 200,
122
+ "target": 0,
123
+ "maxTickRotation": 0,
124
+ "padding": 5,
125
+ "showYearsOnce": false,
126
+ "sortByRecentDate": false,
127
+ "dataKey": "Year",
128
+ "label": "Year",
129
+ "manual": true,
130
+ "axisBBox": 62.779998779296875,
131
+ "tickWidthMax": 39
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": false,
145
+ "dateDisplayFormat": "",
146
+ "showMissingDataLabel": true,
147
+ "showSuppressedSymbol": true,
148
+ "show": true
149
+ },
150
+ "orientation": "vertical",
151
+ "color": "pinkpurple",
152
+ "columns": {},
153
+ "legend": {
154
+ "hide": false,
155
+ "behavior": "isolate",
156
+ "axisAlign": true,
157
+ "singleRow": true,
158
+ "colorCode": "",
159
+ "reverseLabelOrder": false,
160
+ "description": "",
161
+ "dynamicLegend": false,
162
+ "dynamicLegendDefaultText": "Show All",
163
+ "dynamicLegendItemLimit": 5,
164
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
165
+ "dynamicLegendChartMessage": "Select Options from the Legend",
166
+ "label": "",
167
+ "lineMode": false,
168
+ "verticalSorted": false,
169
+ "highlightOnHover": false,
170
+ "hideSuppressedLabels": false,
171
+ "hideSuppressionLink": false,
172
+ "seriesHighlight": [],
173
+ "style": "boxes",
174
+ "subStyle": "linear blocks",
175
+ "shape": "circle",
176
+ "tickRotation": "",
177
+ "hideBorder": {
178
+ "side": false,
179
+ "topBottom": true
180
+ },
181
+ "position": "right"
182
+ },
183
+ "brush": {
184
+ "height": 25,
185
+ "active": false
186
+ },
187
+ "exclusions": {
188
+ "active": false,
189
+ "keys": []
190
+ },
191
+ "palette": "qualitative-bold",
192
+ "isPaletteReversed": false,
193
+ "twoColor": {
194
+ "palette": "monochrome-1",
195
+ "isPaletteReversed": false
196
+ },
197
+ "labels": true,
198
+ "dataFormat": {
199
+ "commas": false,
200
+ "prefix": "",
201
+ "suffix": "",
202
+ "abbreviated": false,
203
+ "bottomSuffix": "",
204
+ "bottomPrefix": "",
205
+ "bottomAbbreviated": false,
206
+ "roundTo": "1"
207
+ },
208
+ "confidenceKeys": {
209
+ "upper": "American Indian/Alaska Native",
210
+ "lower": "Asian/Pacific Islander"
211
+ },
212
+ "visual": {
213
+ "border": true,
214
+ "accent": true,
215
+ "background": true,
216
+ "verticalHoverLine": false,
217
+ "horizontalHoverLine": false,
218
+ "lineDatapointSymbol": "none",
219
+ "maximumShapeAmount": 7
220
+ },
221
+ "useLogScale": false,
222
+ "filterBehavior": "Filter Change",
223
+ "highlightedBarValues": [],
224
+ "series": [
225
+ {
226
+ "dataKey": "White, non-Hispanic",
227
+ "type": "Line",
228
+ "axis": "Left",
229
+ "tooltip": true
230
+ },
231
+ {
232
+ "dataKey": "Hispanic",
233
+ "type": "Line",
234
+ "axis": "Left",
235
+ "tooltip": true
236
+ }
237
+ ],
238
+ "tooltips": {
239
+ "opacity": 90,
240
+ "singleSeries": false,
241
+ "dateDisplayFormat": ""
242
+ },
243
+ "forestPlot": {
244
+ "startAt": 0,
245
+ "colors": {
246
+ "line": "",
247
+ "shape": ""
248
+ },
249
+ "lineOfNoEffect": {
250
+ "show": true
251
+ },
252
+ "type": "",
253
+ "pooledResult": {
254
+ "diamondHeight": 5,
255
+ "column": ""
256
+ },
257
+ "estimateField": "",
258
+ "estimateRadius": "",
259
+ "shape": "square",
260
+ "rowHeight": 20,
261
+ "description": {
262
+ "show": true,
263
+ "text": "description",
264
+ "location": 0
265
+ },
266
+ "result": {
267
+ "show": true,
268
+ "text": "result",
269
+ "location": 100
270
+ },
271
+ "radius": {
272
+ "min": 2,
273
+ "max": 10,
274
+ "scalingColumn": ""
275
+ },
276
+ "regression": {
277
+ "lower": 0,
278
+ "upper": 0,
279
+ "estimateField": 0
280
+ },
281
+ "leftWidthOffset": 0,
282
+ "rightWidthOffset": 0,
283
+ "showZeroLine": false,
284
+ "leftLabel": "",
285
+ "rightLabel": ""
286
+ },
287
+ "area": {
288
+ "isStacked": false
289
+ },
290
+ "sankey": {
291
+ "title": {
292
+ "defaultColor": "black"
293
+ },
294
+ "iterations": 1,
295
+ "rxValue": 0.9,
296
+ "overallSize": {
297
+ "width": 900,
298
+ "height": 700
299
+ },
300
+ "margin": {
301
+ "margin_y": 25,
302
+ "margin_x": 0
303
+ },
304
+ "nodeSize": {
305
+ "nodeWidth": 26,
306
+ "nodeHeight": 40
307
+ },
308
+ "nodePadding": 55,
309
+ "nodeFontColor": "black",
310
+ "nodeColor": {
311
+ "default": "#ff8500",
312
+ "inactive": "#808080"
313
+ },
314
+ "linkColor": {
315
+ "default": "#ffc900",
316
+ "inactive": "#D3D3D3"
317
+ },
318
+ "opacity": {
319
+ "nodeOpacityDefault": 1,
320
+ "nodeOpacityInactive": 0.1,
321
+ "LinkOpacityDefault": 1,
322
+ "LinkOpacityInactive": 0.1
323
+ },
324
+ "storyNodeFontColor": "#006778",
325
+ "storyNodeText": [],
326
+ "nodeValueStyle": {
327
+ "textBefore": "(",
328
+ "textAfter": ")"
329
+ },
330
+ "data": []
331
+ },
332
+ "errors": [],
333
+ "currentViewport": "lg",
334
+ "id": 4,
335
+ "category": "Charts",
336
+ "label": "Line",
337
+ "subType": "Line",
338
+ "icon": {
339
+ "key": null,
340
+ "ref": null,
341
+ "props": {},
342
+ "_owner": null
343
+ },
344
+ "content": "Present one or more data trends over time.",
345
+ "visualizationType": "Bar",
346
+ "datasets": {},
347
+ "activeVizButtonID": 4,
348
+ "data": [
349
+ {
350
+ "Year": "2007",
351
+ "American Indian/Alaska Native": "1.4",
352
+ "Asian/Pacific Islander": "0.9",
353
+ "Black, non-Hispanic": "2.3",
354
+ "White, non-Hispanic": "1",
355
+ "Hispanic": "1"
356
+ },
357
+ {
358
+ "Year": "2008",
359
+ "American Indian/Alaska Native": "1.8",
360
+ "Asian/Pacific Islander": "0.8",
361
+ "Black, non-Hispanic": "2.2",
362
+ "White, non-Hispanic": "0.9",
363
+ "Hispanic": "0.8"
364
+ },
365
+ {
366
+ "Year": "2009",
367
+ "American Indian/Alaska Native": "1",
368
+ "Asian/Pacific Islander": "0.7",
369
+ "Black, non-Hispanic": "1.7",
370
+ "White, non-Hispanic": "0.8",
371
+ "Hispanic": "0.7"
372
+ },
373
+ {
374
+ "Year": "2010",
375
+ "American Indian/Alaska Native": "1.1",
376
+ "Asian/Pacific Islander": "0.6",
377
+ "Black, non-Hispanic": "1.7",
378
+ "White, non-Hispanic": "0.8",
379
+ "Hispanic": "0.6"
380
+ },
381
+ {
382
+ "Year": "2011",
383
+ "American Indian/Alaska Native": "0.5",
384
+ "Asian/Pacific Islander": "0.4",
385
+ "Black, non-Hispanic": "1.4",
386
+ "White, non-Hispanic": "0.8",
387
+ "Hispanic": "0.4"
388
+ },
389
+ {
390
+ "Year": "2012",
391
+ "American Indian/Alaska Native": "0.7",
392
+ "Asian/Pacific Islander": "0.4",
393
+ "Black, non-Hispanic": "1.1",
394
+ "White, non-Hispanic": "0.8",
395
+ "Hispanic": "0.4"
396
+ },
397
+ {
398
+ "Year": "2013",
399
+ "American Indian/Alaska Native": "0.7",
400
+ "Asian/Pacific Islander": "0.3",
401
+ "Black, non-Hispanic": "0.9",
402
+ "White, non-Hispanic": "0.9",
403
+ "Hispanic": "0.4"
404
+ },
405
+ {
406
+ "Year": "2014",
407
+ "American Indian/Alaska Native": "0.8",
408
+ "Asian/Pacific Islander": "0.3",
409
+ "Black, non-Hispanic": "0.8",
410
+ "White, non-Hispanic": "0.9",
411
+ "Hispanic": "0.3"
412
+ },
413
+ {
414
+ "Year": "2015",
415
+ "American Indian/Alaska Native": "0.7",
416
+ "Asian/Pacific Islander": "0.4",
417
+ "Black, non-Hispanic": "1",
418
+ "White, non-Hispanic": "1.1",
419
+ "Hispanic": "0.3"
420
+ },
421
+ {
422
+ "Year": "2016",
423
+ "American Indian/Alaska Native": "0.5",
424
+ "Asian/Pacific Islander": "0.3",
425
+ "Black, non-Hispanic": "0.9",
426
+ "White, non-Hispanic": "1",
427
+ "Hispanic": "0.3"
428
+ },
429
+ {
430
+ "Year": "2017",
431
+ "American Indian/Alaska Native": "0.7",
432
+ "Asian/Pacific Islander": "0.3",
433
+ "Black, non-Hispanic": "1",
434
+ "White, non-Hispanic": "1.1",
435
+ "Hispanic": "0.3"
436
+ },
437
+ {
438
+ "Year": "2018",
439
+ "American Indian/Alaska Native": "0.9",
440
+ "Asian/Pacific Islander": "0.3",
441
+ "Black, non-Hispanic": "1",
442
+ "White, non-Hispanic": "1",
443
+ "Hispanic": "0.4"
444
+ },
445
+ {
446
+ "Year": "2019",
447
+ "American Indian/Alaska Native": "0.6",
448
+ "Asian/Pacific Islander": "0.3",
449
+ "Black, non-Hispanic": "0.9",
450
+ "White, non-Hispanic": "1",
451
+ "Hispanic": "0.4"
452
+ },
453
+ {
454
+ "Year": "2020",
455
+ "American Indian/Alaska Native": "0.4",
456
+ "Asian/Pacific Islander": "0.2",
457
+ "Black, non-Hispanic": "0.7",
458
+ "White, non-Hispanic": "0.7",
459
+ "Hispanic": "0.3"
460
+ },
461
+ {
462
+ "Year": "2021",
463
+ "American Indian/Alaska Native": "0.4",
464
+ "Asian/Pacific Islander": "0.2",
465
+ "Black, non-Hispanic": "0.9",
466
+ "White, non-Hispanic": "0.6",
467
+ "Hispanic": "0.4"
468
+ },
469
+ {
470
+ "Year": "2022",
471
+ "American Indian/Alaska Native": "0.4",
472
+ "Asian/Pacific Islander": "0.3",
473
+ "Black, non-Hispanic": "1",
474
+ "White, non-Hispanic": "0.6",
475
+ "Hispanic": "0.4"
476
+ }
477
+ ],
478
+ "dataFileName": "chart_data 2-6.csv",
479
+ "dataFileSourceType": "file",
480
+ "dataDescription": {
481
+ "horizontal": false,
482
+ "series": false
483
+ },
484
+ "version": "4.25.1",
485
+ "dynamicMarginTop": 67,
486
+ "formattedData": [
487
+ {
488
+ "Year": "2007",
489
+ "American Indian/Alaska Native": "1.4",
490
+ "Asian/Pacific Islander": "0.9",
491
+ "Black, non-Hispanic": "2.3",
492
+ "White, non-Hispanic": "1",
493
+ "Hispanic": "1"
494
+ },
495
+ {
496
+ "Year": "2008",
497
+ "American Indian/Alaska Native": "1.8",
498
+ "Asian/Pacific Islander": "0.8",
499
+ "Black, non-Hispanic": "2.2",
500
+ "White, non-Hispanic": "0.9",
501
+ "Hispanic": "0.8"
502
+ },
503
+ {
504
+ "Year": "2009",
505
+ "American Indian/Alaska Native": "1",
506
+ "Asian/Pacific Islander": "0.7",
507
+ "Black, non-Hispanic": "1.7",
508
+ "White, non-Hispanic": "0.8",
509
+ "Hispanic": "0.7"
510
+ },
511
+ {
512
+ "Year": "2010",
513
+ "American Indian/Alaska Native": "1.1",
514
+ "Asian/Pacific Islander": "0.6",
515
+ "Black, non-Hispanic": "1.7",
516
+ "White, non-Hispanic": "0.8",
517
+ "Hispanic": "0.6"
518
+ },
519
+ {
520
+ "Year": "2011",
521
+ "American Indian/Alaska Native": "0.5",
522
+ "Asian/Pacific Islander": "0.4",
523
+ "Black, non-Hispanic": "1.4",
524
+ "White, non-Hispanic": "0.8",
525
+ "Hispanic": "0.4"
526
+ },
527
+ {
528
+ "Year": "2012",
529
+ "American Indian/Alaska Native": "0.7",
530
+ "Asian/Pacific Islander": "0.4",
531
+ "Black, non-Hispanic": "1.1",
532
+ "White, non-Hispanic": "0.8",
533
+ "Hispanic": "0.4"
534
+ },
535
+ {
536
+ "Year": "2013",
537
+ "American Indian/Alaska Native": "0.7",
538
+ "Asian/Pacific Islander": "0.3",
539
+ "Black, non-Hispanic": "0.9",
540
+ "White, non-Hispanic": "0.9",
541
+ "Hispanic": "0.4"
542
+ },
543
+ {
544
+ "Year": "2014",
545
+ "American Indian/Alaska Native": "0.8",
546
+ "Asian/Pacific Islander": "0.3",
547
+ "Black, non-Hispanic": "0.8",
548
+ "White, non-Hispanic": "0.9",
549
+ "Hispanic": "0.3"
550
+ },
551
+ {
552
+ "Year": "2015",
553
+ "American Indian/Alaska Native": "0.7",
554
+ "Asian/Pacific Islander": "0.4",
555
+ "Black, non-Hispanic": "1",
556
+ "White, non-Hispanic": "1.1",
557
+ "Hispanic": "0.3"
558
+ },
559
+ {
560
+ "Year": "2016",
561
+ "American Indian/Alaska Native": "0.5",
562
+ "Asian/Pacific Islander": "0.3",
563
+ "Black, non-Hispanic": "0.9",
564
+ "White, non-Hispanic": "1",
565
+ "Hispanic": "0.3"
566
+ },
567
+ {
568
+ "Year": "2017",
569
+ "American Indian/Alaska Native": "0.7",
570
+ "Asian/Pacific Islander": "0.3",
571
+ "Black, non-Hispanic": "1",
572
+ "White, non-Hispanic": "1.1",
573
+ "Hispanic": "0.3"
574
+ },
575
+ {
576
+ "Year": "2018",
577
+ "American Indian/Alaska Native": "0.9",
578
+ "Asian/Pacific Islander": "0.3",
579
+ "Black, non-Hispanic": "1",
580
+ "White, non-Hispanic": "1",
581
+ "Hispanic": "0.4"
582
+ },
583
+ {
584
+ "Year": "2019",
585
+ "American Indian/Alaska Native": "0.6",
586
+ "Asian/Pacific Islander": "0.3",
587
+ "Black, non-Hispanic": "0.9",
588
+ "White, non-Hispanic": "1",
589
+ "Hispanic": "0.4"
590
+ },
591
+ {
592
+ "Year": "2020",
593
+ "American Indian/Alaska Native": "0.4",
594
+ "Asian/Pacific Islander": "0.2",
595
+ "Black, non-Hispanic": "0.7",
596
+ "White, non-Hispanic": "0.7",
597
+ "Hispanic": "0.3"
598
+ },
599
+ {
600
+ "Year": "2021",
601
+ "American Indian/Alaska Native": "0.4",
602
+ "Asian/Pacific Islander": "0.2",
603
+ "Black, non-Hispanic": "0.9",
604
+ "White, non-Hispanic": "0.6",
605
+ "Hispanic": "0.4"
606
+ },
607
+ {
608
+ "Year": "2022",
609
+ "American Indian/Alaska Native": "0.4",
610
+ "Asian/Pacific Islander": "0.3",
611
+ "Black, non-Hispanic": "1",
612
+ "White, non-Hispanic": "0.6",
613
+ "Hispanic": "0.4"
614
+ }
615
+ ],
616
+ "filters": [],
617
+ "migrations": {
618
+ "addColorMigration": true
619
+ }
620
+ }