@cdc/dashboard 4.25.11 → 4.26.2

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 (77) hide show
  1. package/Dynamic_Data.md +66 -0
  2. package/dist/cdcdashboard-8NmHlKRI.es.js +15 -0
  3. package/dist/cdcdashboard-BPoPzKPz.es.js +6 -0
  4. package/dist/cdcdashboard-Cf9_fbQf.es.js +6 -0
  5. package/dist/{cdcdashboard-dgT_1dIT.es.js → cdcdashboard-DQ00cQCm.es.js} +1 -20
  6. package/dist/cdcdashboard-jiQQPkty.es.js +6 -0
  7. package/dist/cdcdashboard.js +83537 -86913
  8. package/examples/api-dashboard-data.json +272 -0
  9. package/examples/api-dashboard-years.json +11 -0
  10. package/examples/api-geographies-data.json +11 -0
  11. package/examples/default.json +522 -133
  12. package/examples/nested-dropdown.json +6985 -0
  13. package/examples/private/abc.json +467 -0
  14. package/examples/private/cat-y.json +1235 -0
  15. package/examples/private/chronic-dash.json +1584 -0
  16. package/examples/private/dash.json +12696 -0
  17. package/examples/private/map-issue.json +2260 -0
  18. package/examples/private/mpinc-state-reports.json +2260 -0
  19. package/examples/private/npcr.json +1 -0
  20. package/examples/private/nwss/rsv.json +1240 -0
  21. package/examples/private/simple-dash.json +490 -0
  22. package/examples/private/test-dash.json +0 -0
  23. package/examples/private/test.json +125407 -0
  24. package/examples/private/test123.json +491 -0
  25. package/examples/private/timeline-data.json +4994 -0
  26. package/examples/private/timeline.json +1708 -0
  27. package/examples/test-api-filter-reset.json +8 -4
  28. package/examples/test-dashboard-simple.json +503 -0
  29. package/examples/tp5-gauges.json +196 -0
  30. package/examples/tp5-test.json +266 -0
  31. package/index.html +1 -30
  32. package/package.json +39 -40
  33. package/src/CdcDashboardComponent.tsx +18 -5
  34. package/src/_stories/Dashboard.DataSetup.stories.tsx +204 -0
  35. package/src/_stories/Dashboard.stories.tsx +407 -1
  36. package/src/_stories/_mock/dashboard-line-chart-angles.json +1030 -0
  37. package/src/_stories/_mock/filter-cascade.json +3350 -0
  38. package/src/_stories/_mock/gallery-data-bite-dashboard.json +3500 -0
  39. package/src/_stories/_mock/nested-parent-child-filters.json +392 -0
  40. package/src/_stories/_mock/parent-child-filters.json +233 -0
  41. package/src/_stories/_mock/tp5-test.json +267 -0
  42. package/src/components/DashboardFilters/DashboardFilters.tsx +20 -11
  43. package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +92 -38
  44. package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +56 -30
  45. package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +151 -10
  46. package/src/components/DashboardFilters/DashboardFiltersWrapper.tsx +11 -7
  47. package/src/components/DataDesignerModal.tsx +6 -1
  48. package/src/components/Header/Header.tsx +51 -20
  49. package/src/components/VisualizationRow.tsx +76 -5
  50. package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +2 -20
  51. package/src/components/Widget/Widget.tsx +1 -1
  52. package/src/data/initial-state.js +1 -0
  53. package/src/helpers/addValuesToDashboardFilters.ts +30 -31
  54. package/src/helpers/apiFilterHelpers.ts +28 -32
  55. package/src/helpers/changeFilterActive.ts +67 -65
  56. package/src/helpers/formatConfigBeforeSave.ts +6 -5
  57. package/src/helpers/getUpdateConfig.ts +91 -91
  58. package/src/helpers/tests/addValuesToDashboardFilters.test.ts +141 -44
  59. package/src/helpers/tests/apiFilterHelpers.test.ts +523 -420
  60. package/src/helpers/tests/updatesChildFilters.test.ts +53 -22
  61. package/src/helpers/updateChildFilters.ts +50 -27
  62. package/src/scss/main.scss +144 -1
  63. package/src/test/CdcDashboard.test.jsx +9 -4
  64. package/src/types/Dashboard.ts +1 -0
  65. package/src/types/FilterStyles.ts +8 -7
  66. package/src/types/SharedFilter.ts +13 -0
  67. package/vite.config.js +7 -1
  68. package/LICENSE +0 -201
  69. package/dist/cdcdashboard-BnB1QM5d.es.js +0 -361528
  70. package/dist/cdcdashboard-Ct2SB0vL.es.js +0 -231049
  71. package/dist/cdcdashboard-D6CG2-Hb.es.js +0 -39377
  72. package/dist/cdcdashboard-MXgURbdZ.es.js +0 -39194
  73. package/examples/private/DEV-10538.json +0 -407
  74. package/examples/private/DEV-11072.json +0 -7591
  75. package/examples/private/DEV-11405.json +0 -39112
  76. package/examples/private/delete.json +0 -32919
  77. package/examples/private/pedro.json +0 -1
