@cdc/dashboard 4.25.11 → 4.26.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 (51) hide show
  1. package/Dynamic_Data.md +66 -0
  2. package/dist/cdcdashboard.js +78783 -76370
  3. package/examples/api-dashboard-data.json +272 -0
  4. package/examples/api-dashboard-years.json +11 -0
  5. package/examples/api-geographies-data.json +11 -0
  6. package/examples/private/cat-y.json +1235 -0
  7. package/examples/private/chronic-dash.json +1584 -0
  8. package/examples/private/map-issue.json +2260 -0
  9. package/examples/private/mpinc-state-reports.json +2260 -0
  10. package/examples/private/nwss/rsv.json +1240 -0
  11. package/examples/private/simple-dash.json +490 -0
  12. package/examples/private/test-dash.json +0 -0
  13. package/examples/private/test123.json +491 -0
  14. package/examples/test-dashboard-simple.json +503 -0
  15. package/index.html +24 -25
  16. package/package.json +12 -11
  17. package/src/CdcDashboardComponent.tsx +18 -2
  18. package/src/_stories/Dashboard.DataSetup.stories.tsx +203 -0
  19. package/src/_stories/Dashboard.stories.tsx +385 -1
  20. package/src/_stories/_mock/filter-cascade.json +3350 -0
  21. package/src/_stories/_mock/gallery-data-bite-dashboard.json +3500 -0
  22. package/src/_stories/_mock/nested-parent-child-filters.json +392 -0
  23. package/src/_stories/_mock/parent-child-filters.json +233 -0
  24. package/src/components/DashboardFilters/DashboardFilters.tsx +20 -11
  25. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +89 -38
  26. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +51 -29
  27. package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +146 -9
  28. package/src/components/DashboardFilters/DashboardFiltersWrapper.tsx +11 -7
  29. package/src/components/DataDesignerModal.tsx +6 -1
  30. package/src/components/Header/Header.tsx +51 -20
  31. package/src/components/VisualizationRow.tsx +71 -5
  32. package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +2 -3
  33. package/src/components/Widget/Widget.tsx +1 -1
  34. package/src/data/initial-state.js +1 -0
  35. package/src/helpers/addValuesToDashboardFilters.ts +15 -22
  36. package/src/helpers/changeFilterActive.ts +67 -65
  37. package/src/helpers/formatConfigBeforeSave.ts +6 -5
  38. package/src/helpers/getUpdateConfig.ts +91 -91
  39. package/src/helpers/tests/updatesChildFilters.test.ts +53 -22
  40. package/src/helpers/updateChildFilters.ts +50 -27
  41. package/src/scss/main.scss +141 -1
  42. package/src/test/CdcDashboard.test.jsx +9 -4
  43. package/src/types/Dashboard.ts +1 -0
  44. package/src/types/FilterStyles.ts +8 -7
  45. package/src/types/SharedFilter.ts +13 -0
  46. package/LICENSE +0 -201
  47. package/examples/private/DEV-10538.json +0 -407
  48. package/examples/private/DEV-11072.json +0 -7591
  49. package/examples/private/DEV-11405.json +0 -39112
  50. package/examples/private/delete.json +0 -32919
  51. package/examples/private/pedro.json +0 -1
