@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,435 @@
1
+ {
2
+ "dashboard": {
3
+ "theme": "theme-blue",
4
+ "sharedFilters": []
5
+ },
6
+ "rows": [
7
+ {
8
+ "columns": [
9
+ {
10
+ "width": 12,
11
+ "widget": "markup-include1732895422713"
12
+ },
13
+ {},
14
+ {}
15
+ ],
16
+ "uuid": 1732897571400
17
+ },
18
+ {
19
+ "columns": [
20
+ {
21
+ "width": 12,
22
+ "widget": "map1732897107116"
23
+ }
24
+ ],
25
+ "uuid": 1732897569495
26
+ }
27
+ ],
28
+ "visualizations": {
29
+ "markup-include1732895422713": {
30
+ "filters": [],
31
+ "filterBehavior": "Filter Change",
32
+ "openModal": false,
33
+ "uid": "markup-include1732895422713",
34
+ "type": "markup-include",
35
+ "contentEditor": {
36
+ "inlineHTML": "<div class=\"row\">\n <div class=\"col-md-3\">\n <div class=\"red-custom-border-color\">\n <div class=\"card mb-3\">\n <div class=\"card-body bg-gray-l3\">\n <p><strong>Persistent detection</strong></p>\n <p><span class=\"consistent\">{{Persistent}}</span></p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"gold-custom-border-color\">\n <div class=\"card mb-3\">\n <div class=\"card-body bg-gray-l3\">\n <p><strong>Detection</strong></p>\n <p><span class=\"intermittent\">{{Detection}}</span></p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"blue-custom-border-color\">\n <div class=\"card mb-3\">\n <div class=\"card-body bg-gray-l3\">\n <p><strong>No recent detection</strong></p>\n <p><span class=\"no-detection\">{{No-Detection}}</span></p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"gray-custom-border-color\">\n <div class=\"card mb-3\">\n <div class=\"card-body bg-gray-l2\">\n <p><strong>No recent data</strong></p>\n <p><span class=\"no-recent-detection\">{{No-Recent-Data}}</span></p>\n </div>\n </div>\n </div>\n </div>\n</div>",
37
+ "markupVariables": [
38
+ {
39
+ "columnName": "persistent-detection",
40
+ "conditions": [
41
+ {
42
+ "columnName": "testing_group",
43
+ "isOrIsNotEqualTo": "is",
44
+ "value": "Non-clade Specific"
45
+ }
46
+ ],
47
+ "name": "Persistent",
48
+ "tag": "{{Persistent}}"
49
+ },
50
+ {
51
+ "columnName": "detection",
52
+ "conditions": [
53
+ {
54
+ "columnName": "testing_group",
55
+ "isOrIsNotEqualTo": "is",
56
+ "value": "Non-clade Specific"
57
+ }
58
+ ],
59
+ "name": "Detection",
60
+ "tag": "{{Detection}}"
61
+ },
62
+ {
63
+ "columnName": "no-recent-detection",
64
+ "conditions": [
65
+ {
66
+ "columnName": "testing_group",
67
+ "isOrIsNotEqualTo": "is",
68
+ "value": "Non-clade Specific"
69
+ }
70
+ ],
71
+ "name": "No-Detection",
72
+ "tag": "{{No-Detection}}"
73
+ },
74
+ {
75
+ "columnName": "no-recent-data",
76
+ "conditions": [
77
+ {
78
+ "columnName": "testing_group",
79
+ "isOrIsNotEqualTo": "is",
80
+ "value": "Non-clade Specific"
81
+ }
82
+ ],
83
+ "name": "No-Recent-Data",
84
+ "tag": "{{No-Recent-Data}}"
85
+ }
86
+ ],
87
+ "showHeader": true,
88
+ "srcUrl": "#example",
89
+ "title": "",
90
+ "useInlineHTML": true
91
+ },
92
+ "theme": "theme-blue",
93
+ "visual": {
94
+ "border": false,
95
+ "accent": false,
96
+ "background": false,
97
+ "hideBackgroundColor": false,
98
+ "borderColorTheme": false
99
+ },
100
+ "showEditorPanel": true,
101
+ "visualizationType": "markup-include",
102
+ "dataDescription": {
103
+ "horizontal": false,
104
+ "series": false
105
+ },
106
+ "dataKey": "/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxnationaldatabites.json",
107
+ "version": "4.24.10"
108
+ },
109
+ "map1732897107116": {
110
+ "annotations": [],
111
+ "general": {
112
+ "navigationTarget": "_self",
113
+ "noStateFoundMessage": "Map Unavailable",
114
+ "annotationDropdownText": "Annotations",
115
+ "geoBorderColor": "darkGray",
116
+ "headerColor": "theme-blue",
117
+ "title": "",
118
+ "showTitle": true,
119
+ "showSidebar": true,
120
+ "showDownloadMediaButton": false,
121
+ "displayAsHex": false,
122
+ "displayStateLabels": false,
123
+ "territoriesAlwaysShow": false,
124
+ "language": "en",
125
+ "geoType": "us-county",
126
+ "geoLabelOverride": "Sewershed Id",
127
+ "hasRegions": false,
128
+ "fullBorder": false,
129
+ "type": "us-geocode",
130
+ "convertFipsCodes": true,
131
+ "palette": {
132
+ "isReversed": false
133
+ },
134
+ "allowMapZoom": true,
135
+ "hideGeoColumnInTooltip": false,
136
+ "hidePrimaryColumnInTooltip": false,
137
+ "statePicked": {
138
+ "fipsCode": "01",
139
+ "stateName": "Alabama"
140
+ },
141
+ "expandDataTable": false,
142
+ "footnotes": "",
143
+ "showDownloadImgButton": false,
144
+ "subtext": "Sites may appear more than once on the map and in the detection category site counts if they are testing using more than one non-clade specific test type.\n<div>\n<br/> <br/> Data Last <span class=\"date\">FromDB</span></div>\n\n<div class=\"csv-link\"><a href=\"/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxsitetable.csv\">Download CSV</a>\n</div>"
145
+ },
146
+ "type": "map",
147
+ "color": "pinkpurple",
148
+ "columns": {
149
+ "geo": {
150
+ "name": "sewershed",
151
+ "label": "Location",
152
+ "tooltip": false,
153
+ "dataTable": true
154
+ },
155
+ "primary": {
156
+ "dataTable": true,
157
+ "tooltip": true,
158
+ "prefix": "",
159
+ "suffix": "",
160
+ "name": "detection_classification",
161
+ "label": "Detection Classification",
162
+ "roundToPlace": 0
163
+ },
164
+ "navigate": {
165
+ "name": ""
166
+ },
167
+ "latitude": {
168
+ "name": "latitude"
169
+ },
170
+ "longitude": {
171
+ "name": "longitude"
172
+ },
173
+ "additionalColumn1": {
174
+ "label": "Sampling Location",
175
+ "dataTable": false,
176
+ "tooltips": false,
177
+ "prefix": "",
178
+ "suffix": "",
179
+ "name": "sample_location",
180
+ "tooltip": true
181
+ },
182
+ "additionalColumn2": {
183
+ "label": "Sewershed Jurisdiction",
184
+ "dataTable": true,
185
+ "tooltips": false,
186
+ "prefix": "",
187
+ "suffix": "",
188
+ "name": "jurisdiction",
189
+ "tooltip": true
190
+ },
191
+ "additionalColumn3": {
192
+ "label": "Counties",
193
+ "dataTable": true,
194
+ "tooltips": false,
195
+ "prefix": "",
196
+ "suffix": "",
197
+ "name": "counties",
198
+ "tooltip": true
199
+ },
200
+ "additionalColumn4": {
201
+ "label": "Population",
202
+ "dataTable": false,
203
+ "tooltips": false,
204
+ "prefix": "",
205
+ "suffix": "",
206
+ "name": "population",
207
+ "tooltip": true
208
+ },
209
+ "additionalColumn5": {
210
+ "label": "Samples Collected",
211
+ "dataTable": false,
212
+ "tooltips": false,
213
+ "prefix": "",
214
+ "suffix": "",
215
+ "name": "samples_collected",
216
+ "tooltip": true
217
+ },
218
+ "additionalColumn6": {
219
+ "label": "Type of Testing",
220
+ "dataTable": true,
221
+ "tooltips": false,
222
+ "prefix": "",
223
+ "suffix": "",
224
+ "name": "type_of_testing",
225
+ "tooltip": true
226
+ },
227
+ "additionalColumn7": {
228
+ "label": "Samples that were positive",
229
+ "dataTable": true,
230
+ "tooltips": false,
231
+ "prefix": "",
232
+ "suffix": "",
233
+ "name": "positive_samples",
234
+ "tooltip": true
235
+ },
236
+ "additionalColumn8": {
237
+ "label": "Date Collection Range",
238
+ "dataTable": true,
239
+ "tooltips": false,
240
+ "prefix": "",
241
+ "suffix": "",
242
+ "name": "date_collection_range"
243
+ }
244
+ },
245
+ "legend": {
246
+ "descriptions": {},
247
+ "specialClasses": [],
248
+ "unified": false,
249
+ "singleColumn": false,
250
+ "singleRow": true,
251
+ "verticalSorted": false,
252
+ "showSpecialClassesLast": false,
253
+ "dynamicDescription": false,
254
+ "type": "category",
255
+ "numberOfItems": 3,
256
+ "position": "bottom",
257
+ "title": "",
258
+ "style": "circles",
259
+ "subStyle": "linear blocks",
260
+ "tickRotation": "",
261
+ "singleColumnLegend": false,
262
+ "hideBorder": false,
263
+ "groupBy": "",
264
+ "additionalCategories": [
265
+ "No recent detection",
266
+ "Persistent Detection",
267
+ "No recent data",
268
+ "Detection"
269
+ ],
270
+ "categoryValuesOrder": [
271
+ "Persistent Detection",
272
+ "Detection",
273
+ "No recent detection",
274
+ "No recent data",
275
+ "No Detection"
276
+ ],
277
+ "description": "Select a category to add or remove from map"
278
+ },
279
+ "filters": [
280
+ {
281
+ "filterStyle": "dropdown",
282
+ "id": 1752597504758,
283
+ "showDropdown": false,
284
+ "columnName": "testing_group",
285
+ "orderedValues": [
286
+ "Clade I",
287
+ "Clade II",
288
+ "Non-clade Specific",
289
+ "Overall Mpox Testing"
290
+ ],
291
+ "defaultValue": "Non-clade Specific"
292
+ }
293
+ ],
294
+ "table": {
295
+ "wrapColumns": false,
296
+ "label": "Data Table",
297
+ "expanded": false,
298
+ "limitHeight": false,
299
+ "height": "",
300
+ "caption": "",
301
+ "showDownloadUrl": false,
302
+ "showDataTableLink": false,
303
+ "showDownloadLinkBelow": false,
304
+ "showFullGeoNameInCSV": false,
305
+ "forceDisplay": true,
306
+ "download": true,
307
+ "indexLabel": "",
308
+ "cellMinWidth": "0"
309
+ },
310
+ "tooltips": {
311
+ "appearanceType": "hover",
312
+ "linkLabel": "Learn More",
313
+ "capitalizeLabels": true,
314
+ "opacity": 90
315
+ },
316
+ "visual": {
317
+ "minBubbleSize": 1,
318
+ "maxBubbleSize": 20,
319
+ "extraBubbleBorder": false,
320
+ "cityStyle": "circle",
321
+ "cityStyleLabel": "",
322
+ "showBubbleZeros": false,
323
+ "additionalCityStyles": [],
324
+ "geoCodeCircleSize": "5"
325
+ },
326
+ "mapPosition": {
327
+ "coordinates": [
328
+ 0,
329
+ 30
330
+ ],
331
+ "zoom": 1
332
+ },
333
+ "map": {
334
+ "layers": [],
335
+ "patterns": []
336
+ },
337
+ "hexMap": {
338
+ "type": "",
339
+ "shapeGroups": [
340
+ {
341
+ "legendTitle": "",
342
+ "legendDescription": "",
343
+ "items": [
344
+ {
345
+ "key": "",
346
+ "shape": "Arrow Up",
347
+ "column": "",
348
+ "operator": "=",
349
+ "value": ""
350
+ }
351
+ ]
352
+ }
353
+ ]
354
+ },
355
+ "filterBehavior": "Filter Change",
356
+ "filterIntro": "",
357
+ "openModal": true,
358
+ "uid": "map1732897107116",
359
+ "dataDescription": {
360
+ "horizontal": false,
361
+ "series": false
362
+ },
363
+ "dataKey": "/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxsitemap.json",
364
+ "version": "4.25.1",
365
+ "customColors": [
366
+ "#d73027",
367
+ "#d73027",
368
+ "#ffcc00",
369
+ "#ffcc00",
370
+ "#0e4183",
371
+ "#0e4183",
372
+ "#Cccccc",
373
+ "#Cccccc"
374
+ ],
375
+ "migrations": {
376
+ "addColorMigration": true
377
+ }
378
+ }
379
+ },
380
+ "table": {
381
+ "label": "Data Table",
382
+ "show": false,
383
+ "showDownloadUrl": false,
384
+ "showDownloadLinkBelow": true,
385
+ "showVertical": true
386
+ },
387
+ "errors": [],
388
+ "currentViewport": "lg",
389
+ "id": 15,
390
+ "category": "General",
391
+ "label": "Dashboard",
392
+ "type": "dashboard",
393
+ "subType": null,
394
+ "orientation": null,
395
+ "icon": {
396
+ "key": null,
397
+ "ref": null,
398
+ "props": {},
399
+ "_owner": null
400
+ },
401
+ "content": "Present multiple data visualizations with shared filter controls.",
402
+ "datasets": {
403
+ "/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxsitemap.json": {
404
+ "dataFileSize": 350102,
405
+ "dataFileName": "/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxsitemap.json",
406
+ "dataFileSourceType": "url",
407
+ "dataFileFormat": "JSON",
408
+ "preview": false,
409
+ "dataUrl": "https://www.cdc.gov/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxsitemap.json"
410
+ },
411
+ "/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxnationaldatabites.json": {
412
+ "dataFileSize": 1118,
413
+ "dataFileName": "/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxnationaldatabites.json",
414
+ "dataFileSourceType": "url",
415
+ "dataFileFormat": "JSON",
416
+ "preview": false,
417
+ "dataUrl": "https://www.cdc.gov/wcms/vizdata/NCEZID_DIDRI/mpox/nwssmpoxnationaldatabites.json"
418
+ },
419
+ "": {
420
+ "data": [],
421
+ "dataFileSize": 631564,
422
+ "dataFileName": "",
423
+ "dataFileSourceType": "url",
424
+ "dataFileFormat": "HTML",
425
+ "preview": true
426
+ }
427
+ },
428
+ "visualizationType": null,
429
+ "activeVizButtonID": 15,
430
+ "version": "4.25.7",
431
+ "uuid": 1732897568206,
432
+ "migrations": {
433
+ "addColorMigration": true
434
+ }
435
+ }