@cdc/dashboard 4.26.3 → 4.26.5

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 (151) hide show
  1. package/CONFIG.md +219 -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 +61559 -58048
  6. package/examples/__data__/data-2.json +6 -0
  7. package/examples/__data__/data.json +6 -0
  8. package/examples/dashboard-conditions-filters-incomplete.json +221 -0
  9. package/examples/dashboard-missing-datasets-multi.json +174 -0
  10. package/examples/dashboard-missing-datasets-single.json +121 -0
  11. package/examples/dashboard-multi-dashboard-version-regression.json +146 -0
  12. package/examples/dashboard-shared-filter-row-delete-cleanup.json +186 -0
  13. package/examples/dashboard-stale-dataset-keys.json +181 -0
  14. package/examples/dashboard-tiered-filter-regression.json +190 -0
  15. package/examples/legend-issue.json +1 -1
  16. package/examples/minimal-example.json +34 -0
  17. package/examples/private/cfa-dashboard.json +651 -0
  18. package/examples/private/data-bite-wrap.json +6936 -0
  19. package/examples/private/dengue.json +4640 -0
  20. package/examples/private/link_to_file.json +16662 -0
  21. package/examples/private/multi-dash-fix.json +16963 -0
  22. package/examples/private/versions.json +41612 -0
  23. package/examples/sankey.json +3 -3
  24. package/examples/test-api-filter-reset.json +4 -4
  25. package/examples/tp5-test.json +86 -4
  26. package/examples/us-map-filter-example.json +1074 -0
  27. package/package.json +9 -9
  28. package/src/CdcDashboard.tsx +6 -2
  29. package/src/CdcDashboardComponent.tsx +179 -88
  30. package/src/DashboardCopyPasteContext.test.tsx +33 -0
  31. package/src/DashboardCopyPasteContext.tsx +48 -0
  32. package/src/_stories/Dashboard.EditorRegression.stories.tsx +72 -0
  33. package/src/_stories/Dashboard.Regression.stories.tsx +196 -0
  34. package/src/_stories/Dashboard.Zoom.stories.tsx +88 -0
  35. package/src/_stories/Dashboard.smoke.stories.tsx +33 -0
  36. package/src/_stories/Dashboard.stories.tsx +337 -2
  37. package/src/_stories/FilteredTextMigrationComparison.stories.tsx +87 -0
  38. package/src/_stories/_mock/dashboard-data-driven-colors.json +171 -0
  39. package/src/_stories/_mock/tp5-test.json +86 -5
  40. package/src/components/Column.test.tsx +176 -0
  41. package/src/components/Column.tsx +214 -13
  42. package/src/components/DashboardConditionModal.test.tsx +420 -0
  43. package/src/components/DashboardConditionModal.tsx +367 -0
  44. package/src/components/DashboardConditionSummary.tsx +59 -0
  45. package/src/components/DashboardEditors.tsx +23 -0
  46. package/src/components/DashboardFilters/DashboardFilters.test.tsx +267 -0
  47. package/src/components/DashboardFilters/DashboardFilters.tsx +193 -172
  48. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.test.tsx +164 -0
  49. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +46 -6
  50. package/src/components/DashboardFilters/DashboardFiltersEditor/components/APIModal.tsx +5 -3
  51. package/src/components/DashboardFilters/DashboardFiltersEditor/components/DeleteFilterModal.tsx +59 -58
  52. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.test.tsx +304 -0
  53. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +43 -36
  54. package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +2 -2
  55. package/src/components/DashboardFilters/DashboardFiltersWrapper.test.tsx +142 -0
  56. package/src/components/DashboardFilters/DashboardFiltersWrapper.tsx +32 -27
  57. package/src/components/DashboardFilters/dashboardfilter.styles.css +42 -27
  58. package/src/components/DataDesignerModal.tsx +2 -1
  59. package/src/components/ExpandCollapseButtons.tsx +6 -4
  60. package/src/components/Grid.tsx +12 -7
  61. package/src/components/Header/Header.tsx +36 -17
  62. package/src/components/MultiConfigTabs/MultiConfigTabs.tsx +141 -140
  63. package/src/components/Row.test.tsx +228 -0
  64. package/src/components/Row.tsx +104 -28
  65. package/src/components/VisualizationRow.test.tsx +396 -0
  66. package/src/components/VisualizationRow.tsx +177 -51
  67. package/src/components/VisualizationsPanel/VisualizationsPanel.test.tsx +49 -0
  68. package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +14 -13
  69. package/src/components/Widget/Widget.test.tsx +218 -0
  70. package/src/components/Widget/Widget.tsx +123 -20
  71. package/src/components/Widget/widget.styles.css +58 -14
  72. package/src/components/dashboard-condition-modal.css +76 -0
  73. package/src/components/dashboard-condition-summary.css +87 -0
  74. package/src/data/initial-state.js +1 -0
  75. package/src/helpers/addValuesToDashboardFilters.ts +3 -5
  76. package/src/helpers/addVisualization.ts +17 -4
  77. package/src/helpers/cloneDashboardWidget.ts +127 -0
  78. package/src/helpers/dashboardColumnWidgets.ts +99 -0
  79. package/src/helpers/dashboardConditionUi.ts +47 -0
  80. package/src/helpers/dashboardConditions.ts +200 -0
  81. package/src/helpers/dashboardFilterTargets.ts +156 -0
  82. package/src/helpers/filterData.ts +4 -9
  83. package/src/helpers/filterVisibility.ts +20 -0
  84. package/src/helpers/formatConfigBeforeSave.ts +2 -2
  85. package/src/helpers/getFilteredData.ts +18 -5
  86. package/src/helpers/getUpdateConfig.ts +43 -12
  87. package/src/helpers/getVizRowColumnLocator.ts +11 -1
  88. package/src/helpers/iconHash.tsx +9 -3
  89. package/src/helpers/mapDataToConfig.ts +31 -29
  90. package/src/helpers/reloadURLHelpers.ts +25 -5
  91. package/src/helpers/removeDashboardFilter.ts +33 -33
  92. package/src/helpers/tests/addVisualization.test.ts +53 -9
  93. package/src/helpers/tests/cloneDashboardWidget.test.ts +136 -0
  94. package/src/helpers/tests/dashboardColumnWidgets.test.ts +99 -0
  95. package/src/helpers/tests/dashboardConditionUi.test.ts +41 -0
  96. package/src/helpers/tests/dashboardConditions.test.ts +428 -0
  97. package/src/helpers/tests/formatConfigBeforeSave.test.ts +51 -0
  98. package/src/helpers/tests/getFilteredData.test.ts +265 -86
  99. package/src/helpers/tests/getUpdateConfig.test.ts +338 -0
  100. package/src/helpers/tests/reloadURLHelpers.test.ts +394 -238
  101. package/src/index.tsx +6 -3
  102. package/src/scss/grid.scss +281 -22
  103. package/src/scss/main.scss +215 -64
  104. package/src/store/dashboard.actions.ts +17 -4
  105. package/src/store/dashboard.reducer.test.ts +538 -0
  106. package/src/store/dashboard.reducer.ts +136 -22
  107. package/src/test/CdcDashboard.test.jsx +24 -0
  108. package/src/test/CdcDashboard.test.tsx +148 -0
  109. package/src/test/CdcDashboardComponent.test.tsx +935 -2
  110. package/src/types/ConfigRow.ts +15 -0
  111. package/src/types/DashboardFilters.ts +4 -0
  112. package/src/types/SharedFilter.ts +2 -0
  113. package/tests/fixtures/dashboard-config-with-metadata.json +1 -1
  114. package/dist/cdcdashboard-vr9HZwRt.es.js +0 -6
  115. package/examples/DEV-6574.json +0 -2224
  116. package/examples/api-dashboard-data.json +0 -272
  117. package/examples/api-dashboard-years.json +0 -11
  118. package/examples/api-geographies-data.json +0 -11
  119. package/examples/chart-data.json +0 -5409
  120. package/examples/custom/css/respiratory.css +0 -236
  121. package/examples/custom/js/respiratory.js +0 -242
  122. package/examples/default-data.json +0 -368
  123. package/examples/default-filter-control.json +0 -209
  124. package/examples/default-multi-dataset-shared-filter.json +0 -1729
  125. package/examples/default-multi-dataset.json +0 -506
  126. package/examples/ed-visits-county-file.json +0 -402
  127. package/examples/filters/Alabama.json +0 -72
  128. package/examples/filters/Alaska.json +0 -1737
  129. package/examples/filters/Arkansas.json +0 -4713
  130. package/examples/filters/California.json +0 -212
  131. package/examples/filters/Colorado.json +0 -1500
  132. package/examples/filters/Connecticut.json +0 -559
  133. package/examples/filters/Delaware.json +0 -63
  134. package/examples/filters/DistrictofColumbia.json +0 -63
  135. package/examples/filters/Florida.json +0 -4217
  136. package/examples/filters/States.json +0 -146
  137. package/examples/state-level.json +0 -90136
  138. package/examples/state-points.json +0 -10474
  139. package/examples/temp-example-data.json +0 -130
  140. package/examples/test-dashboard-simple.json +0 -503
  141. package/examples/test-example.json +0 -752
  142. package/examples/test-file.json +0 -147
  143. package/examples/test.json +0 -752
  144. package/examples/testing.json +0 -94456
  145. /package/examples/{data → __data__}/data-with-metadata.json +0 -0
  146. /package/examples/{legend-issue-data.json → __data__/legend-issue-data.json} +0 -0
  147. /package/examples/api-test/{categories.json → __data__/categories.json} +0 -0
  148. /package/examples/api-test/{chart-data.json → __data__/chart-data.json} +0 -0
  149. /package/examples/api-test/{topics.json → __data__/topics.json} +0 -0
  150. /package/examples/api-test/{years.json → __data__/years.json} +0 -0
  151. /package/src/_stories/{Dashboard.Pages.stories.tsx → Dashboard.Pages.smoke.stories.tsx} +0 -0