@@ -1,407 +0,0 @@
1
- {
2
- "dashboard": {
3
- "sharedFilters": [
4
- {
5
- "key": "Topic",
6
- "showDropdown": true,
7
- "type": "urlfilter",
8
- "apiFilter": {
9
- "apiEndpoint": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?%24datakey=statesystem_legi&%24limit=20&%24select=distinct%20Topic%2c%20TopicOrder&%24order=TopicOrder",
10
- "valueSelector": "Topic",
11
- "textSelector": ""
12
- },
13
- "usedBy": [],
14
- "tier": 1
15
- },
16
- {
17
- "key": "Measure",
18
- "showDropdown": true,
19
- "type": "urlfilter",
20
- "apiFilter": {
21
- "apiEndpoint": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi_all_locations&$select=DISTINCT%20Measure&$order=Measure&$limit=2002",
22
- "valueSelector": "Measure",
23
- "textSelector": ""
24
- },
25
- "usedBy": [],
26
- "parents": [
27
- "Topic"
28
- ],
29
- "tier": 2,
30
- "orderedValues": []
31
- },
32
- {
33
- "key": "Sub-Measure",
34
- "showDropdown": true,
35
- "type": "urlfilter",
36
- "apiFilter": {
37
- "apiEndpoint": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi_all_locations&$select=DISTINCT%20Provision&$order=Provision&$limit=2002",
38
- "valueSelector": "Provision",
39
- "textSelector": ""
40
- },
41
- "parents": [
42
- "Topic",
43
- "Measure"
44
- ],
45
- "usedBy": [],
46
- "tier": 3,
47
- "orderedValues": []
48
- },
49
- {
50
- "key": "Tobacco Type",
51
- "showDropdown": true,
52
- "type": "urlfilter",
53
- "apiFilter": {
54
- "apiEndpoint": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi&$select=DISTINCT%20TobaccoType&$order=TobaccoType&$where=TobaccoType!=%22%22&$limit=2002",
55
- "valueSelector": "TobaccoType",
56
- "textSelector": ""
57
- },
58
- "parents": [],
59
- "usedBy": [
60
- 3
61
- ],
62
- "tier": 1
63
- },
64
- {
65
- "key": "Time Period (Select up to 4)",
66
- "showDropdown": true,
67
- "type": "urlfilter",
68
- "filterStyle": "multi-select",
69
- "apiFilter": {
70
- "apiEndpoint": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi&$limit=2002&$select=DISTINCT%20YearQuarter&$order=YearQuarter DESC",
71
- "subgroupValueSelector": "",
72
- "textSelector": "",
73
- "valueSelector": "YearQuarter"
74
- },
75
- "selectLimit": "4",
76
- "parents": [
77
- "Tobacco Type"
78
- ],
79
- "usedBy": [
80
- 3
81
- ],
82
- "tier": 2
83
- }
84
- ]
85
- },
86
- "rows": [
87
- {
88
- "columns": [
89
- {
90
- "width": 12,
91
- "widget": "dashboardFilters1729541409268"
92
- }
93
- ],
94
- "dataDescription": {}
95
- },
96
- {
97
- "columns": [
98
- {
99
- "width": 12,
100
- "widget": "markup-include1733861851857"
101
- }
102
- ],
103
- "dataDescription": {
104
- "series": false
105
- },
106
- "dataKey": "$datakey=statesystem_legi&$limit=2001",
107
- "uuid": 1733861955862
108
- },
109
- {
110
- "columns": [
111
- {
112
- "width": 12,
113
- "widget": "dashboardFilters1729542268478"
114
- }
115
- ],
116
- "uuid": 1733861954085,
117
- "dataDescription": {
118
- "horizontal": false,
119
- "series": false
120
- },
121
- "dataKey": "$datakey=statesystem_legi&$limit=2001"
122
- },
123
- {
124
- "columns": [
125
- {
126
- "width": 12,
127
- "widget": "table1729541872326"
128
- }
129
- ],
130
- "dataDescription": {
131
- "horizontal": false,
132
- "series": false
133
- },
134
- "dataKey": "$datakey=statesystem_legi&$limit=2001",
135
- "uuid": 1733861952573
136
- },
137
- {
138
- "columns": [
139
- {
140
- "width": 12,
141
- "widget": "markup-include1739204271998"
142
- }
143
- ]
144
- }
145
- ],
146
- "visualizations": {
147
- "dashboardFilters1729541409268": {
148
- "filters": [],
149
- "filterBehavior": "Apply Button",
150
- "newViz": true,
151
- "openModal": true,
152
- "uid": "dashboardFilters1729541409268",
153
- "type": "dashboardFilters",
154
- "sharedFilterIndexes": [
155
- 0,
156
- 1,
157
- 2
158
- ],
159
- "visualizationType": "dashboardFilters",
160
- "dataKey": "$datakey=statesystem_legi&$limit=2001",
161
- "dataDescription": {
162
- "horizontal": false,
163
- "series": false
164
- },
165
- "autoLoad": false,
166
- "applyFiltersButtonText": "View Results",
167
- "showEditorPanel": false
168
- },
169
- "table1729541872326": {
170
- "filters": [],
171
- "filterBehavior": "Filter Change",
172
- "newViz": false,
173
- "openModal": true,
174
- "uid": "table1729541872326",
175
- "type": "table",
176
- "table": {
177
- "label": "",
178
- "show": true,
179
- "showDownloadUrl": false,
180
- "showVertical": true,
181
- "expanded": true,
182
- "collapsible": false,
183
- "pivot": {
184
- "columnName": "YearQuarter",
185
- "valueColumns": [
186
- "Value"
187
- ]
188
- }
189
- },
190
- "columns": {
191
- "GeoLocation": {
192
- "name": "GeoLocation",
193
- "dataTable": false
194
- },
195
- "LocationAbbr": {
196
- "name": "LocationAbbr",
197
- "dataTable": false
198
- },
199
- "Measure": {
200
- "name": "Measure",
201
- "dataTable": false
202
- },
203
- "MeasureId": {
204
- "name": "MeasureId",
205
- "dataTable": false
206
- },
207
- "OldTopicId": {
208
- "name": "OldTopicId",
209
- "dataTable": false
210
- },
211
- "Provision": {
212
- "name": "Provision",
213
- "dataTable": false
214
- },
215
- "Quarter": {
216
- "name": "Quarter",
217
- "dataTable": false
218
- },
219
- "RowDisplayOrder": {
220
- "name": "RowDisplayOrder",
221
- "dataTable": false
222
- },
223
- "RowNum": {
224
- "name": "RowNum",
225
- "dataTable": true
226
- },
227
- "TobaccoType": {
228
- "name": "TobaccoType",
229
- "dataTable": false
230
- },
231
- "Topic": {
232
- "name": "Topic",
233
- "dataTable": false
234
- },
235
- "Year": {
236
- "name": "Year",
237
- "dataTable": false
238
- },
239
- "TopicId": {
240
- "name": "TopicId",
241
- "dataTable": false
242
- },
243
- "Location": {
244
- "label": "State",
245
- "dataTable": true,
246
- "tooltips": false,
247
- "prefix": "",
248
- "suffix": "",
249
- "forestPlot": false,
250
- "startingPoint": "0",
251
- "forestPlotAlignRight": false,
252
- "roundToPlace": 0,
253
- "commas": false,
254
- "showInViz": false,
255
- "forestPlotStartingPoint": 0,
256
- "name": "Location",
257
- "order": 1
258
- },
259
- "TopicOrder": {
260
- "name": "TopicOrder",
261
- "dataTable": false
262
- }
263
- },
264
- "dataFormat": {},
265
- "visualizationType": "table",
266
- "dataKey": "$datakey=statesystem_legi&$limit=2001",
267
- "dataDescription": {
268
- "horizontal": false,
269
- "series": false
270
- }
271
- },
272
- "dashboardFilters1729542268478": {
273
- "filters": [],
274
- "filterBehavior": "Filter Change",
275
- "newViz": true,
276
- "openModal": true,
277
- "uid": "dashboardFilters1729542268478",
278
- "type": "dashboardFilters",
279
- "sharedFilterIndexes": [
280
- 3,
281
- 4
282
- ],
283
- "visualizationType": "dashboardFilters",
284
- "dataKey": "$datakey=statesystem_legi&$limit=2001",
285
- "dataDescription": {
286
- "horizontal": false,
287
- "series": false
288
- },
289
- "autoLoad": true
290
- },
291
- "markup-include1733861851857": {
292
- "filters": [],
293
- "filterBehavior": "Filter Change",
294
- "openModal": false,
295
- "uid": "markup-include1733861851857",
296
- "type": "markup-include",
297
- "contentEditor": {
298
- "inlineHTML": "<h2>{{topic}}</h2>",
299
- "markupVariables": [
300
- {
301
- "columnName": "Topic",
302
- "conditions": [],
303
- "name": "topic",
304
- "tag": "{{topic}}"
305
- }
306
- ],
307
- "showHeader": true,
308
- "srcUrl": "#example",
309
- "title": "",
310
- "useInlineHTML": true,
311
- "allowHideSection": false
312
- },
313
- "theme": "theme-blue",
314
- "visual": {
315
- "border": false,
316
- "accent": false,
317
- "background": false,
318
- "hideBackgroundColor": false,
319
- "borderColorTheme": false
320
- },
321
- "showEditorPanel": true,
322
- "visualizationType": "markup-include",
323
- "dataDescription": {
324
- "series": false
325
- },
326
- "dataKey": "$datakey=statesystem_legi&$limit=2001",
327
- "version": "4.24.10"
328
- },
329
- "markup-include1739204271998": {
330
- "filters": [],
331
- "filterBehavior": "Filter Change",
332
- "openModal": false,
333
- "uid": "markup-include1739204271998",
334
- "type": "markup-include",
335
- "contentEditor": {
336
- "inlineHTML": "Source: <a href=\"https://www.cdc.gov/tobacco/\">Office on Smoking and Health (OSH)</a>",
337
- "markupVariables": [],
338
- "showHeader": true,
339
- "srcUrl": "#example",
340
- "title": "",
341
- "useInlineHTML": true
342
- },
343
- "theme": "theme-blue",
344
- "visual": {
345
- "border": false,
346
- "accent": false,
347
- "background": false,
348
- "hideBackgroundColor": false,
349
- "borderColorTheme": false
350
- },
351
- "showEditorPanel": true,
352
- "visualizationType": "markup-include",
353
- "version": "4.25.1",
354
- "migrations": {
355
- "addColorMigration": true
356
- }
357
- }
358
- },
359
- "table": {
360
- "label": "Data Table",
361
- "show": false,
362
- "showDownloadUrl": false,
363
- "showVertical": true
364
- },
365
- "datasets": {
366
- "$datakey=statesystem_legi&$limit=2000": {
367
- "dataFileSize": 772031,
368
- "dataFileName": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi&$limit=2000",
369
- "dataFileSourceType": "url",
370
- "dataFileFormat": "JSON",
371
- "preview": false,
372
- "dataUrl": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi&$limit=2000"
373
- },
374
- "$datakey=statesystem_legi&$limit=2001": {
375
- "dataFileSize": 831366,
376
- "dataFileName": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi&$limit=2001",
377
- "dataFileSourceType": "url",
378
- "dataFileFormat": "JSON",
379
- "preview": false,
380
- "dataUrl": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi&$limit=2001"
381
- },
382
- "$datakey=statesystem_legi&$limit=2002": {
383
- "dataFileSize": 831821,
384
- "dataFileName": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi&$limit=2002",
385
- "dataFileSourceType": "url",
386
- "dataFileFormat": "JSON",
387
- "preview": false,
388
- "dataUrl": "https://nccd-proxy-int.cdc.gov/NCCD_COVE_API?$datakey=statesystem_legi&$limit=2002"
389
- }
390
- },
391
- "isResponsiveTicks": false,
392
- "type": "dashboard",
393
- "barThickness": "0.37",
394
- "xAxis": {
395
- "type": "categorical",
396
- "size": 75,
397
- "maxTickRotation": 45,
398
- "labelOffset": 0
399
- },
400
- "version": "4.25.1",
401
- "uuid": 1740766033549,
402
- "migrations": {
403
- "addColorMigration": true
404
- },
405
- "runtime": {},
406
- "label": "All Locations"
407
- }