@cdc/dashboard 4.25.1 → 4.25.2-25

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 (36) hide show
  1. package/dist/cdcdashboard.js +52965 -52581
  2. package/examples/all-components.json +529 -4607
  3. package/examples/dashboard-gallery.json +397 -397
  4. package/examples/private/DEV-10527.json +564 -0
  5. package/examples/private/DEV-10586.json +54319 -0
  6. package/examples/private/DEV-10856.json +54319 -0
  7. package/examples/private/dashboard-map-filter.json +815 -0
  8. package/examples/private/dev-10856-2.json +1348 -0
  9. package/examples/private/feelings.json +1 -0
  10. package/examples/private/nhis.json +1792 -0
  11. package/index.html +4 -3
  12. package/package.json +9 -9
  13. package/src/CdcDashboard.tsx +5 -8
  14. package/src/CdcDashboardComponent.tsx +58 -56
  15. package/src/_stories/Dashboard.stories.tsx +31 -0
  16. package/src/_stories/_mock/dashboard-filter-asc.json +551 -0
  17. package/src/components/CollapsibleVisualizationRow.tsx +1 -1
  18. package/src/components/DashboardFilters/DashboardFilters.tsx +10 -5
  19. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +22 -5
  20. package/src/components/DashboardFilters/DashboardFiltersEditor/components/DeleteFilterModal.tsx +13 -3
  21. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +129 -40
  22. package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +10 -7
  23. package/src/components/DashboardFilters/DashboardFiltersWrapper.tsx +11 -12
  24. package/src/components/DashboardFilters/dashboardfilter.styles.css +0 -2
  25. package/src/components/VisualizationRow.tsx +12 -2
  26. package/src/helpers/addValuesToDashboardFilters.ts +6 -5
  27. package/src/helpers/apiFilterHelpers.ts +10 -5
  28. package/src/helpers/changeFilterActive.ts +17 -4
  29. package/src/helpers/getFilteredData.ts +13 -4
  30. package/src/helpers/getUpdateConfig.ts +11 -4
  31. package/src/helpers/loadAPIFilters.ts +6 -4
  32. package/src/helpers/tests/updatesChildFilters.test.ts +56 -0
  33. package/src/helpers/updateChildFilters.ts +50 -0
  34. package/src/scss/main.scss +0 -3
  35. package/src/store/dashboard.reducer.ts +46 -24
  36. package/src/types/SharedFilter.ts +1 -1
