@cdc/dashboard 4.26.2 → 4.26.4

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 (109) hide show
  1. package/CONFIG.md +172 -0
  2. package/README.md +60 -20
  3. package/dist/cdcdashboard-CY9IcPSi.es.js +6 -0
  4. package/dist/cdcdashboard-DlpiY3fQ.es.js +4 -0
  5. package/dist/cdcdashboard.js +56686 -50281
  6. package/examples/__data__/data-2.json +6 -0
  7. package/examples/__data__/data-with-metadata.json +18 -0
  8. package/examples/__data__/data.json +6 -0
  9. package/examples/default.json +7 -36
  10. package/examples/legend-issue.json +1 -1
  11. package/examples/minimal-example.json +34 -0
  12. package/examples/private/dengue.json +4640 -0
  13. package/examples/private/inline-markup.json +775 -0
  14. package/examples/private/link_to_file.json +16662 -0
  15. package/examples/private/recent-update.json +1456 -0
  16. package/examples/private/toggle.json +10137 -0
  17. package/examples/sankey.json +3 -3
  18. package/examples/test-api-filter-reset.json +4 -4
  19. package/examples/tp5-test.json +86 -4
  20. package/package.json +9 -9
  21. package/src/CdcDashboard.tsx +2 -1
  22. package/src/CdcDashboardComponent.tsx +48 -28
  23. package/src/_stories/Dashboard.DataSetup.stories.tsx +6 -1
  24. package/src/_stories/Dashboard.Pages.smoke.stories.tsx +22 -0
  25. package/src/_stories/Dashboard.smoke.stories.tsx +33 -0
  26. package/src/_stories/Dashboard.stories.tsx +4523 -83
  27. package/src/_stories/_mock/dashboard-data-driven-colors.json +171 -0
  28. package/src/_stories/_mock/tab-simple-filter.json +153 -0
  29. package/src/_stories/_mock/tp5-test.json +86 -5
  30. package/src/components/DashboardEditors.tsx +15 -0
  31. package/src/components/DashboardFilters/DashboardFilters.test.tsx +129 -0
  32. package/src/components/DashboardFilters/DashboardFilters.tsx +29 -10
  33. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +12 -8
  34. package/src/components/DashboardFilters/DashboardFiltersEditor/components/APIModal.tsx +6 -4
  35. package/src/components/DashboardFilters/DashboardFiltersEditor/components/DeleteFilterModal.tsx +59 -58
  36. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.test.tsx +127 -0
  37. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +29 -6
  38. package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +10 -9
  39. package/src/components/DashboardFilters/DashboardFiltersWrapper.tsx +8 -8
  40. package/src/components/DashboardFilters/_stories/DashboardFilters.stories.tsx +1 -1
  41. package/src/components/DashboardFilters/dashboardfilter.styles.css +3 -3
  42. package/src/components/DataDesignerModal.tsx +2 -2
  43. package/src/components/ExpandCollapseButtons.tsx +6 -4
  44. package/src/components/Grid.tsx +4 -3
  45. package/src/components/Header/Header.tsx +27 -5
  46. package/src/components/Header/index.scss +1 -1
  47. package/src/components/MultiConfigTabs/MultiConfigTabs.tsx +141 -140
  48. package/src/components/MultiConfigTabs/multiconfigtabs.styles.css +6 -6
  49. package/src/components/Row.tsx +30 -8
  50. package/src/components/Toggle/toggle-style.css +7 -7
  51. package/src/components/VisualizationRow.tsx +81 -22
  52. package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +2 -55
  53. package/src/components/VisualizationsPanel/visualizations-panel-styles.css +2 -2
  54. package/src/components/Widget/Widget.tsx +7 -6
  55. package/src/components/Widget/widget.styles.css +48 -17
  56. package/src/data/initial-state.js +2 -1
  57. package/src/helpers/addVisualization.ts +73 -0
  58. package/src/helpers/formatConfigBeforeSave.ts +1 -1
  59. package/src/helpers/getVizConfig.ts +13 -3
  60. package/src/helpers/iconHash.tsx +45 -36
  61. package/src/helpers/processDataLegacy.ts +19 -14
  62. package/src/helpers/tests/addVisualization.test.ts +52 -0
  63. package/src/helpers/tests/formatConfigBeforeSave.test.ts +81 -1
  64. package/src/scss/editor-panel.scss +1 -1
  65. package/src/scss/grid.scss +38 -8
  66. package/src/scss/main.scss +237 -40
  67. package/src/store/dashboard.reducer.ts +2 -1
  68. package/src/test/CdcDashboard.test.jsx +26 -2
  69. package/src/test/CdcDashboardComponent.test.tsx +74 -0
  70. package/src/types/FilterStyles.ts +2 -1
  71. package/src/types/SharedFilter.ts +1 -0
  72. package/tests/fixtures/dashboard-config-with-metadata.json +89 -0
  73. package/vite.config.js +2 -2
  74. package/dist/cdcdashboard-Cf9_fbQf.es.js +0 -6
  75. package/examples/DEV-6574.json +0 -2224
  76. package/examples/api-dashboard-data.json +0 -272
  77. package/examples/api-dashboard-years.json +0 -11
  78. package/examples/api-geographies-data.json +0 -11
  79. package/examples/chart-data.json +0 -5409
  80. package/examples/custom/css/respiratory.css +0 -236
  81. package/examples/custom/js/respiratory.js +0 -242
  82. package/examples/default-data.json +0 -368
  83. package/examples/default-filter-control.json +0 -209
  84. package/examples/default-multi-dataset-shared-filter.json +0 -1729
  85. package/examples/default-multi-dataset.json +0 -506
  86. package/examples/ed-visits-county-file.json +0 -402
  87. package/examples/filters/Alabama.json +0 -72
  88. package/examples/filters/Alaska.json +0 -1737
  89. package/examples/filters/Arkansas.json +0 -4713
  90. package/examples/filters/California.json +0 -212
  91. package/examples/filters/Colorado.json +0 -1500
  92. package/examples/filters/Connecticut.json +0 -559
  93. package/examples/filters/Delaware.json +0 -63
  94. package/examples/filters/DistrictofColumbia.json +0 -63
  95. package/examples/filters/Florida.json +0 -4217
  96. package/examples/filters/States.json +0 -146
  97. package/examples/state-level.json +0 -90136
  98. package/examples/state-points.json +0 -10474
  99. package/examples/temp-example-data.json +0 -130
  100. package/examples/test-dashboard-simple.json +0 -503
  101. package/examples/test-example.json +0 -752
  102. package/examples/test-file.json +0 -147
  103. package/examples/test.json +0 -752
  104. package/examples/testing.json +0 -94456
  105. /package/examples/{legend-issue-data.json → __data__/legend-issue-data.json} +0 -0
  106. /package/examples/api-test/{categories.json → __data__/categories.json} +0 -0
  107. /package/examples/api-test/{chart-data.json → __data__/chart-data.json} +0 -0
  108. /package/examples/api-test/{topics.json → __data__/topics.json} +0 -0
  109. /package/examples/api-test/{years.json → __data__/years.json} +0 -0