@@ -4238,7 +4238,7 @@
4238
4238
  }
4239
4239
  ],
4240
4240
  "dataFileSize": 72,
4241
- "dataFileName": "data.json",
4241
+ "dataFileName": "__data__/data.json",
4242
4242
  "dataFileSourceType": "file",
4243
4243
  "dataFileFormat": "JSON",
4244
4244
  "preview": false
@@ -4251,7 +4251,7 @@
4251
4251
  }
4252
4252
  ],
4253
4253
  "dataFileSize": 59,
4254
- "dataFileName": "data-2.json",
4254
+ "dataFileName": "__data__/data-2.json",
4255
4255
  "dataFileSourceType": "file",
4256
4256
  "dataFileFormat": "JSON",
4257
4257
  "preview": false
@@ -5215,4 +5215,4 @@
5215
5215
  "type": "dashboard",
5216
5216
  "uuid": 1707343065225,
5217
5217
  "runtime": {}
5218
- }
5218
+ }
@@ -7,7 +7,7 @@
7
7
  "type": "urlfilter",
8
8
  "columnName": "category",
9
9
  "apiFilter": {
10
- "apiEndpoint": "/examples/api-test/categories.json",
10
+ "apiEndpoint": "/examples/api-test/__data__/categories.json",
11
11
  "valueSelector": "category",
12
12
  "textSelector": "category"
13
13
  },
