@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
@@ -0,0 +1,490 @@
1
+ {
2
+ "dashboard": {
3
+ "theme": "theme-blue",
4
+ "sharedFilters": [
5
+ {
6
+ "key": "New Dashboard Filter 1",
7
+ "showDropdown": true,
8
+ "values": [
9
+ "Hispanic or Latino",
10
+ "Non-Hispanic American Indian",
11
+ "Non-Hispanic Asian or Pacific Islander",
12
+ "Non-Hispanic Black",
13
+ "Non-Hispanic White"
14
+ ],
15
+ "type": "datafilter",
16
+ "orderedValues": [
17
+ "Hispanic or Latino",
18
+ "Non-Hispanic American Indian",
19
+ "Non-Hispanic Asian or Pacific Islander",
20
+ "Non-Hispanic Black",
21
+ "Non-Hispanic White"
22
+ ],
23
+ "columnName": "Race",
24
+ "usedBy": [
25
+ "chart1764806666923"
26
+ ]
27
+ }
28
+ ]
29
+ },
30
+ "rows": [
31
+ {
32
+ "uuid": "__​undefined__",
33
+ "toggle": "__​undefined__",
34
+ "equalHeight": "__​undefined__",
35
+ "columns": [
36
+ {
37
+ "width": 12,
38
+ "widget": "dashboardFilters1764806686672"
39
+ },
40
+ {},
41
+ {}
42
+ ]
43
+ },
44
+ {
45
+ "columns": [
46
+ {
47
+ "width": 12,
48
+ "widget": "chart1764806666923"
49
+ }
50
+ ]
51
+ }
52
+ ],
53
+ "visualizations": {
54
+ "chart1764806666923": {
55
+ "annotations": [],
56
+ "allowLineToBarGraph": "__​undefined__",
57
+ "type": "chart",
58
+ "debugSvg": false,
59
+ "chartMessage": {
60
+ "noData": "No Data Available"
61
+ },
62
+ "title": "",
63
+ "showTitle": true,
64
+ "showDownloadMediaButton": false,
65
+ "theme": "theme-blue",
66
+ "animate": false,
67
+ "lineDatapointStyle": "hover",
68
+ "lineDatapointColor": "Same as Line",
69
+ "barHasBorder": "true",
70
+ "isLollipopChart": false,
71
+ "lollipopShape": "circle",
72
+ "lollipopColorStyle": "two-tone",
73
+ "visualizationSubType": "regular",
74
+ "barStyle": "",
75
+ "roundingStyle": "standard",
76
+ "tipRounding": "top",
77
+ "isResponsiveTicks": false,
78
+ "general": {
79
+ "annotationDropdownText": "Annotations",
80
+ "showMissingDataLabel": true,
81
+ "showSuppressedSymbol": true,
82
+ "showZeroValueData": true,
83
+ "hideNullValue": true,
84
+ "palette": {
85
+ "isReversed": true,
86
+ "version": "2.0",
87
+ "name": "sequential_bluereverse"
88
+ }
89
+ },
90
+ "padding": {
91
+ "left": 5,
92
+ "right": 5
93
+ },
94
+ "preliminaryData": [],
95
+ "yAxis": {
96
+ "hideAxis": false,
97
+ "displayNumbersOnBar": false,
98
+ "hideLabel": false,
99
+ "hideTicks": false,
100
+ "size": 50,
101
+ "gridLines": false,
102
+ "enablePadding": false,
103
+ "min": "",
104
+ "max": "",
105
+ "labelColor": "#1c1d1f",
106
+ "tickLabelColor": "#1c1d1f",
107
+ "tickColor": "#1c1d1f",
108
+ "rightHideAxis": false,
109
+ "rightAxisSize": 0,
110
+ "rightLabel": "",
111
+ "rightLabelOffsetSize": 0,
112
+ "rightAxisLabelColor": "#1c1d1f",
113
+ "rightAxisTickLabelColor": "#1c1d1f",
114
+ "rightAxisTickColor": "#1c1d1f",
115
+ "numTicks": "",
116
+ "axisPadding": 0,
117
+ "scalePadding": 10,
118
+ "tickRotation": 0,
119
+ "anchors": [],
120
+ "shoMissingDataLabel": true,
121
+ "showMissingDataLine": true,
122
+ "categories": []
123
+ },
124
+ "boxplot": {
125
+ "plots": [],
126
+ "borders": "true",
127
+ "plotOutlierValues": false,
128
+ "plotNonOutlierValues": true,
129
+ "labels": {
130
+ "q1": "Lower Quartile",
131
+ "q2": "q2",
132
+ "q3": "Upper Quartile",
133
+ "q4": "q4",
134
+ "minimum": "Minimum",
135
+ "maximum": "Maximum",
136
+ "mean": "Mean",
137
+ "median": "Median",
138
+ "sd": "Standard Deviation",
139
+ "iqr": "Interquartile Range",
140
+ "count": "Count",
141
+ "outliers": "Outliers",
142
+ "values": "Values",
143
+ "lowerBounds": "Lower Bounds",
144
+ "upperBounds": "Upper Bounds"
145
+ }
146
+ },
147
+ "topAxis": {
148
+ "hasLine": false
149
+ },
150
+ "isLegendValue": false,
151
+ "barThickness": 0.35,
152
+ "barHeight": 25,
153
+ "barSpace": 15,
154
+ "heights": {
155
+ "vertical": 300,
156
+ "horizontal": 750
157
+ },
158
+ "xAxis": {
159
+ "sortDates": false,
160
+ "anchors": [],
161
+ "type": "categorical",
162
+ "showTargetLabel": true,
163
+ "targetLabel": "Target",
164
+ "hideAxis": false,
165
+ "hideLabel": false,
166
+ "hideTicks": false,
167
+ "size": 75,
168
+ "tickRotation": 0,
169
+ "min": "",
170
+ "max": "",
171
+ "labelColor": "#1c1d1f",
172
+ "tickLabelColor": "#1c1d1f",
173
+ "tickColor": "#1c1d1f",
174
+ "numTicks": "",
175
+ "labelOffset": 0,
176
+ "axisPadding": 200,
177
+ "target": 0,
178
+ "maxTickRotation": 0,
179
+ "padding": 5,
180
+ "showYearsOnce": false,
181
+ "sortByRecentDate": false,
182
+ "brushActive": false,
183
+ "dataKey": "Race",
184
+ "axisBBox": "__​undefined__",
185
+ "tickWidthMax": 274
186
+ },
187
+ "table": {
188
+ "label": "Data Table",
189
+ "expanded": true,
190
+ "limitHeight": false,
191
+ "height": "",
192
+ "caption": "",
193
+ "showDownloadUrl": false,
194
+ "showDataTableLink": true,
195
+ "showDownloadLinkBelow": true,
196
+ "indexLabel": "",
197
+ "download": false,
198
+ "showVertical": true,
199
+ "dateDisplayFormat": "",
200
+ "showMissingDataLabel": true,
201
+ "showSuppressedSymbol": true,
202
+ "collapsible": true,
203
+ "show": false
204
+ },
205
+ "orientation": "vertical",
206
+ "color": "qualitative-bold",
207
+ "columns": {},
208
+ "legend": {
209
+ "hide": false,
210
+ "behavior": "isolate",
211
+ "axisAlign": true,
212
+ "singleRow": true,
213
+ "colorCode": "",
214
+ "reverseLabelOrder": false,
215
+ "description": "",
216
+ "dynamicLegend": false,
217
+ "dynamicLegendDefaultText": "Show All",
218
+ "dynamicLegendItemLimit": 5,
219
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
220
+ "dynamicLegendChartMessage": "Select Options from the Legend",
221
+ "label": "",
222
+ "lineMode": false,
223
+ "verticalSorted": false,
224
+ "highlightOnHover": false,
225
+ "hideSuppressedLabels": false,
226
+ "hideSuppressionLink": false,
227
+ "seriesHighlight": [],
228
+ "style": "circles",
229
+ "subStyle": "linear blocks",
230
+ "groupBy": "",
231
+ "shape": "circle",
232
+ "tickRotation": "",
233
+ "order": "dataColumn",
234
+ "hideBorder": {
235
+ "side": false,
236
+ "topBottom": true
237
+ },
238
+ "position": "right",
239
+ "orderedValues": [],
240
+ "patterns": {},
241
+ "patternField": ""
242
+ },
243
+ "smallMultiples": {
244
+ "mode": "",
245
+ "tileColumn": "",
246
+ "tilesPerRowDesktop": 3,
247
+ "tilesPerRowMobile": 1,
248
+ "tileOrder": [],
249
+ "tileOrderType": "asc",
250
+ "tileTitles": {},
251
+ "independentYAxis": false,
252
+ "colorMode": "same",
253
+ "synchronizedTooltips": true,
254
+ "showAreaUnderLine": true
255
+ },
256
+ "exclusions": {
257
+ "active": false,
258
+ "keys": []
259
+ },
260
+ "twoColor": {
261
+ "palette": "monochrome-1",
262
+ "isPaletteReversed": false
263
+ },
264
+ "labels": false,
265
+ "dataFormat": {
266
+ "commas": false,
267
+ "prefix": "",
268
+ "suffix": "",
269
+ "abbreviated": false,
270
+ "bottomSuffix": "",
271
+ "bottomPrefix": "",
272
+ "bottomAbbreviated": false
273
+ },
274
+ "filters": [],
275
+ "confidenceKeys": {},
276
+ "visual": {
277
+ "border": true,
278
+ "accent": true,
279
+ "background": true,
280
+ "verticalHoverLine": false,
281
+ "horizontalHoverLine": false,
282
+ "lineDatapointSymbol": "none",
283
+ "maximumShapeAmount": 7
284
+ },
285
+ "useLogScale": false,
286
+ "filterBehavior": "Filter Change",
287
+ "highlightedBarValues": [],
288
+ "series": [
289
+ {
290
+ "dataKey": "Age-adjusted rate",
291
+ "type": "Bar",
292
+ "axis": "Left",
293
+ "tooltip": true
294
+ }
295
+ ],
296
+ "tooltips": {
297
+ "opacity": 90,
298
+ "singleSeries": false,
299
+ "dateDisplayFormat": ""
300
+ },
301
+ "forestPlot": {
302
+ "startAt": 0,
303
+ "colors": {
304
+ "line": "",
305
+ "shape": ""
306
+ },
307
+ "lineOfNoEffect": {
308
+ "show": true
309
+ },
310
+ "type": "",
311
+ "pooledResult": {
312
+ "diamondHeight": 5,
313
+ "column": ""
314
+ },
315
+ "estimateField": "",
316
+ "estimateRadius": "",
317
+ "shape": "square",
318
+ "rowHeight": 20,
319
+ "description": {
320
+ "show": true,
321
+ "text": "description",
322
+ "location": 0
323
+ },
324
+ "result": {
325
+ "show": true,
326
+ "text": "result",
327
+ "location": 100
328
+ },
329
+ "radius": {
330
+ "min": 2,
331
+ "max": 10,
332
+ "scalingColumn": ""
333
+ },
334
+ "regression": {
335
+ "lower": 0,
336
+ "upper": 0,
337
+ "estimateField": 0
338
+ },
339
+ "leftWidthOffset": 0,
340
+ "rightWidthOffset": 0,
341
+ "showZeroLine": false,
342
+ "leftLabel": "",
343
+ "rightLabel": ""
344
+ },
345
+ "area": {
346
+ "isStacked": false
347
+ },
348
+ "sankey": {
349
+ "title": {
350
+ "defaultColor": "black"
351
+ },
352
+ "iterations": 1,
353
+ "rxValue": 0.9,
354
+ "overallSize": {
355
+ "width": 900,
356
+ "height": 700
357
+ },
358
+ "margin": {
359
+ "margin_y": 25,
360
+ "margin_x": 0
361
+ },
362
+ "nodeSize": {
363
+ "nodeWidth": 26,
364
+ "nodeHeight": 40
365
+ },
366
+ "nodePadding": 55,
367
+ "nodeFontColor": "black",
368
+ "nodeColor": {
369
+ "default": "#ff8500",
370
+ "inactive": "#808080"
371
+ },
372
+ "linkColor": {
373
+ "default": "#ffc900",
374
+ "inactive": "#D3D3D3"
375
+ },
376
+ "opacity": {
377
+ "nodeOpacityDefault": 1,
378
+ "nodeOpacityInactive": 0.1,
379
+ "LinkOpacityDefault": 1,
380
+ "LinkOpacityInactive": 0.1
381
+ },
382
+ "storyNodeFontColor": "#006778",
383
+ "storyNodeText": [],
384
+ "nodeValueStyle": {
385
+ "textBefore": "(",
386
+ "textAfter": ")"
387
+ },
388
+ "data": []
389
+ },
390
+ "markupVariables": [],
391
+ "enableMarkupVariables": false,
392
+ "openModal": true,
393
+ "uid": "chart1764806666923",
394
+ "visualizationType": "Bar",
395
+ "dataDescription": {
396
+ "horizontal": false,
397
+ "series": false
398
+ },
399
+ "dataKey": "valid-data-chart.csv",
400
+ "dynamicMarginTop": 0
401
+ },
402
+ "dashboardFilters1764806686672": {
403
+ "filters": [],
404
+ "filterBehavior": "Filter Change",
405
+ "newViz": true,
406
+ "openModal": true,
407
+ "uid": "dashboardFilters1764806686672",
408
+ "type": "dashboardFilters",
409
+ "sharedFilterIndexes": [
410
+ 0
411
+ ],
412
+ "visualizationType": "dashboardFilters"
413
+ }
414
+ },
415
+ "table": {
416
+ "label": "Data Table",
417
+ "show": true,
418
+ "showDownloadUrl": false,
419
+ "showDownloadLinkBelow": true,
420
+ "showVertical": true
421
+ },
422
+ "newViz": true,
423
+ "errors": [],
424
+ "currentViewport": "lg",
425
+ "id": 15,
426
+ "category": "General",
427
+ "label": "Dashboard",
428
+ "type": "dashboard",
429
+ "subType": null,
430
+ "orientation": null,
431
+ "icon": {
432
+ "key": null,
433
+ "ref": null,
434
+ "props": {},
435
+ "_owner": null,
436
+ "_store": {}
437
+ },
438
+ "content": "Present multiple data visualizations with shared filter controls.",
439
+ "visualizationType": null,
440
+ "activeVizButtonID": 15,
441
+ "runtime": {},
442
+ "version": "4.25.11",
443
+ "migrations": {
444
+ "addColorMigration": true
445
+ },
446
+ "general": {
447
+ "palette": {
448
+ "version": "1.0",
449
+ "backups": [
450
+ {
451
+ "name": "__​undefined__",
452
+ "version": "1.0",
453
+ "isReversed": "__​undefined__"
454
+ }
455
+ ]
456
+ }
457
+ },
458
+ "uuid": 1764806663957,
459
+ "datasets": {
460
+ "valid-data-chart.csv": {
461
+ "data": [
462
+ {
463
+ "Race": "Hispanic or Latino",
464
+ "Age-adjusted rate": "644.2"
465
+ },
466
+ {
467
+ "Race": "Non-Hispanic American Indian",
468
+ "Age-adjusted rate": "636.1"
469
+ },
470
+ {
471
+ "Race": "Non-Hispanic Black",
472
+ "Age-adjusted rate": "563.7"
473
+ },
474
+ {
475
+ "Race": "Non-Hispanic Asian or Pacific Islander",
476
+ "Age-adjusted rate": "202.5"
477
+ },
478
+ {
479
+ "Race": "Non-Hispanic White",
480
+ "Age-adjusted rate": "183.6"
481
+ }
482
+ ],
483
+ "dataFileSize": 178,
484
+ "dataFileName": "valid-data-chart.csv",
485
+ "dataFileSourceType": "file",
486
+ "dataFileFormat": "CSV",
487
+ "preview": true
488
+ }
489
+ }
490
+ }
File without changes