@cdc/dashboard 4.24.5 → 4.24.9-1

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 (86) hide show
  1. package/dist/cdcdashboard.js +147572 -128223
  2. package/examples/custom/css/respiratory.css +236 -0
  3. package/examples/custom/js/respiratory.js +242 -0
  4. package/examples/default-multi-dataset-shared-filter.json +1729 -0
  5. package/examples/ed-visits-county-file.json +618 -0
  6. package/examples/filtered-dash.json +6 -21
  7. package/examples/single-state-dashboard-filters.json +421 -0
  8. package/examples/state-level.json +90136 -0
  9. package/examples/state-points.json +10474 -0
  10. package/examples/test-file.json +147 -0
  11. package/examples/testing.json +94456 -0
  12. package/index.html +25 -4
  13. package/package.json +12 -11
  14. package/src/CdcDashboard.tsx +5 -1
  15. package/src/CdcDashboardComponent.tsx +250 -327
  16. package/src/DashboardContext.tsx +15 -1
  17. package/src/_stories/Dashboard.stories.tsx +158 -40
  18. package/src/_stories/_mock/api-filter-chart.json +11 -35
  19. package/src/_stories/_mock/api-filter-map.json +17 -31
  20. package/src/_stories/_mock/bump-chart.json +3554 -0
  21. package/src/_stories/_mock/methodology.json +412 -0
  22. package/src/_stories/_mock/methodologyAPI.ts +90 -0
  23. package/src/_stories/_mock/multi-viz.json +3 -4
  24. package/src/_stories/_mock/pivot-filter.json +14 -12
  25. package/src/_stories/_mock/single-state-dashboard-filters.json +390 -0
  26. package/src/components/CollapsibleVisualizationRow.tsx +44 -0
  27. package/src/components/Column.tsx +1 -1
  28. package/src/components/DashboardFilters/DashboardFilters.tsx +102 -0
  29. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +218 -0
  30. package/src/components/DashboardFilters/DashboardFiltersEditor/components/DeleteFilterModal.tsx +48 -0
  31. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +477 -0
  32. package/src/components/DashboardFilters/DashboardFiltersEditor/index.ts +1 -0
  33. package/src/components/DashboardFilters/DashboardFiltersWrapper.tsx +191 -0
  34. package/src/components/DashboardFilters/index.ts +3 -0
  35. package/src/components/DataDesignerModal.tsx +9 -9
  36. package/src/components/ExpandCollapseButtons.tsx +20 -0
  37. package/src/components/Header/Header.tsx +1 -102
  38. package/src/components/MultiConfigTabs/MultiConfigTabs.tsx +24 -12
  39. package/src/components/Row.tsx +52 -19
  40. package/src/components/Toggle/Toggle.tsx +2 -4
  41. package/src/components/VisualizationRow.tsx +169 -30
  42. package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +116 -0
  43. package/src/components/VisualizationsPanel/index.ts +1 -0
  44. package/src/components/VisualizationsPanel/visualizations-panel-styles.css +12 -0
  45. package/src/components/Widget.tsx +27 -90
  46. package/src/helpers/FilterBehavior.ts +4 -0
  47. package/src/helpers/addValuesToDashboardFilters.ts +49 -0
  48. package/src/helpers/apiFilterHelpers.ts +103 -0
  49. package/src/helpers/changeFilterActive.ts +39 -0
  50. package/src/helpers/filterData.ts +10 -48
  51. package/src/helpers/generateValuesForFilter.ts +1 -1
  52. package/src/helpers/getAutoLoadVisualization.ts +11 -0
  53. package/src/helpers/getFilteredData.ts +7 -5
  54. package/src/helpers/getVizConfig.ts +23 -2
  55. package/src/helpers/getVizRowColumnLocator.ts +2 -1
  56. package/src/helpers/hasDashboardApplyBehavior.ts +5 -0
  57. package/src/helpers/iconHash.tsx +5 -3
  58. package/src/helpers/loadAPIFilters.ts +74 -0
  59. package/src/helpers/mapDataToConfig.ts +29 -0
  60. package/src/helpers/processData.ts +2 -3
  61. package/src/helpers/reloadURLHelpers.ts +102 -0
  62. package/src/helpers/tests/addValuesToDashboardFilters.test.ts +44 -0
  63. package/src/helpers/tests/apiFilterHelpers.test.ts +155 -0
  64. package/src/helpers/tests/filterData.test.ts +1 -93
  65. package/src/helpers/tests/getFilteredData.test.ts +86 -0
  66. package/src/helpers/tests/loadAPIFiltersWrapper.test.ts +220 -0
  67. package/src/helpers/tests/reloadURLHelpers.test.ts +232 -0
  68. package/src/scss/editor-panel.scss +1 -1
  69. package/src/scss/grid.scss +34 -27
  70. package/src/scss/main.scss +41 -3
  71. package/src/scss/variables.scss +4 -0
  72. package/src/store/dashboard.actions.ts +12 -4
  73. package/src/store/dashboard.reducer.ts +30 -4
  74. package/src/types/APIFilter.ts +1 -5
  75. package/src/types/ConfigRow.ts +2 -0
  76. package/src/types/Dashboard.ts +1 -1
  77. package/src/types/DashboardConfig.ts +2 -4
  78. package/src/types/DashboardFilters.ts +7 -0
  79. package/src/types/InitialState.ts +1 -1
  80. package/src/types/MultiDashboard.ts +2 -2
  81. package/src/types/SharedFilter.ts +4 -6
  82. package/src/types/Tab.ts +1 -1
  83. package/src/components/Filters.tsx +0 -88
  84. package/src/components/Header/FilterModal.tsx +0 -510
  85. package/src/components/VisualizationsPanel.tsx +0 -95
  86. package/src/helpers/getApiFilterKey.ts +0 -5