@@ -7,12 +7,14 @@
7
7
  "type": "urlfilter",
8
8
  "columnName": "category",
9
9
  "apiFilter": {
10
- "apiEndpoint": "http://localhost:8080/examples/api-test/categories.json",
10
+ "apiEndpoint": "/examples/api-test/categories.json",
11
11
  "valueSelector": "category",
12
12
  "textSelector": "category"
13
13
  },
14
14
  "queryParameter": "category",
15
+ "setByQueryParameter": "category",
15
16
  "resetLabel": "- Select Category -",
17
+ "defaultValue": "Chronic Diseases",
16
18
  "showDropdown": true,
17
19
  "filterStyle": "dropdown",
18
20
  "usedBy": ["chart1"]
@@ -22,11 +24,12 @@
22
24
  "type": "urlfilter",
23
25
  "columnName": "topic",
24
26
  "apiFilter": {
25
- "apiEndpoint": "http://localhost:8080/examples/api-test/topics.json",
27
+ "apiEndpoint": "/examples/api-test/topics.json",
26
28
  "valueSelector": "topic",
27
29
  "textSelector": "topic"
28
30
  },
29
31
  "queryParameter": "topic",
32
+ "setByQueryParameter": "topic",
30
33
  "resetLabel": "- Select Topic -",
31
34
  "showDropdown": true,
