@cdc/dashboard 4.25.11 → 4.26.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 (77) hide show
  1. package/Dynamic_Data.md +66 -0
  2. package/dist/cdcdashboard-8NmHlKRI.es.js +15 -0
  3. package/dist/cdcdashboard-BPoPzKPz.es.js +6 -0
  4. package/dist/cdcdashboard-Cf9_fbQf.es.js +6 -0
  5. package/dist/{cdcdashboard-dgT_1dIT.es.js → cdcdashboard-DQ00cQCm.es.js} +1 -20
  6. package/dist/cdcdashboard-jiQQPkty.es.js +6 -0
  7. package/dist/cdcdashboard.js +83537 -86913
  8. package/examples/api-dashboard-data.json +272 -0
  9. package/examples/api-dashboard-years.json +11 -0
  10. package/examples/api-geographies-data.json +11 -0
  11. package/examples/default.json +522 -133
  12. package/examples/nested-dropdown.json +6985 -0
  13. package/examples/private/abc.json +467 -0
  14. package/examples/private/cat-y.json +1235 -0
  15. package/examples/private/chronic-dash.json +1584 -0
  16. package/examples/private/dash.json +12696 -0
  17. package/examples/private/map-issue.json +2260 -0
  18. package/examples/private/mpinc-state-reports.json +2260 -0
  19. package/examples/private/npcr.json +1 -0
  20. package/examples/private/nwss/rsv.json +1240 -0
  21. package/examples/private/simple-dash.json +490 -0
  22. package/examples/private/test-dash.json +0 -0
  23. package/examples/private/test.json +125407 -0
  24. package/examples/private/test123.json +491 -0
  25. package/examples/private/timeline-data.json +4994 -0
  26. package/examples/private/timeline.json +1708 -0
  27. package/examples/test-api-filter-reset.json +8 -4
  28. package/examples/test-dashboard-simple.json +503 -0
  29. package/examples/tp5-gauges.json +196 -0
  30. package/examples/tp5-test.json +266 -0
  31. package/index.html +1 -30
  32. package/package.json +39 -40
  33. package/src/CdcDashboardComponent.tsx +18 -5
  34. package/src/_stories/Dashboard.DataSetup.stories.tsx +204 -0
  35. package/src/_stories/Dashboard.stories.tsx +407 -1
  36. package/src/_stories/_mock/dashboard-line-chart-angles.json +1030 -0
  37. package/src/_stories/_mock/filter-cascade.json +3350 -0
  38. package/src/_stories/_mock/gallery-data-bite-dashboard.json +3500 -0
  39. package/src/_stories/_mock/nested-parent-child-filters.json +392 -0
  40. package/src/_stories/_mock/parent-child-filters.json +233 -0
  41. package/src/_stories/_mock/tp5-test.json +267 -0
  42. package/src/components/DashboardFilters/DashboardFilters.tsx +20 -11
  43. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +92 -38
  44. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +56 -30
  45. package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +151 -10
  46. package/src/components/DashboardFilters/DashboardFiltersWrapper.tsx +11 -7
  47. package/src/components/DataDesignerModal.tsx +6 -1
  48. package/src/components/Header/Header.tsx +51 -20
  49. package/src/components/VisualizationRow.tsx +76 -5
  50. package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +2 -20
  51. package/src/components/Widget/Widget.tsx +1 -1
  52. package/src/data/initial-state.js +1 -0
  53. package/src/helpers/addValuesToDashboardFilters.ts +30 -31
  54. package/src/helpers/apiFilterHelpers.ts +28 -32
  55. package/src/helpers/changeFilterActive.ts +67 -65
  56. package/src/helpers/formatConfigBeforeSave.ts +6 -5
  57. package/src/helpers/getUpdateConfig.ts +91 -91
  58. package/src/helpers/tests/addValuesToDashboardFilters.test.ts +141 -44
  59. package/src/helpers/tests/apiFilterHelpers.test.ts +523 -420
  60. package/src/helpers/tests/updatesChildFilters.test.ts +53 -22
  61. package/src/helpers/updateChildFilters.ts +50 -27
  62. package/src/scss/main.scss +144 -1
  63. package/src/test/CdcDashboard.test.jsx +9 -4
  64. package/src/types/Dashboard.ts +1 -0
  65. package/src/types/FilterStyles.ts +8 -7
  66. package/src/types/SharedFilter.ts +13 -0
  67. package/vite.config.js +7 -1
  68. package/LICENSE +0 -201
  69. package/dist/cdcdashboard-BnB1QM5d.es.js +0 -361528
  70. package/dist/cdcdashboard-Ct2SB0vL.es.js +0 -231049
  71. package/dist/cdcdashboard-D6CG2-Hb.es.js +0 -39377
  72. package/dist/cdcdashboard-MXgURbdZ.es.js +0 -39194
  73. package/examples/private/DEV-10538.json +0 -407
  74. package/examples/private/DEV-11072.json +0 -7591
  75. package/examples/private/DEV-11405.json +0 -39112
  76. package/examples/private/delete.json +0 -32919
  77. package/examples/private/pedro.json +0 -1
