@cdc/core 4.26.1 → 4.26.3
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/.claude/agents/qa-test-developer.md +126 -0
- package/CLAUDE.local.md +67 -0
- package/LICENSE +201 -0
- package/_stories/Gallery.Charts.stories.tsx +35 -42
- package/_stories/Gallery.DataBite.stories.tsx +15 -8
- package/_stories/Gallery.Maps.stories.tsx +37 -28
- package/_stories/Gallery.WaffleChart.stories.tsx +1 -1
- package/_stories/PageART.stories.tsx +5 -4
- package/_stories/PageBRFSS.stories.tsx +21 -16
- package/_stories/PageCancerRegistries.stories.tsx +15 -15
- package/_stories/PageEasternEquineEncephalitis.stories.tsx +33 -19
- package/_stories/PageExcessiveAlcoholUse.stories.tsx +148 -143
- package/_stories/PageMaternalMortality.stories.tsx +5 -4
- package/_stories/PageOralHealth.stories.tsx +15 -10
- package/_stories/PageRespiratory.stories.tsx +4 -4
- package/_stories/PageSmokingTobacco.stories.tsx +15 -10
- package/_stories/PageStateDiabetesProfiles.stories.tsx +15 -10
- package/_stories/PageWastewater.stories.tsx +44 -30
- package/_stories/VegaImport.stories.tsx +401 -0
- package/_stories/vega-fixtures/bars-with-line.json +444 -0
- package/_stories/vega-fixtures/bars.json +58 -0
- package/_stories/vega-fixtures/combo-bar-rolling-mean.json +88 -0
- package/_stories/vega-fixtures/combo.json +68 -0
- package/_stories/vega-fixtures/grouped-horizontal-bars.json +83 -0
- package/_stories/vega-fixtures/grouped-horizontal-bars2.json +231 -0
- package/_stories/vega-fixtures/horizontal-bar.json +427 -0
- package/_stories/vega-fixtures/horizontal-bars-with-bad-colors.json +197 -0
- package/_stories/vega-fixtures/horizontal-bars2.json +58 -0
- package/_stories/vega-fixtures/lines.json +227 -0
- package/_stories/vega-fixtures/measles-bars.json +348 -0
- package/_stories/vega-fixtures/measles-map.json +11101 -0
- package/_stories/vega-fixtures/measles-stacked-bars.json +2147 -0
- package/_stories/vega-fixtures/multi-dataset.json +255 -0
- package/_stories/vega-fixtures/no-data.json +14 -0
- package/_stories/vega-fixtures/pie-chart.json +94 -0
- package/_stories/vega-fixtures/repeat-spec.json +47 -0
- package/_stories/vega-fixtures/stacked-area.json +222 -0
- package/_stories/vega-fixtures/stacked-bar-with-rect.json +3412 -0
- package/_stories/vega-fixtures/stacked-bars-with-line.json +364 -0
- package/_stories/vega-fixtures/stacked-bars.json +212 -0
- package/_stories/vega-fixtures/stacked-horizontal-bars.json +140 -0
- package/_stories/vega-fixtures/warning-combo.json +59 -0
- package/_stories/vega-fixtures/warning-scatter-and-line.json +1182 -0
- package/assets/callout-flag.svg +7 -0
- package/assets/icon-chart-area.svg +1 -0
- package/assets/icon-chart-radar.svg +23 -0
- package/assets/logo2.svg +31 -0
- package/components/AdvancedEditor/EmbedEditor.tsx +270 -38
- package/components/Alert/components/Alert.styles.css +2 -2
- package/components/ComboBox/combobox.styles.css +48 -48
- package/components/CustomColorsEditor/CustomColorsEditor.css +53 -53
- package/components/CustomColorsEditor/CustomColorsEditor.tsx +3 -10
- package/components/DataTable/DataTable.tsx +46 -18
- package/components/DataTable/DataTableStandAlone.tsx +1 -0
- package/components/DataTable/components/ChartHeader.tsx +21 -12
- package/components/DataTable/components/MapHeader.tsx +34 -28
- package/components/DataTable/components/SortIcon/sort-icon.css +5 -5
- package/components/DataTable/data-table.css +50 -52
- package/components/DataTable/helpers/applyCustomOrder.ts +17 -0
- package/components/DataTable/helpers/getChartCellValue.ts +10 -7
- package/components/DataTable/helpers/getMapDataTableColumnKeys.ts +22 -0
- package/components/DataTable/helpers/getSeriesName.ts +6 -0
- package/components/DataTable/helpers/mapCellMatrix.tsx +33 -23
- package/components/DataTable/helpers/tests/mapCellMatrix.test.ts +33 -0
- package/components/DownloadButton.tsx +14 -6
- package/components/EditorPanel/ColumnsEditor.tsx +38 -31
- package/components/EditorPanel/CustomSortOrder.tsx +94 -0
- package/components/EditorPanel/DataTableEditor.tsx +139 -23
- package/components/EditorPanel/EditorPanel.styles.css +71 -71
- package/components/EditorPanel/EditorPanel.tsx +3 -8
- package/components/EditorPanel/EditorPanelDispatch.tsx +4 -4
- package/components/EditorPanel/FootnotesEditor.tsx +2 -2
- package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +21 -12
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +16 -10
- package/components/EditorPanel/VizFilterEditor/components/FilterOrder.tsx +33 -29
- package/components/EditorPanel/components/MarkupVariablesEditor.tsx +160 -106
- package/components/EditorPanel/components/PanelMarkup.tsx +5 -1
- package/{styles/v2/components → components/EditorPanel}/editor.scss +76 -22
- package/components/EditorPanel/sections/StyleTreatmentSection.tsx +99 -0
- package/components/EditorPanel/sections/VisualSection.tsx +11 -0
- package/components/EditorWrapper/editor-wrapper.style.css +1 -1
- package/components/Filters/Filters.tsx +3 -5
- package/components/Filters/components/Tabs.tsx +19 -7
- package/{styles → components/Filters}/filters.scss +3 -3
- package/components/Footnotes/FootnotesStandAlone.tsx +4 -2
- package/components/HeaderThemeSelector/HeaderThemeSelector.css +61 -5
- package/components/Layout/components/Responsive.tsx +14 -6
- package/components/Layout/components/Sidebar/components/Sidebar.tsx +1 -1
- package/components/Layout/components/Sidebar/components/sidebar.styles.scss +14 -20
- package/components/Layout/components/Visualization/index.tsx +50 -38
- package/components/Layout/components/Visualization/visualizations.scss +232 -15
- package/components/Layout/components/VisualizationContainer.test.tsx +67 -0
- package/components/Layout/components/VisualizationContainer.tsx +37 -0
- package/components/Layout/components/VisualizationContent.test.tsx +182 -0
- package/components/Layout/components/VisualizationContent.tsx +75 -0
- package/components/Layout/index.tsx +5 -5
- package/components/Layout/styles/editor-utils.scss +3 -3
- package/components/Layout/styles/editor.scss +4 -4
- package/components/Legend/Legend.Gradient.tsx +7 -1
- package/components/Loader/loader.styles.css +2 -2
- package/components/Loading.jsx +1 -1
- package/components/MediaControls.tsx +10 -3
- package/components/MultiSelect/multiselect.styles.css +19 -19
- package/components/NestedDropdown/nesteddropdown.styles.css +15 -15
- package/components/PaletteSelector/PaletteSelector.css +15 -15
- package/components/RichTooltip/richTooltip.css +6 -6
- package/components/Table/table.styles.css +2 -2
- package/components/Waiting.tsx +1 -1
- package/components/_stories/CustomColorsEditor.stories.tsx +37 -0
- package/components/_stories/DataTable.stories.tsx +1 -0
- package/components/_stories/Filters.stories.tsx +1 -1
- package/components/_stories/styles.scss +0 -1
- package/components/elements/Button.jsx +1 -1
- package/components/elements/Card.jsx +1 -1
- package/{styles/v2/components → components/elements}/button.scss +9 -8
- package/components/inputs/InputCheckbox.jsx +1 -1
- package/components/inputs/InputSelect.tsx +1 -1
- package/components/inputs/InputText.jsx +1 -1
- package/components/inputs/InputToggle.tsx +1 -1
- package/{styles/v2/components/input → components/inputs}/_input-check-radio.scss +2 -2
- package/{styles/v2/components/input → components/inputs}/_input-group.scss +3 -3
- package/{styles/v2/components/input → components/inputs}/_input-slider.scss +2 -2
- package/{styles/v2/components/input → components/inputs}/_input.scss +5 -5
- package/{styles/v2/components/input → components/inputs}/index.scss +2 -2
- package/{styles → components}/loading.scss +1 -1
- package/components/managers/DataDesigner.tsx +1 -1
- package/{styles/v2/components → components/managers}/data-designer.scss +6 -7
- package/components/ui/Accordion.jsx +1 -1
- package/components/ui/Icon.tsx +1 -1
- package/components/ui/LoadSpin.jsx +1 -1
- package/components/ui/Modal.jsx +1 -1
- package/components/ui/Overlay.jsx +1 -1
- package/components/ui/Title/index.test.tsx +34 -0
- package/components/ui/Title/index.tsx +24 -7
- package/components/ui/Title/title.styles.css +119 -25
- package/components/ui/Tooltip.tsx +1 -1
- package/components/ui/_stories/Title.stories.tsx +1 -1
- package/{styles/v2/components → components/ui}/accordion.scss +3 -3
- package/components/ui/accordion.styles.css +11 -11
- package/{styles/v2/components → components/ui}/modal.scss +2 -2
- package/{styles/v2/components → components/ui}/overlay.scss +6 -6
- package/{styles/v2/components → components}/ui/tooltip.scss +1 -1
- package/{styles → components}/waiting.scss +9 -3
- package/data/colorPalettes.ts +18 -5
- package/data/mapColorPalettes.ts +10 -0
- package/devTemplate/dev.js +285 -0
- package/devTemplate/index.html +30 -0
- package/devTemplate/preview.html +1503 -0
- package/devTemplate/sidebar.css +151 -0
- package/dist/cove-main.css +2530 -3901
- package/dist/cove-main.css.map +1 -1
- package/generateViteConfig.js +111 -2
- package/helpers/DataTransform.ts +1 -5
- package/helpers/backfillDefaults.ts +35 -0
- package/helpers/constants.ts +12 -0
- package/helpers/cove/date.ts +64 -3
- package/helpers/cove/number.ts +29 -15
- package/helpers/cove/string.ts +29 -0
- package/helpers/coveUpdateWorker.ts +14 -8
- package/helpers/displayDataAsText.ts +1 -1
- package/helpers/embed/embedCodeGenerator.ts +80 -0
- package/helpers/embed/embedHelper.js +169 -0
- package/helpers/embed/filterUtils.ts +121 -0
- package/helpers/embed/index.ts +17 -0
- package/helpers/embed/urlValidation.ts +119 -0
- package/helpers/extractDataAndMetadata.ts +20 -0
- package/helpers/fetchRemoteData.ts +14 -8
- package/helpers/filterVizData.ts +6 -1
- package/helpers/getFileExtension.ts +0 -6
- package/helpers/labelHash.ts +9 -0
- package/helpers/markupProcessor.ts +56 -38
- package/helpers/metrics/types.ts +3 -0
- package/helpers/palettes/colorDistributions.ts +1 -1
- package/helpers/palettes/utils.ts +12 -12
- package/helpers/parseCsvWithQuotes.ts +15 -14
- package/helpers/prepareScreenshot.ts +33 -10
- package/helpers/testing.ts +44 -0
- package/helpers/tests/DataTransform.test.ts +125 -0
- package/helpers/tests/abbreviateNumber.test.ts +59 -0
- package/helpers/tests/backfillDefaults.test.ts +253 -0
- package/helpers/tests/date.test.ts +110 -0
- package/helpers/tests/extractDataAndMetadata.test.ts +93 -0
- package/helpers/tests/markupProcessor.test.ts +315 -124
- package/helpers/tests/number.test.ts +42 -0
- package/helpers/tests/prepareScreenshot.test.ts +28 -28
- package/helpers/tests/testStandaloneBuild.ts +36 -26
- package/helpers/tests/useDataVizClasses.test.ts +66 -0
- package/helpers/tests/visualizationWrapperUsage.test.ts +57 -0
- package/helpers/useDataVizClasses.ts +13 -7
- package/helpers/vegaConfig.ts +1 -1
- package/helpers/vegaConfigImport.ts +160 -0
- package/helpers/ver/4.24.4.ts +24 -0
- package/helpers/ver/4.26.1.ts +1 -1
- package/helpers/ver/4.26.2.ts +84 -0
- package/helpers/ver/4.26.3.ts +44 -0
- package/helpers/ver/4.26.4.ts +31 -0
- package/helpers/ver/tests/4.26.1.test.ts +105 -0
- package/helpers/ver/tests/4.26.2.test.ts +298 -0
- package/helpers/ver/tests/4.26.3.test.ts +168 -0
- package/helpers/ver/tests/4.26.4.test.ts +88 -0
- package/helpers/ver/tests/coveUpdateWorker.test.ts +57 -0
- package/helpers/viewports.ts +2 -0
- package/package.json +27 -32
- package/styles/_global.scss +7 -7
- package/styles/_reset.scss +2 -2
- package/styles/{v2/base → base}/_file-selector.scss +4 -4
- package/styles/{v2/base → base}/_general.scss +2 -4
- package/styles/{v2/base → base}/index.scss +1 -1
- package/styles/base.scss +107 -165
- package/styles/cove-main.scss +3 -6
- package/styles/layout/_component.scss +110 -0
- package/styles/{v2/layout → layout}/_data-table.scss +7 -7
- package/styles/layout/_wrapper-padding.scss +27 -0
- package/styles/{v2/main.scss → main.scss} +3 -1
- package/styles/{v2/themes → themes}/_color-definitions.scss +46 -41
- package/styles/{_accessibility.scss → utils/_accessibility.scss} +1 -1
- package/styles/{v2/utils → utils}/_grid.scss +8 -3
- package/styles/{_global-variables.scss → utils/_properties.scss} +133 -112
- package/styles/{v2/utils → utils}/index.scss +2 -1
- package/types/Annotation.ts +10 -11
- package/types/Axis.ts +2 -0
- package/types/ComponentStyles.ts +1 -0
- package/types/ConfigureData.ts +1 -0
- package/types/General.ts +2 -0
- package/types/MarkupInclude.ts +1 -0
- package/types/MarkupVariable.ts +2 -1
- package/types/Palette.ts +22 -0
- package/types/Table.ts +9 -0
- package/types/Visualization.ts +7 -0
- package/_stories/StoryRenderingTests.stories.tsx +0 -164
- package/helpers/embedCodeGenerator.ts +0 -109
- package/styles/_common-components.css +0 -73
- package/styles/_variables.scss +0 -63
- package/styles/v2/layout/_component.scss +0 -21
- package/styles/v2/utils/_variables.scss +0 -9
- package/{styles/v2/components/card.scss → components/elements/card.css} +2 -2
- /package/{styles/v2/components → components/ui}/icon.scss +0 -0
- /package/{styles/v2/components → components/ui}/loadspin.scss +0 -0
- /package/styles/{v2/base → base}/_heading.scss +0 -0
- /package/styles/{v2/base → base}/_reset.scss +0 -0
- /package/styles/{v2/layout → layout}/_alert.scss +0 -0
- /package/styles/{v2/layout → layout}/_progression.scss +0 -0
- /package/styles/{v2/layout → layout}/_tooltip.scss +0 -0
- /package/styles/{v2/layout → layout}/index.scss +0 -0
- /package/styles/{v2/themes → themes}/index.scss +0 -0
- /package/styles/{v2/utils → utils}/_align.scss +0 -0
- /package/styles/{v2/utils → utils}/_animations.scss +0 -0
- /package/styles/{v2/utils → utils}/_breakpoints.scss +0 -0
- /package/styles/{v2/utils → utils}/_mixins.scss +0 -0
|
@@ -41,7 +41,7 @@ const testChartRendering = async (canvasElement: HTMLElement, storyName: string)
|
|
|
41
41
|
})
|
|
42
42
|
|
|
43
43
|
await step('Verify COVE module wrapper is present', async () => {
|
|
44
|
-
const coveModule = canvasElement.querySelector('.
|
|
44
|
+
const coveModule = canvasElement.querySelector('.cove-visualization')
|
|
45
45
|
expect(coveModule).toBeInTheDocument()
|
|
46
46
|
})
|
|
47
47
|
|
|
@@ -50,42 +50,42 @@ const testChartRendering = async (canvasElement: HTMLElement, storyName: string)
|
|
|
50
50
|
|
|
51
51
|
// Bar Charts
|
|
52
52
|
export const Bar_Chart_Time_Based: Story = {
|
|
53
|
-
render: () => <Chart configUrl=
|
|
53
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Example_Bar_Chart.json' />,
|
|
54
54
|
play: async ({ canvasElement }) => {
|
|
55
55
|
await testChartRendering(canvasElement, 'Bar Chart Time Based')
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export const Bar_Chart_Categorical: Story = {
|
|
60
|
-
render: () => <Chart configUrl=
|
|
60
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/example-category-bar-char.json' />,
|
|
61
61
|
play: async ({ canvasElement }) => {
|
|
62
62
|
await testChartRendering(canvasElement, 'Bar Chart Categorical')
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export const Bar_Chart_With_Highlighted_Value: Story = {
|
|
67
|
-
render: () => <Chart configUrl=
|
|
67
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/bar-chart-with-highlighte.json' />,
|
|
68
68
|
play: async ({ canvasElement }) => {
|
|
69
69
|
await testChartRendering(canvasElement, 'Bar Chart With Highlighted Value')
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export const Bar_Chart_With_Confidence_Intervals: Story = {
|
|
74
|
-
render: () => <Chart configUrl=
|
|
74
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Example_Bar_CI_1.json' />,
|
|
75
75
|
play: async ({ canvasElement }) => {
|
|
76
76
|
await testChartRendering(canvasElement, 'Bar Chart With Confidence Intervals')
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export const Bar_Chart_With_Suppressed_Values: Story = {
|
|
81
|
-
render: () => <Chart configUrl=
|
|
81
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/bar-chart-with-suppressed-values.json' />,
|
|
82
82
|
play: async ({ canvasElement }) => {
|
|
83
83
|
await testChartRendering(canvasElement, 'Bar Chart With Suppressed Values')
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export const Horizontal_Bar_Chart: Story = {
|
|
88
|
-
render: () => <Chart configUrl=
|
|
88
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Horizontal_Bar_Chart_Viz.json' />,
|
|
89
89
|
play: async ({ canvasElement }) => {
|
|
90
90
|
await testChartRendering(canvasElement, 'Horizontal Bar Chart')
|
|
91
91
|
}
|
|
@@ -93,14 +93,14 @@ export const Horizontal_Bar_Chart: Story = {
|
|
|
93
93
|
|
|
94
94
|
// Box and Whiskers Plots
|
|
95
95
|
export const Box_Plot_With_Outliers: Story = {
|
|
96
|
-
render: () => <Chart configUrl=
|
|
96
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/box-plot-outliers.json' />,
|
|
97
97
|
play: async ({ canvasElement }) => {
|
|
98
98
|
await testChartRendering(canvasElement, 'Box Plot With Outliers')
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export const Horizontal_Box_Plot: Story = {
|
|
103
|
-
render: () => <Chart configUrl=
|
|
103
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/horizontal-box-plot.json' />,
|
|
104
104
|
play: async ({ canvasElement }) => {
|
|
105
105
|
await testChartRendering(canvasElement, 'Horizontal Box Plot')
|
|
106
106
|
}
|
|
@@ -108,7 +108,7 @@ export const Horizontal_Box_Plot: Story = {
|
|
|
108
108
|
|
|
109
109
|
// Bump Chart
|
|
110
110
|
export const Bump_Chart: Story = {
|
|
111
|
-
render: () => <Chart configUrl=
|
|
111
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/bump-chart.json' />,
|
|
112
112
|
play: async ({ canvasElement }) => {
|
|
113
113
|
await testChartRendering(canvasElement, 'Bump Chart')
|
|
114
114
|
}
|
|
@@ -116,14 +116,14 @@ export const Bump_Chart: Story = {
|
|
|
116
116
|
|
|
117
117
|
// Combo Bar/Line Charts
|
|
118
118
|
export const Combo_Bar_And_Area: Story = {
|
|
119
|
-
render: () => <Chart configUrl=
|
|
119
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Combo_Bar_Line_Viz.json' />,
|
|
120
120
|
play: async ({ canvasElement }) => {
|
|
121
121
|
await testChartRendering(canvasElement, 'Combo Bar And Area')
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export const Epi_Style_Bar_Chart: Story = {
|
|
126
|
-
render: () => <Chart configUrl=
|
|
126
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/example-epi-style-bar-chart.json' />,
|
|
127
127
|
play: async ({ canvasElement }) => {
|
|
128
128
|
await testChartRendering(canvasElement, 'Epi Style Bar Chart')
|
|
129
129
|
}
|
|
@@ -131,7 +131,7 @@ export const Epi_Style_Bar_Chart: Story = {
|
|
|
131
131
|
|
|
132
132
|
// Deviation Bar Chart
|
|
133
133
|
export const Deviation_Bar_Chart: Story = {
|
|
134
|
-
render: () => <Chart configUrl=
|
|
134
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/example-deviation-bar-chart.json' />,
|
|
135
135
|
play: async ({ canvasElement }) => {
|
|
136
136
|
await testChartRendering(canvasElement, 'Deviation Bar Chart')
|
|
137
137
|
}
|
|
@@ -139,14 +139,14 @@ export const Deviation_Bar_Chart: Story = {
|
|
|
139
139
|
|
|
140
140
|
// Forecast Charts
|
|
141
141
|
export const Forecast_Chart_Single_CI: Story = {
|
|
142
|
-
render: () => <Chart configUrl=
|
|
142
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/forecast-chart-one-CI.json' />,
|
|
143
143
|
play: async ({ canvasElement }) => {
|
|
144
144
|
await testChartRendering(canvasElement, 'Forecast Chart Single CI')
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
export const Forecast_Chart_Multiple_CIs: Story = {
|
|
149
|
-
render: () => <Chart configUrl=
|
|
149
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/forecast-chart-2-CIs.json' />,
|
|
150
150
|
play: async ({ canvasElement }) => {
|
|
151
151
|
await testChartRendering(canvasElement, 'Forecast Chart Multiple CIs')
|
|
152
152
|
}
|
|
@@ -154,42 +154,42 @@ export const Forecast_Chart_Multiple_CIs: Story = {
|
|
|
154
154
|
|
|
155
155
|
// Line Charts
|
|
156
156
|
export const Line_Chart_Standard: Story = {
|
|
157
|
-
render: () => <Chart configUrl=
|
|
157
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Line_Chart_Viz.json' />,
|
|
158
158
|
play: async ({ canvasElement }) => {
|
|
159
159
|
await testChartRendering(canvasElement, 'Line Chart Standard')
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
export const Line_Chart_With_Regions: Story = {
|
|
164
|
-
render: () => <Chart configUrl=
|
|
164
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Line_Chart_Regions_Viz.json' />,
|
|
165
165
|
play: async ({ canvasElement }) => {
|
|
166
166
|
await testChartRendering(canvasElement, 'Line Chart With Regions')
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
export const Line_Chart_Isolated: Story = {
|
|
171
|
-
render: () => <Chart configUrl=
|
|
171
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Line_Chart_Isolated.json' />,
|
|
172
172
|
play: async ({ canvasElement }) => {
|
|
173
173
|
await testChartRendering(canvasElement, 'Line Chart Isolated')
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
export const Line_Chart_Line_Weights: Story = {
|
|
178
|
-
render: () => <Chart configUrl=
|
|
178
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Line_Chart_Line_Weights.json' />,
|
|
179
179
|
play: async ({ canvasElement }) => {
|
|
180
180
|
await testChartRendering(canvasElement, 'Line Chart Line Weights')
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
export const Line_Chart_With_Open_Circles: Story = {
|
|
185
|
-
render: () => <Chart configUrl=
|
|
185
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/line-chart-with-open-circles.json' />,
|
|
186
186
|
play: async ({ canvasElement }) => {
|
|
187
187
|
await testChartRendering(canvasElement, 'Line Chart With Open Circles')
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
export const Line_Chart_With_Suppression: Story = {
|
|
192
|
-
render: () => <Chart configUrl=
|
|
192
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/line-chart-with-suppression.json' />,
|
|
193
193
|
play: async ({ canvasElement }) => {
|
|
194
194
|
await testChartRendering(canvasElement, 'Line Chart With Suppression')
|
|
195
195
|
}
|
|
@@ -197,7 +197,7 @@ export const Line_Chart_With_Suppression: Story = {
|
|
|
197
197
|
|
|
198
198
|
// Lollipop Bar Chart
|
|
199
199
|
export const Lollipop_Horizontal_Bar_Chart: Story = {
|
|
200
|
-
render: () => <Chart configUrl=
|
|
200
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/lollipop-style-horizontal-bar-chart.json' />,
|
|
201
201
|
play: async ({ canvasElement }) => {
|
|
202
202
|
await testChartRendering(canvasElement, 'Lollipop Horizontal Bar Chart')
|
|
203
203
|
}
|
|
@@ -205,14 +205,14 @@ export const Lollipop_Horizontal_Bar_Chart: Story = {
|
|
|
205
205
|
|
|
206
206
|
// Pie and Donut Charts
|
|
207
207
|
export const Pie_Chart: Story = {
|
|
208
|
-
render: () => <Chart configUrl=
|
|
208
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Example_Pie_viz.json' />,
|
|
209
209
|
play: async ({ canvasElement }) => {
|
|
210
210
|
await testChartRendering(canvasElement, 'Pie Chart')
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
export const Donut_Chart: Story = {
|
|
215
|
-
render: () => <Chart configUrl=
|
|
215
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Donut-Chart.json' />,
|
|
216
216
|
play: async ({ canvasElement }) => {
|
|
217
217
|
await testChartRendering(canvasElement, 'Donut Chart')
|
|
218
218
|
}
|
|
@@ -220,50 +220,43 @@ export const Donut_Chart: Story = {
|
|
|
220
220
|
|
|
221
221
|
// Scatter Plots
|
|
222
222
|
export const Scatter_Plot_Negative_Trend: Story = {
|
|
223
|
-
render: () => <Chart configUrl=
|
|
223
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/scatter-plot-negative-trend.json' />,
|
|
224
224
|
play: async ({ canvasElement }) => {
|
|
225
225
|
await testChartRendering(canvasElement, 'Scatter Plot Negative Trend')
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
export const Scatter_Plot_Multi_Series: Story = {
|
|
230
|
-
render: () => <Chart configUrl=
|
|
230
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/scatter-plot-multi-series.json' />,
|
|
231
231
|
play: async ({ canvasElement }) => {
|
|
232
232
|
await testChartRendering(canvasElement, 'Scatter Plot Multi Series')
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
export const Scatter_Plot_Nonlinear_Trend: Story = {
|
|
237
|
-
render: () => <Chart configUrl=
|
|
237
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/scatter-plot-nonlinear-trend.json' />,
|
|
238
238
|
play: async ({ canvasElement }) => {
|
|
239
239
|
await testChartRendering(canvasElement, 'Scatter Plot Nonlinear Trend')
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
// Sparklines
|
|
244
|
-
export const Sparkline_Dashboard: Story = {
|
|
245
|
-
render: () => <Chart configUrl="https://www.cdc.gov/cove/examples/sparkline-dash.json" />,
|
|
246
|
-
play: async ({ canvasElement }) => {
|
|
247
|
-
await testChartRendering(canvasElement, 'Sparkline Dashboard')
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
244
|
export const Sparkline_2016_Outreach_Var2: Story = {
|
|
252
|
-
render: () => <Chart configUrl=
|
|
245
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/2016-outreach-2.json' />,
|
|
253
246
|
play: async ({ canvasElement }) => {
|
|
254
247
|
await testChartRendering(canvasElement, 'Sparkline 2016 Outreach Var2')
|
|
255
248
|
}
|
|
256
249
|
}
|
|
257
250
|
|
|
258
251
|
export const Sparkline_2016_Outreach_Var3: Story = {
|
|
259
|
-
render: () => <Chart configUrl=
|
|
252
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/2016-outreach-3.json' />,
|
|
260
253
|
play: async ({ canvasElement }) => {
|
|
261
254
|
await testChartRendering(canvasElement, 'Sparkline 2016 Outreach Var3')
|
|
262
255
|
}
|
|
263
256
|
}
|
|
264
257
|
|
|
265
258
|
export const Sparkline_2016_Outreach_Var4: Story = {
|
|
266
|
-
render: () => <Chart configUrl=
|
|
259
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/2016-outreach-4.json' />,
|
|
267
260
|
play: async ({ canvasElement }) => {
|
|
268
261
|
await testChartRendering(canvasElement, 'Sparkline 2016 Outreach Var4')
|
|
269
262
|
}
|
|
@@ -271,21 +264,21 @@ export const Sparkline_2016_Outreach_Var4: Story = {
|
|
|
271
264
|
|
|
272
265
|
// Stacked Area Charts
|
|
273
266
|
export const Stacked_Area_Chart: Story = {
|
|
274
|
-
render: () => <Chart configUrl=
|
|
267
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/example-stacked-area-chart.json' />,
|
|
275
268
|
play: async ({ canvasElement }) => {
|
|
276
269
|
await testChartRendering(canvasElement, 'Stacked Area Chart')
|
|
277
270
|
}
|
|
278
271
|
}
|
|
279
272
|
|
|
280
273
|
export const Area_Chart_With_Annotations: Story = {
|
|
281
|
-
render: () => <Chart configUrl=
|
|
274
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/area-chart-with-annotations_1.json' />,
|
|
282
275
|
play: async ({ canvasElement }) => {
|
|
283
276
|
await testChartRendering(canvasElement, 'Area Chart With Annotations')
|
|
284
277
|
}
|
|
285
278
|
}
|
|
286
279
|
|
|
287
280
|
export const Area_Chart_With_Categorical_Axis: Story = {
|
|
288
|
-
render: () => <Chart configUrl=
|
|
281
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/example-area-chart-with-cat-axis.json' />,
|
|
289
282
|
play: async ({ canvasElement }) => {
|
|
290
283
|
await testChartRendering(canvasElement, 'Area Chart With Categorical Axis')
|
|
291
284
|
}
|
|
@@ -293,14 +286,14 @@ export const Area_Chart_With_Categorical_Axis: Story = {
|
|
|
293
286
|
|
|
294
287
|
// Stacked Bar Charts
|
|
295
288
|
export const Stacked_Horizontal_Bar_Chart: Story = {
|
|
296
|
-
render: () => <Chart configUrl=
|
|
289
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/example-stacked-horizontal-chart.json' />,
|
|
297
290
|
play: async ({ canvasElement }) => {
|
|
298
291
|
await testChartRendering(canvasElement, 'Stacked Horizontal Bar Chart')
|
|
299
292
|
}
|
|
300
293
|
}
|
|
301
294
|
|
|
302
295
|
export const Stacked_Vertical_Bar_Chart: Story = {
|
|
303
|
-
render: () => <Chart configUrl=
|
|
296
|
+
render: () => <Chart configUrl='https://www.cdc.gov/cove/examples/Stacked_Bar_Viz.json' />,
|
|
304
297
|
play: async ({ canvasElement }) => {
|
|
305
298
|
await testChartRendering(canvasElement, 'Stacked Vertical Bar Chart')
|
|
306
299
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
import { within, expect } from 'storybook/test'
|
|
2
|
+
import { within, expect, waitFor } from 'storybook/test'
|
|
3
3
|
import DataBite from '@cdc/data-bite'
|
|
4
4
|
|
|
5
5
|
// Fallback step function for test descriptions
|
|
@@ -31,12 +31,11 @@ const testDataBiteRendering = async (canvasElement: HTMLElement, storyName: stri
|
|
|
31
31
|
const canvas = within(canvasElement)
|
|
32
32
|
|
|
33
33
|
await step('Wait for data bite to render', async () => {
|
|
34
|
-
|
|
35
|
-
expect(dataBiteElement).toBeInTheDocument()
|
|
34
|
+
await waitFor(() => expect(canvasElement.querySelector('.bite-content')).toBeInTheDocument(), { timeout: 10000 })
|
|
36
35
|
})
|
|
37
36
|
|
|
38
37
|
await step('Verify COVE module wrapper is present', async () => {
|
|
39
|
-
const coveModule = canvasElement.querySelector('.
|
|
38
|
+
const coveModule = canvasElement.querySelector('.cove-visualization')
|
|
40
39
|
expect(coveModule).toBeInTheDocument()
|
|
41
40
|
})
|
|
42
41
|
|
|
@@ -44,28 +43,36 @@ const testDataBiteRendering = async (canvasElement: HTMLElement, storyName: stri
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
export const Data_Bite_Circle_Average: Story = {
|
|
47
|
-
render: () =>
|
|
46
|
+
render: () => (
|
|
47
|
+
<DataBite configUrl='https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/Data_Bite_Circle_Average.json' />
|
|
48
|
+
),
|
|
48
49
|
play: async ({ canvasElement }) => {
|
|
49
50
|
await testDataBiteRendering(canvasElement, 'Data Bite Circle Average')
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
export const Data_Bite_Text_Max_Pic: Story = {
|
|
54
|
-
render: () =>
|
|
55
|
+
render: () => (
|
|
56
|
+
<DataBite configUrl='https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/Data_Bite_Text_Max_Pic.json' />
|
|
57
|
+
),
|
|
55
58
|
play: async ({ canvasElement }) => {
|
|
56
59
|
await testDataBiteRendering(canvasElement, 'Data Bite Text Max Pic')
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
export const Data_Bite_Circle_Sum: Story = {
|
|
61
|
-
render: () =>
|
|
64
|
+
render: () => (
|
|
65
|
+
<DataBite configUrl='https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/Data_Bite_Circle_Sum.json' />
|
|
66
|
+
),
|
|
62
67
|
play: async ({ canvasElement }) => {
|
|
63
68
|
await testDataBiteRendering(canvasElement, 'Data Bite Circle Sum')
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
export const Data_Bite_Text_Average_Pic: Story = {
|
|
68
|
-
render: () =>
|
|
73
|
+
render: () => (
|
|
74
|
+
<DataBite configUrl='https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/Data_Bite_Text_Average_Pic.json' />
|
|
75
|
+
),
|
|
69
76
|
play: async ({ canvasElement }) => {
|
|
70
77
|
await testDataBiteRendering(canvasElement, 'Data Bite Text Average Pic')
|
|
71
78
|
}
|
|
@@ -31,17 +31,19 @@ const testMapRendering = async (canvasElement: HTMLElement, storyName: string) =
|
|
|
31
31
|
const canvas = within(canvasElement)
|
|
32
32
|
|
|
33
33
|
await step('Wait for map to render', async () => {
|
|
34
|
-
const mapElement = await canvas
|
|
34
|
+
const mapElement = await canvas
|
|
35
|
+
.findByRole('img', { hidden: true }, { timeout: 10000 })
|
|
36
|
+
.catch(() => canvasElement.querySelector('canvas'))
|
|
35
37
|
expect(mapElement).toBeInTheDocument()
|
|
36
38
|
})
|
|
37
39
|
|
|
38
|
-
await step('Verify SVG element is present', async () => {
|
|
39
|
-
const
|
|
40
|
-
expect(
|
|
40
|
+
await step('Verify SVG or canvas element is present', async () => {
|
|
41
|
+
const vizElement = canvasElement.querySelector('svg, canvas')
|
|
42
|
+
expect(vizElement).toBeInTheDocument()
|
|
41
43
|
})
|
|
42
44
|
|
|
43
45
|
await step('Verify COVE module wrapper is present', async () => {
|
|
44
|
-
const coveModule = canvasElement.querySelector('.
|
|
46
|
+
const coveModule = canvasElement.querySelector('.cove-visualization')
|
|
45
47
|
expect(coveModule).toBeInTheDocument()
|
|
46
48
|
})
|
|
47
49
|
|
|
@@ -50,14 +52,14 @@ const testMapRendering = async (canvasElement: HTMLElement, storyName: string) =
|
|
|
50
52
|
|
|
51
53
|
// Bubble Maps
|
|
52
54
|
export const Bubble_Map_World: Story = {
|
|
53
|
-
render: () => <CdcMap configUrl=
|
|
55
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/example-Bubble-Map-world.json' />,
|
|
54
56
|
play: async ({ canvasElement }) => {
|
|
55
57
|
await testMapRendering(canvasElement, 'Bubble Map World')
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
export const Bubble_Map_US: Story = {
|
|
60
|
-
render: () => <CdcMap configUrl=
|
|
62
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/Example-Bubble-US-Data-Map.json' />,
|
|
61
63
|
play: async ({ canvasElement }) => {
|
|
62
64
|
await testMapRendering(canvasElement, 'Bubble Map US')
|
|
63
65
|
}
|
|
@@ -65,14 +67,16 @@ export const Bubble_Map_US: Story = {
|
|
|
65
67
|
|
|
66
68
|
// Categorical Maps
|
|
67
69
|
export const Categorical_Map_With_Special_Classes: Story = {
|
|
68
|
-
render: () =>
|
|
70
|
+
render: () => (
|
|
71
|
+
<CdcMap configUrl='https://www.cdc.gov/cove/data-files/Scale-Based-Categorical-Map-With-Special-Classes.json' />
|
|
72
|
+
),
|
|
69
73
|
play: async ({ canvasElement }) => {
|
|
70
74
|
await testMapRendering(canvasElement, 'Categorical Map With Special Classes')
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
export const Qualitative_Categorical_Map: Story = {
|
|
75
|
-
render: () => <CdcMap configUrl=
|
|
79
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/data-files/qualitative-map.json' />,
|
|
76
80
|
play: async ({ canvasElement }) => {
|
|
77
81
|
await testMapRendering(canvasElement, 'Qualitative Categorical Map')
|
|
78
82
|
}
|
|
@@ -80,7 +84,7 @@ export const Qualitative_Categorical_Map: Story = {
|
|
|
80
84
|
|
|
81
85
|
// Custom Layer Map
|
|
82
86
|
export const Custom_Layer_Map: Story = {
|
|
83
|
-
render: () => <CdcMap configUrl=
|
|
87
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/custom-layer-map.json' />,
|
|
84
88
|
play: async ({ canvasElement }) => {
|
|
85
89
|
await testMapRendering(canvasElement, 'Custom Layer Map')
|
|
86
90
|
}
|
|
@@ -88,14 +92,14 @@ export const Custom_Layer_Map: Story = {
|
|
|
88
92
|
|
|
89
93
|
// Filterable Data Maps
|
|
90
94
|
export const Map_Multiple_Filters: Story = {
|
|
91
|
-
render: () => <CdcMap configUrl=
|
|
95
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/map-multiple-filters.json' />,
|
|
92
96
|
play: async ({ canvasElement }) => {
|
|
93
97
|
await testMapRendering(canvasElement, 'Map Multiple Filters')
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
export const Map_Tab_Filters: Story = {
|
|
98
|
-
render: () => <CdcMap configUrl=
|
|
102
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/map-tab-filters.json' />,
|
|
99
103
|
play: async ({ canvasElement }) => {
|
|
100
104
|
await testMapRendering(canvasElement, 'Map Tab Filters')
|
|
101
105
|
}
|
|
@@ -103,7 +107,7 @@ export const Map_Tab_Filters: Story = {
|
|
|
103
107
|
|
|
104
108
|
// Geocode Map
|
|
105
109
|
export const US_Geocode_Map: Story = {
|
|
106
|
-
render: () => <CdcMap configUrl=
|
|
110
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/example-u-s-geo-code-dat.json' />,
|
|
107
111
|
play: async ({ canvasElement }) => {
|
|
108
112
|
await testMapRendering(canvasElement, 'US Geocode Map')
|
|
109
113
|
}
|
|
@@ -111,7 +115,7 @@ export const US_Geocode_Map: Story = {
|
|
|
111
115
|
|
|
112
116
|
// HHS Region Map
|
|
113
117
|
export const HHS_Regions_Map: Story = {
|
|
114
|
-
render: () => <CdcMap configUrl=
|
|
118
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/example-hhs-regions-data.json' />,
|
|
115
119
|
play: async ({ canvasElement }) => {
|
|
116
120
|
await testMapRendering(canvasElement, 'HHS Regions Map')
|
|
117
121
|
}
|
|
@@ -119,21 +123,21 @@ export const HHS_Regions_Map: Story = {
|
|
|
119
123
|
|
|
120
124
|
// Hex Maps
|
|
121
125
|
export const Standard_Hex_Map: Story = {
|
|
122
|
-
render: () => <CdcMap configUrl=
|
|
126
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/Hex_Map.json' />,
|
|
123
127
|
play: async ({ canvasElement }) => {
|
|
124
128
|
await testMapRendering(canvasElement, 'Standard Hex Map')
|
|
125
129
|
}
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
export const Hex_Map_With_Filter: Story = {
|
|
129
|
-
render: () => <CdcMap configUrl=
|
|
133
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/example-hex-map-with-filter.json' />,
|
|
130
134
|
play: async ({ canvasElement }) => {
|
|
131
135
|
await testMapRendering(canvasElement, 'Hex Map With Filter')
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
export const Hex_Map_With_Arrows: Story = {
|
|
136
|
-
render: () => <CdcMap configUrl=
|
|
140
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/Hex_Map_Arrows.json' />,
|
|
137
141
|
play: async ({ canvasElement }) => {
|
|
138
142
|
await testMapRendering(canvasElement, 'Hex Map With Arrows')
|
|
139
143
|
}
|
|
@@ -141,7 +145,7 @@ export const Hex_Map_With_Arrows: Story = {
|
|
|
141
145
|
|
|
142
146
|
// Map with Cities
|
|
143
147
|
export const US_Map_With_Cities: Story = {
|
|
144
|
-
render: () => <CdcMap configUrl=
|
|
148
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/city-data-map-example.json' />,
|
|
145
149
|
play: async ({ canvasElement }) => {
|
|
146
150
|
await testMapRendering(canvasElement, 'US Map With Cities')
|
|
147
151
|
}
|
|
@@ -149,14 +153,14 @@ export const US_Map_With_Cities: Story = {
|
|
|
149
153
|
|
|
150
154
|
// Navigation-Only Maps
|
|
151
155
|
export const US_Navigation_Map: Story = {
|
|
152
|
-
render: () => <CdcMap configUrl=
|
|
156
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/us-nav-map.json' />,
|
|
153
157
|
play: async ({ canvasElement }) => {
|
|
154
158
|
await testMapRendering(canvasElement, 'US Navigation Map')
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
161
|
|
|
158
162
|
export const World_Navigation_Map: Story = {
|
|
159
|
-
render: () => <CdcMap configUrl=
|
|
163
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/world-nav-map-example.json' />,
|
|
160
164
|
play: async ({ canvasElement }) => {
|
|
161
165
|
await testMapRendering(canvasElement, 'World Navigation Map')
|
|
162
166
|
}
|
|
@@ -164,21 +168,21 @@ export const World_Navigation_Map: Story = {
|
|
|
164
168
|
|
|
165
169
|
// Numeric Maps
|
|
166
170
|
export const Equal_Interval_Map: Story = {
|
|
167
|
-
render: () => <CdcMap configUrl=
|
|
171
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/equal-interval-map.json' />,
|
|
168
172
|
play: async ({ canvasElement }) => {
|
|
169
173
|
await testMapRendering(canvasElement, 'Equal Interval Map')
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
176
|
|
|
173
177
|
export const Equal_Number_Map: Story = {
|
|
174
|
-
render: () => <CdcMap configUrl=
|
|
178
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/equal-number-map.json' />,
|
|
175
179
|
play: async ({ canvasElement }) => {
|
|
176
180
|
await testMapRendering(canvasElement, 'Equal Number Map')
|
|
177
181
|
}
|
|
178
182
|
}
|
|
179
183
|
|
|
180
184
|
export const Equal_Number_Map_New_Quantile: Story = {
|
|
181
|
-
render: () => <CdcMap configUrl=
|
|
185
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/equal-number-map_new_quantile.json' />,
|
|
182
186
|
play: async ({ canvasElement }) => {
|
|
183
187
|
await testMapRendering(canvasElement, 'Equal Number Map New Quantile')
|
|
184
188
|
}
|
|
@@ -186,28 +190,33 @@ export const Equal_Number_Map_New_Quantile: Story = {
|
|
|
186
190
|
|
|
187
191
|
// Single State Maps
|
|
188
192
|
export const Single_State_Map_Counties: Story = {
|
|
189
|
-
render: () => <CdcMap configUrl=
|
|
193
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/example-data-map-counties.json' />,
|
|
190
194
|
play: async ({ canvasElement }) => {
|
|
191
195
|
await testMapRendering(canvasElement, 'Single State Map Counties')
|
|
192
196
|
}
|
|
193
197
|
}
|
|
194
198
|
|
|
199
|
+
/*
|
|
200
|
+
Commented out because the config is pointing at a data file on wcms-wp.cdc.gov which is not accessible.
|
|
195
201
|
export const Single_State_With_Census_Toggle: Story = {
|
|
196
202
|
render: () => <CdcMap configUrl="https://www.cdc.gov/cove/examples/single-state-map-with-census-toggle.json" />,
|
|
197
203
|
play: async ({ canvasElement }) => {
|
|
198
204
|
await testMapRendering(canvasElement, 'Single State With Census Toggle')
|
|
199
205
|
}
|
|
200
206
|
}
|
|
207
|
+
*/
|
|
201
208
|
|
|
202
209
|
export const Single_State_Filter_With_Zoom: Story = {
|
|
203
|
-
render: () => <CdcMap configUrl=
|
|
210
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/single-state-filter-change-with-zoom.json' />,
|
|
204
211
|
play: async ({ canvasElement }) => {
|
|
205
212
|
await testMapRendering(canvasElement, 'Single State Filter With Zoom')
|
|
206
213
|
}
|
|
207
214
|
}
|
|
208
215
|
|
|
209
216
|
export const Multi_State_County_Map: Story = {
|
|
210
|
-
render: () =>
|
|
217
|
+
render: () => (
|
|
218
|
+
<CdcMap configUrl='https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/multistate-county-map.json' />
|
|
219
|
+
),
|
|
211
220
|
play: async ({ canvasElement }) => {
|
|
212
221
|
await testMapRendering(canvasElement, 'Multi State County Map')
|
|
213
222
|
}
|
|
@@ -215,7 +224,7 @@ export const Multi_State_County_Map: Story = {
|
|
|
215
224
|
|
|
216
225
|
// US County Map
|
|
217
226
|
export const US_County_Level_Map: Story = {
|
|
218
|
-
render: () => <CdcMap configUrl=
|
|
227
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/US-County-Level-Map.json' />,
|
|
219
228
|
play: async ({ canvasElement }) => {
|
|
220
229
|
await testMapRendering(canvasElement, 'US County Level Map')
|
|
221
230
|
}
|
|
@@ -223,7 +232,7 @@ export const US_County_Level_Map: Story = {
|
|
|
223
232
|
|
|
224
233
|
// World Map
|
|
225
234
|
export const World_Data_Map: Story = {
|
|
226
|
-
render: () => <CdcMap configUrl=
|
|
235
|
+
render: () => <CdcMap configUrl='https://www.cdc.gov/cove/examples/world-data-map-example.json' />,
|
|
227
236
|
play: async ({ canvasElement }) => {
|
|
228
237
|
await testMapRendering(canvasElement, 'World Data Map')
|
|
229
238
|
}
|
|
@@ -54,7 +54,7 @@ const testWaffleChartRendering = async (canvasElement: HTMLElement, storyName: s
|
|
|
54
54
|
})
|
|
55
55
|
|
|
56
56
|
await step('Verify waffle chart container is present', async () => {
|
|
57
|
-
const waffleContainer = canvasElement.querySelector('.cove-waffle-chart')
|
|
57
|
+
const waffleContainer = canvasElement.querySelector('.cove-waffle-chart, .cove-gauge-chart')
|
|
58
58
|
expect(waffleContainer).toBeInTheDocument()
|
|
59
59
|
})
|
|
60
60
|
|
|
@@ -16,7 +16,8 @@ const meta: Meta = {
|
|
|
16
16
|
layout: 'fullscreen',
|
|
17
17
|
docs: {
|
|
18
18
|
description: {
|
|
19
|
-
component:
|
|
19
|
+
component:
|
|
20
|
+
'Stories for visualizations from the CDC ART (Assisted Reproductive Technology) Surveillance State-Specific page (https://www.cdc.gov/art/php/surveillance-state-specific/index.html)'
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
},
|
|
@@ -140,7 +141,7 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
|
|
|
140
141
|
const timeout = 20000
|
|
141
142
|
|
|
142
143
|
const checkDashboard = () => {
|
|
143
|
-
const dashboardElement = canvasElement.querySelector('.
|
|
144
|
+
const dashboardElement = canvasElement.querySelector('.type-dashboard')
|
|
144
145
|
const loadingDiv = canvasElement.querySelector('div')
|
|
145
146
|
|
|
146
147
|
// Log current state for debugging
|
|
@@ -161,12 +162,12 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
|
|
|
161
162
|
})
|
|
162
163
|
|
|
163
164
|
await step('Verify dashboard wrapper is present', async () => {
|
|
164
|
-
const dashboard = canvasElement.querySelector('.
|
|
165
|
+
const dashboard = canvasElement.querySelector('.type-dashboard')
|
|
165
166
|
expect(dashboard).toBeInTheDocument()
|
|
166
167
|
})
|
|
167
168
|
|
|
168
169
|
await step('Verify at least one visualization rendered', async () => {
|
|
169
|
-
const coveModules = canvasElement.querySelectorAll('.
|
|
170
|
+
const coveModules = canvasElement.querySelectorAll('.cove-visualization')
|
|
170
171
|
expect(coveModules.length).toBeGreaterThan(0)
|
|
171
172
|
})
|
|
172
173
|
|