32
35
  "parents": [
@@ -40,11 +43,12 @@
40
43
  "type": "urlfilter",
41
44
  "columnName": "year",
42
45
  "apiFilter": {
43
- "apiEndpoint": "http://localhost:8080/examples/api-test/years.json",
46
+ "apiEndpoint": "/examples/api-test/years.json",
44
47
  "valueSelector": "year",
45
48
  "textSelector": "year"
46
49
  },
47
50
  "queryParameter": "year",
51
+ "setByQueryParameter": "year",
48
52
  "resetLabel": "- Select -",
49
53
  "showDropdown": true,
50
54
  "parents": [
@@ -129,4 +133,4 @@
129
133
  },
130
134
  "filterBehavior": "Apply Button",
131
135
  "type": "dashboard"
132
- }
136
+ }
@@ -0,0 +1,503 @@
1
+ {
2
+ "dashboard": {
3
+ "sharedFilters": [
4
+ {
5
+ "key": "Geography",
6
+ "type": "datafilter",
7
+ "columnName": "geography",
8
+ "showDropdown": true,
9
+ "filterStyle": "dropdown",
10
+ "defaultValue": "United States",
11
+ "usedBy": [
12
+ "chart1"
13
+ ]
14
+ },
15
+ {
16
+ "key": "Year",
17
+ "type": "datafilter",
18
+ "columnName": "year",
19
+ "showDropdown": true,
20
+ "filterStyle": "dropdown",
21
+ "defaultValue": "2023",
22
+ "usedBy": [
23
+ "chart1"
24
+ ]
25
+ }
26
+ ]
27
+ },
28
+ "rows": [
29
+ {
30
+ "uuid": "__​undefined__",
31
+ "toggle": "__​undefined__",
32
+ "equalHeight": "__​undefined__",
33
+ "columns": [
34
+ {
35
+ "width": 12,
36
+ "widget": "filters",
37
+ "toggleName": "Filter Dropdowns"
38
+ }
39
+ ]
40
+ },
41
+ {
42
+ "uuid": "__​undefined__",
43
+ "toggle": "__​undefined__",
44
+ "equalHeight": "__​undefined__",
45
+ "columns": [
46
+ {
47
+ "width": 12,
48
+ "widget": "chart1",
49
+ "toggleName": "Chart"
50
+ }
51
+ ]
52
+ }
53
+ ],
54
+ "visualizations": {
55
+ "filters": {
56
+ "type": "dashboardFilters",
57
+ "visualizationType": "dashboardFilters",
58
+ "uid": "filters",
59
+ "sharedFilterIndexes": [
60
+ 0,
61
+ 1
62
+ ],
63
+ "filterBehavior": "Apply Button",
64
+ "dashboardFilters": [
65
+ {
66
+ "columnName": "geography",
67
+ "active": "United States",
68
+ "values": [
69
+ "California",
70
+ "Texas",
71
+ "United States"
72
+ ]
73
+ },
74
+ {
75
+ "columnName": "year",
76
+ "active": "2021",
77
+ "values": [
78
+ "2021",
79
+ "2022",
80
+ "2023"
81
+ ]
82
+ }
83
+ ]
84
+ },
85
+ "chart1": {
86
+ "annotations": [],
87
+ "allowLineToBarGraph": "__​undefined__",
88
+ "type": "chart",
89
+ "debugSvg": false,
90
+ "chartMessage": {
91
+ "noData": "No Data Available"
92
+ },
93
+ "title": "Test Chart",
94
+ "showTitle": true,
95
+ "showDownloadMediaButton": false,
96
+ "theme": "theme-blue",
97
+ "animate": false,
98
+ "lineDatapointStyle": "hover",
99
+ "lineDatapointColor": "Same as Line",
100
+ "barHasBorder": "true",
101
+ "isLollipopChart": false,
102
+ "lollipopShape": "circle",
103
+ "lollipopColorStyle": "two-tone",
104
+ "visualizationSubType": "regular",
105
+ "barStyle": "",
106
+ "roundingStyle": "standard",
107
+ "tipRounding": "top",
108
+ "isResponsiveTicks": false,
109
+ "general": {
110
+ "annotationDropdownText": "Annotations",
111
+ "showMissingDataLabel": true,
112
+ "showSuppressedSymbol": true,
113
+ "showZeroValueData": true,
114
+ "hideNullValue": true,
115
+ "palette": {
116
+ "name": "sequential_blue",
117
+ "version": "2.0",
118
+ "isReversed": false
119
+ }
120
+ },
121
+ "padding": {
122
+ "left": 5,
123
+ "right": 5
124
+ },
125
+ "preliminaryData": [],
126
+ "yAxis": {
127
+ "hideAxis": false,
128
+ "displayNumbersOnBar": false,
129
+ "hideLabel": false,
130
+ "hideTicks": false,
131
+ "size": 50,
132
+ "gridLines": false,
133
+ "enablePadding": false,
134
+ "min": "",
135
+ "max": "",
136
+ "labelColor": "#1c1d1f",
137
+ "tickLabelColor": "#1c1d1f",
138
+ "tickColor": "#1c1d1f",
139
+ "rightHideAxis": false,
140
+ "rightAxisSize": 0,
141
+ "rightLabel": "",
142
+ "rightLabelOffsetSize": 0,
143
+ "rightAxisLabelColor": "#1c1d1f",
144
+ "rightAxisTickLabelColor": "#1c1d1f",
145
+ "rightAxisTickColor": "#1c1d1f",
146
+ "numTicks": "",
147
+ "axisPadding": 0,
148
+ "scalePadding": 10,
149
+ "tickRotation": 0,
150
+ "anchors": [],
151
+ "shoMissingDataLabel": true,
152
+ "showMissingDataLine": true,
153
+ "categories": [],
154
+ "label": "Value"
155
+ },
156
+ "boxplot": {
157
+ "plots": [],
158
+ "borders": "true",
159
+ "plotOutlierValues": false,
160
+ "plotNonOutlierValues": true,
161
+ "labels": {
162
+ "q1": "Lower Quartile",
163
+ "q2": "q2",
164
+ "q3": "Upper Quartile",
165
+ "q4": "q4",
166
+ "minimum": "Minimum",
167
+ "maximum": "Maximum",
168
+ "mean": "Mean",
169
+ "median": "Median",
170
+ "sd": "Standard Deviation",
171
+ "iqr": "Interquartile Range",
172
+ "count": "Count",
173
+ "outliers": "Outliers",
174
+ "values": "Values",
175
+ "lowerBounds": "Lower Bounds",
176
+ "upperBounds": "Upper Bounds"
177
+ }
178
+ },
179
+ "topAxis": {
180
+ "hasLine": false
181
+ },
182
+ "isLegendValue": false,
183
+ "barThickness": 0.35,
184
+ "barHeight": 25,
185
+ "barSpace": 15,
186
+ "heights": {
187
+ "vertical": 300,
188
+ "horizontal": 750
189
+ },
190
+ "xAxis": {
191
+ "sortDates": false,
192
+ "anchors": [],
193
+ "type": "categorical",
194
+ "showTargetLabel": true,
195
+ "targetLabel": "Target",
196
+ "hideAxis": false,
197
+ "hideLabel": false,
198
+ "hideTicks": false,
199
+ "size": 75,
200
+ "tickRotation": 0,
201
+ "min": "",
202
+ "max": "",
203
+ "labelColor": "#1c1d1f",
204
+ "tickLabelColor": "#1c1d1f",
205
+ "tickColor": "#1c1d1f",
206
+ "numTicks": "",
207
+ "labelOffset": 0,
208
+ "axisPadding": 200,
209
+ "target": 0,
210
+ "maxTickRotation": 0,
211
+ "padding": 5,
212
+ "showYearsOnce": false,
213
+ "sortByRecentDate": false,
214
+ "brushActive": false,
215
+ "dataKey": "category",
216
+ "axisBBox": 29.360000610351562,
217
+ "tickWidthMax": 82
218
+ },
219
+ "table": {
220
+ "label": "Data Table",
221
+ "expanded": false,
222
+ "limitHeight": false,
223
+ "height": "",
224
+ "caption": "",
225
+ "showDownloadUrl": false,
226
+ "showDataTableLink": true,
227
+ "showDownloadLinkBelow": true,
228
+ "indexLabel": "",
229
+ "download": false,
230
+ "showVertical": false,
231
+ "dateDisplayFormat": "",
232
+ "showMissingDataLabel": true,
233
+ "showSuppressedSymbol": true,
234
+ "collapsible": true,
235
+ "sharedFilterColumns": [
236
+ "geography",
237
+ "year"
238
+ ],
239
+ "show": false
240
+ },
241
+ "orientation": "vertical",
242
+ "columns": {},
243
+ "legend": {
244
+ "hide": false,
245
+ "behavior": "isolate",
246
+ "axisAlign": true,
247
+ "singleRow": true,
248
+ "colorCode": "",
249
+ "reverseLabelOrder": false,
250
+ "description": "",
251
+ "dynamicLegend": false,
252
+ "dynamicLegendDefaultText": "Show All",
253
+ "dynamicLegendItemLimit": 5,
254
+ "dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
255
+ "dynamicLegendChartMessage": "Select Options from the Legend",
256
+ "label": "",
257
+ "lineMode": false,
258
+ "verticalSorted": false,
259
+ "highlightOnHover": false,
260
+ "hideSuppressedLabels": false,
261
+ "hideSuppressionLink": false,
262
+ "seriesHighlight": [],
263
+ "style": "circles",
264
+ "subStyle": "linear blocks",
265
+ "groupBy": "",
266
+ "shape": "circle",
267
+ "tickRotation": "",
268
+ "order": "dataColumn",
269
+ "hideBorder": {
270
+ "side": false,
271
+ "topBottom": true
272
+ },
273
+ "position": "right",
274
+ "orderedValues": [],
275
+ "patterns": {},
276
+ "patternField": "",
277
+ "unified": true
278
+ },
279
+ "smallMultiples": {
280
+ "mode": "",
281
+ "tileColumn": "",
282
+ "tilesPerRowDesktop": 3,
283
+ "tilesPerRowMobile": 1,
284
+ "tileOrder": [],
285
+ "tileOrderType": "asc",
286
+ "tileTitles": {},
287
+ "independentYAxis": false,
288
+ "colorMode": "same",
289
+ "synchronizedTooltips": true,
290
+ "showAreaUnderLine": true
291
+ },
292
+ "exclusions": {
293
+ "active": false,
294
+ "keys": []
295
+ },
296
+ "twoColor": {
297
+ "palette": "monochrome-1",
298
+ "isPaletteReversed": false
299
+ },
300
+ "labels": false,
301
+ "dataFormat": {
302
+ "commas": false,
303
+ "prefix": "",
304
+ "suffix": "",
305
+ "abbreviated": false,
306
+ "bottomSuffix": "",
307
+ "bottomPrefix": "",
308
+ "bottomAbbreviated": false
309
+ },
310
+ "filters": [],
311
+ "confidenceKeys": {},
312
+ "visual": {
313
+ "border": true,
314
+ "accent": true,
315
+ "background": true,
316
+ "verticalHoverLine": false,
317
+ "horizontalHoverLine": false,
318
+ "lineDatapointSymbol": "none",
319
+ "maximumShapeAmount": 7
320
+ },
321
+ "useLogScale": false,
322
+ "filterBehavior": "Filter Change",
323
+ "highlightedBarValues": [],
324
+ "series": [
325
+ {
326
+ "dataKey": "value",
327
+ "type": "Bar",
328
+ "axis": "Left",
329
+ "tooltip": true
330
+ }
331
+ ],
332
+ "tooltips": {
333
+ "opacity": 90,
334
+ "singleSeries": false,
335
+ "dateDisplayFormat": ""
336
+ },
337
+ "forestPlot": {
338
+ "startAt": 0,
339
+ "colors": {
340
+ "line": "",
341
+ "shape": ""
342
+ },
343
+ "lineOfNoEffect": {
344
+ "show": true
345
+ },
346
+ "type": "",
347
+ "pooledResult": {
348
+ "diamondHeight": 5,
349
+ "column": ""
350
+ },
351
+ "estimateField": "",
352
+ "estimateRadius": "",
353
+ "shape": "square",
354
+ "rowHeight": 20,
355
+ "description": {
356
+ "show": true,
357
+ "text": "description",
358
+ "location": 0
359
+ },
360
+ "result": {
361
+ "show": true,
362
+ "text": "result",
363
+ "location": 100
364
+ },
365
+ "radius": {
366
+ "min": 2,
367
+ "max": 10,
368
+ "scalingColumn": ""
369
+ },
370
+ "regression": {
371
+ "lower": 0,
372
+ "upper": 0,
373
+ "estimateField": 0
374
+ },
375
+ "leftWidthOffset": 0,
376
+ "rightWidthOffset": 0,
377
+ "showZeroLine": false,
378
+ "leftLabel": "",
379
+ "rightLabel": ""
380
+ },
381
+ "area": {
382
+ "isStacked": false
383
+ },
384
+ "sankey": {
385
+ "title": {
386
+ "defaultColor": "black"
387
+ },
388
+ "iterations": 1,
389
+ "rxValue": 0.9,
390
+ "overallSize": {
391
+ "width": 900,
392
+ "height": 700
393
+ },
394
+ "margin": {
395
+ "margin_y": 25,
396
+ "margin_x": 0
397
+ },
398
+ "nodeSize": {
399
+ "nodeWidth": 26,
400
+ "nodeHeight": 40
401
+ },
402
+ "nodePadding": 55,
403
+ "nodeFontColor": "black",
404
+ "nodeColor": {
405
+ "default": "#ff8500",
406
+ "inactive": "#808080"
407
+ },
408
+ "linkColor": {
409
+ "default": "#ffc900",
410
+ "inactive": "#D3D3D3"
411
+ },
412
+ "opacity": {
413
+ "nodeOpacityDefault": 1,
414
+ "nodeOpacityInactive": 0.1,
415
+ "LinkOpacityDefault": 1,
416
+ "LinkOpacityInactive": 0.1
417
+ },
418
+ "storyNodeFontColor": "#006778",
419
+ "storyNodeText": [],
420
+ "nodeValueStyle": {
421
+ "textBefore": "(",
422
+ "textAfter": ")"
423
+ },
424
+ "data": []
425
+ },
426
+ "markupVariables": [],
427
+ "enableMarkupVariables": false,
428
+ "uid": "chart1",
429
+ "visualizationType": "Bar",
430
+ "dataKey": "chartData",
431
+ "dataDescription": {
432
+ "horizontal": false,
433
+ "series": false
434
+ },
435
+ "dashboardFilters": [
436
+ {
437
+ "columnName": "geography",
438
+ "active": "United States",
439
+ "values": [
440
+ "California",
441
+ "Texas",
442
+ "United States"
443
+ ]
444
+ },
445
+ {
446
+ "columnName": "year",
447
+ "active": "2021",
448
+ "values": [
449
+ "2021",
450
+ "2022",
451
+ "2023"
452
+ ]
453
+ }
454
+ ],
455
+ "dynamicMarginTop": 0
456
+ }
457
+ },
458
+ "table": {
459
+ "label": "Data Table",
460
+ "show": true,
461
+ "showDownloadUrl": false,
462
+ "showDownloadLinkBelow": true,
463
+ "showVertical": true
464
+ },
465
+ "type": "dashboard",
466
+ "runtime": {},
467
+ "version": "4.25.11",
468
+ "migrations": {
469
+ "addColorMigration": true
470
+ },
471
+ "general": {
472
+ "palette": {
473
+ "version": "1.0",
474
+ "backups": [
475
+ {
476
+ "name": "__​undefined__",
477
+ "version": "1.0",
478
+ "isReversed": "__​undefined__"
479
+ },
480
+ {
481
+ "name": "__​undefined__",
482
+ "version": "1.0",
483
+ "isReversed": "__​undefined__"
484
+ },
485
+ {
486
+ "name": "__​undefined__",
487
+ "version": "1.0",
488
+ "isReversed": "__​undefined__"
489
+ },
490
+ {
491
+ "name": "__​undefined__",
492
+ "version": "1.0",
493
+ "isReversed": "__​undefined__"
494
+ }
495
+ ]
496
+ }
497
+ },
498
+ "datasets": {
499
+ "chartData": {
500
+ "dataUrl": "http://localhost:8080/examples/api-dashboard-data.json"
501
+ }
502
+ }
503
+ }