@cdc/dashboard 4.25.8 → 4.25.11

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 (88) hide show
  1. package/dist/{cdcdashboard-fce76882.es.js → cdcdashboard-BnB1QM5d.es.js} +6 -13
  2. package/dist/{cdcdashboard-c55ac1ea.es.js → cdcdashboard-D6CG2-Hb.es.js} +5 -12
  3. package/dist/{cdcdashboard-31a33da1.es.js → cdcdashboard-MXgURbdZ.es.js} +6 -13
  4. package/dist/{cdcdashboard-1a1724a1.es.js → cdcdashboard-dgT_1dIT.es.js} +136 -151
  5. package/dist/cdcdashboard.js +80040 -75976
  6. package/examples/api-test/categories.json +18 -0
  7. package/examples/api-test/chart-data.json +602 -0
  8. package/examples/api-test/topics.json +47 -0
  9. package/examples/api-test/years.json +22 -0
  10. package/examples/markup-axis-label.json +4167 -0
  11. package/examples/private/DEV-10538.json +407 -0
  12. package/examples/private/DEV-11405.json +39112 -0
  13. package/examples/private/big-dashboard.json +39112 -0
  14. package/examples/private/brfs-2.json +1532 -0
  15. package/examples/private/brfs.json +2128 -2138
  16. package/examples/private/clade-2.json +430 -0
  17. package/examples/private/delete.json +32919 -0
  18. package/examples/private/diabetes.json +5582 -0
  19. package/examples/private/example-2.json +49796 -0
  20. package/examples/private/group-legend-test.json +328 -0
  21. package/examples/private/map.json +1211 -0
  22. package/examples/private/markup-footer/burden_toolkit_mortality_diabetes_attributable_deaths_data.csv +14041 -0
  23. package/examples/private/markup-footer/burden_toolkit_mortality_diabetes_attributable_deaths_per_100000_data.csv +14041 -0
  24. package/examples/private/markup-footer/burden_toolkit_mortality_qaly_data.csv +18721 -0
  25. package/examples/private/markup-footer/burden_toolkit_mortality_yll_data.csv +18721 -0
  26. package/examples/private/markup-footer/mortality-deaths-footnotes-age.csv +3 -0
  27. package/examples/private/markup-variables.json +1451 -0
  28. package/examples/private/markup.json +5471 -0
  29. package/examples/private/mpox.json +38128 -0
  30. package/examples/private/north-dakota.json +1132 -0
  31. package/examples/private/ophdst.json +38754 -0
  32. package/examples/private/pedro.json +1 -0
  33. package/examples/private/pivot.json +683 -0
  34. package/examples/private/reset.json +32920 -0
  35. package/examples/private/sewershed.json +435 -0
  36. package/examples/private/tobacco.json +1938 -0
  37. package/examples/test-api-filter-reset.json +132 -0
  38. package/index.html +2 -2
  39. package/package.json +16 -10
  40. package/src/CdcDashboard.tsx +1 -3
  41. package/src/CdcDashboardComponent.tsx +34 -16
  42. package/src/DashboardContext.tsx +5 -1
  43. package/src/_stories/Dashboard.API.stories.tsx +62 -0
  44. package/src/_stories/Dashboard.stories.tsx +492 -472
  45. package/src/_stories/_mock/api/cessation.json +1 -0
  46. package/src/_stories/_mock/api/data-explorer.json +1 -0
  47. package/src/_stories/_mock/api/explore-by-location.json +1 -0
  48. package/src/_stories/_mock/api/explore-by-topic.json +1 -0
  49. package/src/_stories/_mock/api/legislation.json +1 -0
  50. package/src/_stories/_mock/api/oral-health-data.json +1 -0
  51. package/src/_stories/_mock/custom-order-new-values.json +116 -0
  52. package/src/components/CollapsibleVisualizationRow.tsx +1 -1
  53. package/src/components/DashboardFilters/DashboardFilters.tsx +34 -23
  54. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +29 -12
  55. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +81 -112
  56. package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +82 -52
  57. package/src/components/DashboardFilters/DashboardFiltersWrapper.tsx +130 -31
  58. package/src/components/DashboardFilters/_stories/DashboardFilters.stories.tsx +80 -21
  59. package/src/components/DataDesignerModal.tsx +227 -210
  60. package/src/components/Header/Header.tsx +13 -12
  61. package/src/components/Toggle/Toggle.tsx +48 -47
  62. package/src/components/VisualizationRow.tsx +13 -6
  63. package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +2 -0
  64. package/src/components/Widget/Widget.tsx +47 -18
  65. package/src/helpers/addValuesToDashboardFilters.ts +111 -60
  66. package/src/helpers/apiFilterHelpers.ts +190 -166
  67. package/src/helpers/filterData.ts +52 -7
  68. package/src/helpers/filterResetHelpers.ts +102 -0
  69. package/src/helpers/formatConfigBeforeSave.ts +137 -0
  70. package/src/helpers/getVizConfig.ts +36 -18
  71. package/src/helpers/loadAPIFilters.ts +109 -99
  72. package/src/helpers/reloadURLHelpers.ts +1 -1
  73. package/src/helpers/tests/filterResetHelpers.test.ts +532 -0
  74. package/src/helpers/tests/formatConfigBeforeSave.test.ts +69 -0
  75. package/src/index.tsx +1 -1
  76. package/src/scss/editor-panel.scss +3 -431
  77. package/src/scss/grid.scss +7 -5
  78. package/src/scss/main.scss +1 -24
  79. package/src/store/errorMessage/errorMessage.reducer.ts +1 -1
  80. package/src/types/DashboardFilters.ts +9 -8
  81. package/src/types/InitialState.ts +12 -12
  82. package/vite.config.js +1 -1
  83. package/vitest.config.ts +16 -0
  84. package/src/coreStyles_dashboard.scss +0 -3
  85. package/src/helpers/getAutoLoadVisualization.ts +0 -11
  86. package/src/scss/mixins.scss +0 -47
  87. package/src/scss/variables.scss +0 -5
  88. /package/dist/{cdcdashboard-548642e6.es.js → cdcdashboard-Ct2SB0vL.es.js} +0 -0