@@ -24,7 +24,7 @@
24
24
  "type": "urlfilter",
25
25
  "columnName": "topic",
26
26
  "apiFilter": {
27
- "apiEndpoint": "/examples/api-test/topics.json",
27
+ "apiEndpoint": "/examples/api-test/__data__/topics.json",
28
28
  "valueSelector": "topic",
29
29
  "textSelector": "topic"
30
30
  },
@@ -43,7 +43,7 @@
43
43
  "type": "urlfilter",
44
44
  "columnName": "year",
45
45
  "apiFilter": {
46
- "apiEndpoint": "/examples/api-test/years.json",
46
+ "apiEndpoint": "/examples/api-test/__data__/years.json",
47
47
  "valueSelector": "year",
48
48
  "textSelector": "year"
49
49
  },
@@ -128,7 +128,7 @@
128
128
  },
129
129
  "datasets": {
130
130
  "chartData": {
131
- "dataUrl": "http://localhost:8080/examples/api-test/chart-data.json"
131
+ "dataUrl": "http://localhost:8080/examples/api-test/__data__/chart-data.json"
132
132
  }
133
133
  },
134
134
  "filterBehavior": "Apply Button",
@@ -40,13 +40,23 @@
40
40
  { "width": 4, "widget": "gauge1" },
41
41
  { "width": 4, "widget": "gauge2" },
42
42
  { "width": 4, "widget": "gauge3" }
43
+ ],
44
+ [
45
+ { "width": 4, "widget": "markup1" },
46
+ { "width": 4, "widget": "markup2" },
47
+ { "width": 4, "widget": "markup3" }
48
+ ],
49
+ [
50
+ { "width": 4, "widget": "waffle2" },
51
+ { "width": 4, "widget": "bite3" },
52
+ { "width": 4, "widget": "markup2" }
43
53
  ]