@@ -0,0 +1,6 @@
1
+ [
2
+ {
3
+ "Text": "Number of Deaths",
4
+ "Value": "4736"
5
+ }
6
+ ]
@@ -0,0 +1,18 @@
1
+ {
2
+ "lastUpdated": "January 15, 2026",
3
+ "source": "CDC NREVSS",
4
+ "data": [
5
+ { "Location": "Alaska", "Year": "2019", "Type": "Federal", "Amount": "1377" },
6
+ { "Location": "Alaska", "Year": "2019", "Type": "Local", "Amount": "1613" },
7
+ { "Location": "Alaska", "Year": "2019", "Type": "State", "Amount": "1495" },
8
+ { "Location": "Alaska", "Year": "2020", "Type": "Federal", "Amount": "1377" },
9
+ { "Location": "Alaska", "Year": "2020", "Type": "Local", "Amount": "1613" },
10
+ { "Location": "Alaska", "Year": "2020", "Type": "State", "Amount": "1495" },
11
+ { "Location": "Alabama", "Year": "2019", "Type": "Federal", "Amount": "1375" },
12
+ { "Location": "Alabama", "Year": "2019", "Type": "Local", "Amount": "1611" },
13
+ { "Location": "Alabama", "Year": "2019", "Type": "State", "Amount": "1493" },
14
+ { "Location": "Alabama", "Year": "2020", "Type": "Federal", "Amount": "1375" },
15
+ { "Location": "Alabama", "Year": "2020", "Type": "Local", "Amount": "1611" },
16
+ { "Location": "Alabama", "Year": "2020", "Type": "State", "Amount": "1493" }
17
+ ]
18
+ }
@@ -0,0 +1,6 @@
1
+ [
2
+ {
3
+ "Text": "Number of EMS Responses",
4
+ "Value": "467136"
5
+ }
6
+ ]
@@ -4,46 +4,20 @@
4
4
  "title": "Amount Filtered by Location and Type ",
