@cdc/chart 4.25.5-1 → 4.25.6-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 (63) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cdcchart.js +31118 -27459
  3. package/examples/private/0527.json +1 -0
  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/line-issue.json +497 -0
  20. package/examples/private/not-loading.json +360 -0
  21. package/examples/private/test.json +493 -0
  22. package/examples/private/testing-pie.json +436 -0
  23. package/index.html +130 -130
  24. package/package.json +2 -2
  25. package/src/CdcChartComponent.tsx +66 -26
  26. package/src/_stories/Chart.stories.tsx +99 -93
  27. package/src/_stories/ChartPrefixSuffix.stories.tsx +29 -32
  28. package/src/_stories/_mock/pie_calculated_area.json +417 -0
  29. package/src/components/BarChart/components/BarChart.Horizontal.tsx +4 -13
  30. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +3 -14
  31. package/src/components/BarChart/components/BarChart.Vertical.tsx +2 -8
  32. package/src/components/Brush/BrushChart.tsx +73 -0
  33. package/src/components/Brush/BrushController..tsx +39 -0
  34. package/src/components/DeviationBar.jsx +0 -1
  35. package/src/components/EditorPanel/EditorPanel.tsx +246 -156
  36. package/src/components/EditorPanel/components/Panels/Panel.General.tsx +2 -2
  37. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +3 -2
  38. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +2 -1
  39. package/src/components/EditorPanel/components/Panels/panelVisual.styles.css +8 -0
  40. package/src/components/EditorPanel/useEditorPermissions.ts +7 -4
  41. package/src/components/HoverLine/HoverLine.tsx +74 -0
  42. package/src/components/Legend/Legend.Suppression.tsx +47 -3
  43. package/src/components/Legend/helpers/index.ts +1 -1
  44. package/src/components/LineChart/helpers.ts +7 -7
  45. package/src/components/LineChart/index.tsx +3 -6
  46. package/src/components/LinearChart.tsx +108 -72
  47. package/src/components/PieChart/PieChart.tsx +58 -13
  48. package/src/data/initial-state.js +8 -5
  49. package/src/helpers/countNumOfTicks.ts +4 -19
  50. package/src/helpers/getNewRuntime.ts +35 -0
  51. package/src/helpers/getPiePercent.ts +22 -0
  52. package/src/helpers/getTransformedData.ts +22 -0
  53. package/src/helpers/tests/getNewRuntime.test.ts +82 -0
  54. package/src/helpers/tests/getPiePercent.test.ts +38 -0
  55. package/src/hooks/useRightAxis.ts +1 -1
  56. package/src/hooks/useScales.ts +8 -3
  57. package/src/hooks/useTooltip.tsx +24 -10
  58. package/src/scss/main.scss +8 -4
  59. package/src/store/chart.actions.ts +2 -6
  60. package/src/store/chart.reducer.ts +23 -23
  61. package/src/types/ChartConfig.ts +7 -4
  62. package/src/types/ChartContext.ts +0 -2
  63. package/src/components/ZoomBrush.tsx +0 -251