@@ -0,0 +1,196 @@
1
+ {
2
+ "type": "dashboard",
3
+ "title": "TP5 Gauge Dashboard Example",
4
+ "description": "Three TP5 Gauge charts displaying health metrics",
5
+ "data": [
6
+ {
7
+ "Category": "Adults",
8
+ "Vaccination Rate": "68.5",
9
+ "Insured Rate": "87.2",
10
+ "Screening Rate": "72.8"
11
+ },
12
+ {
13
+ "Category": "Seniors",
14
+ "Vaccination Rate": "82.3",
15
+ "Insured Rate": "95.1",
16
+ "Screening Rate": "84.6"
17
+ },
18
+ {
19
+ "Category": "Youth",
20
+ "Vaccination Rate": "54.2",
21
+ "Insured Rate": "92.4",
22
+ "Screening Rate": "65.3"
23
+ }
24
+ ],
25
+ "dashboard": {
26
+ "filters": []
27
+ },
28
+ "rows": [
29
+ [
30
+ { "width": 4, "widget": "gauge1" },
31
+ { "width": 4, "widget": "gauge2" },
32
+ { "width": 4, "widget": "gauge3" }
33
+ ]
34
+ ],
35
+ "visualizations": {
36
+ "gauge1": {
37
+ "uid": "gauge1",
38
+ "type": "waffle-chart",
39
+ "title": "Vaccination Coverage",
40
+ "visualizationType": "TP5 Gauge",
41
+ "visualizationSubType": "linear",
42
+ "showPercent": true,
43
+ "showDenominator": false,
44
+ "valueDescription": "",
45
+ "content": "of the population is vaccinated against seasonal flu",
46
+ "subtext": "Based on 2024 CDC surveillance data across all age groups",
47
+ "dataColumn": "Vaccination Rate",
48
+ "dataFunction": "Mean (Average)",
49
+ "dataConditionalColumn": "",
50
+ "dataConditionalOperator": "",
51
+ "dataConditionalComparate": "",
52
+ "invalidComparate": false,
53
+ "customDenom": false,
54
+ "dataDenom": "100",
55
+ "dataDenomColumn": "",
56
+ "dataDenomFunction": "",
57
+ "prefix": "",
58
+ "suffix": "%",
59
+ "roundToPlace": "1",
60
+ "theme": "theme-blue",
61
+ "gauge": {
62
+ "height": 35,
63
+ "width": "100%"
64
+ },
65
+ "visual": {
66
+ "border": true,
67
+ "accent": false,
68
+ "background": false,
69
+ "hideBackgroundColor": false,
70
+ "borderColorTheme": false,
71
+ "whiteBackground": false,
72
+ "colors": {
73
+ "theme-blue": "#005eaa",
74
+ "theme-purple": "#712177",
75
+ "theme-brown": "#705043",
76
+ "theme-teal": "#00695c",
77
+ "theme-pink": "#af4448",
78
+ "theme-orange": "#bb4d00",
79
+ "theme-slate": "#29434e",
80
+ "theme-indigo": "#26418f",
81
+ "theme-cyan": "#006778",
82
+ "theme-green": "#4b830d",
83
+ "theme-amber": "#fbab18"
84
+ }
85
+ },
86
+ "showTitle": true,
87
+ "overallFontSize": "medium"
88
+ },
89
+ "gauge2": {
90
+ "uid": "gauge2",
91
+ "type": "waffle-chart",
92
+ "title": "Health Insurance Coverage Rate",
93
+ "visualizationType": "TP5 Gauge",
94
+ "visualizationSubType": "linear",
95
+ "showPercent": true,
96
+ "showDenominator": false,
97
+ "valueDescription": "",
98
+ "content": "",
99
+ "subtext": "",
100
+ "dataColumn": "Insured Rate",
101
+ "dataFunction": "Mean (Average)",
102
+ "dataConditionalColumn": "",
103
+ "dataConditionalOperator": "",
104
+ "dataConditionalComparate": "",
105
+ "invalidComparate": false,
106
+ "customDenom": false,
107
+ "dataDenom": "100",
108
+ "dataDenomColumn": "",
109
+ "dataDenomFunction": "",
110
+ "prefix": "",
111
+ "suffix": "%",
112
+ "roundToPlace": "1",
113
+ "theme": "theme-teal",
114
+ "gauge": {
115
+ "height": 35,
116
+ "width": "100%"
117
+ },
118
+ "visual": {
119
+ "border": true,
120
+ "accent": false,
121
+ "background": false,
122
+ "hideBackgroundColor": false,
123
+ "borderColorTheme": false,
124
+ "whiteBackground": false,
125
+ "colors": {
126
+ "theme-blue": "#005eaa",
127
+ "theme-purple": "#712177",
128
+ "theme-brown": "#705043",
129
+ "theme-teal": "#00695c",
130
+ "theme-pink": "#af4448",
131
+ "theme-orange": "#bb4d00",
132
+ "theme-slate": "#29434e",
133
+ "theme-indigo": "#26418f",
134
+ "theme-cyan": "#006778",
135
+ "theme-green": "#4b830d",
136
+ "theme-amber": "#fbab18"
137
+ }
138
+ },
139
+ "showTitle": true,
140
+ "overallFontSize": "medium"
141
+ },
142
+ "gauge3": {
143
+ "uid": "gauge3",
144
+ "type": "waffle-chart",
145
+ "title": "Cancer Screening Completion",
146
+ "visualizationType": "TP5 Gauge",
147
+ "visualizationSubType": "linear",
148
+ "showPercent": true,
149
+ "showDenominator": false,
150
+ "valueDescription": "",
151
+ "content": "completed recommended cancer screenings including mammography, colonoscopy, and cervical cancer screening",
152
+ "subtext": "Data from National Health Interview Survey 2024",
153
+ "dataColumn": "Screening Rate",
154
+ "dataFunction": "Mean (Average)",
155
+ "dataConditionalColumn": "",
156
+ "dataConditionalOperator": "",
157
+ "dataConditionalComparate": "",
158
+ "invalidComparate": false,
159
+ "customDenom": false,
160
+ "dataDenom": "100",
161
+ "dataDenomColumn": "",
162
+ "dataDenomFunction": "",
163
+ "prefix": "",
164
+ "suffix": "%",
165
+ "roundToPlace": "1",
166
+ "theme": "theme-purple",
167
+ "gauge": {
168
+ "height": 35,
169
+ "width": "100%"
170
+ },
171
+ "visual": {
172
+ "border": true,
173
+ "accent": false,
174
+ "background": false,
175
+ "hideBackgroundColor": false,
176
+ "borderColorTheme": false,
177
+ "whiteBackground": false,
178
+ "colors": {
179
+ "theme-blue": "#005eaa",
180
+ "theme-purple": "#712177",
181
+ "theme-brown": "#705043",
182
+ "theme-teal": "#00695c",
183
+ "theme-pink": "#af4448",
184
+ "theme-orange": "#bb4d00",
185
+ "theme-slate": "#29434e",
186
+ "theme-indigo": "#26418f",
187
+ "theme-cyan": "#006778",
188
+ "theme-green": "#4b830d",
189
+ "theme-amber": "#fbab18"
190
+ }
191
+ },
192
+ "showTitle": true,
193
+ "overallFontSize": "medium"
194
+ }
195
+ }
196
+ }
@@ -0,0 +1,266 @@
1
+ {
2
+ "type": "dashboard",
3
+ "title": "TP5 Alignment Test Dashboard",
4
+ "description": "Testing alignment of TP5 Waffles, Data Bites, and Gauges",
5
+ "data": [
6
+ {
7
+ "Category": "Adults",
8
+ "Vaccination Rate": "68.5",
9
+ "Insured Rate": "87.2",
10
+ "Screening Rate": "72.8"
11
+ },
12
+ {
13
+ "Category": "Seniors",
14
+ "Vaccination Rate": "82.3",
15
+ "Insured Rate": "95.1",
16
+ "Screening Rate": "84.6"
17
+ },
18
+ {
19
+ "Category": "Youth",
20
+ "Vaccination Rate": "54.2",
21
+ "Insured Rate": "92.4",
22
+ "Screening Rate": "65.3"
23
+ }
24
+ ],
25
+ "dashboard": {
26
+ "filters": []
27
+ },
28
+ "rows": [
29
+ [
30
+ { "width": 4, "widget": "waffle1" },
31
+ { "width": 4, "widget": "waffle2" },
32
+ { "width": 4, "widget": "waffle3" }
33
+ ],
34
+ [
35
+ { "width": 4, "widget": "bite1" },
36
+ { "width": 4, "widget": "bite2" },
37
+ { "width": 4, "widget": "bite3" }
38
+ ],
39
+ [
40
+ { "width": 4, "widget": "gauge1" },
41
+ { "width": 4, "widget": "gauge2" },
42
+ { "width": 4, "widget": "gauge3" }
43
+ ]
44
+ ],
45
+ "visualizations": {
46
+ "waffle1": {
47
+ "uid": "waffle1",
48
+ "type": "waffle-chart",
49
+ "title": "Vaccination Coverage",
50
+ "visualizationType": "TP5 Waffle",
51
+ "visualizationSubType": "linear",
52
+ "showPercent": true,
53
+ "showDenominator": false,
54
+ "valueDescription": "",
55
+ "content": "of the population is vaccinated against seasonal flu",
56
+ "subtext": "Based on 2024 CDC surveillance data across all age groups",
57
+ "dataColumn": "Vaccination Rate",
58
+ "dataFunction": "Mean (Average)",
59
+ "customDenom": false,
60
+ "dataDenom": "100",
61
+ "suffix": "%",
62
+ "roundToPlace": "1",
63
+ "theme": "theme-blue",
64
+ "shape": "square",
65
+ "visual": {
66
+ "whiteBackground": false
67
+ },
68
+ "showTitle": true,
69
+ "overallFontSize": "medium"
70
+ },
71
+ "waffle2": {
72
+ "uid": "waffle2",
73
+ "type": "waffle-chart",
74
+ "title": "Health Insurance Coverage Rate",
75
+ "visualizationType": "TP5 Waffle",
76
+ "visualizationSubType": "linear",
77
+ "showPercent": true,
78
+ "showDenominator": false,
79
+ "valueDescription": "",
80
+ "content": "completed recommended cancer screenings including mammography, colonoscopy, and cervical cancer screening",
81
+ "subtext": "",
82
+ "dataColumn": "Insured Rate",
83
+ "dataFunction": "Mean (Average)",
84
+ "customDenom": false,
85
+ "dataDenom": "100",
86
+ "suffix": "%",
87
+ "roundToPlace": "1",
88
+ "theme": "theme-teal",
89
+ "shape": "person",
90
+ "visual": {
91
+ "whiteBackground": false
92
+ },
93
+ "showTitle": true,
94
+ "overallFontSize": "medium"
95
+ },
96
+ "waffle3": {
97
+ "uid": "waffle3",
98
+ "type": "waffle-chart",
99
+ "title": "Cancer Screening Completion",
100
+ "visualizationType": "TP5 Waffle",
101
+ "visualizationSubType": "linear",
102
+ "showPercent": true,
103
+ "showDenominator": false,
104
+ "valueDescription": "",
105
+ "content": "completed recommended cancer screenings including mammography, colonoscopy, and cervical cancer screening",
106
+ "subtext": "Data from National Health Interview Survey 2024",
107
+ "dataColumn": "Screening Rate",
108
+ "dataFunction": "Mean (Average)",
109
+ "customDenom": false,
110
+ "dataDenom": "100",
111
+ "suffix": "%",
112
+ "roundToPlace": "1",
113
+ "theme": "theme-purple",
114
+ "shape": "circle",
115
+ "visual": {
116
+ "whiteBackground": false
117
+ },
118
+ "showTitle": true,
119
+ "overallFontSize": "medium"
120
+ },
121
+ "gauge1": {
122
+ "uid": "gauge1",
123
+ "type": "waffle-chart",
124
+ "title": "Vaccination Coverage",
125
+ "visualizationType": "TP5 Gauge",
126
+ "visualizationSubType": "linear",
127
+ "showPercent": true,
128
+ "showDenominator": false,
129
+ "valueDescription": "",
130
+ "content": "of the population is vaccinated against seasonal flu",
131
+ "subtext": "Based on 2024 CDC surveillance data across all age groups",
132
+ "dataColumn": "Vaccination Rate",
133
+ "dataFunction": "Mean (Average)",
134
+ "customDenom": false,
135
+ "dataDenom": "100",
136
+ "suffix": "%",
137
+ "roundToPlace": "1",
138
+ "theme": "theme-blue",
139
+ "gauge": {
140
+ "height": 35,
141
+ "width": "100%"
142
+ },
143
+ "visual": {
144
+ "whiteBackground": false
145
+ },
146
+ "showTitle": true,
147
+ "overallFontSize": "medium"
148
+ },
149
+ "gauge2": {
150
+ "uid": "gauge2",
151
+ "type": "waffle-chart",
152
+ "title": "Health Insurance Coverage Rate",
153
+ "visualizationType": "TP5 Gauge",
154
+ "visualizationSubType": "linear",
155
+ "showPercent": true,
156
+ "showDenominator": false,
157
+ "valueDescription": "",
158
+ "content": "",
159
+ "subtext": "",
160
+ "dataColumn": "Insured Rate",
161
+ "dataFunction": "Mean (Average)",
162
+ "customDenom": false,
163
+ "dataDenom": "100",
164
+ "suffix": "%",
165
+ "roundToPlace": "1",
166
+ "theme": "theme-teal",
167
+ "gauge": {
168
+ "height": 35,
169
+ "width": "100%"
170
+ },
171
+ "visual": {
172
+ "whiteBackground": false
173
+ },
174
+ "showTitle": true,
175
+ "overallFontSize": "medium"
176
+ },
177
+ "gauge3": {
178
+ "uid": "gauge3",
179
+ "type": "waffle-chart",
180
+ "title": "Cancer Screening Completion",
181
+ "visualizationType": "TP5 Gauge",
182
+ "visualizationSubType": "linear",
183
+ "showPercent": true,
184
+ "showDenominator": false,
185
+ "valueDescription": "",
186
+ "content": "completed recommended cancer screenings including mammography, colonoscopy, and cervical cancer screening",
187
+ "subtext": "Data from National Health Interview Survey 2024",
188
+ "dataColumn": "Screening Rate",
189
+ "dataFunction": "Mean (Average)",
190
+ "customDenom": false,
191
+ "dataDenom": "100",
192
+ "suffix": "%",
193
+ "roundToPlace": "1",
194
+ "theme": "theme-purple",
195
+ "gauge": {
196
+ "height": 35,
197
+ "width": "100%"
198
+ },
199
+ "visual": {
200
+ "whiteBackground": false
201
+ },
202
+ "showTitle": true,
203
+ "overallFontSize": "medium"
204
+ },
205
+ "bite1": {
206
+ "uid": "bite1",
207
+ "type": "data-bite",
208
+ "title": "Vaccination Coverage",
209
+ "biteStyle": "tp5",
210
+ "dataColumn": "Vaccination Rate",
211
+ "dataFunction": "Mean (Average)",
212
+ "biteBody": "of the population is vaccinated against seasonal flu",
213
+ "subtext": "Based on 2024 CDC surveillance data across all age groups",
214
+ "dataFormat": {
215
+ "roundToPlace": 1,
216
+ "commas": true,
217
+ "prefix": "",
218
+ "suffix": "%"
219
+ },
220
+ "theme": "theme-blue",
221
+ "visual": {
222
+ "hideBackgroundColor": false
223
+ }
224
+ },
225
+ "bite2": {
226
+ "uid": "bite2",
227
+ "type": "data-bite",
228
+ "title": "Health Insurance Coverage Rate",
229
+ "biteStyle": "tp5",
230
+ "dataColumn": "Insured Rate",
231
+ "dataFunction": "Mean (Average)",
232
+ "biteBody": "",
233
+ "subtext": "",
234
+ "dataFormat": {
235
+ "roundToPlace": 1,
236
+ "commas": true,
237
+ "prefix": "",
238
+ "suffix": "%"
239
+ },
240
+ "theme": "theme-teal",
241
+ "visual": {
242
+ "hideBackgroundColor": false
243
+ }
244
+ },
245
+ "bite3": {
246
+ "uid": "bite3",
247
+ "type": "data-bite",
248
+ "title": "Cancer Screening Completion",
249
+ "biteStyle": "tp5",
250
+ "dataColumn": "Screening Rate",
251
+ "dataFunction": "Mean (Average)",
252
+ "biteBody": "completed recommended cancer screenings including mammography, colonoscopy, and cervical cancer screening",
253
+ "subtext": "Data from National Health Interview Survey 2024",
254
+ "dataFormat": {
255
+ "roundToPlace": 1,
256
+ "commas": true,
257
+ "prefix": "",
258
+ "suffix": "%"
259
+ },
260
+ "theme": "theme-purple",
261
+ "visual": {
262
+ "hideBackgroundColor": false
263
+ }
264
+ }
265
+ }
266
+ }
package/index.html CHANGED
@@ -1,30 +1 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="utf-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
7
- <style>
8
- body {
9
- margin: 0 auto !important;
10
- display: flex;
11
- flex-direction: column;
12
- justify-content: center;
13
- min-height: unset !important;
14
- }
15
-
16
- .react-container+.react-container {
17
- margin-top: 3rem;
18
- }
19
- </style>
20
- <link rel="stylesheet prefetch" href="examples/custom/css/respiratory.css" />
21
- <link rel="stylesheet prefetch" href="https://www.cdc.gov/TemplatePackage/5.0/css/app.min.css?_=71669" />
22
- </head>
23
-
24
- <body>
25
- <div class="react-container" data-config="/examples/markup-axis-label.json"></div>
26
- <script src="https://www.cdc.gov/TemplatePackage/contrib/libs/jquery/latest/jquery.min.js?_=91329"></script>
27
- <script type="module" src="./src/index.tsx"></script>
28
- </body>
29
-
30
- </html>
1
+ <!-- index.html is generated by @cdc/core/generateViteConfig.js using the files in @cdc/core/devTemplate/ -->
package/package.json CHANGED
@@ -1,54 +1,53 @@
1
1
  {
2
2
  "name": "@cdc/dashboard",
3
- "version": "4.25.11",
3
+ "version": "4.26.2",
4
4
  "description": "React component for combining multiple visualizations into a single dashboard",
5
- "moduleName": "CdcDashboard",
6
- "main": "dist/cdcdashboard",
7
- "type": "module",
8
- "scripts": {
9
- "start": "vite --open",
10
- "build": "vite build",
11
- "preview": "vite preview",
12
- "graph": "nx graph",
13
- "prepublishOnly": "lerna run --scope @cdc/dashboard build",
14
- "test": "vitest run --reporter verbose",
15
- "test-watch": "vitest watch --reporter verbose",
16
- "test-watch:ui": "vitest --ui",
17
- "coverage": "vitest run --coverage"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/CDCgov/cdc-open-viz",
22
- "directory": "packages/dashboard"
23
- },
24
- "author": "Matthew Pallansch <mpallansch@adittech.com>",
25
- "bugs": {
26
- "url": "https://github.com/CDCgov/cdc-open-viz/issues"
27
- },
28
5
  "license": "Apache-2.0",
6
+ "author": "Matthew Pallansch <mpallansch@adittech.com>",
7
+ "bugs": "https://github.com/CDCgov/cdc-open-viz/issues",
29
8
  "dependencies": {
30
- "@cdc/chart": "^4.25.11",
31
- "@cdc/core": "^4.25.11",
32
- "@cdc/data-bite": "^4.25.11",
33
- "@cdc/filtered-text": "^4.25.11",
34
- "@cdc/map": "^4.25.11",
35
- "@cdc/markup-include": "^4.25.11",
36
- "@cdc/waffle-chart": "^4.25.11",
9
+ "@cdc/chart": "^4.26.2",
10
+ "@cdc/core": "^4.26.2",
11
+ "@cdc/data-bite": "^4.26.2",
12
+ "@cdc/filtered-text": "^4.26.2",
13
+ "@cdc/map": "^4.26.2",
14
+ "@cdc/markup-include": "^4.26.2",
15
+ "@cdc/waffle-chart": "^4.26.2",
37
16
  "js-base64": "^2.5.2",
38
17
  "react-accessible-accordion": "^5.0.1",
39
- "react-dnd": "^14.0.2",
40
- "react-dnd-html5-backend": "^14.0.0",
41
- "use-debounce": "^6.0.1"
18
+ "react-dnd": "^16.0.1",
19
+ "react-dnd-html5-backend": "^16.0.1",
20
+ "use-debounce": "^10.1.0"
42
21
  },
22
+ "devDependencies": {
23
+ "@rollup/plugin-dsv": "^3.0.2",
24
+ "@vitejs/plugin-react": "^5.1.2",
25
+ "sass": "^1.89.2",
26
+ "vite-plugin-css-injected-by-js": "^2.4.0",
27
+ "vite-plugin-svgr": "^4.2.0"
28
+ },
29
+ "gitHead": "be3413e8e1149abf94225108f86a7910f56e0616",
30
+ "main": "dist/cdcdashboard",
31
+ "moduleName": "CdcDashboard",
43
32
  "peerDependencies": {
44
33
  "react": "^18.2.0",
45
34
  "react-dom": "^18.2.0"
46
35
  },
47
- "devDependencies": {
48
- "@vitejs/plugin-react": "^4.3.4",
49
- "vite": "^4.4.11",
50
- "vite-plugin-css-injected-by-js": "^2.4.0",
51
- "vite-plugin-svgr": "^2.4.0"
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/CDCgov/cdc-open-viz",
39
+ "directory": "packages/dashboard"
40
+ },
41
+ "scripts": {
42
+ "build": "vite build",
43
+ "coverage": "vitest run --coverage",
44
+ "graph": "nx graph",
45
+ "prepublishOnly": "lerna run --scope @cdc/dashboard build",
46
+ "preview": "vite preview",
47
+ "start": "vite --open",
48
+ "test": "vitest run --reporter verbose",
49
+ "test-watch": "vitest watch --reporter verbose",
50
+ "test-watch:ui": "vitest --ui"
52
51
  },
53
- "gitHead": "5f09a137c22f454111ab5f4cd7fdf1d2d58e31bd"
52
+ "type": "module"
54
53
  }