5
5
  "sharedFilters": [
6
6
  {
7
- "values": [
8
- "Alabama",
9
- "Alaska",
10
- "American Samoa",
11
- "Arizona",
12
- "Arkansas"
13
- ],
7
+ "values": ["Alabama", "Alaska", "American Samoa", "Arizona", "Arkansas"],
14
8
  "columnName": "Location",
15
9
  "showDropdown": true,
16
- "usedBy": [
17
- "data-bite1628875468150",
18
- "chart1628875631849",
19
- "data-bite1628876561387",
20
- "data-bite1628877031319"
21
- ],
10
+ "usedBy": ["data-bite1628875468150", "chart1628875631849", "data-bite1628876561387", "data-bite1628877031319"],
22
11
  "tier": 1,
23
12
  "type": "datafilter",
24
13
  "order": "cust",
25
- "orderedValues": [
26
- "Alabama",
27
- "Alaska",
28
- "American Samoa",
29
- "Arizona",
30
- "Arkansas"
31
- ]
14
+ "orderedValues": ["Alabama", "Alaska", "American Samoa", "Arizona", "Arkansas"]
32
15
  },
33
16
  {
34
- "values": [
35
- "Federal",
36
- "Local",
37
- "State"
38
- ],
17
+ "values": ["Federal", "Local", "State"],
39
18
  "columnName": "Type",
40
19
  "showDropdown": true,
41
- "usedBy": [
42
- "data-bite1628875468150",
43
- "chart1628875631849",
44
- "data-bite1628876561387",
45
- "data-bite1628877031319"
46
- ],
20
+ "usedBy": ["data-bite1628875468150", "chart1628875631849", "data-bite1628876561387", "data-bite1628877031319"],
47
21
  "tier": 1
48
22
  }
49
23
  ]
@@ -247,10 +221,7 @@
247
221
  "legacySharedFilters": {
248
222
  "type": "dashboardFilters",
249
223
  "visualizationType": "dashboardFilters",
250
- "sharedFilterIndexes": [
251
- 0,
252
- 1
253
- ],
224
+ "sharedFilterIndexes": [0, 1],
254
225
  "filterBehavior": "Filter Change",
255
226
  "uid": "legacySharedFilters"
256
227
  }
@@ -548,4 +519,4 @@
548
519
  "migrations": {
549
520
  "addColorMigration": true
550
521
  }
551
- }
522
+ }
@@ -16,7 +16,7 @@
16
16
  "dataFileSourceType": "url",
17
17
  "dataFileFormat": "JSON",
18
18
  "preview": true,
19
- "dataUrl": "/examples/legend-issue-data.json"
19
+ "dataUrl": "/examples/__data__/legend-issue-data.json"
20
20
  }
21
21
  },
22
22
  "visualizationType": null,
@@ -0,0 +1,34 @@
1
+ {
2
+ "type": "dashboard",
3
+ "version": "4.26.4",
4
+ "dashboard": {
5
+ "theme": "theme-blue",
6
+ "title": "Dashboard Example",
7
+ "titleStyle": "small",
8
+ "sharedFilters": []
9
+ },
10
+ "data": [],
11
+ "rows": [
12
+ {
13
+ "columns": [
14
+ {
15
+ "width": 12,
16
+ "widget": "markup-1"
17
+ }
18
+ ]
19
+ }
20
+ ],
21
+ "visualizations": {
22
+ "markup-1": {
23
+ "type": "markup-include",
24
+ "theme": "theme-blue",
25
+ "contentEditor": {
26
+ "inlineHTML": "<p>Minimal dashboard example</p>",
27
+ "showHeader": true,
28
+ "srcUrl": "",
29
+ "title": "Dashboard Example",
30
+ "useInlineHTML": true
31
+ }
32
+ }
33
+ }
34
+ }