@@ -0,0 +1,564 @@
1
+ {
2
+ "dashboard": {
3
+ "theme": "theme-blue",
4
+ "title": "Amount Filtered by Location and Type ",
5
+ "sharedFilters": [
6
+ {
7
+ "values": [
8
+ "Alabama",
9
+ "Alaska",
10
+ "American Samoa",
11
+ "Arizona",
12
+ "Arkansas"
13
+ ],
14
+ "columnName": "Location",
15
+ "showDropdown": true,
16
+ "usedBy": [
17
+ "data-bite1628875468150",
18
+ "chart1628875631849",
19
+ "data-bite1628876561387",
20
+ "data-bite1628877031319"
21
+ ],
22
+ "tier": 1,
23
+ "type": "datafilter",
24
+ "order": "cust",
25
+ "orderedValues": [
26
+ "Alabama",
27
+ "Alaska",
28
+ "American Samoa",
29
+ "Arizona",
30
+ "Arkansas"
31
+ ]
32
+ },
33
+ {
34
+ "values": [
35
+ "Federal",
36
+ "Local",
37
+ "State"
38
+ ],
39
+ "columnName": "Type",
40
+ "showDropdown": true,
41
+ "usedBy": [
42
+ "data-bite1628875468150",
43
+ "chart1628875631849",
44
+ "data-bite1628876561387",
45
+ "data-bite1628877031319"
46
+ ],
47
+ "tier": 1,
48
+ "orderedValues": [
49
+ "Federal",
50
+ "Local",
51
+ "State"
52
+ ]
53
+ },
54
+ {
55
+ "key": "Map Detail",
56
+ "showDropdown": true,
57
+ "values": [],
58
+ "type": "mapFilter",
59
+ "orderedValues": []
60
+ }
61
+ ]
62
+ },
63
+ "rows": [
64
+ {
65
+ "columns": [
66
+ {
67
+ "width": 12,
68
+ "widget": "legacySharedFilters"
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "columns": [
74
+ {
75
+ "width": 6,
76
+ "widget": "data-bite1628875468150"
77
+ },
78
+ {
79
+ "width": 6,
80
+ "widget": "chart1628875631849"
81
+ },
82
+ {
83
+ "width": null
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "columns": [
89
+ {
90
+ "width": 6,
91
+ "widget": "data-bite1628877031319"
92
+ },
93
+ {
94
+ "width": 6,
95
+ "widget": "data-bite1628876561387"
96
+ },
97
+ {
98
+ "width": null
99
+ }
100
+ ]
101
+ }
102
+ ],
103
+ "visualizations": {
104
+ "data-bite1628875468150": {
105
+ "type": "data-bite",
106
+ "dataBite": "",
107
+ "dataFunction": "Mean (Average)",
108
+ "dataColumn": "Amount",
109
+ "bitePosition": "Left",
110
+ "biteFontSize": 24,
111
+ "fontSize": "medium",
112
+ "biteBody": "<span style=\"font-size: 20px;\">Average Amount 2019-2021</span> <br>Reflects the average of the dashboard level filter selections within the timeframe available in the data. In this case 2019-2021. \n This number is calculated within the Data Bite module.\n",
113
+ "imageData": {
114
+ "display": "none",
115
+ "url": "",
116
+ "alt": "",
117
+ "options": []
118
+ },
119
+ "dataFormat": {
120
+ "roundToPlace": 0,
121
+ "commas": true,
122
+ "prefix": "",
123
+ "suffix": ""
124
+ },
125
+ "biteStyle": "graphic",
126
+ "filters": [],
127
+ "subtext": "Citation for Source ",
128
+ "title": "",
129
+ "theme": "theme-orange",
130
+ "shadow": true,
131
+ "visual": {
132
+ "border": false,
133
+ "accent": false,
134
+ "background": false,
135
+ "hideBackgroundColor": false,
136
+ "borderColorTheme": false
137
+ },
138
+ "general": {
139
+ "isCompactStyle": false
140
+ },
141
+ "imageUrl": "",
142
+ "prefix": "",
143
+ "suffix": "",
144
+ "uid": "data-bite1628875468150",
145
+ "visualizationType": "data-bite",
146
+ "dataKey": "dashboard_aggregate_example_no_add_fullname.csv",
147
+ "version": "4.25.1",
148
+ "migrations": {
149
+ "addColorMigration": true
150
+ }
151
+ },
152
+ "chart1628875631849": {
153
+ "type": "chart",
154
+ "title": "",
155
+ "theme": "theme-blue",
156
+ "fontSize": "large",
157
+ "height": "200",
158
+ "padding": {
159
+ "left": 5,
160
+ "right": 5
161
+ },
162
+ "yAxis": {
163
+ "size": "80",
164
+ "gridLines": false,
165
+ "label": "Amount",
166
+ "numTicks": "4"
167
+ },
168
+ "barThickness": 0.35,
169
+ "xAxis": {
170
+ "size": "0",
171
+ "tickRotation": 0,
172
+ "dataKey": "Year",
173
+ "label": ""
174
+ },
175
+ "table": {
176
+ "label": "Data Table",
177
+ "expanded": false,
178
+ "show": false
179
+ },
180
+ "legend": {
181
+ "behavior": "isolate",
182
+ "position": "right",
183
+ "hide": true
184
+ },
185
+ "palette": "qualitative-bold",
186
+ "labels": true,
187
+ "dataFormat": {},
188
+ "confidenceKeys": {},
189
+ "uid": "chart1628875631849",
190
+ "visualizationType": "Bar",
191
+ "series": [
192
+ {
193
+ "dataKey": "Amount",
194
+ "type": "Bar"
195
+ }
196
+ ],
197
+ "dataKey": "dashboard_aggregate_example_no_add_fullname.csv"
198
+ },
199
+ "data-bite1628876561387": {
200
+ "type": "data-bite",
201
+ "dataBite": "",
202
+ "dataFunction": "Max",
203
+ "dataColumn": "Amount",
204
+ "bitePosition": "Right",
205
+ "biteFontSize": "58",
206
+ "fontSize": "medium",
207
+ "imageUrl": "",
208
+ "biteBody": "<span style=\"font-size: 24px;\"> Peak Amount</span> <br>Reflects the maximum point of data within the dashboard level filter selections within the timeframe set in the data. In this case 2019-2021. \nThis number is calculated within the Data Bite module.\n",
209
+ "prefix": "",
210
+ "suffix": "",
211
+ "dataFormat": {
212
+ "roundToPlace": 0,
213
+ "commas": true,
214
+ "prefix": "",
215
+ "suffix": ""
216
+ },
217
+ "biteStyle": "title",
218
+ "filters": [],
219
+ "subtext": "Source",
220
+ "title": "",
221
+ "theme": "theme-blue",
222
+ "shadow": true,
223
+ "uid": "data-bite1628876561387",
224
+ "visualizationType": "data-bite",
225
+ "dataKey": "dashboard_aggregate_example_no_add_fullname.csv"
226
+ },
227
+ "data-bite1628877031319": {
228
+ "type": "data-bite",
229
+ "dataBite": "",
230
+ "dataFunction": "Sum",
231
+ "dataColumn": "Amount",
232
+ "bitePosition": "Right",
233
+ "biteFontSize": "58",
234
+ "fontSize": "medium",
235
+ "imageUrl": "",
236
+ "biteBody": "<span style=\"font-size: 24px;\">State Total</span> <br>Reflects the Sum total of the dashboard level filter selections within the timeframe set in the data. In this case 2019-2021. \n This number is calculated within the Data Bite module.\n",
237
+ "prefix": "",
238
+ "suffix": "",
239
+ "dataFormat": {
240
+ "roundToPlace": 0,
241
+ "commas": true,
242
+ "prefix": "",
243
+ "suffix": ""
244
+ },
245
+ "biteStyle": "title",
246
+ "filters": [
247
+ {
248
+ "id": 1738001923264
249
+ }
250
+ ],
251
+ "subtext": "Source ",
252
+ "title": "",
253
+ "theme": "theme-amber",
254
+ "shadow": true,
255
+ "uid": "data-bite1628877031319",
256
+ "visualizationType": "data-bite",
257
+ "dataKey": "dashboard_aggregate_example_no_add_fullname.csv"
258
+ },
259
+ "legacySharedFilters": {
260
+ "type": "dashboardFilters",
261
+ "visualizationType": "dashboardFilters",
262
+ "sharedFilterIndexes": [
263
+ 0,
264
+ 1,
265
+ 2
266
+ ],
267
+ "filterBehavior": "Filter Change",
268
+ "uid": "legacySharedFilters"
269
+ }
270
+ },
271
+ "table": {
272
+ "label": "Data Table",
273
+ "show": true
274
+ },
275
+ "data": [],
276
+ "dataFileName": "",
277
+ "dataFileSourceType": "",
278
+ "type": "dashboard",
279
+ "uuid": 1628875999137,
280
+ "runtime": {},
281
+ "datasets": {
282
+ "dashboard_aggregate_example_no_add_fullname.csv": {
283
+ "data": [
284
+ {
285
+ "Location": "Alaska",
286
+ "Year": "2019",
287
+ "Type": "Federal",
288
+ "Amount": "1377"
289
+ },
290
+ {
291
+ "Location": "Alaska",
292
+ "Year": "2019",
293
+ "Type": "Local",
294
+ "Amount": "1613"
295
+ },
296
+ {
297
+ "Location": "Alaska",
298
+ "Year": "2019",
299
+ "Type": "State",
300
+ "Amount": "1495"
301
+ },
302
+ {
303
+ "Location": "Alaska",
304
+ "Year": "2020",
305
+ "Type": "Federal",
306
+ "Amount": "1377"
307
+ },
308
+ {
309
+ "Location": "Alaska",
310
+ "Year": "2020",
311
+ "Type": "Local",
312
+ "Amount": "1613"
313
+ },
314
+ {
315
+ "Location": "Alaska",
316
+ "Year": "2020",
317
+ "Type": "State",
318
+ "Amount": "1495"
319
+ },
320
+ {
321
+ "Location": "Alaska",
322
+ "Year": "2021",
323
+ "Type": "Federal",
324
+ "Amount": "1436"
325
+ },
326
+ {
327
+ "Location": "Alaska",
328
+ "Year": "2021",
329
+ "Type": "Local",
330
+ "Amount": "1672"
331
+ },
332
+ {
333
+ "Location": "Alaska",
334
+ "Year": "2021",
335
+ "Type": "State",
336
+ "Amount": "1554"
337
+ },
338
+ {
339
+ "Location": "Alabama",
340
+ "Year": "2019",
341
+ "Type": "Federal",
342
+ "Amount": "1375"
343
+ },
344
+ {
345
+ "Location": "Alabama",
346
+ "Year": "2019",
347
+ "Type": "Local",
348
+ "Amount": "1611"
349
+ },
350
+ {
351
+ "Location": "Alabama",
352
+ "Year": "2019",
353
+ "Type": "State",
354
+ "Amount": "1493"
355
+ },
356
+ {
357
+ "Location": "Alabama",
358
+ "Year": "2020",
359
+ "Type": "Federal",
360
+ "Amount": "1375"
361
+ },
362
+ {
363
+ "Location": "Alabama",
364
+ "Year": "2020",
365
+ "Type": "Local",
366
+ "Amount": "1611"
367
+ },
368
+ {
369
+ "Location": "Alabama",
370
+ "Year": "2020",
371
+ "Type": "State",
372
+ "Amount": "1493"
373
+ },
374
+ {
375
+ "Location": "Alabama",
376
+ "Year": "2021",
377
+ "Type": "Federal",
378
+ "Amount": "1434"
379
+ },
380
+ {
381
+ "Location": "Alabama",
382
+ "Year": "2021",
383
+ "Type": "Local",
384
+ "Amount": "1670"
385
+ },
386
+ {
387
+ "Location": "Alabama",
388
+ "Year": "2021",
389
+ "Type": "State",
390
+ "Amount": "1552"
391
+ },
392
+ {
393
+ "Location": "Arkansas",
394
+ "Year": "2019",
395
+ "Type": "Federal",
396
+ "Amount": "1398"
397
+ },
398
+ {
399
+ "Location": "Arkansas",
400
+ "Year": "2019",
401
+ "Type": "Local",
402
+ "Amount": "1634"
403
+ },
404
+ {
405
+ "Location": "Arkansas",
406
+ "Year": "2019",
407
+ "Type": "State",
408
+ "Amount": "1516"
409
+ },
410
+ {
411
+ "Location": "Arkansas",
412
+ "Year": "2020",
413
+ "Type": "Federal",
414
+ "Amount": "1398"
415
+ },
416
+ {
417
+ "Location": "Arkansas",
418
+ "Year": "2020",
419
+ "Type": "Local",
420
+ "Amount": "1634"
421
+ },
422
+ {
423
+ "Location": "Arkansas",
424
+ "Year": "2020",
425
+ "Type": "State",
426
+ "Amount": "1516"
427
+ },
428
+ {
429
+ "Location": "Arkansas",
430
+ "Year": "2021",
431
+ "Type": "Federal",
432
+ "Amount": "1457"
433
+ },
434
+ {
435
+ "Location": "Arkansas",
436
+ "Year": "2021",
437
+ "Type": "Local",
438
+ "Amount": "1693"
439
+ },
440
+ {
441
+ "Location": "Arkansas",
442
+ "Year": "2021",
443
+ "Type": "State",
444
+ "Amount": "1575"
445
+ },
446
+ {
447
+ "Location": "American Samoa",
448
+ "Year": "2019",
449
+ "Type": "Federal",
450
+ "Amount": "1388"
451
+ },
452
+ {
453
+ "Location": "American Samoa",
454
+ "Year": "2019",
455
+ "Type": "Local",
456
+ "Amount": "1624"
457
+ },
458
+ {
459
+ "Location": "American Samoa",
460
+ "Year": "2019",
461
+ "Type": "State",
462
+ "Amount": "1506"
463
+ },
464
+ {
465
+ "Location": "American Samoa",
466
+ "Year": "2020",
467
+ "Type": "Federal",
468
+ "Amount": "1388"
469
+ },
470
+ {
471
+ "Location": "American Samoa",
472
+ "Year": "2020",
473
+ "Type": "Local",
474
+ "Amount": "1624"
475
+ },
476
+ {
477
+ "Location": "American Samoa",
478
+ "Year": "2020",
479
+ "Type": "State",
480
+ "Amount": "1506"
481
+ },
482
+ {
483
+ "Location": "American Samoa",
484
+ "Year": "2021",
485
+ "Type": "Federal",
486
+ "Amount": "1447"
487
+ },
488
+ {
489
+ "Location": "American Samoa",
490
+ "Year": "2021",
491
+ "Type": "Local",
492
+ "Amount": "1683"
493
+ },
494
+ {
495
+ "Location": "American Samoa",
496
+ "Year": "2021",
497
+ "Type": "State",
498
+ "Amount": "1565"
499
+ },
500
+ {
501
+ "Location": "Arizona",
502
+ "Year": "2019",
503
+ "Type": "Federal",
504
+ "Amount": "1401"
505
+ },
506
+ {
507
+ "Location": "Arizona",
508
+ "Year": "2019",
509
+ "Type": "Local",
510
+ "Amount": "1637"
511
+ },
512
+ {
513
+ "Location": "Arizona",
514
+ "Year": "2019",
515
+ "Type": "State",
516
+ "Amount": "1519"
517
+ },
518
+ {
519
+ "Location": "Arizona",
520
+ "Year": "2020",
521
+ "Type": "Federal",
522
+ "Amount": "1401"
523
+ },
524
+ {
525
+ "Location": "Arizona",
526
+ "Year": "2020",
527
+ "Type": "Local",
528
+ "Amount": "1637"
529
+ },
530
+ {
531
+ "Location": "Arizona",
532
+ "Year": "2020",
533
+ "Type": "State",
534
+ "Amount": "1519"
535
+ },
536
+ {
537
+ "Location": "Arizona",
538
+ "Year": "2021",
539
+ "Type": "Federal",
540
+ "Amount": "1460"
541
+ },
542
+ {
543
+ "Location": "Arizona",
544
+ "Year": "2021",
545
+ "Type": "Local",
546
+ "Amount": "1696"
547
+ },
548
+ {
549
+ "Location": "Arizona",
550
+ "Year": "2021",
551
+ "Type": "State",
552
+ "Amount": "1578"
553
+ }
554
+ ]
555
+ }
556
+ },
557
+ "dataUrl": "",
558
+ "dataDescription": {},
559
+ "formattedData": [],
560
+ "version": "4.25.1",
561
+ "migrations": {
562
+ "addColorMigration": true
563
+ }
564
+ }