@@ -1,7 +1,4 @@
1
1
  import React, { useState, useEffect, useCallback, useMemo, useReducer, useContext } from 'react'
2
-
3
- // IE11
4
- // import 'core-js/stable'
5
2
  import 'whatwg-fetch'
6
3
  import ResizeObserver from 'resize-observer-polyfill'
7
4
 
@@ -60,6 +57,7 @@ import Alert from '@cdc/core/components/Alert'
60
57
  import { shouldLoadAllFilters } from './helpers/shouldLoadAllFilters'
61
58
  import { subscribe, unsubscribe } from '@cdc/core/helpers/events'
62
59
  import DashboardEditors from './components/DashboardEditors'
60
+ import { updateChildFilters } from './helpers/updateChildFilters'
63
61
 
64
62
  type DashboardProps = Omit<WCMSProps, 'configUrl'> & {
65
63
  initialState: InitialState
@@ -97,6 +95,16 @@ export default function CdcDashboard({
97
95
  }
98
96
 
99
97
  const vals = reloadURLHelpers.getDatasetKeys(state.config).map(key => state.data[key])
98
+
99
+ // Check if there are any visualizations that actually need data
100
+ // Markup-includes without dataKey don't require dashboard data
101
+ const visualizationsNeedingData = Object.values(state.config.visualizations).filter(viz => {
102
+ return viz.type !== 'markup-include' || viz.dataKey
103
+ })
104
+
105
+ // If no visualizations need data, don't show no-data state
106
+ if (!vals.length && visualizationsNeedingData.length === 0) return false
107
+
100
108
  if (!vals.length) return true
101
109
  return vals.some(val => val === undefined)
102
110
  }, [state.data, state.config.visualizations, state.config.dashboard?.sharedFilters, state.filtersApplied])
