@cdc/dashboard 4.23.5 → 4.23.6
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.
- package/dist/cdcdashboard.js +73277 -69815
- package/examples/shared-filters.json +542 -0
- package/index.html +2 -1
- package/package.json +9 -9
- package/src/CdcDashboard.jsx +22 -8
- package/src/components/DataTable.tsx +4 -4
- package/src/components/Header.jsx +151 -149
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dashboard": {
|
|
3
|
+
"sharedFilters": [
|
|
4
|
+
{
|
|
5
|
+
"key": "State",
|
|
6
|
+
"columnName": "state",
|
|
7
|
+
"setBy": "chart1684783399780",
|
|
8
|
+
"usedBy": [
|
|
9
|
+
"chart1",
|
|
10
|
+
"map1"
|
|
11
|
+
],
|
|
12
|
+
"values": [
|
|
13
|
+
"Alabama",
|
|
14
|
+
"Georgia",
|
|
15
|
+
"Florida"
|
|
16
|
+
],
|
|
17
|
+
"active": "Alabama",
|
|
18
|
+
"resetLabel": "- Select -",
|
|
19
|
+
"showDropdown": true
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"rows": [
|
|
24
|
+
[
|
|
25
|
+
{
|
|
26
|
+
"width": 12,
|
|
27
|
+
"widget": "map1"
|
|
28
|
+
},
|
|
29
|
+
{},
|
|
30
|
+
{}
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
{
|
|
34
|
+
"width": 12,
|
|
35
|
+
"widget": "chart1"
|
|
36
|
+
},
|
|
37
|
+
{},
|
|
38
|
+
{}
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
{
|
|
42
|
+
"width": 12,
|
|
43
|
+
"widget": "chart1684783399780"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"equalHeight": false
|
|
47
|
+
},
|
|
48
|
+
{},
|
|
49
|
+
{}
|
|
50
|
+
]
|
|
51
|
+
],
|
|
52
|
+
"visualizations": {
|
|
53
|
+
"map1": {
|
|
54
|
+
"uid": "map1",
|
|
55
|
+
"type": "map",
|
|
56
|
+
"defaultData": false,
|
|
57
|
+
"dataKey": "data2",
|
|
58
|
+
"general": {
|
|
59
|
+
"title": "Map Example",
|
|
60
|
+
"subtext": "",
|
|
61
|
+
"territoriesLabel": "Territories",
|
|
62
|
+
"type": "data",
|
|
63
|
+
"geoType": "us",
|
|
64
|
+
"headerColor": "theme-blue",
|
|
65
|
+
"showSidebar": true,
|
|
66
|
+
"showTitle": true,
|
|
67
|
+
"geoBorderColor": "darkGray",
|
|
68
|
+
"showDownloadButton": true,
|
|
69
|
+
"expandDataTable": true,
|
|
70
|
+
"showDownloadMediaButton": false,
|
|
71
|
+
"displayAsHex": false,
|
|
72
|
+
"displayStateLabels": false,
|
|
73
|
+
"territoriesAlwaysShow": false,
|
|
74
|
+
"language": "en",
|
|
75
|
+
"geoLabelOverride": "",
|
|
76
|
+
"hasRegions": false,
|
|
77
|
+
"fullBorder": false,
|
|
78
|
+
"palette": {
|
|
79
|
+
"isReversed": false
|
|
80
|
+
},
|
|
81
|
+
"allowMapZoom": true,
|
|
82
|
+
"hideGeoColumnInTooltip": false,
|
|
83
|
+
"hidePrimaryColumnInTooltip": false
|
|
84
|
+
},
|
|
85
|
+
"color": "pinkpurple",
|
|
86
|
+
"columns": {
|
|
87
|
+
"geo": {
|
|
88
|
+
"name": "state",
|
|
89
|
+
"label": "Location",
|
|
90
|
+
"tooltip": false,
|
|
91
|
+
"dataTable": true
|
|
92
|
+
},
|
|
93
|
+
"primary": {
|
|
94
|
+
"name": "Insured Rate",
|
|
95
|
+
"label": "Data Label",
|
|
96
|
+
"prefix": "",
|
|
97
|
+
"suffix": "%",
|
|
98
|
+
"dataTable": true,
|
|
99
|
+
"tooltip": true
|
|
100
|
+
},
|
|
101
|
+
"navigate": {
|
|
102
|
+
"name": "link",
|
|
103
|
+
"tooltip": false,
|
|
104
|
+
"dataTable": false
|
|
105
|
+
},
|
|
106
|
+
"latitude": {
|
|
107
|
+
"name": ""
|
|
108
|
+
},
|
|
109
|
+
"longitude": {
|
|
110
|
+
"name": ""
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"legend": {
|
|
114
|
+
"numberOfItems": 3,
|
|
115
|
+
"position": "side",
|
|
116
|
+
"title": "Legend Title",
|
|
117
|
+
"description": "Legend Text",
|
|
118
|
+
"type": "equalnumber",
|
|
119
|
+
"specialClasses": [
|
|
120
|
+
"N/A"
|
|
121
|
+
],
|
|
122
|
+
"descriptions": {},
|
|
123
|
+
"unified": false,
|
|
124
|
+
"singleColumn": false,
|
|
125
|
+
"singleRow": false,
|
|
126
|
+
"showSpecialClassesLast": false,
|
|
127
|
+
"dynamicDescription": false
|
|
128
|
+
},
|
|
129
|
+
"formattedData": [
|
|
130
|
+
{
|
|
131
|
+
"Insured Rate": 43,
|
|
132
|
+
"state": "Alabama"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"Insured Rate": 63,
|
|
136
|
+
"state": "Georgia"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"Insured Rate": 53,
|
|
140
|
+
"state": "Florida"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"chart1": {
|
|
145
|
+
"uid": "chart1",
|
|
146
|
+
"type": "chart",
|
|
147
|
+
"dataKey": "data1",
|
|
148
|
+
"title": "Test",
|
|
149
|
+
"description": "<p>Test</p>",
|
|
150
|
+
"visualizationType": "Line",
|
|
151
|
+
"series": [
|
|
152
|
+
{
|
|
153
|
+
"dataKey": "Insured Rate",
|
|
154
|
+
"label": "Insured Rate"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"fontSize": "large",
|
|
158
|
+
"dataFormat": {
|
|
159
|
+
"commas": false,
|
|
160
|
+
"prefix": "",
|
|
161
|
+
"suffix": ""
|
|
162
|
+
},
|
|
163
|
+
"padding": {
|
|
164
|
+
"left": 15,
|
|
165
|
+
"right": 15
|
|
166
|
+
},
|
|
167
|
+
"yAxis": {
|
|
168
|
+
"label": "Insured Rate",
|
|
169
|
+
"paddingPercent": 0.15
|
|
170
|
+
},
|
|
171
|
+
"xAxis": {
|
|
172
|
+
"label": "Date",
|
|
173
|
+
"dataKey": "date",
|
|
174
|
+
"type": "date",
|
|
175
|
+
"dateParseFormat": "%Y-%m-%d",
|
|
176
|
+
"dateDisplayFormat": "%b %d",
|
|
177
|
+
"numTicks": 8,
|
|
178
|
+
"tickRotation": 50
|
|
179
|
+
},
|
|
180
|
+
"legend": {
|
|
181
|
+
"label": "Legend",
|
|
182
|
+
"above": true,
|
|
183
|
+
"left": true
|
|
184
|
+
},
|
|
185
|
+
"table": {
|
|
186
|
+
"label": "Data Table",
|
|
187
|
+
"expanded": false,
|
|
188
|
+
"download": true,
|
|
189
|
+
"showVertical": false,
|
|
190
|
+
"show": false
|
|
191
|
+
},
|
|
192
|
+
"formattedData": [
|
|
193
|
+
{
|
|
194
|
+
"Insured Rate": "43",
|
|
195
|
+
"date": "2022-01-02",
|
|
196
|
+
"state": "Alabama"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"Insured Rate": "53",
|
|
200
|
+
"date": "2022-02-02",
|
|
201
|
+
"state": "Alabama"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"Insured Rate": "23",
|
|
205
|
+
"date": "2022-03-02",
|
|
206
|
+
"state": "Alabama"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"Insured Rate": "13",
|
|
210
|
+
"date": "2022-01-02",
|
|
211
|
+
"state": "Georgia"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"Insured Rate": "63",
|
|
215
|
+
"date": "2022-02-02",
|
|
216
|
+
"state": "Georgia"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"Insured Rate": "40",
|
|
220
|
+
"date": "2022-03-02",
|
|
221
|
+
"state": "Georgia"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"Insured Rate": "30",
|
|
225
|
+
"date": "2022-01-02",
|
|
226
|
+
"state": "Florida"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"Insured Rate": "55",
|
|
230
|
+
"date": "2022-02-02",
|
|
231
|
+
"state": "Florida"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"Insured Rate": "90",
|
|
235
|
+
"date": "2022-03-02",
|
|
236
|
+
"state": "Florida"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
"chart1684783399780": {
|
|
241
|
+
"type": "chart",
|
|
242
|
+
"title": "",
|
|
243
|
+
"showTitle": true,
|
|
244
|
+
"showDownloadMediaButton": false,
|
|
245
|
+
"theme": "theme-blue",
|
|
246
|
+
"animate": false,
|
|
247
|
+
"fontSize": "medium",
|
|
248
|
+
"lineDatapointStyle": "hover",
|
|
249
|
+
"barHasBorder": "false",
|
|
250
|
+
"isLollipopChart": false,
|
|
251
|
+
"lollipopShape": "circle",
|
|
252
|
+
"lollipopColorStyle": "two-tone",
|
|
253
|
+
"visualizationSubType": "regular",
|
|
254
|
+
"barStyle": "",
|
|
255
|
+
"roundingStyle": "standard",
|
|
256
|
+
"tipRounding": "top",
|
|
257
|
+
"general": {
|
|
258
|
+
"showDownloadButton": false
|
|
259
|
+
},
|
|
260
|
+
"padding": {
|
|
261
|
+
"left": 5,
|
|
262
|
+
"right": 5
|
|
263
|
+
},
|
|
264
|
+
"yAxis": {
|
|
265
|
+
"hideAxis": false,
|
|
266
|
+
"displayNumbersOnBar": false,
|
|
267
|
+
"hideLabel": false,
|
|
268
|
+
"hideTicks": false,
|
|
269
|
+
"size": 50,
|
|
270
|
+
"gridLines": false,
|
|
271
|
+
"enablePadding": false,
|
|
272
|
+
"min": "",
|
|
273
|
+
"max": "",
|
|
274
|
+
"labelColor": "#333",
|
|
275
|
+
"tickLabelColor": "#333",
|
|
276
|
+
"tickColor": "#333",
|
|
277
|
+
"rightHideAxis": true,
|
|
278
|
+
"rightAxisSize": 50,
|
|
279
|
+
"rightLabel": "",
|
|
280
|
+
"rightLabelOffsetSize": 0,
|
|
281
|
+
"rightAxisLabelColor": "#333",
|
|
282
|
+
"rightAxisTickLabelColor": "#333",
|
|
283
|
+
"rightAxisTickColor": "#333",
|
|
284
|
+
"numTicks": "",
|
|
285
|
+
"axisPadding": 0,
|
|
286
|
+
"tickRotation": 0,
|
|
287
|
+
"anchors": []
|
|
288
|
+
},
|
|
289
|
+
"boxplot": {
|
|
290
|
+
"plots": [],
|
|
291
|
+
"borders": "true",
|
|
292
|
+
"firstQuartilePercentage": 25,
|
|
293
|
+
"thirdQuartilePercentage": 75,
|
|
294
|
+
"boxWidthPercentage": 40,
|
|
295
|
+
"plotOutlierValues": false,
|
|
296
|
+
"plotNonOutlierValues": true,
|
|
297
|
+
"legend": {
|
|
298
|
+
"showHowToReadText": false,
|
|
299
|
+
"howToReadText": ""
|
|
300
|
+
},
|
|
301
|
+
"labels": {
|
|
302
|
+
"q1": "Lower Quartile",
|
|
303
|
+
"q2": "q2",
|
|
304
|
+
"q3": "Upper Quartile",
|
|
305
|
+
"q4": "q4",
|
|
306
|
+
"minimum": "Minimum",
|
|
307
|
+
"maximum": "Maximum",
|
|
308
|
+
"mean": "Mean",
|
|
309
|
+
"median": "Median",
|
|
310
|
+
"sd": "Standard Deviation",
|
|
311
|
+
"iqr": "Interquartile Range",
|
|
312
|
+
"total": "Total",
|
|
313
|
+
"outliers": "Outliers",
|
|
314
|
+
"values": "Values",
|
|
315
|
+
"lowerBounds": "Lower Bounds",
|
|
316
|
+
"upperBounds": "Upper Bounds"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"topAxis": {
|
|
320
|
+
"hasLine": false
|
|
321
|
+
},
|
|
322
|
+
"isLegendValue": false,
|
|
323
|
+
"barThickness": 0.35,
|
|
324
|
+
"barHeight": 25,
|
|
325
|
+
"barSpace": 15,
|
|
326
|
+
"heights": {
|
|
327
|
+
"vertical": 300,
|
|
328
|
+
"horizontal": 750
|
|
329
|
+
},
|
|
330
|
+
"xAxis": {
|
|
331
|
+
"anchors": [],
|
|
332
|
+
"type": "categorical",
|
|
333
|
+
"showTargetLabel": true,
|
|
334
|
+
"targetLabel": "Target",
|
|
335
|
+
"hideAxis": false,
|
|
336
|
+
"hideLabel": false,
|
|
337
|
+
"hideTicks": false,
|
|
338
|
+
"size": 75,
|
|
339
|
+
"tickRotation": 0,
|
|
340
|
+
"min": "",
|
|
341
|
+
"max": "",
|
|
342
|
+
"labelColor": "#333",
|
|
343
|
+
"tickLabelColor": "#333",
|
|
344
|
+
"tickColor": "#333",
|
|
345
|
+
"numTicks": "",
|
|
346
|
+
"labelOffset": 65,
|
|
347
|
+
"axisPadding": 0,
|
|
348
|
+
"target": 0,
|
|
349
|
+
"dataKey": "state"
|
|
350
|
+
},
|
|
351
|
+
"table": {
|
|
352
|
+
"label": "Data Table",
|
|
353
|
+
"expanded": true,
|
|
354
|
+
"limitHeight": false,
|
|
355
|
+
"height": "",
|
|
356
|
+
"caption": "",
|
|
357
|
+
"showDownloadUrl": false,
|
|
358
|
+
"showDataTableLink": true,
|
|
359
|
+
"indexLabel": "",
|
|
360
|
+
"download": false,
|
|
361
|
+
"showVertical": true,
|
|
362
|
+
"show": false
|
|
363
|
+
},
|
|
364
|
+
"orientation": "vertical",
|
|
365
|
+
"color": "pinkpurple",
|
|
366
|
+
"columns": {},
|
|
367
|
+
"legend": {
|
|
368
|
+
"behavior": "isolate",
|
|
369
|
+
"singleRow": false,
|
|
370
|
+
"colorCode": "",
|
|
371
|
+
"reverseLabelOrder": false,
|
|
372
|
+
"description": "",
|
|
373
|
+
"dynamicLegend": false,
|
|
374
|
+
"dynamicLegendDefaultText": "Show All",
|
|
375
|
+
"dynamicLegendItemLimit": 5,
|
|
376
|
+
"dynamicLegendItemLimitMessage": "Dynamic Legend Item Limit Hit.",
|
|
377
|
+
"dynamicLegendChartMessage": "Select Options from the Legend"
|
|
378
|
+
},
|
|
379
|
+
"exclusions": {
|
|
380
|
+
"active": false,
|
|
381
|
+
"keys": []
|
|
382
|
+
},
|
|
383
|
+
"palette": "qualitative-bold",
|
|
384
|
+
"isPaletteReversed": false,
|
|
385
|
+
"twoColor": {
|
|
386
|
+
"palette": "monochrome-1",
|
|
387
|
+
"isPaletteReversed": false
|
|
388
|
+
},
|
|
389
|
+
"labels": false,
|
|
390
|
+
"dataFormat": {
|
|
391
|
+
"commas": false,
|
|
392
|
+
"prefix": "",
|
|
393
|
+
"suffix": "",
|
|
394
|
+
"abbreviated": false,
|
|
395
|
+
"bottomSuffix": "",
|
|
396
|
+
"bottomPrefix": "",
|
|
397
|
+
"bottomAbbreviated": false
|
|
398
|
+
},
|
|
399
|
+
"confidenceKeys": {},
|
|
400
|
+
"visual": {
|
|
401
|
+
"border": true,
|
|
402
|
+
"accent": true,
|
|
403
|
+
"background": true
|
|
404
|
+
},
|
|
405
|
+
"useLogScale": false,
|
|
406
|
+
"filterBehavior": "Filter Change",
|
|
407
|
+
"highlightedBarValues": [],
|
|
408
|
+
"series": [
|
|
409
|
+
{
|
|
410
|
+
"dataKey": "Insured Rate",
|
|
411
|
+
"type": "Bar"
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"openModal": false,
|
|
415
|
+
"uid": "chart1684783399780",
|
|
416
|
+
"visualizationType": "Bar",
|
|
417
|
+
"dataKey": "data2",
|
|
418
|
+
"data": [
|
|
419
|
+
{
|
|
420
|
+
"Insured Rate": "43",
|
|
421
|
+
"state": "Alabama"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"Insured Rate": "63",
|
|
425
|
+
"state": "Georgia"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"Insured Rate": "53",
|
|
429
|
+
"state": "Florida"
|
|
430
|
+
}
|
|
431
|
+
],
|
|
432
|
+
"dataDescription": {
|
|
433
|
+
"horizontal": false,
|
|
434
|
+
"series": false
|
|
435
|
+
},
|
|
436
|
+
"formattedData": [
|
|
437
|
+
{
|
|
438
|
+
"Insured Rate": 43,
|
|
439
|
+
"state": "Alabama"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"Insured Rate": 63,
|
|
443
|
+
"state": "Georgia"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"Insured Rate": 53,
|
|
447
|
+
"state": "Florida"
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"originalFormattedData": [
|
|
451
|
+
{
|
|
452
|
+
"Insured Rate": "43",
|
|
453
|
+
"state": "Alabama"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"Insured Rate": "63",
|
|
457
|
+
"state": "Georgia"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"Insured Rate": "53",
|
|
461
|
+
"state": "Florida"
|
|
462
|
+
}
|
|
463
|
+
]
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
"table": {
|
|
467
|
+
"downloadImageButton": true,
|
|
468
|
+
"downloadPdfButton": true,
|
|
469
|
+
"download": true,
|
|
470
|
+
"show": true
|
|
471
|
+
},
|
|
472
|
+
"type": "dashboard",
|
|
473
|
+
"datasets": {
|
|
474
|
+
"data1": {
|
|
475
|
+
"data": [
|
|
476
|
+
{
|
|
477
|
+
"Insured Rate": "43",
|
|
478
|
+
"date": "2022-01-02",
|
|
479
|
+
"state": "Alabama"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"Insured Rate": "53",
|
|
483
|
+
"date": "2022-02-02",
|
|
484
|
+
"state": "Alabama"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"Insured Rate": "23",
|
|
488
|
+
"date": "2022-03-02",
|
|
489
|
+
"state": "Alabama"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"Insured Rate": "13",
|
|
493
|
+
"date": "2022-01-02",
|
|
494
|
+
"state": "Georgia"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"Insured Rate": "63",
|
|
498
|
+
"date": "2022-02-02",
|
|
499
|
+
"state": "Georgia"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"Insured Rate": "40",
|
|
503
|
+
"date": "2022-03-02",
|
|
504
|
+
"state": "Georgia"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"Insured Rate": "30",
|
|
508
|
+
"date": "2022-01-02",
|
|
509
|
+
"state": "Florida"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"Insured Rate": "55",
|
|
513
|
+
"date": "2022-02-02",
|
|
514
|
+
"state": "Florida"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"Insured Rate": "90",
|
|
518
|
+
"date": "2022-03-02",
|
|
519
|
+
"state": "Florida"
|
|
520
|
+
}
|
|
521
|
+
]
|
|
522
|
+
},
|
|
523
|
+
"data2": {
|
|
524
|
+
"data": [
|
|
525
|
+
{
|
|
526
|
+
"Insured Rate": 43,
|
|
527
|
+
"state": "Alabama"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"Insured Rate": 63,
|
|
531
|
+
"state": "Georgia"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"Insured Rate": 53,
|
|
535
|
+
"state": "Florida"
|
|
536
|
+
}
|
|
537
|
+
]
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
"runtime": {},
|
|
541
|
+
"uuid": 1684783370106
|
|
542
|
+
}
|
package/index.html
CHANGED
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
</head>
|
|
20
20
|
|
|
21
21
|
<body>
|
|
22
|
-
<div class="react-container" data-config="/examples/default.json"></div>
|
|
22
|
+
<!-- <div class="react-container" data-config="/examples/default.json"></div> -->
|
|
23
23
|
<!-- <div class="react-container" data-config="/examples/default-multi-dataset.json"></div> -->
|
|
24
24
|
<!-- <div class="react-container" data-config="/examples/default-filter-control.json"></div> -->
|
|
25
|
+
<div class="react-container" data-config="/examples/shared-filters.json"></div>
|
|
25
26
|
<!-- <div class="react-container" data-config="/examples/private/totals.json"></div> -->
|
|
26
27
|
<!-- <div class="react-container" data-config="/examples/private/totals-two.json"></div> -->
|
|
27
28
|
<script type="module" src="./src/index.jsx"></script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/dashboard",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.6",
|
|
4
4
|
"description": "React component for combining multiple visualizations into a single dashboard",
|
|
5
5
|
"moduleName": "CdcDashboard",
|
|
6
6
|
"main": "dist/cdcdashboard",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@cdc/chart": "^4.23.
|
|
29
|
-
"@cdc/core": "^4.23.
|
|
30
|
-
"@cdc/data-bite": "^4.23.
|
|
31
|
-
"@cdc/filtered-text": "^4.23.
|
|
32
|
-
"@cdc/map": "^4.23.
|
|
33
|
-
"@cdc/markup-include": "^4.23.
|
|
34
|
-
"@cdc/waffle-chart": "^4.23.
|
|
28
|
+
"@cdc/chart": "^4.23.6",
|
|
29
|
+
"@cdc/core": "^4.23.6",
|
|
30
|
+
"@cdc/data-bite": "^4.23.6",
|
|
31
|
+
"@cdc/filtered-text": "^4.23.6",
|
|
32
|
+
"@cdc/map": "^4.23.6",
|
|
33
|
+
"@cdc/markup-include": "^4.23.6",
|
|
34
|
+
"@cdc/waffle-chart": "^4.23.6",
|
|
35
35
|
"html-react-parser": "^3.0.8",
|
|
36
36
|
"js-base64": "^2.5.2",
|
|
37
37
|
"papaparse": "^5.3.0",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"react": "^18.2.0",
|
|
48
48
|
"react-dom": "^18.2.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "aaed0388b487adfeb3e7e278b4ce74df09cbaade"
|
|
51
51
|
}
|
package/src/CdcDashboard.jsx
CHANGED
|
@@ -31,10 +31,11 @@ import Header from './components/Header'
|
|
|
31
31
|
import defaults from './data/initial-state'
|
|
32
32
|
import Widget from './components/Widget'
|
|
33
33
|
import DataTable from './components/DataTable'
|
|
34
|
-
import
|
|
34
|
+
import MediaControls from '@cdc/core/components/MediaControls'
|
|
35
35
|
|
|
36
36
|
import './scss/main.scss'
|
|
37
37
|
import '@cdc/core/styles/v2/main.scss'
|
|
38
|
+
import AdvancedEditor from '@cdc/core/components/AdvancedEditor'
|
|
38
39
|
|
|
39
40
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
40
41
|
|
|
@@ -75,7 +76,7 @@ const addVisualization = (type, subType) => {
|
|
|
75
76
|
return newVisualizationConfig
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
const VisualizationsPanel = () => (
|
|
79
|
+
const VisualizationsPanel = ({ loadConfig, config }) => (
|
|
79
80
|
<div className='visualizations-panel'>
|
|
80
81
|
<p style={{ fontSize: '14px' }}>Click and drag an item onto the grid to add it to your dashboard.</p>
|
|
81
82
|
<span className='subheading-3'>Chart</span>
|
|
@@ -97,6 +98,8 @@ const VisualizationsPanel = () => (
|
|
|
97
98
|
<Widget addVisualization={() => addVisualization('markup-include', '')} type='markup-include' />
|
|
98
99
|
<Widget addVisualization={() => addVisualization('filtered-text', '')} type='filtered-text' />
|
|
99
100
|
</div>
|
|
101
|
+
<span className='subheading-3'>Advanced</span>
|
|
102
|
+
<AdvancedEditor loadConfig={loadConfig} state={config} />
|
|
100
103
|
</div>
|
|
101
104
|
)
|
|
102
105
|
|
|
@@ -268,7 +271,6 @@ export default function CdcDashboard({ configUrl = '', config: configObj = undef
|
|
|
268
271
|
}
|
|
269
272
|
|
|
270
273
|
setData(datasets)
|
|
271
|
-
|
|
272
274
|
updateConfig(newConfig, datasets)
|
|
273
275
|
setLoading(false)
|
|
274
276
|
}
|
|
@@ -375,7 +377,7 @@ export default function CdcDashboard({ configUrl = '', config: configObj = undef
|
|
|
375
377
|
if (applicableFilters.length > 0) {
|
|
376
378
|
const visualization = newConfig.visualizations[visualizationKey]
|
|
377
379
|
|
|
378
|
-
const formattedData = getFormattedData(visualization.data, visualization.dataDescription)
|
|
380
|
+
const formattedData = getFormattedData(newConfig.datasets[visualization.dataKey] && newConfig.datasets[visualization.dataKey].data ? newConfig.datasets[visualization.dataKey].data : visualization.data, visualization.dataDescription)
|
|
379
381
|
|
|
380
382
|
newFilteredData[visualizationKey] = filterData(applicableFilters, formattedData || visualization.data || (dataOverride || data)[visualization.dataKey])
|
|
381
383
|
}
|
|
@@ -435,6 +437,9 @@ export default function CdcDashboard({ configUrl = '', config: configObj = undef
|
|
|
435
437
|
})
|
|
436
438
|
|
|
437
439
|
setFilteredData(newFilteredData)
|
|
440
|
+
if (dashboardConfig.sharedFilters[index].active === dashboardConfig.sharedFilters[index].resetLabel) {
|
|
441
|
+
setFilteredData(data)
|
|
442
|
+
}
|
|
438
443
|
}
|
|
439
444
|
|
|
440
445
|
const announceChange = text => {}
|
|
@@ -444,6 +449,14 @@ export default function CdcDashboard({ configUrl = '', config: configObj = undef
|
|
|
444
449
|
|
|
445
450
|
const values = []
|
|
446
451
|
|
|
452
|
+
if (singleFilter.resetLabel) {
|
|
453
|
+
values.push(
|
|
454
|
+
<option key={`${singleFilter.resetLabel}-option-${index}`} value={singleFilter.resetLabel}>
|
|
455
|
+
{singleFilter.resetLabel}
|
|
456
|
+
</option>
|
|
457
|
+
)
|
|
458
|
+
}
|
|
459
|
+
|
|
447
460
|
singleFilter.values.forEach((filterOption, index) => {
|
|
448
461
|
values.push(
|
|
449
462
|
<option key={`${singleFilter.key}-option-${index}`} value={filterOption}>
|
|
@@ -538,7 +551,7 @@ export default function CdcDashboard({ configUrl = '', config: configObj = undef
|
|
|
538
551
|
body = (
|
|
539
552
|
<>
|
|
540
553
|
<Header tabSelected={tabSelected} setTabSelected={setTabSelected} back={back} subEditor='Chart' />
|
|
541
|
-
<CdcChart key={visualizationKey} config={visualizationConfig} isEditor={true} isDebug={isDebug} setConfig={updateConfig} setSharedFilter={setsSharedFilter ? setSharedFilter : undefined} isDashboard={true} />
|
|
554
|
+
<CdcChart key={visualizationKey} config={visualizationConfig} isEditor={true} isDebug={isDebug} setConfig={updateConfig} setSharedFilter={setsSharedFilter ? setSharedFilter : undefined} setSharedFilterValue={setSharedFilterValue} dashboardConfig={config} isDashboard={true} />
|
|
542
555
|
</>
|
|
543
556
|
)
|
|
544
557
|
break
|
|
@@ -595,7 +608,7 @@ export default function CdcDashboard({ configUrl = '', config: configObj = undef
|
|
|
595
608
|
<DndProvider backend={HTML5Backend}>
|
|
596
609
|
<Header tabSelected={tabSelected} setTabSelected={setTabSelected} preview={preview} setPreview={setPreview} />
|
|
597
610
|
<div className='layout-container'>
|
|
598
|
-
<VisualizationsPanel />
|
|
611
|
+
<VisualizationsPanel loadConfig={loadConfig} config={config} />
|
|
599
612
|
<Grid />
|
|
600
613
|
</div>
|
|
601
614
|
</DndProvider>
|
|
@@ -666,6 +679,7 @@ export default function CdcDashboard({ configUrl = '', config: configObj = undef
|
|
|
666
679
|
<CdcChart
|
|
667
680
|
key={col.widget}
|
|
668
681
|
config={visualizationConfig}
|
|
682
|
+
dashboardConfig={config}
|
|
669
683
|
isEditor={false}
|
|
670
684
|
setConfig={newConfig => {
|
|
671
685
|
updateChildConfig(col.widget, newConfig)
|
|
@@ -746,8 +760,8 @@ export default function CdcDashboard({ configUrl = '', config: configObj = undef
|
|
|
746
760
|
|
|
747
761
|
{/* Image or PDF Inserts */}
|
|
748
762
|
<section className='download-buttons'>
|
|
749
|
-
{config.table.downloadImageButton && <
|
|
750
|
-
{config.table.downloadPdfButton && <
|
|
763
|
+
{config.table.downloadImageButton && <MediaControls.Button title='Download Dashboard as Image' type='image' state={config} text='Download Dashboard Image' elementToCapture={imageId} />}
|
|
764
|
+
{config.table.downloadPdfButton && <MediaControls.Button title='Download Dashboard as PDF' type='pdf' state={config} text='Download Dashboard PDF' elementToCapture={imageId} />}
|
|
751
765
|
</section>
|
|
752
766
|
|
|
753
767
|
{/* Data Table */}
|