@cdc/core 4.26.1 → 4.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/.claude/agents/qa-test-developer.md +126 -0
  2. package/CLAUDE.local.md +67 -0
  3. package/_stories/Gallery.Charts.stories.tsx +34 -41
  4. package/_stories/Gallery.DataBite.stories.tsx +14 -7
  5. package/_stories/Gallery.Maps.stories.tsx +36 -27
  6. package/_stories/Gallery.WaffleChart.stories.tsx +1 -1
  7. package/_stories/PageART.stories.tsx +4 -3
  8. package/_stories/PageBRFSS.stories.tsx +20 -15
  9. package/_stories/PageCancerRegistries.stories.tsx +14 -14
  10. package/_stories/PageEasternEquineEncephalitis.stories.tsx +30 -16
  11. package/_stories/PageExcessiveAlcoholUse.stories.tsx +148 -143
  12. package/_stories/PageMaternalMortality.stories.tsx +4 -3
  13. package/_stories/PageOralHealth.stories.tsx +14 -9
  14. package/_stories/PageSmokingTobacco.stories.tsx +14 -9
  15. package/_stories/PageStateDiabetesProfiles.stories.tsx +14 -9
  16. package/_stories/PageWastewater.stories.tsx +40 -26
  17. package/_stories/VegaImport.stories.tsx +401 -0
  18. package/_stories/vega-fixtures/bars-with-line.json +444 -0
  19. package/_stories/vega-fixtures/bars.json +58 -0
  20. package/_stories/vega-fixtures/combo-bar-rolling-mean.json +88 -0
  21. package/_stories/vega-fixtures/combo.json +68 -0
  22. package/_stories/vega-fixtures/grouped-horizontal-bars.json +83 -0
  23. package/_stories/vega-fixtures/grouped-horizontal-bars2.json +231 -0
  24. package/_stories/vega-fixtures/horizontal-bar.json +427 -0
  25. package/_stories/vega-fixtures/horizontal-bars-with-bad-colors.json +197 -0
  26. package/_stories/vega-fixtures/horizontal-bars2.json +58 -0
  27. package/_stories/vega-fixtures/lines.json +227 -0
  28. package/_stories/vega-fixtures/measles-bars.json +348 -0
  29. package/_stories/vega-fixtures/measles-map.json +11101 -0
  30. package/_stories/vega-fixtures/measles-stacked-bars.json +2147 -0
  31. package/_stories/vega-fixtures/multi-dataset.json +255 -0
  32. package/_stories/vega-fixtures/no-data.json +14 -0
  33. package/_stories/vega-fixtures/pie-chart.json +94 -0
  34. package/_stories/vega-fixtures/repeat-spec.json +47 -0
  35. package/_stories/vega-fixtures/stacked-area.json +222 -0
  36. package/_stories/vega-fixtures/stacked-bar-with-rect.json +3412 -0
  37. package/_stories/vega-fixtures/stacked-bars-with-line.json +364 -0
  38. package/_stories/vega-fixtures/stacked-bars.json +212 -0
  39. package/_stories/vega-fixtures/stacked-horizontal-bars.json +140 -0
  40. package/_stories/vega-fixtures/warning-combo.json +59 -0
  41. package/_stories/vega-fixtures/warning-scatter-and-line.json +1182 -0
  42. package/assets/icon-chart-area.svg +1 -0
  43. package/assets/icon-chart-radar.svg +23 -0
  44. package/assets/logo2.svg +31 -0
  45. package/components/AdvancedEditor/EmbedEditor.tsx +270 -38
  46. package/components/CustomColorsEditor/CustomColorsEditor.tsx +3 -10
  47. package/components/DataTable/helpers/getSeriesName.ts +6 -0
  48. package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +14 -6
  49. package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +4 -0
  50. package/components/EditorPanel/VizFilterEditor/components/FilterOrder.tsx +33 -29
  51. package/components/Layout/components/Sidebar/components/sidebar.styles.scss +2 -2
  52. package/components/Layout/components/Visualization/index.tsx +11 -0
  53. package/components/MediaControls.tsx +0 -1
  54. package/components/_stories/CustomColorsEditor.stories.tsx +37 -0
  55. package/components/_stories/DataTable.stories.tsx +1 -0
  56. package/data/colorPalettes.ts +18 -5
  57. package/data/mapColorPalettes.ts +10 -0
  58. package/devTemplate/dev.js +235 -0
  59. package/devTemplate/index.html +30 -0
  60. package/devTemplate/preview.html +1503 -0
  61. package/devTemplate/sidebar.css +151 -0
  62. package/dist/cove-main.css +2803 -4471
  63. package/dist/cove-main.css.map +1 -1
  64. package/generateViteConfig.js +111 -2
  65. package/helpers/DataTransform.ts +1 -5
  66. package/helpers/cove/date.ts +33 -1
  67. package/helpers/cove/string.ts +29 -0
  68. package/helpers/coveUpdateWorker.ts +3 -1
  69. package/helpers/embed/embedCodeGenerator.ts +80 -0
  70. package/helpers/embed/embedHelper.js +158 -0
  71. package/helpers/embed/filterUtils.ts +121 -0
  72. package/helpers/embed/index.ts +21 -0
  73. package/helpers/embed/urlValidation.ts +119 -0
  74. package/helpers/filterVizData.ts +6 -1
  75. package/helpers/getFileExtension.ts +0 -6
  76. package/helpers/metrics/types.ts +3 -0
  77. package/helpers/palettes/colorDistributions.ts +1 -1
  78. package/helpers/palettes/utils.ts +12 -12
  79. package/helpers/parseCsvWithQuotes.ts +15 -14
  80. package/helpers/prepareScreenshot.ts +27 -7
  81. package/helpers/testing.ts +44 -0
  82. package/helpers/tests/DataTransform.test.ts +125 -0
  83. package/helpers/tests/date.test.ts +64 -0
  84. package/helpers/vegaConfig.ts +1 -1
  85. package/helpers/vegaConfigImport.ts +160 -0
  86. package/helpers/ver/4.26.1.ts +1 -1
  87. package/helpers/ver/4.26.2.ts +84 -0
  88. package/helpers/ver/tests/4.26.1.test.ts +105 -0
  89. package/helpers/ver/tests/4.26.2.test.ts +298 -0
  90. package/helpers/viewports.ts +2 -0
  91. package/package.json +27 -32
  92. package/styles/v2/components/editor.scss +9 -9
  93. package/styles/v2/utils/_grid.scss +8 -3
  94. package/types/Annotation.ts +10 -11
  95. package/types/General.ts +2 -0
  96. package/types/Palette.ts +21 -0
  97. package/types/Visualization.ts +6 -0
  98. package/_stories/StoryRenderingTests.stories.tsx +0 -164
  99. package/helpers/embedCodeGenerator.ts +0 -109
