@cdc/dashboard 4.26.3 → 4.26.4
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/CONFIG.md +172 -0
- package/README.md +60 -20
- package/dist/cdcdashboard-CY9IcPSi.es.js +6 -0
- package/dist/cdcdashboard-DlpiY3fQ.es.js +4 -0
- package/dist/cdcdashboard.js +51744 -49003
- package/examples/__data__/data-2.json +6 -0
- package/examples/__data__/data.json +6 -0
- package/examples/legend-issue.json +1 -1
- package/examples/minimal-example.json +34 -0
- package/examples/private/dengue.json +4640 -0
- package/examples/private/link_to_file.json +16662 -0
- package/examples/sankey.json +3 -3
- package/examples/test-api-filter-reset.json +4 -4
- package/examples/tp5-test.json +86 -4
- package/package.json +9 -9
- package/src/CdcDashboardComponent.tsx +1 -1
- package/src/_stories/Dashboard.smoke.stories.tsx +33 -0
- package/src/_stories/Dashboard.stories.tsx +43 -2
- package/src/_stories/_mock/dashboard-data-driven-colors.json +171 -0
- package/src/_stories/_mock/tp5-test.json +86 -5
- package/src/components/DashboardEditors.tsx +15 -0
- package/src/components/DashboardFilters/DashboardFilters.test.tsx +129 -0
- package/src/components/DashboardFilters/DashboardFilters.tsx +10 -7
- package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +5 -4
- package/src/components/DashboardFilters/DashboardFiltersEditor/components/APIModal.tsx +5 -3
- package/src/components/DashboardFilters/DashboardFiltersEditor/components/DeleteFilterModal.tsx +59 -58
- package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.test.tsx +127 -0
- package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +28 -4
- package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +2 -2
- package/src/components/ExpandCollapseButtons.tsx +6 -4
- package/src/components/Grid.tsx +4 -3
- package/src/components/MultiConfigTabs/MultiConfigTabs.tsx +141 -140
- package/src/components/Row.tsx +11 -10
- package/src/components/VisualizationRow.tsx +71 -20
- package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +1 -1
- package/src/components/Widget/Widget.tsx +5 -4
- package/src/components/Widget/widget.styles.css +41 -10
- package/src/data/initial-state.js +1 -0
- package/src/helpers/addVisualization.ts +3 -1
- package/src/helpers/tests/addVisualization.test.ts +1 -1
- package/src/scss/grid.scss +38 -8
- package/src/scss/main.scss +110 -38
- package/src/store/dashboard.reducer.ts +1 -0
- package/src/test/CdcDashboard.test.jsx +24 -0
- package/src/types/SharedFilter.ts +1 -0
- package/tests/fixtures/dashboard-config-with-metadata.json +1 -1
- package/LICENSE +0 -201
- package/dist/cdcdashboard-vr9HZwRt.es.js +0 -6
- package/examples/DEV-6574.json +0 -2224
- package/examples/api-dashboard-data.json +0 -272
- package/examples/api-dashboard-years.json +0 -11
- package/examples/api-geographies-data.json +0 -11
- package/examples/chart-data.json +0 -5409
- package/examples/custom/css/respiratory.css +0 -236
- package/examples/custom/js/respiratory.js +0 -242
- package/examples/default-data.json +0 -368
- package/examples/default-filter-control.json +0 -209
- package/examples/default-multi-dataset-shared-filter.json +0 -1729
- package/examples/default-multi-dataset.json +0 -506
- package/examples/ed-visits-county-file.json +0 -402
- package/examples/filters/Alabama.json +0 -72
- package/examples/filters/Alaska.json +0 -1737
- package/examples/filters/Arkansas.json +0 -4713
- package/examples/filters/California.json +0 -212
- package/examples/filters/Colorado.json +0 -1500
- package/examples/filters/Connecticut.json +0 -559
- package/examples/filters/Delaware.json +0 -63
- package/examples/filters/DistrictofColumbia.json +0 -63
- package/examples/filters/Florida.json +0 -4217
- package/examples/filters/States.json +0 -146
- package/examples/state-level.json +0 -90136
- package/examples/state-points.json +0 -10474
- package/examples/temp-example-data.json +0 -130
- package/examples/test-dashboard-simple.json +0 -503
- package/examples/test-example.json +0 -752
- package/examples/test-file.json +0 -147
- package/examples/test.json +0 -752
- package/examples/testing.json +0 -94456
- /package/examples/{data → __data__}/data-with-metadata.json +0 -0
- /package/examples/{legend-issue-data.json → __data__/legend-issue-data.json} +0 -0
- /package/examples/api-test/{categories.json → __data__/categories.json} +0 -0
- /package/examples/api-test/{chart-data.json → __data__/chart-data.json} +0 -0
- /package/examples/api-test/{topics.json → __data__/topics.json} +0 -0
- /package/examples/api-test/{years.json → __data__/years.json} +0 -0
- /package/src/_stories/{Dashboard.Pages.stories.tsx → Dashboard.Pages.smoke.stories.tsx} +0 -0
package/examples/sankey.json
CHANGED
|
@@ -4238,7 +4238,7 @@
|
|
|
4238
4238
|
}
|
|
4239
4239
|
],
|
|
4240
4240
|
"dataFileSize": 72,
|
|
4241
|
-
"dataFileName": "data.json",
|
|
4241
|
+
"dataFileName": "__data__/data.json",
|
|
4242
4242
|
"dataFileSourceType": "file",
|
|
4243
4243
|
"dataFileFormat": "JSON",
|
|
4244
4244
|
"preview": false
|
|
@@ -4251,7 +4251,7 @@
|
|
|
4251
4251
|
}
|
|
4252
4252
|
],
|
|
4253
4253
|
"dataFileSize": 59,
|
|
4254
|
-
"dataFileName": "data-2.json",
|
|
4254
|
+
"dataFileName": "__data__/data-2.json",
|
|
4255
4255
|
"dataFileSourceType": "file",
|
|
4256
4256
|
"dataFileFormat": "JSON",
|
|
4257
4257
|
"preview": false
|
|
@@ -5215,4 +5215,4 @@
|
|
|
5215
5215
|
"type": "dashboard",
|
|
5216
5216
|
"uuid": 1707343065225,
|
|
5217
5217
|
"runtime": {}
|
|
5218
|
-
}
|
|
5218
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"type": "urlfilter",
|
|
8
8
|
"columnName": "category",
|
|
9
9
|
"apiFilter": {
|
|
10
|
-
"apiEndpoint": "/examples/api-test/categories.json",
|
|
10
|
+
"apiEndpoint": "/examples/api-test/__data__/categories.json",
|
|
11
11
|
"valueSelector": "category",
|
|
12
12
|
"textSelector": "category"
|
|
13
13
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"type": "urlfilter",
|
|
25
25
|
"columnName": "topic",
|
|
26
26
|
"apiFilter": {
|
|
27
|
-
"apiEndpoint": "/examples/api-test/topics.json",
|
|
27
|
+
"apiEndpoint": "/examples/api-test/__data__/topics.json",
|
|
28
28
|
"valueSelector": "topic",
|
|
29
29
|
"textSelector": "topic"
|
|
30
30
|
},
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"type": "urlfilter",
|
|
44
44
|
"columnName": "year",
|
|
45
45
|
"apiFilter": {
|
|
46
|
-
"apiEndpoint": "/examples/api-test/years.json",
|
|
46
|
+
"apiEndpoint": "/examples/api-test/__data__/years.json",
|
|
47
47
|
"valueSelector": "year",
|
|
48
48
|
"textSelector": "year"
|
|
49
49
|
},
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"datasets": {
|
|
130
130
|
"chartData": {
|
|
131
|
-
"dataUrl": "http://localhost:8080/examples/api-test/chart-data.json"
|
|
131
|
+
"dataUrl": "http://localhost:8080/examples/api-test/__data__/chart-data.json"
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
"filterBehavior": "Apply Button",
|
package/examples/tp5-test.json
CHANGED
|
@@ -40,13 +40,23 @@
|
|
|
40
40
|
{ "width": 4, "widget": "gauge1" },
|
|
41
41
|
{ "width": 4, "widget": "gauge2" },
|
|
42
42
|
{ "width": 4, "widget": "gauge3" }
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
{ "width": 4, "widget": "markup1" },
|
|
46
|
+
{ "width": 4, "widget": "markup2" },
|
|
47
|
+
{ "width": 4, "widget": "markup3" }
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
{ "width": 4, "widget": "waffle2" },
|
|
51
|
+
{ "width": 4, "widget": "bite3" },
|
|
52
|
+
{ "width": 4, "widget": "markup2" }
|
|
43
53
|
]
|
|
44
54
|
],
|
|
45
55
|
"visualizations": {
|
|
46
56
|
"waffle1": {
|
|
47
57
|
"uid": "waffle1",
|
|
48
58
|
"type": "waffle-chart",
|
|
49
|
-
"title": "Vaccination
|
|
59
|
+
"title": "Vaccination",
|
|
50
60
|
"visualizationType": "TP5 Waffle",
|
|
51
61
|
"visualizationSubType": "linear",
|
|
52
62
|
"showPercent": true,
|
|
@@ -71,7 +81,7 @@
|
|
|
71
81
|
"waffle2": {
|
|
72
82
|
"uid": "waffle2",
|
|
73
83
|
"type": "waffle-chart",
|
|
74
|
-
"title": "Health
|
|
84
|
+
"title": "Health",
|
|
75
85
|
"visualizationType": "TP5 Waffle",
|
|
76
86
|
"visualizationSubType": "linear",
|
|
77
87
|
"showPercent": true,
|
|
@@ -96,7 +106,7 @@
|
|
|
96
106
|
"waffle3": {
|
|
97
107
|
"uid": "waffle3",
|
|
98
108
|
"type": "waffle-chart",
|
|
99
|
-
"title": "Cancer
|
|
109
|
+
"title": "Cancer",
|
|
100
110
|
"visualizationType": "TP5 Waffle",
|
|
101
111
|
"visualizationSubType": "linear",
|
|
102
112
|
"showPercent": true,
|
|
@@ -245,7 +255,7 @@
|
|
|
245
255
|
"bite3": {
|
|
246
256
|
"uid": "bite3",
|
|
247
257
|
"type": "data-bite",
|
|
248
|
-
"title": "Cancer Screening Completion",
|
|
258
|
+
"title": "Cancer Screening Completion, and a little something else to make the title taller",
|
|
249
259
|
"biteStyle": "tp5",
|
|
250
260
|
"dataColumn": "Screening Rate",
|
|
251
261
|
"dataFunction": "Mean (Average)",
|
|
@@ -261,6 +271,78 @@
|
|
|
261
271
|
"visual": {
|
|
262
272
|
"hideBackgroundColor": false
|
|
263
273
|
}
|
|
274
|
+
},
|
|
275
|
+
"markup1": {
|
|
276
|
+
"uid": "markup1",
|
|
277
|
+
"type": "markup-include",
|
|
278
|
+
"title": "",
|
|
279
|
+
"theme": "theme-blue",
|
|
280
|
+
"contentEditor": {
|
|
281
|
+
"style": "tp5",
|
|
282
|
+
"title": "TP5 Markup Include",
|
|
283
|
+
"titleStyle": "small",
|
|
284
|
+
"useInlineHTML": true,
|
|
285
|
+
"inlineHTML": "<p><strong>68.5%</strong> of adults were vaccinated against seasonal flu in this sample dataset.</p>",
|
|
286
|
+
"srcUrl": "#example",
|
|
287
|
+
"showHeader": true,
|
|
288
|
+
"showNoDataMessage": false,
|
|
289
|
+
"noDataMessageText": "No Data Available"
|
|
290
|
+
},
|
|
291
|
+
"visual": {
|
|
292
|
+
"border": true,
|
|
293
|
+
"accent": false,
|
|
294
|
+
"whiteBackground": false,
|
|
295
|
+
"hideBackgroundColor": false,
|
|
296
|
+
"borderColorTheme": false
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"markup2": {
|
|
300
|
+
"uid": "markup2",
|
|
301
|
+
"type": "markup-include",
|
|
302
|
+
"title": "",
|
|
303
|
+
"theme": "theme-teal",
|
|
304
|
+
"contentEditor": {
|
|
305
|
+
"style": "tp5",
|
|
306
|
+
"title": "White Background TP5",
|
|
307
|
+
"titleStyle": "small",
|
|
308
|
+
"useInlineHTML": true,
|
|
309
|
+
"inlineHTML": "<p>This TP5 markup include uses white-background styling with border enabled for comparison.</p>",
|
|
310
|
+
"srcUrl": "#example",
|
|
311
|
+
"showHeader": true,
|
|
312
|
+
"showNoDataMessage": false,
|
|
313
|
+
"noDataMessageText": "No Data Available"
|
|
314
|
+
},
|
|
315
|
+
"visual": {
|
|
316
|
+
"border": true,
|
|
317
|
+
"accent": false,
|
|
318
|
+
"whiteBackground": true,
|
|
319
|
+
"hideBackgroundColor": false,
|
|
320
|
+
"borderColorTheme": false
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"markup3": {
|
|
324
|
+
"uid": "markup3",
|
|
325
|
+
"type": "markup-include",
|
|
326
|
+
"title": "",
|
|
327
|
+
"theme": "theme-purple",
|
|
328
|
+
"contentEditor": {
|
|
329
|
+
"style": "tp5",
|
|
330
|
+
"title": "TP5 Markup Include (No White BG)",
|
|
331
|
+
"titleStyle": "small",
|
|
332
|
+
"useInlineHTML": true,
|
|
333
|
+
"inlineHTML": "<p>This TP5 markup include uses the standard background and border settings for side-by-side alignment testing.</p>",
|
|
334
|
+
"srcUrl": "#example",
|
|
335
|
+
"showHeader": true,
|
|
336
|
+
"showNoDataMessage": false,
|
|
337
|
+
"noDataMessageText": "No Data Available"
|
|
338
|
+
},
|
|
339
|
+
"visual": {
|
|
340
|
+
"border": true,
|
|
341
|
+
"accent": false,
|
|
342
|
+
"whiteBackground": false,
|
|
343
|
+
"hideBackgroundColor": false,
|
|
344
|
+
"borderColorTheme": false
|
|
345
|
+
}
|
|
264
346
|
}
|
|
265
347
|
}
|
|
266
348
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/dashboard",
|
|
3
|
-
"version": "4.26.
|
|
3
|
+
"version": "4.26.4",
|
|
4
4
|
"description": "React component for combining multiple visualizations into a single dashboard",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Matthew Pallansch <mpallansch@adittech.com>",
|
|
7
7
|
"bugs": "https://github.com/CDCgov/cdc-open-viz/issues",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@cdc/chart": "^4.26.
|
|
10
|
-
"@cdc/core": "^4.26.
|
|
11
|
-
"@cdc/data-bite": "^4.26.
|
|
12
|
-
"@cdc/filtered-text": "^4.26.
|
|
13
|
-
"@cdc/map": "^4.26.
|
|
14
|
-
"@cdc/markup-include": "^4.26.
|
|
15
|
-
"@cdc/waffle-chart": "^4.26.
|
|
9
|
+
"@cdc/chart": "^4.26.4",
|
|
10
|
+
"@cdc/core": "^4.26.4",
|
|
11
|
+
"@cdc/data-bite": "^4.26.4",
|
|
12
|
+
"@cdc/filtered-text": "^4.26.4",
|
|
13
|
+
"@cdc/map": "^4.26.4",
|
|
14
|
+
"@cdc/markup-include": "^4.26.4",
|
|
15
|
+
"@cdc/waffle-chart": "^4.26.4",
|
|
16
16
|
"js-base64": "^2.5.2",
|
|
17
17
|
"react-accessible-accordion": "^5.0.1",
|
|
18
18
|
"react-dnd": "^16.0.1",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
27
27
|
"vite-plugin-svgr": "^4.2.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "6097de1ff814001880d9ac64bd66becdc092d63c",
|
|
30
30
|
"main": "dist/cdcdashboard",
|
|
31
31
|
"moduleName": "CdcDashboard",
|
|
32
32
|
"peerDependencies": {
|
|
@@ -523,7 +523,7 @@ export default function CdcDashboard({
|
|
|
523
523
|
classes={[`dashboard-title`, `${config.dashboard.theme ?? 'theme-blue'}`]}
|
|
524
524
|
/>
|
|
525
525
|
{/* Description */}
|
|
526
|
-
{description && <div className='subtext mb-4'>{parse(description)}</div>}
|
|
526
|
+
{description && <div className='subtext cove-prose mb-4'>{parse(description)}</div>}
|
|
527
527
|
{/* Visualizations */}
|
|
528
528
|
{filteredRows?.map((row, index) => (
|
|
529
529
|
<VisualizationRow
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import { expect } from 'storybook/test'
|
|
3
|
+
import { assertVisualizationRendered } from '@cdc/core/helpers/testing'
|
|
4
|
+
import Dashboard from '../CdcDashboard'
|
|
5
|
+
import MinimalExampleConfig from '../../examples/minimal-example.json'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Dashboard> = {
|
|
8
|
+
title: 'Components/Pages/Dashboard',
|
|
9
|
+
component: Dashboard
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default meta
|
|
13
|
+
type Story = StoryObj<typeof Dashboard>
|
|
14
|
+
|
|
15
|
+
export const Dashboard_Minimal_Config: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
config: MinimalExampleConfig,
|
|
18
|
+
isEditor: false
|
|
19
|
+
},
|
|
20
|
+
parameters: {
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
story:
|
|
24
|
+
'Minimum working consumer config. This story validates the source-of-truth minimal example used by the package README and CONFIG reference.'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
play: async ({ canvasElement }) => {
|
|
29
|
+
await assertVisualizationRendered(canvasElement)
|
|
30
|
+
expect(canvasElement.textContent).toContain('Dashboard Example')
|
|
31
|
+
expect(canvasElement.textContent).toContain('Minimal dashboard example')
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -44,13 +44,16 @@ import GalleryDataBiteDashboard from './_mock/gallery-data-bite-dashboard.json'
|
|
|
44
44
|
import TP5TestConfig from './_mock/tp5-test.json'
|
|
45
45
|
import LineChartAnglesConfig from './_mock/dashboard-line-chart-angles.json'
|
|
46
46
|
import TabSimpleFilterConfig from './_mock/tab-simple-filter.json'
|
|
47
|
+
import DataDrivenColorsConfig from './_mock/dashboard-data-driven-colors.json'
|
|
47
48
|
|
|
48
49
|
// Dashboard Filter Updates for Ascending, Descending, and Custom Order
|
|
49
50
|
import DashboardFilterAsc from './_mock/dashboard-filter-asc.json'
|
|
50
51
|
const DashboardFilterDesc = cloneDeep(DashboardFilterAsc)
|
|
51
52
|
const DashboardFilterCust = cloneDeep(DashboardFilterAsc)
|
|
53
|
+
const NestedParentChildFiltersSubgroupOnly = cloneDeep(NestedParentChildFilters)
|
|
52
54
|
DashboardFilterDesc.dashboard.sharedFilters[0].order = 'desc'
|
|
53
55
|
DashboardFilterCust.dashboard.sharedFilters[0].order = 'cust'
|
|
56
|
+
NestedParentChildFiltersSubgroupOnly.dashboard.sharedFilters[1].displaySubgroupingOnly = true
|
|
54
57
|
|
|
55
58
|
// On DashboardFilterCust change the sharedFilters[0].values and orderedValues to be in a custom order
|
|
56
59
|
const customOrder = ['American Samoa', 'Alaska', 'Alabama', 'Arizona', 'Arkansas']
|
|
@@ -119,6 +122,20 @@ export const TP5_Test_Dashboard: Story = {
|
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
|
|
125
|
+
export const DataDrivenColors: Story = {
|
|
126
|
+
args: {
|
|
127
|
+
config: DataDrivenColorsConfig as unknown as Config,
|
|
128
|
+
isEditor: false
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const DataDrivenColors_Editor: Story = {
|
|
133
|
+
args: {
|
|
134
|
+
config: DataDrivenColorsConfig as unknown as Config,
|
|
135
|
+
isEditor: true
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
122
139
|
export const Line_Chart_Angles: Story = {
|
|
123
140
|
args: {
|
|
124
141
|
config: LineChartAnglesConfig,
|
|
@@ -4788,8 +4805,7 @@ export const Nested_Dropdown_With_Parent_Child: Story = {
|
|
|
4788
4805
|
|
|
4789
4806
|
// Verify defaultValue is applied on initial load (North region, 2023 Q2)
|
|
4790
4807
|
expect(initialState.regionSelected).toBe('North')
|
|
4791
|
-
expect(initialState.yearQuarterSelected).
|
|
4792
|
-
expect(initialState.yearQuarterSelected).toContain('Q2')
|
|
4808
|
+
expect(initialState.yearQuarterSelected).toBe('2023 - Q2')
|
|
4793
4809
|
expect(initialState.chartRendered).toBe(true)
|
|
4794
4810
|
|
|
4795
4811
|
// Test 1: Change region to South → year options should update based on available data
|
|
@@ -4846,6 +4862,31 @@ export const Nested_Dropdown_With_Parent_Child: Story = {
|
|
|
4846
4862
|
}
|
|
4847
4863
|
}
|
|
4848
4864
|
|
|
4865
|
+
export const Nested_Dropdown_With_Parent_Child_Subgroup_Only: Story = {
|
|
4866
|
+
args: {
|
|
4867
|
+
config: NestedParentChildFiltersSubgroupOnly as unknown as Config,
|
|
4868
|
+
isEditor: false
|
|
4869
|
+
},
|
|
4870
|
+
parameters: {
|
|
4871
|
+
docs: {
|
|
4872
|
+
description: {
|
|
4873
|
+
story:
|
|
4874
|
+
'Displays only the selected subgroup in the closed nested dropdown input while preserving the same filter behavior.'
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
},
|
|
4878
|
+
play: async ({ canvasElement }) => {
|
|
4879
|
+
const canvas = within(canvasElement)
|
|
4880
|
+
const regionFilter = (await canvas.findByLabelText('Region', { selector: 'select' })) as HTMLSelectElement
|
|
4881
|
+
const yearQuarterInput = canvasElement.querySelector('.nested-dropdown input') as HTMLInputElement
|
|
4882
|
+
|
|
4883
|
+
await waitForOptionsToPopulate(regionFilter, 4)
|
|
4884
|
+
|
|
4885
|
+
expect(regionFilter.value).toBe('North')
|
|
4886
|
+
expect(yearQuarterInput.value).toBe('Q2')
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4849
4890
|
export const Metadata_In_Dashboard: Story = {
|
|
4850
4891
|
args: {
|
|
4851
4892
|
configUrl: '/packages/dashboard/tests/fixtures/dashboard-config-with-metadata.json'
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "dashboard",
|
|
3
|
+
"title": "COVID-19 County Case Tracker",
|
|
4
|
+
"description": "Select a state to view COVID-19 case counts by county. Background colors reflect the current alert status.",
|
|
5
|
+
"datasets": {
|
|
6
|
+
"covid-counties": {
|
|
7
|
+
"data": [
|
|
8
|
+
{
|
|
9
|
+
"State": "California",
|
|
10
|
+
"County1": "Los Angeles", "Cases1": "12847", "Status1": "Critical",
|
|
11
|
+
"County2": "San Diego", "Cases2": "4521", "Status2": "High",
|
|
12
|
+
"County3": "Sacramento", "Cases3": "1893", "Status3": "Medium"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"State": "Texas",
|
|
16
|
+
"County1": "Harris", "Cases1": "9734", "Status1": "High",
|
|
17
|
+
"County2": "Dallas", "Cases2": "7218", "Status2": "High",
|
|
18
|
+
"County3": "Travis", "Cases3": "2105", "Status3": "Medium"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"State": "New York",
|
|
22
|
+
"County1": "Kings", "Cases1": "3842", "Status1": "Medium",
|
|
23
|
+
"County2": "Queens", "Cases2": "3156", "Status2": "Medium",
|
|
24
|
+
"County3": "Erie", "Cases3": "987", "Status3": "Low"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"State": "Florida",
|
|
28
|
+
"County1": "Miami-Dade", "Cases1": "11203", "Status1": "Critical",
|
|
29
|
+
"County2": "Broward", "Cases2": "6890", "Status2": "High",
|
|
30
|
+
"County3": "Hillsborough", "Cases3": "3214", "Status3": "Medium"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"State": "Ohio",
|
|
34
|
+
"County1": "Franklin", "Cases1": "1542", "Status1": "Low",
|
|
35
|
+
"County2": "Cuyahoga", "Cases2": "1321", "Status2": "Low",
|
|
36
|
+
"County3": "Hamilton", "Cases3": "876", "Status3": "Low"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"dashboard": {
|
|
42
|
+
"theme": "theme-blue",
|
|
43
|
+
"sharedFilters": [
|
|
44
|
+
{
|
|
45
|
+
"key": "State Filter",
|
|
46
|
+
"label": "Select State",
|
|
47
|
+
"columnName": "State",
|
|
48
|
+
"showDropdown": true,
|
|
49
|
+
"active": "California",
|
|
50
|
+
"values": ["California", "Florida", "New York", "Ohio", "Texas"],
|
|
51
|
+
"usedBy": ["bite-county-1", "bite-county-2", "bite-county-3"],
|
|
52
|
+
"tier": 1,
|
|
53
|
+
"type": "datafilter"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"rows": [
|
|
58
|
+
[
|
|
59
|
+
{ "width": 4, "widget": "bite-county-1" },
|
|
60
|
+
{ "width": 4, "widget": "bite-county-2" },
|
|
61
|
+
{ "width": 4, "widget": "bite-county-3" }
|
|
62
|
+
]
|
|
63
|
+
],
|
|
64
|
+
"visualizations": {
|
|
65
|
+
"bite-county-1": {
|
|
66
|
+
"uid": "bite-county-1",
|
|
67
|
+
"type": "data-bite",
|
|
68
|
+
"title": "County 1",
|
|
69
|
+
"biteStyle": "tp5",
|
|
70
|
+
"dataKey": "covid-counties",
|
|
71
|
+
"dataColumn": "Cases1",
|
|
72
|
+
"dataFunction": "Pass Through",
|
|
73
|
+
"biteBody": "confirmed cases",
|
|
74
|
+
"subtext": "",
|
|
75
|
+
"dataFormat": {
|
|
76
|
+
"roundToPlace": 0,
|
|
77
|
+
"commas": true,
|
|
78
|
+
"prefix": "",
|
|
79
|
+
"suffix": ""
|
|
80
|
+
},
|
|
81
|
+
"filters": [],
|
|
82
|
+
"theme": "theme-blue",
|
|
83
|
+
"visual": {
|
|
84
|
+
"border": false,
|
|
85
|
+
"accent": false,
|
|
86
|
+
"background": false,
|
|
87
|
+
"hideBackgroundColor": false,
|
|
88
|
+
"borderColorTheme": false
|
|
89
|
+
},
|
|
90
|
+
"dataColors": {
|
|
91
|
+
"column": "Status1",
|
|
92
|
+
"mappings": [
|
|
93
|
+
{ "sourceValue": "Low", "color": "#d7f2ed" },
|
|
94
|
+
{ "sourceValue": "Medium", "color": "#b8e5ac" },
|
|
95
|
+
{ "sourceValue": "High", "color": "#fea82f" },
|
|
96
|
+
{ "sourceValue": "Critical", "color": "#a03169" }
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"bite-county-2": {
|
|
101
|
+
"uid": "bite-county-2",
|
|
102
|
+
"type": "data-bite",
|
|
103
|
+
"title": "County 2",
|
|
104
|
+
"biteStyle": "tp5",
|
|
105
|
+
"dataKey": "covid-counties",
|
|
106
|
+
"dataColumn": "Cases2",
|
|
107
|
+
"dataFunction": "Pass Through",
|
|
108
|
+
"biteBody": "confirmed cases",
|
|
109
|
+
"subtext": "",
|
|
110
|
+
"dataFormat": {
|
|
111
|
+
"roundToPlace": 0,
|
|
112
|
+
"commas": true,
|
|
113
|
+
"prefix": "",
|
|
114
|
+
"suffix": ""
|
|
115
|
+
},
|
|
116
|
+
"filters": [],
|
|
117
|
+
"theme": "theme-blue",
|
|
118
|
+
"visual": {
|
|
119
|
+
"border": false,
|
|
120
|
+
"accent": false,
|
|
121
|
+
"background": false,
|
|
122
|
+
"hideBackgroundColor": false,
|
|
123
|
+
"borderColorTheme": false
|
|
124
|
+
},
|
|
125
|
+
"dataColors": {
|
|
126
|
+
"column": "Status2",
|
|
127
|
+
"mappings": [
|
|
128
|
+
{ "sourceValue": "Low", "color": "#d7f2ed" },
|
|
129
|
+
{ "sourceValue": "Medium", "color": "#b8e5ac" },
|
|
130
|
+
{ "sourceValue": "High", "color": "#fea82f" },
|
|
131
|
+
{ "sourceValue": "Critical", "color": "#a03169" }
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"bite-county-3": {
|
|
136
|
+
"uid": "bite-county-3",
|
|
137
|
+
"type": "data-bite",
|
|
138
|
+
"title": "County 3",
|
|
139
|
+
"biteStyle": "tp5",
|
|
140
|
+
"dataKey": "covid-counties",
|
|
141
|
+
"dataColumn": "Cases3",
|
|
142
|
+
"dataFunction": "Pass Through",
|
|
143
|
+
"biteBody": "confirmed cases",
|
|
144
|
+
"subtext": "",
|
|
145
|
+
"dataFormat": {
|
|
146
|
+
"roundToPlace": 0,
|
|
147
|
+
"commas": true,
|
|
148
|
+
"prefix": "",
|
|
149
|
+
"suffix": ""
|
|
150
|
+
},
|
|
151
|
+
"filters": [],
|
|
152
|
+
"theme": "theme-blue",
|
|
153
|
+
"visual": {
|
|
154
|
+
"border": false,
|
|
155
|
+
"accent": false,
|
|
156
|
+
"background": false,
|
|
157
|
+
"hideBackgroundColor": false,
|
|
158
|
+
"borderColorTheme": false
|
|
159
|
+
},
|
|
160
|
+
"dataColors": {
|
|
161
|
+
"column": "Status3",
|
|
162
|
+
"mappings": [
|
|
163
|
+
{ "sourceValue": "Low", "color": "#d7f2ed" },
|
|
164
|
+
{ "sourceValue": "Medium", "color": "#b8e5ac" },
|
|
165
|
+
{ "sourceValue": "High", "color": "#fea82f" },
|
|
166
|
+
{ "sourceValue": "Critical", "color": "#a03169" }
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -40,13 +40,23 @@
|
|
|
40
40
|
{ "width": 4, "widget": "gauge1" },
|
|
41
41
|
{ "width": 4, "widget": "gauge2" },
|
|
42
42
|
{ "width": 4, "widget": "gauge3" }
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
{ "width": 4, "widget": "markup1" },
|
|
46
|
+
{ "width": 4, "widget": "markup2" },
|
|
47
|
+
{ "width": 4, "widget": "markup3" }
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
{ "width": 4, "widget": "waffle2" },
|
|
51
|
+
{ "width": 4, "widget": "bite3" },
|
|
52
|
+
{ "width": 4, "widget": "markup2" }
|
|
43
53
|
]
|
|
44
54
|
],
|
|
45
55
|
"visualizations": {
|
|
46
56
|
"waffle1": {
|
|
47
57
|
"uid": "waffle1",
|
|
48
58
|
"type": "waffle-chart",
|
|
49
|
-
"title": "Vaccination
|
|
59
|
+
"title": "Vaccination",
|
|
50
60
|
"visualizationType": "TP5 Waffle",
|
|
51
61
|
"visualizationSubType": "linear",
|
|
52
62
|
"showPercent": true,
|
|
@@ -71,7 +81,7 @@
|
|
|
71
81
|
"waffle2": {
|
|
72
82
|
"uid": "waffle2",
|
|
73
83
|
"type": "waffle-chart",
|
|
74
|
-
"title": "Health
|
|
84
|
+
"title": "Health",
|
|
75
85
|
"visualizationType": "TP5 Waffle",
|
|
76
86
|
"visualizationSubType": "linear",
|
|
77
87
|
"showPercent": true,
|
|
@@ -96,7 +106,7 @@
|
|
|
96
106
|
"waffle3": {
|
|
97
107
|
"uid": "waffle3",
|
|
98
108
|
"type": "waffle-chart",
|
|
99
|
-
"title": "Cancer
|
|
109
|
+
"title": "Cancer",
|
|
100
110
|
"visualizationType": "TP5 Waffle",
|
|
101
111
|
"visualizationSubType": "linear",
|
|
102
112
|
"showPercent": true,
|
|
@@ -245,7 +255,7 @@
|
|
|
245
255
|
"bite3": {
|
|
246
256
|
"uid": "bite3",
|
|
247
257
|
"type": "data-bite",
|
|
248
|
-
"title": "Cancer Screening Completion",
|
|
258
|
+
"title": "Cancer Screening Completion, and a little something else to make the title taller",
|
|
249
259
|
"biteStyle": "tp5",
|
|
250
260
|
"dataColumn": "Screening Rate",
|
|
251
261
|
"dataFunction": "Mean (Average)",
|
|
@@ -261,7 +271,78 @@
|
|
|
261
271
|
"visual": {
|
|
262
272
|
"hideBackgroundColor": false
|
|
263
273
|
}
|
|
274
|
+
},
|
|
275
|
+
"markup1": {
|
|
276
|
+
"uid": "markup1",
|
|
277
|
+
"type": "markup-include",
|
|
278
|
+
"title": "",
|
|
279
|
+
"theme": "theme-blue",
|
|
280
|
+
"contentEditor": {
|
|
281
|
+
"style": "tp5",
|
|
282
|
+
"title": "TP5 Markup Include",
|
|
283
|
+
"titleStyle": "small",
|
|
284
|
+
"useInlineHTML": true,
|
|
285
|
+
"inlineHTML": "<p><strong>68.5%</strong> of adults were vaccinated against seasonal flu in this sample dataset.</p>",
|
|
286
|
+
"srcUrl": "#example",
|
|
287
|
+
"showHeader": true,
|
|
288
|
+
"showNoDataMessage": false,
|
|
289
|
+
"noDataMessageText": "No Data Available"
|
|
290
|
+
},
|
|
291
|
+
"visual": {
|
|
292
|
+
"border": true,
|
|
293
|
+
"accent": false,
|
|
294
|
+
"whiteBackground": false,
|
|
295
|
+
"hideBackgroundColor": false,
|
|
296
|
+
"borderColorTheme": false
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"markup2": {
|
|
300
|
+
"uid": "markup2",
|
|
301
|
+
"type": "markup-include",
|
|
302
|
+
"title": "",
|
|
303
|
+
"theme": "theme-teal",
|
|
304
|
+
"contentEditor": {
|
|
305
|
+
"style": "tp5",
|
|
306
|
+
"title": "White Background TP5",
|
|
307
|
+
"titleStyle": "small",
|
|
308
|
+
"useInlineHTML": true,
|
|
309
|
+
"inlineHTML": "<p>This TP5 markup include uses white-background styling with border enabled for comparison.</p>",
|
|
310
|
+
"srcUrl": "#example",
|
|
311
|
+
"showHeader": true,
|
|
312
|
+
"showNoDataMessage": false,
|
|
313
|
+
"noDataMessageText": "No Data Available"
|
|
314
|
+
},
|
|
315
|
+
"visual": {
|
|
316
|
+
"border": true,
|
|
317
|
+
"accent": false,
|
|
318
|
+
"whiteBackground": true,
|
|
319
|
+
"hideBackgroundColor": false,
|
|
320
|
+
"borderColorTheme": false
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"markup3": {
|
|
324
|
+
"uid": "markup3",
|
|
325
|
+
"type": "markup-include",
|
|
326
|
+
"title": "",
|
|
327
|
+
"theme": "theme-purple",
|
|
328
|
+
"contentEditor": {
|
|
329
|
+
"style": "tp5",
|
|
330
|
+
"title": "TP5 Markup Include (No White BG)",
|
|
331
|
+
"titleStyle": "small",
|
|
332
|
+
"useInlineHTML": true,
|
|
333
|
+
"inlineHTML": "<p>This TP5 markup include uses the standard background and border settings for side-by-side alignment testing.</p>",
|
|
334
|
+
"srcUrl": "#example",
|
|
335
|
+
"showHeader": true,
|
|
336
|
+
"showNoDataMessage": false,
|
|
337
|
+
"noDataMessageText": "No Data Available"
|
|
338
|
+
},
|
|
339
|
+
"visual": {
|
|
340
|
+
"border": true,
|
|
341
|
+
"accent": false,
|
|
342
|
+
"whiteBackground": false,
|
|
343
|
+
"hideBackgroundColor": false,
|
|
344
|
+
"borderColorTheme": false
|
|
345
|
+
}
|
|
264
346
|
}
|
|
265
347
|
}
|
|
266
348
|
}
|
|
267
|
-
|