@cdc/chart 4.24.10 → 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 (94) hide show
  1. package/dist/cdcchart.js +35019 -34301
  2. package/examples/feature/boxplot/boxplot-data.json +88 -22
  3. package/examples/feature/boxplot/boxplot.json +540 -16
  4. package/examples/feature/boxplot/testing.csv +7 -7
  5. package/examples/feature/sankey/sankey-example-data.json +126 -14
  6. package/examples/feature/tests-date-exclusions/date-exclusions-config.json +372 -12
  7. package/examples/private/DEV-8850-2.json +493 -0
  8. package/examples/private/DEV-9822.json +574 -0
  9. package/examples/private/DEV-9840.json +553 -0
  10. package/examples/private/DEV-9850-3.json +461 -0
  11. package/examples/private/chart.json +1084 -0
  12. package/examples/private/ci_formatted.json +202 -0
  13. package/examples/private/ci_issue.json +3016 -0
  14. package/examples/private/completed.json +634 -0
  15. package/examples/private/dem-data-long.csv +20 -0
  16. package/examples/private/dem-data-long.json +36 -0
  17. package/examples/private/demographic_data.csv +157 -0
  18. package/examples/private/demographic_data.json +2654 -0
  19. package/examples/private/demographic_dynamic.json +443 -0
  20. package/examples/private/demographic_standard.json +560 -0
  21. package/examples/private/ehdi.json +29939 -0
  22. package/examples/private/test.json +493 -0
  23. package/index.html +10 -7
  24. package/package.json +2 -2
  25. package/src/CdcChart.tsx +132 -152
  26. package/src/_stories/Chart.Anchors.stories.tsx +31 -0
  27. package/src/_stories/Chart.CustomColors.stories.tsx +19 -0
  28. package/src/_stories/Chart.DynamicSeries.stories.tsx +34 -0
  29. package/src/_stories/Chart.Legend.Gradient.stories.tsx +42 -1
  30. package/src/_stories/Chart.stories.tsx +37 -6
  31. package/src/_stories/ChartAxisLabels.stories.tsx +4 -1
  32. package/src/_stories/ChartEditor.stories.tsx +27 -0
  33. package/src/_stories/ChartLine.Suppression.stories.tsx +25 -0
  34. package/src/_stories/ChartPrefixSuffix.stories.tsx +8 -0
  35. package/{examples/feature/area/area-chart-date-city-temperature.json → src/_stories/_mock/area_chart_stacked.json} +125 -27
  36. package/src/_stories/_mock/boxplot_multiseries.json +647 -0
  37. package/src/_stories/_mock/dynamic_series_bar_config.json +723 -0
  38. package/src/_stories/_mock/dynamic_series_config.json +979 -0
  39. package/src/_stories/_mock/line_chart_dynamic_ci.json +493 -0
  40. package/src/_stories/_mock/line_chart_non_dynamic_ci.json +522 -0
  41. package/{examples/feature/scatterplot/scatterplot.json → src/_stories/_mock/scatterplot_mock.json} +62 -92
  42. package/src/_stories/_mock/short_dates.json +288 -0
  43. package/src/_stories/_mock/suppression_mock.json +1549 -0
  44. package/src/components/AreaChart/components/AreaChart.Stacked.jsx +15 -3
  45. package/src/components/Axis/Categorical.Axis.tsx +2 -2
  46. package/src/components/BarChart/components/BarChart.Horizontal.tsx +46 -37
  47. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +43 -9
  48. package/src/components/BarChart/components/BarChart.Vertical.tsx +53 -47
  49. package/src/components/BarChart/helpers/getBarData.ts +28 -0
  50. package/src/components/BarChart/helpers/index.ts +1 -2
  51. package/src/components/BarChart/helpers/tests/getBarData.test.ts +74 -0
  52. package/src/components/BoxPlot/BoxPlot.tsx +131 -0
  53. package/src/components/BoxPlot/helpers/index.ts +54 -0
  54. package/src/components/BrushChart.tsx +23 -26
  55. package/src/components/EditorPanel/EditorPanel.tsx +117 -139
  56. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +3 -3
  57. package/src/components/EditorPanel/components/Panels/Panel.BoxPlot.tsx +51 -6
  58. package/src/components/EditorPanel/components/Panels/Panel.Regions.tsx +40 -9
  59. package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +3 -3
  60. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +122 -56
  61. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +1 -2
  62. package/src/components/EditorPanel/useEditorPermissions.ts +20 -2
  63. package/src/components/Legend/Legend.Component.tsx +11 -12
  64. package/src/components/Legend/Legend.tsx +16 -16
  65. package/src/components/Legend/helpers/getLegendClasses.ts +59 -0
  66. package/src/components/Legend/helpers/index.ts +2 -1
  67. package/src/components/Legend/tests/getLegendClasses.test.ts +115 -0
  68. package/src/components/LineChart/components/LineChart.Circle.tsx +1 -1
  69. package/src/components/LineChart/helpers.ts +49 -43
  70. package/src/components/LineChart/index.tsx +135 -83
  71. package/src/components/LinearChart.tsx +196 -181
  72. package/src/components/PieChart/PieChart.tsx +7 -1
  73. package/src/components/Sankey/components/ColumnList.tsx +19 -0
  74. package/src/components/Sankey/components/Sankey.tsx +479 -0
  75. package/src/components/Sankey/helpers/getSankeyTooltip.tsx +33 -0
  76. package/src/components/Sankey/index.tsx +1 -492
  77. package/src/components/Sankey/sankey.scss +22 -21
  78. package/src/components/Sankey/types/index.ts +1 -1
  79. package/src/components/Sankey/useSankeyAlert.tsx +60 -0
  80. package/src/components/ScatterPlot/ScatterPlot.jsx +20 -4
  81. package/src/data/initial-state.js +7 -12
  82. package/src/helpers/countNumOfTicks.ts +57 -0
  83. package/src/helpers/getQuartiles.ts +15 -18
  84. package/src/hooks/useMinMax.ts +44 -16
  85. package/src/hooks/useReduceData.ts +43 -10
  86. package/src/hooks/useScales.ts +90 -35
  87. package/src/hooks/useTooltip.tsx +59 -50
  88. package/src/scss/DataTable.scss +5 -0
  89. package/src/scss/main.scss +6 -20
  90. package/src/types/ChartConfig.ts +6 -19
  91. package/src/types/ChartContext.ts +4 -1
  92. package/src/types/ForestPlot.ts +8 -0
  93. package/src/components/BoxPlot/BoxPlot.jsx +0 -111
  94. package/src/hooks/useLegendClasses.ts +0 -72