@@ -5,171 +5,176 @@ import { useEffect, useState } from 'react'
5
5
 
6
6
  // Fallback step function for test descriptions
7
7
  const step = async (description: string, fn: () => Promise<void> | void) => {
8
- console.log(`▶ ${description}`)
9
- await fn()
10
- console.log(`✓ ${description}`)
8
+ console.log(`▶ ${description}`)
9
+ await fn()
10
+ console.log(`✓ ${description}`)
11
11
  }
12
12
 
13
13
  const meta: Meta = {
14
- title: 'Regression Tests/Pages/Excessive Alcohol Use',
15
- parameters: {
16
- layout: 'fullscreen',
17
- docs: {
18
- description: {
19
- component: 'Stories for visualizations from the CDC Excessive Alcohol Use page (https://www.cdc.gov/alcohol/fact-sheets/states/excessive-alcohol-use-united-states.html)'
20
- }
21
- }
22
- },
23
- tags: ['autodocs']
14
+ title: 'Regression Tests/Pages/Excessive Alcohol Use',
15
+ parameters: {
16
+ layout: 'fullscreen',
17
+ docs: {
18
+ description: {
19
+ component:
20
+ 'Stories for visualizations from the CDC Excessive Alcohol Use page (https://www.cdc.gov/alcohol/fact-sheets/states/excessive-alcohol-use-united-states.html)'
21
+ }
22
+ }
23
+ },
24
+ tags: ['autodocs']
24
25
  }