@@ -330,7 +338,8 @@ export default function CdcDashboard({
330
338
  useEffect(() => {
331
339
  const { config } = state
332
340
  const loadAllFilters = shouldLoadAllFilters(config, isEditor && !isPreview)
333
- const sharedFiltersWithValues = addValuesToDashboardFilters(config.dashboard.sharedFilters, state.data)
341
+ let sharedFiltersWithValues = addValuesToDashboardFilters(config.dashboard.sharedFilters, state.data)
342
+ sharedFiltersWithValues = updateChildFilters(sharedFiltersWithValues, state.data)
334
343
  setAPILoading(true)
335
344
  loadAPIFilters(sharedFiltersWithValues, apiFilterDropdowns, loadAllFilters)?.then(newFilters => {
336
345
  const allValuesSelected = newFilters.every(filter => {
@@ -493,10 +502,11 @@ export default function CdcDashboard({
493
502
  <Title
494
503
  title={title}
495
504
  isDashboard={true}
505
+ titleStyle={config.dashboard.titleStyle}
496
506
  classes={[`dashboard-title`, `${config.dashboard.theme ?? 'theme-blue'}`]}
497
507
  />
498
508
  {/* Description */}
499
- {description && <div className='subtext mb-3'>{parse(description)}</div>}
509
+ {description && <div className='subtext mb-4'>{parse(description)}</div>}
500
510
  {/* Visualizations */}
501
511
  {filteredRows?.map((row, index) => (
502
512
  <VisualizationRow
@@ -636,6 +646,9 @@ export default function CdcDashboard({
636
646
  }
637
647
 
638
648
  const dashboardContainerClasses = ['cdc-open-viz-module', 'type-dashboard', `${currentViewport}`]
649
+ if (isEditor) {
650
+ dashboardContainerClasses.push('isDashboardEditor')
651
+ }
639
652
 
640
653
  return (
641
654
  <GlobalContextProvider>