@@ -0,0 +1,328 @@
1
+ {
2
+ "dashboard": {
3
+ "theme": "theme-blue",
4
+ "sharedFilters": [
5
+ {
6
+ "key": "New Dashboard Filter 1",
7
+ "showDropdown": true,
8
+ "type": "datafilter",
9
+ "orderedValues": [],
10
+ "datasetKey": "test2.csv",
11
+ "columnName": "state",
12
+ "usedBy": [
13
+ "map1749061009678"
14
+ ],
15
+ "tier": 1
16
+ }
17
+ ]
18
+ },
19
+ "rows": [
20
+ {
21
+ "columns": [
22
+ {
23
+ "width": 12,
24
+ "widget": "dashboardFilters1758563094998"
25
+ }
26
+ ],
27
+ "uuid": 1758563248622
28
+ },
29
+ {
30
+ "uuid": 1758563248622,
31
+ "toggle": true,
32
+ "equalHeight": "__​undefined__",
33
+ "columns": [
34
+ {
35
+ "toggleName": "County",
36
+ "width": 12,
37
+ "widget": "map1749061009678"
38
+ },
39
+ {
40
+ "toggleName": "__​undefined__",
41
+ "width": 12
42
+ }
43
+ ]
44
+ }
45
+ ],
46
+ "visualizations": {
47
+ "map1749061009678": {
48
+ "annotations": [],
49
+ "customColors": [
50
+ "#6d085a",
51
+ "#b83d93",
52
+ "#e3e3e3",
53
+ "#3bbbb0",
54
+ "#006166",
55
+ "#ffffff"
56
+ ],
57
+ "general": {
58
+ "navigationTarget": "_self",
59
+ "noDataMessage": "No State Selected",
60
+ "annotationDropdownText": "Annotations",
61
+ "geoBorderColor": "darkGray",
62
+ "headerColor": "theme-blue",
63
+ "title": "",
64
+ "showTitle": true,
65
+ "showSidebar": true,
66
+ "showDownloadMediaButton": false,
67
+ "displayAsHex": false,
68
+ "displayStateLabels": true,
69
+ "territoriesAlwaysShow": false,
70
+ "language": "en",
71
+ "geoType": "single-state",
72
+ "geoLabelOverride": "",
73
+ "hasRegions": false,
74
+ "fullBorder": false,
75
+ "type": "data",
76
+ "convertFipsCodes": true,
77
+ "palette": {
78
+ "isReversed": false,
79
+ "name": "sequential_pink_purple",
80
+ "version": "1.0",
81
+ "customColors": [
82
+ "#6d085a",
83
+ "#b83d93",
84
+ "#e3e3e3",
85
+ "#3bbbb0",
86
+ "#006166",
87
+ "#ffffff"
88
+ ]
89
+ },
90
+ "allowMapZoom": false,
91
+ "hideGeoColumnInTooltip": false,
92
+ "hidePrimaryColumnInTooltip": false,
93
+ "statesPicked": [
94
+ {
95
+ "fipsCode": "01",
96
+ "stateName": "Alabama"
97
+ }
98
+ ],
99
+ "filterControlsStatesPicked": "state"
100
+ },
101
+ "type": "map",
102
+ "columns": {
103
+ "geo": {
104
+ "name": "fips",
105
+ "label": "Location",
106
+ "tooltip": false,
107
+ "dataTable": true
108
+ },
109
+ "primary": {
110
+ "dataTable": true,
111
+ "tooltip": true,
112
+ "prefix": "",
113
+ "suffix": "",
114
+ "name": "category",
115
+ "label": "category",
116
+ "roundToPlace": 0
117
+ },
118
+ "navigate": {
119
+ "name": ""
120
+ },
121
+ "latitude": {
122
+ "name": ""
123
+ },
124
+ "longitude": {
125
+ "name": ""
126
+ }
127
+ },
128
+ "legend": {
129
+ "descriptions": {},
130
+ "specialClasses": [],
131
+ "unified": false,
132
+ "singleColumn": true,
133
+ "singleRow": false,
134
+ "verticalSorted": false,
135
+ "showSpecialClassesLast": false,
136
+ "dynamicDescription": false,
137
+ "type": "category",
138
+ "numberOfItems": 6,
139
+ "position": "side",
140
+ "title": "Epidemic Trends",
141
+ "style": "circles",
142
+ "subStyle": "linear blocks",
143
+ "tickRotation": "",
144
+ "singleColumnLegend": false,
145
+ "hideBorder": false,
146
+ "groupBy": "",
147
+ "categoryValuesOrder": [
148
+ "Growing",
149
+ "Likely Growing",
150
+ "Not Changing",
151
+ "Likely Declining",
152
+ "Declining",
153
+ "Not Estimated"
154
+ ],
155
+ "additionalCategories": [
156
+ "Growing",
157
+ "Likely Growing",
158
+ "Not Changing",
159
+ "Likely Declining",
160
+ "Declining",
161
+ "Not Estimated"
162
+ ]
163
+ },
164
+ "filters": [],
165
+ "table": {
166
+ "wrapColumns": false,
167
+ "label": "Data Table",
168
+ "expanded": false,
169
+ "limitHeight": false,
170
+ "height": "",
171
+ "caption": "",
172
+ "showDownloadUrl": false,
173
+ "showDataTableLink": false,
174
+ "showDownloadLinkBelow": true,
175
+ "showFullGeoNameInCSV": false,
176
+ "forceDisplay": true,
177
+ "download": false,
178
+ "indexLabel": "",
179
+ "cellMinWidth": "0",
180
+ "collapsible": true,
181
+ "sharedFilterColumns": [
182
+ "State"
183
+ ],
184
+ "showNonGeoData": true
185
+ },
186
+ "tooltips": {
187
+ "appearanceType": "hover",
188
+ "linkLabel": "Learn More",
189
+ "opacity": 90,
190
+ "capitalizeLabels": true
191
+ },
192
+ "visual": {
193
+ "minBubbleSize": 1,
194
+ "maxBubbleSize": 20,
195
+ "extraBubbleBorder": false,
196
+ "cityStyle": "circle",
197
+ "cityStyleLabel": "",
198
+ "showBubbleZeros": false,
199
+ "additionalCityStyles": [],
200
+ "geoCodeCircleSize": 8
201
+ },
202
+ "mapPosition": {
203
+ "coordinates": [
204
+ 0,
205
+ 30
206
+ ],
207
+ "zoom": 1
208
+ },
209
+ "map": {
210
+ "layers": [],
211
+ "patterns": []
212
+ },
213
+ "hexMap": {
214
+ "type": "",
215
+ "shapeGroups": [
216
+ {
217
+ "legendTitle": "",
218
+ "legendDescription": "",
219
+ "items": [
220
+ {
221
+ "key": "",
222
+ "shape": "Arrow Up",
223
+ "column": "",
224
+ "operator": "=",
225
+ "value": ""
226
+ }
227
+ ]
228
+ }
229
+ ]
230
+ },
231
+ "filterBehavior": "Filter Change",
232
+ "filterIntro": "",
233
+ "openModal": true,
234
+ "uid": "map1749061009678",
235
+ "dataDescription": {
236
+ "horizontal": false,
237
+ "series": false
238
+ },
239
+ "dataKey": "test2.csv"
240
+ },
241
+ "dashboardFilters1758563094998": {
242
+ "filters": [],
243
+ "filterBehavior": "Filter Change",
244
+ "newViz": true,
245
+ "openModal": true,
246
+ "uid": "dashboardFilters1758563094998",
247
+ "type": "dashboardFilters",
248
+ "sharedFilterIndexes": [
249
+ 0
250
+ ],
251
+ "visualizationType": "dashboardFilters"
252
+ }
253
+ },
254
+ "table": {
255
+ "label": "Data Table",
256
+ "show": false,
257
+ "showDownloadUrl": false,
258
+ "showVertical": true
259
+ },
260
+ "id": 15,
261
+ "category": "General",
262
+ "type": "dashboard",
263
+ "subType": null,
264
+ "orientation": null,
265
+ "content": "Present multiple data visualizations with shared filter controls.",
266
+ "visualizationType": null,
267
+ "activeVizButtonID": 15,
268
+ "version": "4.25.9",
269
+ "migrations": {
270
+ "addColorMigration": true
271
+ },
272
+ "uuid": 1758563086392,
273
+ "label": "COVID-19",
274
+ "runtime": {},
275
+ "general": {
276
+ "palette": {
277
+ "version": "1.0",
278
+ "backups": [
279
+ {
280
+ "name": "__​undefined__",
281
+ "version": "1.0",
282
+ "isReversed": "__​undefined__"
283
+ }
284
+ ]
285
+ }
286
+ },
287
+ "datasets": {
288
+ "test2.csv": {
289
+ "data": [
290
+ {
291
+ "fips": "47025",
292
+ "location_name": "Claiborne",
293
+ "location_type": "county",
294
+ "category": "Growing",
295
+ "median": 1.0037363,
296
+ "state": "Tennessee"
297
+ },
298
+ {
299
+ "fips": "47151",
300
+ "location_name": "Scott",
301
+ "location_type": "county",
302
+ "category": "Likely Growing",
303
+ "median": 0.9458983,
304
+ "state": "Tennessee"
305
+ },
306
+ {
307
+ "category": "Likely Declining",
308
+ "fips": "13001",
309
+ "location_name": "Appling",
310
+ "location_type": "county",
311
+ "report_date": "Tue, 09 Sep 2025 00:00:00 GMT",
312
+ "state": "Georgia"
313
+ },
314
+ {
315
+ "category": "Declining",
316
+ "fips": "13003",
317
+ "location_name": "Atkinson",
318
+ "location_type": "county",
319
+ "state": "Georgia"
320
+ }
321
+ ],
322
+ "dataFileSize": 123,
323
+ "dataFileName": "test2.csv",
324
+ "dataFileSourceType": "file",
325
+ "dataFileFormat": "CSV"
326
+ }
327
+ }
328
+ }