25
26
 
26
27
  export default meta
27
28
 
28
29
  // Config URL from the excessive alcohol use page
29
30
  const CONFIG_URLS = {
30
- excessiveAlcoholUse: 'https://www.cdc.gov/alcohol/fact-sheets/states/alcohol-data-for-50-states.json'
31
+ excessiveAlcoholUse: 'https://www.cdc.gov/alcohol/fact-sheets/states/alcohol-data-for-50-states.json'
31
32
  }
32
33
 
33
34
  // Helper to fetch config and update data URLs to use absolute cdc.gov paths
34
35
  const useConfigWithAbsoluteDataUrl = (configUrl: string) => {
35
- const [config, setConfig] = useState(null)
36
-
37
- useEffect(() => {
38
- fetch(configUrl)
39
- .then(res => res.json())
40
- .then(data => {
41
- // Convert relative data URLs to absolute cdc.gov URLs
42
- if (data.dataUrl) {
43
- // Handle different relative path formats (../../path or /path)
44
- const dataUrl = data.dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
45
- data.dataUrl = `https://www.cdc.gov/${dataUrl}`
46
- }
47
- if (data.dataFileName) {
48
- const dataFileName = data.dataFileName.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
49
- data.dataFileName = `https://www.cdc.gov/${dataFileName}`
50
- }
36
+ const [config, setConfig] = useState(null)
37
+
38
+ useEffect(() => {
39
+ fetch(configUrl)
40
+ .then(res => res.json())
41
+ .then(data => {
42
+ // Convert relative data URLs to absolute cdc.gov URLs
43
+ if (data.dataUrl) {
44
+ // Handle different relative path formats (../../path or /path)
45
+ const dataUrl = data.dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
46
+ data.dataUrl = `https://www.cdc.gov/${dataUrl}`
47
+ }
48
+ if (data.dataFileName) {
49
+ const dataFileName = data.dataFileName.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
50
+ data.dataFileName = `https://www.cdc.gov/${dataFileName}`
51
+ }
51
52
 
52
- // For dashboard configs with multiDashboards, convert dataKey references in visualizations
53
- if (data.multiDashboards) {
54
- data.multiDashboards.forEach((dashboard: any) => {
55
- if (dashboard.visualizations) {
56
- Object.values(dashboard.visualizations).forEach((viz: any) => {
57
- // Only convert dataKey if it's a URL path (starts with / or ../)
58
- if (viz.dataKey && (viz.dataKey.startsWith('/') || viz.dataKey.startsWith('../'))) {
59
- const dataKey = viz.dataKey.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
60
- viz.dataKey = `https://www.cdc.gov/${dataKey}`
61
- }
62
- })
63
- }
64
- })
53
+ // For dashboard configs with multiDashboards, convert dataKey references in visualizations
54
+ if (data.multiDashboards) {
55
+ data.multiDashboards.forEach((dashboard: any) => {
56
+ if (dashboard.visualizations) {
57
+ Object.values(dashboard.visualizations).forEach((viz: any) => {
58
+ // Only convert dataKey if it's a URL path (starts with / or ../)
59
+ if (viz.dataKey && (viz.dataKey.startsWith('/') || viz.dataKey.startsWith('../'))) {
60
+ const dataKey = viz.dataKey.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
61
+ viz.dataKey = `https://www.cdc.gov/${dataKey}`
65
62
  }
63
+ })
64
+ }
65
+ })
66
+ }
66
67
 
67
- // For dashboard configs, convert dataKey references in visualizations
68
- if (data.visualizations) {
69
- Object.values(data.visualizations).forEach((viz: any) => {
70
- // Only convert dataKey if it's a URL path (starts with / or ../)
71
- if (viz.dataKey && (viz.dataKey.startsWith('/') || viz.dataKey.startsWith('../'))) {
72
- const dataKey = viz.dataKey.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
73
- viz.dataKey = `https://www.cdc.gov/${dataKey}`
74
- }
75
- })
76
- }
68
+ // For dashboard configs, convert dataKey references in visualizations
69
+ if (data.visualizations) {
70
+ Object.values(data.visualizations).forEach((viz: any) => {
71
+ // Only convert dataKey if it's a URL path (starts with / or ../)
72
+ if (viz.dataKey && (viz.dataKey.startsWith('/') || viz.dataKey.startsWith('../'))) {
73
+ const dataKey = viz.dataKey.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
74
+ viz.dataKey = `https://www.cdc.gov/${dataKey}`
75
+ }
76
+ })
77
+ }
77
78
 
78
- // For dashboard configs, convert datasets only if they reference external files
79
- if (data.datasets) {
80
- const newDatasets = {}
81
- Object.entries(data.datasets).forEach(([key, dataset]: [string, any]) => {
82
- // Check if dataset has embedded data
83
- const hasEmbeddedData = (dataset as any).data && Array.isArray((dataset as any).data)
84
-
85
- // If data is embedded, keep the original key
86
- if (hasEmbeddedData) {
87
- newDatasets[key] = dataset
88
- } else {
89
- // Otherwise, convert paths to absolute URLs (but keep absolute URLs as-is)
90
- const newKey = key.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
91
- const absoluteKey = key.startsWith('http') ? key : `https://www.cdc.gov/${newKey}`
92
-
93
- newDatasets[absoluteKey] = {
94
- ...dataset,
95
- dataFileName: (dataset as any).dataFileName && !(dataset as any).dataFileName.startsWith('http')
96
- ? `https://www.cdc.gov/${(dataset as any).dataFileName.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
97
- : (dataset as any).dataFileName,
98
- dataUrl: (dataset as any).dataUrl && !(dataset as any).dataUrl.startsWith('http')
99
- ? `https://www.cdc.gov/${(dataset as any).dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
100
- : (dataset as any).dataUrl
101
- }
102
- }
103
- })
104
- data.datasets = newDatasets
105
- }
79
+ // For dashboard configs, convert datasets only if they reference external files
80
+ if (data.datasets) {
81
+ const newDatasets = {}
82
+ Object.entries(data.datasets).forEach(([key, dataset]: [string, any]) => {
83
+ // Check if dataset has embedded data
84
+ const hasEmbeddedData = (dataset as any).data && Array.isArray((dataset as any).data)
85
+
86
+ // If data is embedded, keep the original key
87
+ if (hasEmbeddedData) {
88
+ newDatasets[key] = dataset
89
+ } else {
90
+ // Otherwise, convert paths to absolute URLs (but keep absolute URLs as-is)
91
+ const newKey = key.replace(/^(\.\.\/)+/, '').replace(/^\//, '')
92
+ const absoluteKey = key.startsWith('http') ? key : `https://www.cdc.gov/${newKey}`
93
+
94
+ newDatasets[absoluteKey] = {
95
+ ...dataset,
96
+ dataFileName:
97
+ (dataset as any).dataFileName && !(dataset as any).dataFileName.startsWith('http')
98
+ ? `https://www.cdc.gov/${(dataset as any).dataFileName
99
+ .replace(/^(\.\.\/)+/, '')
100
+ .replace(/^\//, '')}`
101
+ : (dataset as any).dataFileName,
102
+ dataUrl:
103
+ (dataset as any).dataUrl && !(dataset as any).dataUrl.startsWith('http')
104
+ ? `https://www.cdc.gov/${(dataset as any).dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
105
+ : (dataset as any).dataUrl
106
+ }
107
+ }
108
+ })
109
+ data.datasets = newDatasets
110
+ }
106
111
 
107
- // Set activeDashboard to 0 if it's null and multiDashboards exist
108
- if (data.multiDashboards && data.multiDashboards.length > 0 && data.activeDashboard === null) {
109
- data.activeDashboard = 0
110
- }
112
+ // Set activeDashboard to 0 if it's null and multiDashboards exist
113
+ if (data.multiDashboards && data.multiDashboards.length > 0 && data.activeDashboard === null) {
114
+ data.activeDashboard = 0
115
+ }
116
+
117
+ // Log config info for debugging
118
+ console.log('✓ Config loaded:', {
119
+ type: data.type,
120
+ hasMultiDashboards: !!data.multiDashboards,
121
+ dashboardCount: data.multiDashboards?.length || 0,
122
+ activeDashboard: data.activeDashboard,
123
+ datasetCount: Object.keys(data.datasets || {}).length,
124
+ dashboardLabels: data.multiDashboards?.map((d: any) => d.label)
125
+ })
111
126
 
112
- // Log config info for debugging
113
- console.log('✓ Config loaded:', {
114
- type: data.type,
115
- hasMultiDashboards: !!data.multiDashboards,
116
- dashboardCount: data.multiDashboards?.length || 0,
117
- activeDashboard: data.activeDashboard,
118
- datasetCount: Object.keys(data.datasets || {}).length,
119
- dashboardLabels: data.multiDashboards?.map((d: any) => d.label)
120
- })
121
-
122
- setConfig(data)
123
- })
124
- .catch(err => {
125
- console.error('Failed to fetch config:', configUrl, err)
126
- })
127
- }, [configUrl])
128
-
129
- return config
127
+ setConfig(data)
128
+ })
129
+ .catch(err => {
130
+ console.error('Failed to fetch config:', configUrl, err)
131
+ })
132
+ }, [configUrl])
133
+
134
+ return config
130
135
  }
131
136
 
132
137
  type DashboardStory = StoryObj<typeof Dashboard>
133
138
 
134
139
  // Helper function to test dashboard rendering
135
140
  const testDashboardRendering = async (canvasElement: HTMLElement, storyName: string) => {
136
- await step('Wait for dashboard to render', async () => {
137
- await new Promise<void>((resolve, reject) => {
138
- const startTime = Date.now()
139
- const timeout = 30000 // Longer timeout for external data loading
140
-
141
- const checkDashboard = () => {
142
- const dashboardElement = canvasElement.querySelector('.cove-dashboard')
143
- const loadingDiv = canvasElement.querySelector('div')
144
-
145
- // Log current state for debugging
146
- if (!dashboardElement && loadingDiv?.textContent?.includes('Loading')) {
147
- console.log('Still loading config...')
148
- }
141
+ await step('Wait for dashboard to render', async () => {
142
+ await new Promise<void>((resolve, reject) => {
143
+ const startTime = Date.now()
144
+ const timeout = 30000 // Longer timeout for external data loading
145
+
146
+ const checkDashboard = () => {
147
+ const dashboardElement = canvasElement.querySelector('.type-dashboard')
148
+ const loadingDiv = canvasElement.querySelector('div')
149
+
150
+ // Log current state for debugging
151
+ if (!dashboardElement && loadingDiv?.textContent?.includes('Loading')) {
152
+ console.log('Still loading config...')
153
+ }
149
154
 
150
- if (dashboardElement) {
151
- resolve()
152
- } else if (Date.now() - startTime > timeout) {
153
- reject(new Error(`Timeout: Dashboard element not found after ${timeout}ms`))
154
- } else {
155
- setTimeout(checkDashboard, 100)
156
- }
157
- }
158
- checkDashboard()
159
- })
155
+ if (dashboardElement) {
156
+ resolve()
157
+ } else if (Date.now() - startTime > timeout) {
158
+ reject(new Error(`Timeout: Dashboard element not found after ${timeout}ms`))
159
+ } else {
160
+ setTimeout(checkDashboard, 100)
161
+ }
162
+ }
163
+ checkDashboard()
160
164
  })
165
+ })
161
166
 
162
- await step('Verify dashboard wrapper is present', async () => {
163
- const dashboard = canvasElement.querySelector('.cove-dashboard')
164
- expect(dashboard).toBeInTheDocument()
165
- })
167
+ await step('Verify dashboard wrapper is present', async () => {
168
+ const dashboard = canvasElement.querySelector('.type-dashboard')
169
+ expect(dashboard).toBeInTheDocument()
170
+ })
166
171
 
167
- await step('Verify at least one visualization rendered', async () => {
168
- const coveModules = canvasElement.querySelectorAll('.cdc-open-viz-module')
169
- expect(coveModules.length).toBeGreaterThan(0)
170
- })
172
+ await step('Verify at least one visualization rendered', async () => {
173
+ const coveModules = canvasElement.querySelectorAll('.cdc-open-viz-module')
174
+ expect(coveModules.length).toBeGreaterThan(0)
175
+ })
171
176
 
172
- console.log(`✓ ${storyName} dashboard rendered successfully`)
177
+ console.log(`✓ ${storyName} dashboard rendered successfully`)
173
178
  }
174
179
 
175
180
  /**
@@ -185,12 +190,12 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
185
190
  * - State-specific alcohol consumption trends
186
191
  */
187
192
  export const Excessive_Alcohol_Use_Dashboard: DashboardStory = {
188
- render: () => {
189
- const config = useConfigWithAbsoluteDataUrl(CONFIG_URLS.excessiveAlcoholUse)
190
- if (!config) return <div>Loading...</div>
191
- return <Dashboard config={config} />
192
- },
193
- play: async ({ canvasElement }) => {
194
- await testDashboardRendering(canvasElement, 'Excessive Alcohol Use Dashboard')
195
- }
193
+ render: () => {
194
+ const config = useConfigWithAbsoluteDataUrl(CONFIG_URLS.excessiveAlcoholUse)
195
+ if (!config) return <div>Loading...</div>
196
+ return <Dashboard config={config} />
197
+ },
198
+ play: async ({ canvasElement }) => {
199
+ await testDashboardRendering(canvasElement, 'Excessive Alcohol Use Dashboard')
200
+ }
196
201
  }
@@ -16,7 +16,8 @@ const meta: Meta = {
16
16
  layout: 'fullscreen',
17
17
  docs: {
18
18
  description: {
19
- component: 'Stories for visualizations from the CDC Pregnancy Mortality Surveillance System (PMSS) page (https://www.cdc.gov/maternal-mortality/php/pregnancy-mortality-surveillance-data/index.html)'
19
+ component:
20
+ 'Stories for visualizations from the CDC Pregnancy Mortality Surveillance System (PMSS) page (https://www.cdc.gov/maternal-mortality/php/pregnancy-mortality-surveillance-data/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('.cove-dashboard')
144
+ const dashboardElement = canvasElement.querySelector('.type-dashboard')
144
145
  const loadingDiv = canvasElement.querySelector('div')
145
146
 
146
147
  // Log current state for debugging
@@ -161,7 +162,7 @@ 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('.cove-dashboard')
165
+ const dashboard = canvasElement.querySelector('.type-dashboard')
165
166
  expect(dashboard).toBeInTheDocument()
166
167
  })
167
168
 
@@ -16,7 +16,8 @@ const meta: Meta = {
16
16
  layout: 'fullscreen',
17
17
  docs: {
18
18
  description: {
19
- component: 'Stories for visualizations from the CDC Oral Health Data page (https://www.cdc.gov/oral-health-data-systems/oral_health_data/oral-health-dashboard.html)'
19
+ component:
20
+ 'Stories for visualizations from the CDC Oral Health Data page (https://www.cdc.gov/oral-health-data-systems/oral_health_data/oral-health-dashboard.html)'
20
21
  }
21
22
  }
22
23
  },
@@ -92,12 +93,16 @@ const useConfigWithAbsoluteDataUrl = (configUrl: string) => {
92
93
 
93
94
  newDatasets[absoluteKey] = {
94
95
  ...dataset,
95
- dataFileName: (dataset as any).dataFileName && !(dataset as any).dataFileName.startsWith('http')
96
- ? `https://www.cdc.gov/${(dataset as any).dataFileName.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
97
- : (dataset as any).dataFileName,
98
- dataUrl: (dataset as any).dataUrl && !(dataset as any).dataUrl.startsWith('http')
99
- ? `https://www.cdc.gov/${(dataset as any).dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
100
- : (dataset as any).dataUrl
96
+ dataFileName:
97
+ (dataset as any).dataFileName && !(dataset as any).dataFileName.startsWith('http')
98
+ ? `https://www.cdc.gov/${(dataset as any).dataFileName
99
+ .replace(/^(\.\.\/)+/, '')
100
+ .replace(/^\//, '')}`
101
+ : (dataset as any).dataFileName,
102
+ dataUrl:
103
+ (dataset as any).dataUrl && !(dataset as any).dataUrl.startsWith('http')
104
+ ? `https://www.cdc.gov/${(dataset as any).dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
105
+ : (dataset as any).dataUrl
101
106
  }
102
107
  }
103
108
  })
@@ -139,7 +144,7 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
139
144
  const timeout = 30000 // Longer timeout for external data loading
140
145
 
141
146
  const checkDashboard = () => {
142
- const dashboardElement = canvasElement.querySelector('.cove-dashboard')
147
+ const dashboardElement = canvasElement.querySelector('.type-dashboard')
143
148
  const loadingDiv = canvasElement.querySelector('div')
144
149
 
145
150
  // Log current state for debugging
@@ -160,7 +165,7 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
160
165
  })
161
166
 
162
167
  await step('Verify dashboard wrapper is present', async () => {
163
- const dashboard = canvasElement.querySelector('.cove-dashboard')
168
+ const dashboard = canvasElement.querySelector('.type-dashboard')
164
169
  expect(dashboard).toBeInTheDocument()
165
170
  })
166
171
 
@@ -16,7 +16,8 @@ const meta: Meta = {
16
16
  layout: 'fullscreen',
17
17
  docs: {
18
18
  description: {
19
- component: 'Stories for visualizations from the CDC Global Tobacco Surveillance System (GTSS) Data Explorer page (https://www.cdc.gov/tobacco/global/gtss/data-explorer/index.html)'
19
+ component:
20
+ 'Stories for visualizations from the CDC Global Tobacco Surveillance System (GTSS) Data Explorer page (https://www.cdc.gov/tobacco/global/gtss/data-explorer/index.html)'
20
21
  }
21
22
  }
22
23
  },
@@ -92,12 +93,16 @@ const useConfigWithAbsoluteDataUrl = (configUrl: string) => {
92
93
 
93
94
  newDatasets[absoluteKey] = {
94
95
  ...dataset,
95
- dataFileName: (dataset as any).dataFileName && !(dataset as any).dataFileName.startsWith('http')
96
- ? `https://www.cdc.gov/${(dataset as any).dataFileName.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
97
- : (dataset as any).dataFileName,
98
- dataUrl: (dataset as any).dataUrl && !(dataset as any).dataUrl.startsWith('http')
99
- ? `https://www.cdc.gov/${(dataset as any).dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
100
- : (dataset as any).dataUrl
96
+ dataFileName:
97
+ (dataset as any).dataFileName && !(dataset as any).dataFileName.startsWith('http')
98
+ ? `https://www.cdc.gov/${(dataset as any).dataFileName
99
+ .replace(/^(\.\.\/)+/, '')
100
+ .replace(/^\//, '')}`
101
+ : (dataset as any).dataFileName,
102
+ dataUrl:
103
+ (dataset as any).dataUrl && !(dataset as any).dataUrl.startsWith('http')
104
+ ? `https://www.cdc.gov/${(dataset as any).dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
105
+ : (dataset as any).dataUrl
101
106
  }
102
107
  }
103
108
  })
@@ -139,7 +144,7 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
139
144
  const timeout = 30000 // Longer timeout for external data loading
140
145
 
141
146
  const checkDashboard = () => {
142
- const dashboardElement = canvasElement.querySelector('.cove-dashboard')
147
+ const dashboardElement = canvasElement.querySelector('.type-dashboard')
143
148
  const loadingDiv = canvasElement.querySelector('div')
144
149
 
145
150
  // Log current state for debugging
@@ -160,7 +165,7 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
160
165
  })
161
166
 
162
167
  await step('Verify dashboard wrapper is present', async () => {
163
- const dashboard = canvasElement.querySelector('.cove-dashboard')
168
+ const dashboard = canvasElement.querySelector('.type-dashboard')
164
169
  expect(dashboard).toBeInTheDocument()
165
170
  })
166
171
 
@@ -16,7 +16,8 @@ const meta: Meta = {
16
16
  layout: 'fullscreen',
17
17
  docs: {
18
18
  description: {
19
- component: 'Stories for visualizations from the CDC State Diabetes Profiles page (https://www.cdc.gov/diabetes-state-local/php/state-profiles/index.html)'
19
+ component:
20
+ 'Stories for visualizations from the CDC State Diabetes Profiles page (https://www.cdc.gov/diabetes-state-local/php/state-profiles/index.html)'
20
21
  }
21
22
  }
22
23
  },
@@ -92,12 +93,16 @@ const useConfigWithAbsoluteDataUrl = (configUrl: string) => {
92
93
 
93
94
  newDatasets[absoluteKey] = {
94
95
  ...dataset,
95
- dataFileName: (dataset as any).dataFileName && !(dataset as any).dataFileName.startsWith('http')
96
- ? `https://www.cdc.gov/${(dataset as any).dataFileName.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
97
- : (dataset as any).dataFileName,
98
- dataUrl: (dataset as any).dataUrl && !(dataset as any).dataUrl.startsWith('http')
99
- ? `https://www.cdc.gov/${(dataset as any).dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
100
- : (dataset as any).dataUrl
96
+ dataFileName:
97
+ (dataset as any).dataFileName && !(dataset as any).dataFileName.startsWith('http')
98
+ ? `https://www.cdc.gov/${(dataset as any).dataFileName
99
+ .replace(/^(\.\.\/)+/, '')
100
+ .replace(/^\//, '')}`
101
+ : (dataset as any).dataFileName,
102
+ dataUrl:
103
+ (dataset as any).dataUrl && !(dataset as any).dataUrl.startsWith('http')
104
+ ? `https://www.cdc.gov/${(dataset as any).dataUrl.replace(/^(\.\.\/)+/, '').replace(/^\//, '')}`
105
+ : (dataset as any).dataUrl
101
106
  }
102
107
  }
103
108
  })
@@ -139,7 +144,7 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
139
144
  const timeout = 30000 // Longer timeout for external data loading
140
145
 
141
146
  const checkDashboard = () => {
142
- const dashboardElement = canvasElement.querySelector('.cove-dashboard')
147
+ const dashboardElement = canvasElement.querySelector('.type-dashboard')
143
148
  const loadingDiv = canvasElement.querySelector('div')
144
149
 
145
150
  // Log current state for debugging
@@ -160,7 +165,7 @@ const testDashboardRendering = async (canvasElement: HTMLElement, storyName: str
160
165
  })
161
166
 
162
167
  await step('Verify dashboard wrapper is present', async () => {
163
- const dashboard = canvasElement.querySelector('.cove-dashboard')
168
+ const dashboard = canvasElement.querySelector('.type-dashboard')
164
169
  expect(dashboard).toBeInTheDocument()
165
170
  })
166
171