@@ -0,0 +1,147 @@
1
+ {
2
+ "dashboard": {
3
+ "theme": "theme-blue",
4
+ "sharedFilters": [
5
+ {
6
+ "key": "Topic",
7
+ "showDropdown": true,
8
+ "type": "urlfilter",
9
+ "apiFilter": {
10
+ "apiEndpoint": "https://nccd-cove-public-api.apps.ecpaas-dev.cdc.gov/od-public?$datakey=statesystem_cessation&$select=distinct%20Topic",
11
+ "valueSelector": "Topic",
12
+ "textSelector": ""
13
+ }
14
+ },
15
+ {
16
+ "key": "Quarter",
17
+ "showDropdown": true,
18
+ "type": "urlfilter",
19
+ "apiFilter": {
20
+ "apiEndpoint": "https://nccd-cove-public-api.apps.ecpaas-dev.cdc.gov/od-public?$datakey=statesystem_cessation&$select=distinct%20Quarter",
21
+ "valueSelector": "Quarter",
22
+ "textSelector": ""
23
+ },
24
+ "parents": [
25
+ "Topic"
26
+ ]
27
+ },
28
+ {
29
+ "key": "YearQuarter",
30
+ "showDropdown": true,
31
+ "type": "urlfilter",
32
+ "apiFilter": {
33
+ "apiEndpoint": "https://nccd-cove-public-api.apps.ecpaas-dev.cdc.gov/od-public?$datakey=statesystem_cessation&$select=distinct YearQuarter,Year",
34
+ "valueSelector": "Year",
35
+ "textSelector": "YearQuarter"
36
+ },
37
+ "parents": [
38
+ "Topic",
39
+ "Quarter"
40
+ ],
41
+ "multiSelect": true
42
+ }
43
+ ]
44
+ },
45
+ "rows": [
46
+ {
47
+ "columns": [
48
+ {
49
+ "width": 12,
50
+ "widget": "dashboardFilters1723058075362"
51
+ },
52
+ {},
53
+ {}
54
+ ]
55
+ },
56
+ {
57
+ "columns": [
58
+ {
59
+ "width": 12,
60
+ "widget": "dashboardFilters1723058794676"
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "columns": [
66
+ {
67
+ "width": 12,
68
+ "widget": "table1724779017139"
69
+ }
70
+ ]
71
+ }
72
+ ],
73
+ "visualizations": {
74
+ "dashboardFilters1723058075362": {
75
+ "filters": [],
76
+ "filterBehavior": "Apply Button",
77
+ "newViz": true,
78
+ "openModal": true,
79
+ "uid": "dashboardFilters1723058075362",
80
+ "type": "dashboardFilters",
81
+ "sharedFilterIndexes": [
82
+ 0,
83
+ 1
84
+ ],
85
+ "visualizationType": "dashboardFilters",
86
+ "editing": false
87
+ },
88
+ "dashboardFilters1723058794676": {
89
+ "filters": [],
90
+ "filterBehavior": "Filter Change",
91
+ "newViz": true,
92
+ "openModal": true,
93
+ "uid": "dashboardFilters1723058794676",
94
+ "type": "dashboardFilters",
95
+ "sharedFilterIndexes": [
96
+ 2
97
+ ],
98
+ "visualizationType": "dashboardFilters",
99
+ "editing": false,
100
+ "autoLoad": true
101
+ },
102
+ "table1724779017139": {
103
+ "filters": [],
104
+ "filterBehavior": "Filter Change",
105
+ "newViz": false,
106
+ "openModal": true,
107
+ "uid": "table1724779017139",
108
+ "type": "table",
109
+ "table": {
110
+ "label": "Data Table",
111
+ "show": true,
112
+ "showDownloadUrl": false,
113
+ "showVertical": true,
114
+ "expanded": true,
115
+ "collapsible": true
116
+ },
117
+ "columns": {},
118
+ "dataFormat": {},
119
+ "visualizationType": "table",
120
+ "dataDescription": {
121
+ "horizontal": false,
122
+ "series": false
123
+ },
124
+ "dataKey": "https://nccd-cove-public-api.apps.ecpaas-dev.cdc.gov/od-public?$datakey=statesystem_cessation"
125
+ }
126
+ },
127
+ "table": {
128
+ "label": "Data Table",
129
+ "show": true,
130
+ "showDownloadUrl": false,
131
+ "showVertical": true
132
+ },
133
+ "datasets": {
134
+ "https://nccd-cove-public-api.apps.ecpaas-dev.cdc.gov/od-public?$datakey=statesystem_cessation": {
135
+ "dataFileSize": 19076,
136
+ "dataFileName": "https://nccd-cove-public-api.apps.ecpaas-dev.cdc.gov/od-public?$datakey=statesystem_cessation",
137
+ "dataFileSourceType": "url",
138
+ "dataFileFormat": "JSON",
139
+ "preview": true,
140
+ "dataUrl": "https://nccd-cove-public-api.apps.ecpaas-dev.cdc.gov/od-public?$datakey=statesystem_cessation"
141
+ }
142
+ },
143
+ "type": "dashboard",
144
+ "version": "4.24.9",
145
+ "uuid": 1724778985218,
146
+ "runtime": {}
147
+ }