@@ -0,0 +1,288 @@
1
+ {
2
+ "annotations": [],
3
+ "type": "chart",
4
+ "debugSvg": false,
5
+ "chartMessage": { "noData": "No Data Available" },
6
+ "title": "",
7
+ "showTitle": true,
8
+ "showDownloadMediaButton": false,
9
+ "theme": "theme-blue",
10
+ "animate": false,
11
+ "fontSize": "medium",
12
+ "lineDatapointStyle": "hover",
13
+ "lineDatapointColor": "Same as Line",
14
+ "barHasBorder": "false",
15
+ "isLollipopChart": false,
16
+ "lollipopShape": "circle",
17
+ "lollipopColorStyle": "two-tone",
18
+ "visualizationSubType": "regular",
19
+ "barStyle": "flat",
20
+ "roundingStyle": "standard",
21
+ "tipRounding": "top",
22
+ "isResponsiveTicks": false,
23
+ "general": {
24
+ "annotationDropdownText": "Annotations",
25
+ "showDownloadButton": false,
26
+ "showMissingDataLabel": true,
27
+ "showSuppressedSymbol": true,
28
+ "showZeroValueData": true,
29
+ "hideNullValue": true,
30
+ "showAnnotationDropdown": false
31
+ },
32
+ "padding": { "left": 5, "right": 5 },
33
+ "preliminaryData": [],
34
+ "yAxis": {
35
+ "hideAxis": true,
36
+ "displayNumbersOnBar": false,
37
+ "hideLabel": false,
38
+ "hideTicks": true,
39
+ "size": "50",
40
+ "gridLines": true,
41
+ "enablePadding": true,
42
+ "min": "0",
43
+ "max": "99",
44
+ "labelColor": "#333",
45
+ "tickLabelColor": "#333",
46
+ "tickColor": "#333",
47
+ "rightHideAxis": true,
48
+ "rightAxisSize": 0,
49
+ "rightLabel": "",
50
+ "rightLabelOffsetSize": 0,
51
+ "rightAxisLabelColor": "#333",
52
+ "rightAxisTickLabelColor": "#333",
53
+ "rightAxisTickColor": "#333",
54
+ "numTicks": "5",
55
+ "axisPadding": 0,
56
+ "scalePadding": 10,
57
+ "tickRotation": 0,
58
+ "anchors": [],
59
+ "shoMissingDataLabel": true,
60
+ "showMissingDataLine": true,
61
+ "categories": [],
62
+ "label": "",
63
+ "maxValue": 108.9
64
+ },
65
+ "boxplot": {
66
+ "plots": [],
67
+ "borders": "true",
68
+ "plotOutlierValues": false,
69
+ "plotNonOutlierValues": true,
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
+ "firstQuartilePercentage": 25,
88
+ "thirdQuartilePercentage": 75,
89
+ "boxWidthPercentage": 40,
90
+ "legend": { "showHowToReadText": false, "howToReadText": "" }
91
+ },
92
+ "topAxis": { "hasLine": false },
93
+ "isLegendValue": false,
94
+ "barThickness": 0.35,
95
+ "barHeight": 25,
96
+ "barSpace": 15,
97
+ "heights": { "vertical": "250", "horizontal": 750, "mobileVertical": "150" },
98
+ "xAxis": {
99
+ "sortDates": false,
100
+ "anchors": [],
101
+ "type": "date-time",
102
+ "showTargetLabel": true,
103
+ "targetLabel": "Target",
104
+ "hideAxis": false,
105
+ "hideLabel": false,
106
+ "hideTicks": false,
107
+ "size": "0",
108
+ "tickRotation": 0,
109
+ "min": "",
110
+ "max": "",
111
+ "labelColor": "#333",
112
+ "tickLabelColor": "#333",
113
+ "tickColor": "#333",
114
+ "numTicks": "6",
115
+ "labelOffset": 0,
116
+ "axisPadding": 200,
117
+ "target": 0,
118
+ "maxTickRotation": "45",
119
+ "padding": "0",
120
+ "showYearsOnce": false,
121
+ "sortByRecentDate": false,
122
+ "dataKey": "week_end",
123
+ "label": "",
124
+ "dateParseFormat": "%Y-%m-%d",
125
+ "dateDisplayFormat": "%b. %-d %Y",
126
+ "axisBBox": 24.939998626708984,
127
+ "tickWidthMax": 108,
128
+ "viewportNumTicks": { "xxs": "4" },
129
+ "manual": true
130
+ },
131
+ "table": {
132
+ "label": "Data Table",
133
+ "expanded": false,
134
+ "limitHeight": false,
135
+ "height": "",
136
+ "caption": "",
137
+ "showDownloadUrl": false,
138
+ "showDataTableLink": true,
139
+ "showDownloadLinkBelow": true,
140
+ "indexLabel": "Week Ending",
141
+ "download": true,
142
+ "showVertical": true,
143
+ "dateDisplayFormat": "",
144
+ "showMissingDataLabel": true,
145
+ "showSuppressedSymbol": true,
146
+ "show": true
147
+ },
148
+ "orientation": "vertical",
149
+ "color": "pinkpurple",
150
+ "columns": {},
151
+ "legend": {
152
+ "hide": false,
153
+ "behavior": "isolate",
154
+ "axisAlign": true,
155
+ "singleRow": true,
156
+ "colorCode": "",
157
+ "reverseLabelOrder": false,
158
+ "description": "",
159
+ "dynamicLegend": false,
160
+ "dynamicLegendDefaultText": "Show All",
161
+ "dynamicLegendItemLimit": 5,
162
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
163
+ "dynamicLegendChartMessage": "Select Options from the Legend",
164
+ "label": "",
165
+ "lineMode": false,
166
+ "verticalSorted": false,
167
+ "highlightOnHover": false,
168
+ "hideSuppressedLabels": false,
169
+ "hideSuppressionLink": false,
170
+ "seriesHighlight": [],
171
+ "style": "lines",
172
+ "subStyle": "linear blocks",
173
+ "tickRotation": "",
174
+ "hideBorder": { "side": false, "topBottom": true },
175
+ "position": "bottom"
176
+ },
177
+ "brush": { "height": 25, "active": false },
178
+ "exclusions": { "active": false, "keys": [] },
179
+ "palette": "qualitative-bold",
180
+ "isPaletteReversed": false,
181
+ "twoColor": { "palette": "monochrome-1", "isPaletteReversed": false },
182
+ "labels": false,
183
+ "dataFormat": {
184
+ "commas": true,
185
+ "prefix": "",
186
+ "suffix": " percent vaccinated",
187
+ "abbreviated": true,
188
+ "bottomSuffix": "",
189
+ "bottomPrefix": "",
190
+ "bottomAbbreviated": false,
191
+ "roundTo": "1",
192
+ "onlyShowTopPrefixSuffix": true
193
+ },
194
+ "confidenceKeys": {},
195
+ "visual": {
196
+ "border": true,
197
+ "accent": true,
198
+ "background": true,
199
+ "verticalHoverLine": true,
200
+ "horizontalHoverLine": false
201
+ },
202
+ "useLogScale": false,
203
+ "filterBehavior": "Filter Change",
204
+ "highlightedBarValues": [],
205
+ "series": [
206
+ { "dataKey": "Adults", "type": "Line", "axis": "Left", "tooltip": true, "name": "Adults (18+)" },
207
+ { "dataKey": "Children", "type": "dashed-md", "axis": "Left", "tooltip": true, "name": "Children (under 18)" }
208
+ ],
209
+ "tooltips": { "opacity": 90, "singleSeries": false, "dateDisplayFormat": "%B %-d, %Y" },
210
+ "forestPlot": {
211
+ "startAt": 0,
212
+ "colors": { "line": "", "shape": "" },
213
+ "lineOfNoEffect": { "show": true },
214
+ "type": "",
215
+ "pooledResult": { "diamondHeight": 5, "column": "" },
216
+ "estimateField": "",
217
+ "estimateRadius": "",
218
+ "shape": "square",
219
+ "rowHeight": 20,
220
+ "description": { "show": true, "text": "description", "location": 0 },
221
+ "result": { "show": true, "text": "result", "location": 100 },
222
+ "radius": { "min": 2, "max": 10, "scalingColumn": "" },
223
+ "regression": { "lower": 0, "upper": 0, "estimateField": 0 },
224
+ "leftWidthOffset": 0,
225
+ "rightWidthOffset": 0,
226
+ "showZeroLine": false,
227
+ "leftLabel": "",
228
+ "rightLabel": ""
229
+ },
230
+ "area": { "isStacked": false },
231
+ "sankey": {
232
+ "title": { "defaultColor": "black" },
233
+ "iterations": 1,
234
+ "rxValue": 0.9,
235
+ "overallSize": { "width": 900, "height": 700 },
236
+ "margin": { "margin_y": 25, "margin_x": 0 },
237
+ "nodeSize": { "nodeWidth": 26, "nodeHeight": 40 },
238
+ "nodePadding": 55,
239
+ "nodeFontColor": "black",
240
+ "nodeColor": { "default": "#ff8500", "inactive": "#808080" },
241
+ "linkColor": { "default": "#ffc900", "inactive": "#D3D3D3" },
242
+ "opacity": {
243
+ "nodeOpacityDefault": 1,
244
+ "nodeOpacityInactive": 0.1,
245
+ "LinkOpacityDefault": 1,
246
+ "LinkOpacityInactive": 0.1
247
+ },
248
+ "storyNodeFontColor": "#006778",
249
+ "storyNodeText": [],
250
+ "nodeValueStyle": { "textBefore": "(", "textAfter": ")" },
251
+ "data": []
252
+ },
253
+ "visualizationType": "Line",
254
+ "customColors": ["#f06f19", "#f06f19", "#f06f19", "#000000", "#0A6C75", "#C0F2FD", "#C0F2FD", "#C0F2FD", "#C0F2FD"],
255
+ "dataFileName": "/wcms/vizdata/Respitory_Viruses/NISVaccinationsCumulative7a.json",
256
+ "dataFileSourceType": "url",
257
+ "dataUrl": "https://www.cdc.gov/wcms/vizdata/Respitory_Viruses/NISVaccinationsCumulative7a.json",
258
+ "dataDescription": {
259
+ "horizontal": false,
260
+ "series": true,
261
+ "singleRow": false,
262
+ "xKey": "week_end",
263
+ "valueKeysTallSupport": ["value"],
264
+ "ignoredKeys": [
265
+ "suppression_flag",
266
+ "95_confidence_interval_lower",
267
+ "95_confidence_interval_upper",
268
+ "95_confidence_internal_range"
269
+ ],
270
+ "seriesKey": "demographic_group"
271
+ },
272
+ "version": "4.24.10",
273
+ "description": "<div class=\"text-left\"><p class=\"fnote\">95% confidence intervals for the point estimates are presented at the data.cdc.gov link below.<br><br> Data last updated on <span data-timestamp=\"NISVaccinationsCumulative7a:Data_as_of\"></span> and presented through <span data-timestamp=\"NISVaccinationsCumulative7a:Data_Presented_Through\"></span>. <a href=\"https://data.cdc.gov/Vaccinations/Weekly-Respiratory-Virus-Vaccination-Data-Children/5c6r-xi2t\">View this dataset</a> on data.CDC.gov.</p></div>",
274
+ "dynamicMarginTop": 0,
275
+ "filters": [
276
+ {
277
+ "values": ["COVID-19", "Influenza", "RSV"],
278
+ "filterStyle": "dropdown",
279
+ "id": 1726688167656,
280
+ "columnName": "pathogen",
281
+ "showDropdown": false,
282
+ "active": "COVID-19"
283
+ }
284
+ ],
285
+ "runtimeDataUrl": "https://wcms-wp.cdc.gov/wcms/vizdata/Respitory_Viruses/NISVaccinationsCumulative7a.json",
286
+ "showLineSeriesLabels": false,
287
+ "colorMatchLineSeriesLabels": false
288
+ }