@@ -0,0 +1,436 @@
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": "small",
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": "",
22
+ "roundingStyle": "standard",
23
+ "tipRounding": "top",
24
+ "isResponsiveTicks": false,
25
+ "general": {
26
+ "annotationDropdownText": "Annotations",
27
+ "showMissingDataLabel": true,
28
+ "showSuppressedSymbol": true,
29
+ "showZeroValueData": true,
30
+ "hideNullValue": true,
31
+ "showDownloadButton": false,
32
+ "showZeroValueDataLabel": true
33
+ },
34
+ "padding": {
35
+ "left": 5,
36
+ "right": 5
37
+ },
38
+ "preliminaryData": [],
39
+ "yAxis": {
40
+ "hideAxis": false,
41
+ "displayNumbersOnBar": false,
42
+ "hideLabel": false,
43
+ "hideTicks": false,
44
+ "size": 50,
45
+ "gridLines": false,
46
+ "enablePadding": false,
47
+ "min": "",
48
+ "max": "",
49
+ "labelColor": "#333",
50
+ "tickLabelColor": "#333",
51
+ "tickColor": "#333",
52
+ "rightHideAxis": true,
53
+ "rightAxisSize": 0,
54
+ "rightLabel": "",
55
+ "rightLabelOffsetSize": 0,
56
+ "rightAxisLabelColor": "#333",
57
+ "rightAxisTickLabelColor": "#333",
58
+ "rightAxisTickColor": "#333",
59
+ "numTicks": "",
60
+ "axisPadding": 0,
61
+ "scalePadding": 10,
62
+ "tickRotation": 0,
63
+ "anchors": [],
64
+ "shoMissingDataLabel": true,
65
+ "showMissingDataLine": true,
66
+ "categories": [],
67
+ "dataKey": "Number of adults",
68
+ "labelPlacement": "On Date/Category Axis",
69
+ "maxValue": 62
70
+ },
71
+ "boxplot": {
72
+ "plots": [],
73
+ "borders": "true",
74
+ "plotOutlierValues": false,
75
+ "plotNonOutlierValues": true,
76
+ "labels": {
77
+ "q1": "Lower Quartile",
78
+ "q2": "q2",
79
+ "q3": "Upper Quartile",
80
+ "q4": "q4",
81
+ "minimum": "Minimum",
82
+ "maximum": "Maximum",
83
+ "mean": "Mean",
84
+ "median": "Median",
85
+ "sd": "Standard Deviation",
86
+ "iqr": "Interquartile Range",
87
+ "total": "Total",
88
+ "outliers": "Outliers",
89
+ "values": "Values",
90
+ "lowerBounds": "Lower Bounds",
91
+ "upperBounds": "Upper Bounds",
92
+ "count": "Count"
93
+ },
94
+ "firstQuartilePercentage": 25,
95
+ "thirdQuartilePercentage": 75,
96
+ "boxWidthPercentage": 40,
97
+ "legend": {
98
+ "showHowToReadText": false,
99
+ "howToReadText": ""
100
+ }
101
+ },
102
+ "topAxis": {
103
+ "hasLine": false
104
+ },
105
+ "isLegendValue": false,
106
+ "barThickness": 0.35,
107
+ "barHeight": "40",
108
+ "barSpace": "50",
109
+ "heights": {
110
+ "vertical": 300,
111
+ "horizontal": 180
112
+ },
113
+ "xAxis": {
114
+ "sortDates": false,
115
+ "anchors": [],
116
+ "type": "categorical",
117
+ "showTargetLabel": true,
118
+ "targetLabel": "Target",
119
+ "hideAxis": false,
120
+ "hideLabel": false,
121
+ "hideTicks": false,
122
+ "size": 75,
123
+ "tickRotation": 0,
124
+ "min": "",
125
+ "max": "",
126
+ "labelColor": "#333",
127
+ "tickLabelColor": "#333",
128
+ "tickColor": "#333",
129
+ "numTicks": "",
130
+ "labelOffset": 0,
131
+ "axisPadding": 200,
132
+ "target": 0,
133
+ "maxTickRotation": 0,
134
+ "padding": 5,
135
+ "showYearsOnce": false,
136
+ "sortByRecentDate": false,
137
+ "dataKey": "Subgroup",
138
+ "tickWidthMax": 46
139
+ },
140
+ "table": {
141
+ "label": "Data Table",
142
+ "expanded": false,
143
+ "limitHeight": false,
144
+ "height": "",
145
+ "caption": "",
146
+ "showDownloadUrl": false,
147
+ "showDataTableLink": true,
148
+ "showDownloadLinkBelow": true,
149
+ "indexLabel": "",
150
+ "download": true,
151
+ "showVertical": true,
152
+ "dateDisplayFormat": "",
153
+ "showMissingDataLabel": true,
154
+ "showSuppressedSymbol": true,
155
+ "show": true,
156
+ "showDownloadImgButton": false,
157
+ "collapsible": true
158
+ },
159
+ "orientation": "Pie",
160
+ "color": "pinkpurple",
161
+ "columns": {
162
+ "95% Confidence interval": {
163
+ "label": "95% Confidence interval",
164
+ "dataTable": true,
165
+ "tooltips": false,
166
+ "prefix": "",
167
+ "suffix": "",
168
+ "forestPlot": false,
169
+ "startingPoint": "0",
170
+ "forestPlotAlignRight": false,
171
+ "roundToPlace": 0,
172
+ "commas": false,
173
+ "showInViz": false,
174
+ "forestPlotStartingPoint": 0,
175
+ "name": "95% Confidence interval",
176
+ "order": 4
177
+ },
178
+ "Percent": {
179
+ "label": "Percent",
180
+ "dataTable": true,
181
+ "tooltips": false,
182
+ "prefix": "",
183
+ "suffix": "%",
184
+ "forestPlot": false,
185
+ "startingPoint": "0",
186
+ "forestPlotAlignRight": false,
187
+ "roundToPlace": "1",
188
+ "commas": false,
189
+ "showInViz": false,
190
+ "forestPlotStartingPoint": 0,
191
+ "name": "Percent",
192
+ "order": 3
193
+ },
194
+ "Number of adults": {
195
+ "label": "Number of adults",
196
+ "dataTable": true,
197
+ "tooltips": false,
198
+ "prefix": "",
199
+ "suffix": "",
200
+ "forestPlot": false,
201
+ "startingPoint": "0",
202
+ "forestPlotAlignRight": false,
203
+ "roundToPlace": 0,
204
+ "commas": true,
205
+ "showInViz": false,
206
+ "forestPlotStartingPoint": 0,
207
+ "name": "Number of adults"
208
+ }
209
+ },
210
+ "legend": {
211
+ "hide": false,
212
+ "behavior": "isolate",
213
+ "axisAlign": true,
214
+ "singleRow": true,
215
+ "colorCode": "",
216
+ "reverseLabelOrder": false,
217
+ "description": "",
218
+ "dynamicLegend": false,
219
+ "dynamicLegendDefaultText": "Show All",
220
+ "dynamicLegendItemLimit": 5,
221
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
222
+ "dynamicLegendChartMessage": "Select Options from the Legend",
223
+ "label": "",
224
+ "lineMode": false,
225
+ "verticalSorted": false,
226
+ "highlightOnHover": false,
227
+ "hideSuppressedLabels": false,
228
+ "hideSuppressionLink": false,
229
+ "seriesHighlight": [],
230
+ "style": "circles",
231
+ "subStyle": "linear blocks",
232
+ "groupBy": "",
233
+ "shape": "circle",
234
+ "tickRotation": "",
235
+ "hideBorder": {
236
+ "side": false,
237
+ "topBottom": true
238
+ },
239
+ "position": "right"
240
+ },
241
+ "brush": {
242
+ "height": 25,
243
+ "active": false
244
+ },
245
+ "exclusions": {
246
+ "active": false,
247
+ "keys": []
248
+ },
249
+ "palette": "sequential-bluereverse",
250
+ "isPaletteReversed": true,
251
+ "twoColor": {
252
+ "palette": "monochrome-1",
253
+ "isPaletteReversed": false
254
+ },
255
+ "labels": false,
256
+ "dataFormat": {
257
+ "commas": false,
258
+ "prefix": "",
259
+ "suffix": "",
260
+ "abbreviated": false,
261
+ "bottomSuffix": "",
262
+ "bottomPrefix": "",
263
+ "bottomAbbreviated": false,
264
+ "roundTo": ""
265
+ },
266
+ "confidenceKeys": {},
267
+ "visual": {
268
+ "border": true,
269
+ "accent": true,
270
+ "background": true,
271
+ "verticalHoverLine": false,
272
+ "horizontalHoverLine": false,
273
+ "lineDatapointSymbol": "none",
274
+ "maximumShapeAmount": 7
275
+ },
276
+ "useLogScale": false,
277
+ "filterBehavior": "Filter Change",
278
+ "highlightedBarValues": [],
279
+ "series": [
280
+ {
281
+ "dataKey": "Percent",
282
+ "type": "Bar",
283
+ "axis": "Left",
284
+ "tooltip": true
285
+ }
286
+ ],
287
+ "tooltips": {
288
+ "opacity": 90,
289
+ "singleSeries": false,
290
+ "dateDisplayFormat": ""
291
+ },
292
+ "forestPlot": {
293
+ "startAt": 0,
294
+ "colors": {
295
+ "line": "",
296
+ "shape": ""
297
+ },
298
+ "lineOfNoEffect": {
299
+ "show": true
300
+ },
301
+ "type": "",
302
+ "pooledResult": {
303
+ "diamondHeight": 5,
304
+ "column": ""
305
+ },
306
+ "estimateField": "",
307
+ "estimateRadius": "",
308
+ "shape": "square",
309
+ "rowHeight": 20,
310
+ "description": {
311
+ "show": true,
312
+ "text": "description",
313
+ "location": 0
314
+ },
315
+ "result": {
316
+ "show": true,
317
+ "text": "result",
318
+ "location": 100
319
+ },
320
+ "radius": {
321
+ "min": 2,
322
+ "max": 10,
323
+ "scalingColumn": ""
324
+ },
325
+ "regression": {
326
+ "lower": 0,
327
+ "upper": 0,
328
+ "estimateField": 0
329
+ },
330
+ "leftWidthOffset": 0,
331
+ "rightWidthOffset": 0,
332
+ "showZeroLine": false,
333
+ "leftLabel": "",
334
+ "rightLabel": ""
335
+ },
336
+ "area": {
337
+ "isStacked": false
338
+ },
339
+ "sankey": {
340
+ "title": {
341
+ "defaultColor": "black"
342
+ },
343
+ "iterations": 1,
344
+ "rxValue": 0.9,
345
+ "overallSize": {
346
+ "width": 900,
347
+ "height": 700
348
+ },
349
+ "margin": {
350
+ "margin_y": 25,
351
+ "margin_x": 0
352
+ },
353
+ "nodeSize": {
354
+ "nodeWidth": 26,
355
+ "nodeHeight": 40
356
+ },
357
+ "nodePadding": 55,
358
+ "nodeFontColor": "black",
359
+ "nodeColor": {
360
+ "default": "#ff8500",
361
+ "inactive": "#808080"
362
+ },
363
+ "linkColor": {
364
+ "default": "#ffc900",
365
+ "inactive": "#D3D3D3"
366
+ },
367
+ "opacity": {
368
+ "nodeOpacityDefault": 1,
369
+ "nodeOpacityInactive": 0.1,
370
+ "LinkOpacityDefault": 1,
371
+ "LinkOpacityInactive": 0.1
372
+ },
373
+ "storyNodeFontColor": "#006778",
374
+ "storyNodeText": [],
375
+ "nodeValueStyle": {
376
+ "textBefore": "(",
377
+ "textAfter": ")"
378
+ },
379
+ "data": []
380
+ },
381
+ "datasets": {},
382
+ "visualizationType": "Pie",
383
+ "data": [
384
+ {
385
+ "Subgroup": "Yes",
386
+ "Number of adults": "1201537",
387
+ "Percent": "38.4",
388
+ "95% Confidence interval": "34.8 - 42.1"
389
+ },
390
+ {
391
+ "Subgroup": "No",
392
+ "Number of adults": "1927950",
393
+ "Percent": "61.6",
394
+ "95% Confidence interval": "57.9 - 65.2"
395
+ }
396
+ ],
397
+ "dataFileName": "disability-status.csv",
398
+ "dataFileSourceType": "file",
399
+ "dataDescription": {
400
+ "horizontal": false,
401
+ "series": false
402
+ },
403
+ "version": "4.25.1",
404
+ "footnotes": "<sup>a</sup> The final recode variable created for Washington Group Adult Composite Disability Indicator. Disability is defined by the reported level of difficulty (no difficulty, some difficulty, a lot of difficulty, or cannot do at all) in six functioning domains: seeing (even if wearing glasses), hearing (even if wearing hearing aids), mobility (walking or climbing stairs), communication (understanding or being understood by others), cognition (remembering or concentrating), and self-care (such as washing all over or dressing). Sample adults who responded \"a lot of difficulty\" or \"cannot do at all\" to at least one question were considered to have a disability.<br/><br/>\n\n<sup>b</sup> Active epilepsy was defined as adults who answered that a doctor or health professional had ever told them they had a seizure disorder or epilepsy and also reported taking medication, having had one or more seizures in the past year, or both.",
405
+ "dynamicMarginTop": 0,
406
+ "filters": [],
407
+ "migrations": {
408
+ "addColorMigration": true
409
+ },
410
+ "id": 13,
411
+ "category": "Charts",
412
+ "label": "Pie",
413
+ "subType": "Pie",
414
+ "icon": {
415
+ "key": null,
416
+ "ref": null,
417
+ "props": {},
418
+ "_owner": null
419
+ },
420
+ "content": "Present the numerical proportions of a data series.",
421
+ "activeVizButtonID": 13,
422
+ "formattedData": [
423
+ {
424
+ "Subgroup": "Yes",
425
+ "Number of adults": "1201537",
426
+ "Percent": "38.4",
427
+ "95% Confidence interval": "34.8 - 42.1"
428
+ },
429
+ {
430
+ "Subgroup": "No",
431
+ "Number of adults": "1927950",
432
+ "Percent": "61.6",
433
+ "95% Confidence interval": "57.9 - 65.2"
434
+ }
435
+ ]
436
+ }