44
54
  ],
45
55
  "visualizations": {
46
56
  "waffle1": {
47
57
  "uid": "waffle1",
48
58
  "type": "waffle-chart",
49
- "title": "Vaccination Coverage",
59
+ "title": "Vaccination",
50
60
  "visualizationType": "TP5 Waffle",
51
61
  "visualizationSubType": "linear",
52
62
  "showPercent": true,
@@ -71,7 +81,7 @@
71
81
  "waffle2": {
72
82
  "uid": "waffle2",
73
83
  "type": "waffle-chart",
74
- "title": "Health Insurance Coverage Rate",
84
+ "title": "Health",
75
85
  "visualizationType": "TP5 Waffle",
76
86
  "visualizationSubType": "linear",
77
87
  "showPercent": true,
@@ -96,7 +106,7 @@
96
106
  "waffle3": {
97
107
  "uid": "waffle3",
98
108
  "type": "waffle-chart",
99
- "title": "Cancer Screening Completion",
109
+ "title": "Cancer",
100
110
  "visualizationType": "TP5 Waffle",
101
111
  "visualizationSubType": "linear",
102
112
  "showPercent": true,
@@ -245,7 +255,7 @@
245
255
  "bite3": {
246
256
  "uid": "bite3",
247
257
  "type": "data-bite",
248
- "title": "Cancer Screening Completion",
258
+ "title": "Cancer Screening Completion, and a little something else to make the title taller",
249
259
  "biteStyle": "tp5",
250
260
  "dataColumn": "Screening Rate",
251
261
  "dataFunction": "Mean (Average)",
@@ -261,6 +271,78 @@
261
271
  "visual": {
262
272
  "hideBackgroundColor": false
263
273
  }
274
+ },
275
+ "markup1": {
276
+ "uid": "markup1",
277
+ "type": "markup-include",
278
+ "title": "",
279
+ "theme": "theme-blue",
280
+ "contentEditor": {
281
+ "style": "tp5",
282
+ "title": "TP5 Markup Include",
283
+ "titleStyle": "small",
284
+ "useInlineHTML": true,
285
+ "inlineHTML": "<p><strong>68.5%</strong> of adults were vaccinated against seasonal flu in this sample dataset.</p>",
286
+ "srcUrl": "#example",
287
+ "showHeader": true,
288
+ "showNoDataMessage": false,
289
+ "noDataMessageText": "No Data Available"
290
+ },
291
+ "visual": {
292
+ "border": true,
293
+ "accent": false,
294
+ "whiteBackground": false,
295
+ "hideBackgroundColor": false,
296
+ "borderColorTheme": false
297
+ }
298
+ },
299
+ "markup2": {
300
+ "uid": "markup2",
301
+ "type": "markup-include",
302
+ "title": "",
303
+ "theme": "theme-teal",
304
+ "contentEditor": {
305
+ "style": "tp5",
306
+ "title": "White Background TP5",
307
+ "titleStyle": "small",
308
+ "useInlineHTML": true,
309
+ "inlineHTML": "<p>This TP5 markup include uses white-background styling with border enabled for comparison.</p>",
310
+ "srcUrl": "#example",
311
+ "showHeader": true,
312
+ "showNoDataMessage": false,
313
+ "noDataMessageText": "No Data Available"
314
+ },
315
+ "visual": {
316
+ "border": true,
317
+ "accent": false,
318
+ "whiteBackground": true,
319
+ "hideBackgroundColor": false,
320
+ "borderColorTheme": false
321
+ }
322
+ },
323
+ "markup3": {
324
+ "uid": "markup3",
325
+ "type": "markup-include",
326
+ "title": "",
327
+ "theme": "theme-purple",
328
+ "contentEditor": {
329
+ "style": "tp5",
330
+ "title": "TP5 Markup Include (No White BG)",
331
+ "titleStyle": "small",
332
+ "useInlineHTML": true,
333
+ "inlineHTML": "<p>This TP5 markup include uses the standard background and border settings for side-by-side alignment testing.</p>",
334
+ "srcUrl": "#example",
335
+ "showHeader": true,
336
+ "showNoDataMessage": false,
337
+ "noDataMessageText": "No Data Available"
338
+ },
339
+ "visual": {
340
+ "border": true,
341
+ "accent": false,
342
+ "whiteBackground": false,
343
+ "hideBackgroundColor": false,
344
+ "borderColorTheme": false
345
+ }
264
346
  }
265
347
  }
266
348
  }