@cdc/map 4.26.2 → 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.
Files changed (118) hide show
  1. package/CONFIG.md +235 -0
  2. package/README.md +70 -24
  3. package/dist/cdcmap-CY9IcPSi.es.js +6 -0
  4. package/dist/cdcmap-DlpiY3fQ.es.js +4 -0
  5. package/dist/cdcmap.js +31260 -27946
  6. package/examples/{testing-layer-2.json → __data__/testing-layer-2.json} +1 -1
  7. package/examples/{testing-layer.json → __data__/testing-layer.json} +1 -1
  8. package/examples/county-hsa-toggle.json +51993 -0
  9. package/examples/custom-map-layers.json +2 -2
  10. package/examples/default-county.json +3 -3
  11. package/examples/minimal-example.json +69 -0
  12. package/examples/private/annotation-bug.json +642 -0
  13. package/examples/private/css-issue.json +314 -0
  14. package/examples/private/region-breaking.json +1639 -0
  15. package/examples/private/test1.json +27247 -0
  16. package/package.json +4 -4
  17. package/src/CdcMap.tsx +3 -14
  18. package/src/CdcMapComponent.tsx +302 -164
  19. package/src/_stories/CdcMap.Defaults.smoke.stories.tsx +76 -0
  20. package/src/_stories/CdcMap.Editor.ColumnsSectionTests.stories.tsx +601 -0
  21. package/src/_stories/CdcMap.Editor.DataTableSectionTests.stories.tsx +404 -0
  22. package/src/_stories/CdcMap.Editor.FiltersSectionTests.stories.tsx +229 -0
  23. package/src/_stories/CdcMap.Editor.GeneralSectionTests.stories.tsx +262 -0
  24. package/src/_stories/CdcMap.Editor.LegendSectionTests.stories.tsx +541 -0
  25. package/src/_stories/CdcMap.Editor.MultiCountryWorldMapTests.stories.tsx +359 -0
  26. package/src/_stories/CdcMap.Editor.PatternSettingsSectionTests.stories.tsx +516 -0
  27. package/src/_stories/CdcMap.Editor.SmallMultiplesSectionTests.stories.tsx +165 -0
  28. package/src/_stories/CdcMap.Editor.TextAnnotationsSectionTests.stories.tsx +145 -0
  29. package/src/_stories/CdcMap.Editor.TypeSectionTests.stories.tsx +312 -0
  30. package/src/_stories/CdcMap.Editor.VisualSectionTests.stories.tsx +359 -0
  31. package/src/_stories/CdcMap.Editor.ZoomControlsTests.stories.tsx +88 -0
  32. package/src/_stories/{CdcMap.stories.tsx → CdcMap.smoke.stories.tsx} +23 -1
  33. package/src/_stories/Map.HTMLInDataTable.stories.tsx +385 -0
  34. package/src/_stories/_mock/legends/legend-tests.json +3 -3
  35. package/src/_stories/_mock/multi-state-show-unselected.json +82 -0
  36. package/src/cdcMapComponent.styles.css +2 -2
  37. package/src/components/Annotation/Annotation.Draggable.styles.css +4 -4
  38. package/src/components/Annotation/AnnotationDropdown.styles.css +1 -1
  39. package/src/components/Annotation/AnnotationList.styles.css +13 -13
  40. package/src/components/Annotation/AnnotationList.tsx +1 -1
  41. package/src/components/EditorPanel/components/EditorPanel.tsx +905 -416
  42. package/src/components/EditorPanel/components/HexShapeSettings.tsx +1 -1
  43. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +112 -117
  44. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings-style.css +1 -1
  45. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +31 -15
  46. package/src/components/EditorPanel/components/editorPanel.styles.css +55 -25
  47. package/src/components/Legend/components/Legend.tsx +12 -7
  48. package/src/components/Legend/components/LegendGroup/legend.group.css +5 -5
  49. package/src/components/Legend/components/LegendItem.Hex.tsx +4 -2
  50. package/src/components/Legend/components/index.scss +2 -3
  51. package/src/components/NavigationMenu.tsx +2 -1
  52. package/src/components/SmallMultiples/SmallMultiples.css +5 -5
  53. package/src/components/SmallMultiples/SynchronizedTooltip.tsx +1 -1
  54. package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +32 -17
  55. package/src/components/UsaMap/components/TerritoriesSection.tsx +3 -2
  56. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +13 -8
  57. package/src/components/UsaMap/components/UsaMap.County.tsx +629 -231
  58. package/src/components/UsaMap/components/UsaMap.Region.styles.css +1 -1
  59. package/src/components/UsaMap/components/UsaMap.SingleState.styles.css +2 -2
  60. package/src/components/UsaMap/components/UsaMap.State.tsx +14 -9
  61. package/src/components/UsaMap/data/cb_2019_us_county_20m.json +75817 -1
  62. package/src/components/UsaMap/data/hsa_fips_mapping.json +3144 -0
  63. package/src/components/WorldMap/WorldMap.tsx +10 -13
  64. package/src/components/WorldMap/data/world-topo-updated.json +1 -0
  65. package/src/components/WorldMap/data/world-topo.json +1 -1
  66. package/src/components/WorldMap/worldMap.styles.css +1 -1
  67. package/src/components/ZoomControls.tsx +49 -18
  68. package/src/components/zoomControls.styles.css +27 -11
  69. package/src/data/initial-state.js +15 -5
  70. package/src/data/legacy-defaults.ts +8 -0
  71. package/src/data/supported-counties.json +1 -1
  72. package/src/data/supported-geos.js +19 -0
  73. package/src/helpers/colors.ts +2 -1
  74. package/src/helpers/countyTerritories.ts +38 -0
  75. package/src/helpers/dataTableHelpers.ts +85 -0
  76. package/src/helpers/displayGeoName.ts +19 -11
  77. package/src/helpers/getMapContainerClasses.ts +8 -2
  78. package/src/helpers/getMatchingPatternForRow.ts +67 -0
  79. package/src/helpers/getPatternForRow.ts +11 -18
  80. package/src/helpers/tests/countyTerritories.test.ts +87 -0
  81. package/src/helpers/tests/dataTableHelpers.test.ts +78 -0
  82. package/src/helpers/tests/displayGeoName.test.ts +17 -0
  83. package/src/helpers/tests/getMatchingPatternForRow.test.ts +150 -0
  84. package/src/helpers/tests/getPatternForRow.test.ts +140 -2
  85. package/src/helpers/urlDataHelpers.ts +7 -1
  86. package/src/hooks/useApplyTooltipsToGeo.tsx +7 -4
  87. package/src/hooks/useMapLayers.tsx +1 -1
  88. package/src/hooks/useResizeObserver.ts +36 -22
  89. package/src/hooks/useTooltip.test.tsx +64 -0
  90. package/src/hooks/useTooltip.ts +46 -15
  91. package/src/scss/editor-panel.scss +1 -1
  92. package/src/scss/main.scss +140 -6
  93. package/src/scss/map.scss +9 -4
  94. package/src/store/map.actions.ts +5 -0
  95. package/src/store/map.reducer.ts +13 -0
  96. package/src/test/CdcMap.test.jsx +26 -2
  97. package/src/types/MapConfig.ts +28 -4
  98. package/src/types/MapContext.ts +5 -1
  99. package/topojson-updater/README.txt +1 -1
  100. package/dist/cdcmap-Cf9_fbQf.es.js +0 -6
  101. package/examples/__data__/city-state-data.json +0 -668
  102. package/examples/city-state.json +0 -434
  103. package/examples/default-world-data.json +0 -1450
  104. package/examples/new-cities.json +0 -656
  105. package/src/_stories/CdcMap.Editor.stories.tsx +0 -3475
  106. package/src/helpers/componentHelpers.ts +0 -8
  107. package/topojson-updater/package-lock.json +0 -223
  108. /package/src/_stories/{CdcMap.ColumnWrap.stories.tsx → CdcMap.ColumnWrap.smoke.stories.tsx} +0 -0
  109. /package/src/_stories/{CdcMap.DistrictOfColumbia.stories.tsx → CdcMap.DistrictOfColumbia.smoke.stories.tsx} +0 -0
  110. /package/src/_stories/{CdcMap.Filters.stories.tsx → CdcMap.Filters.smoke.stories.tsx} +0 -0
  111. /package/src/_stories/{CdcMap.Legend.Gradient.stories.tsx → CdcMap.Legend.Gradient.smoke.stories.tsx} +0 -0
  112. /package/src/_stories/{CdcMap.Legend.stories.tsx → CdcMap.Legend.smoke.stories.tsx} +0 -0
  113. /package/src/_stories/{CdcMap.Patterns.stories.tsx → CdcMap.Patterns.smoke.stories.tsx} +0 -0
  114. /package/src/_stories/{CdcMap.SmallMultiples.stories.tsx → CdcMap.SmallMultiples.smoke.stories.tsx} +0 -0
  115. /package/src/_stories/{CdcMap.Table.stories.tsx → CdcMap.Table.smoke.stories.tsx} +0 -0
  116. /package/src/_stories/{CdcMap.ZeroColor.stories.tsx → CdcMap.ZeroColor.smoke.stories.tsx} +0 -0
  117. /package/src/_stories/{GoogleMap.stories.tsx → GoogleMap.smoke.stories.tsx} +0 -0
  118. /package/src/_stories/{UsaMap.NoData.stories.tsx → UsaMap.NoData.smoke.stories.tsx} +0 -0
@@ -0,0 +1,385 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+ import CdcMapComponent from '../CdcMapComponent'
3
+ import { assertVisualizationRendered } from '@cdc/core/helpers/testing'
4
+ import usaStateGradient from './_mock/usa-state-gradient.json'
5
+
6
+ const meta: Meta<typeof CdcMapComponent> = {
7
+ title: 'Components/Templates/Map/HTML in Data Table',
8
+ component: CdcMapComponent,
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component:
13
+ 'Demonstrates map data tables with colored legend circles rendered inline next to location names, and HTML content in a notes column.'
14
+ }
15
+ }
16
+ }
17
+ }
18
+
19
+ export default meta
20
+
21
+ type Story = StoryObj<typeof CdcMapComponent>
22
+
23
+ const data = [
24
+ { STATE: 'Overall', Rate: '55', Location: 'Vehicle', URL: 'https://www.cdc.gov', Notes: '' },
25
+ {
26
+ STATE: 'Alabama',
27
+ Rate: 130,
28
+ Location: 'Vehicle',
29
+ URL: 'https://www.cdc.gov/',
30
+ Notes: 'Rate increased <strong>8%</strong> from prior year'
31
+ },
32
+ {
33
+ STATE: 'Alaska',
34
+ Rate: 40,
35
+ Location: 'Work',
36
+ URL: 'https://www.cdc.gov/',
37
+ Notes: 'Remote regions excluded from <em>survey</em>'
38
+ },
39
+ { STATE: 'American Samoa', Rate: 55, Location: 'Home', URL: 'https://www.cdc.gov/', Notes: '' },
40
+ {
41
+ STATE: 'Arizona',
42
+ Rate: 0,
43
+ Location: 'School',
44
+ URL: 'https://www.cdc.gov/',
45
+ Notes: '<span style="color:#d54309;">⚠ Below target</span> — outreach underway'
46
+ },
47
+ {
48
+ STATE: 'Arkansas',
49
+ Rate: 60,
50
+ Location: 'School',
51
+ URL: 'https://www.cdc.gov/',
52
+ Notes: 'See <a href="https://www.cdc.gov" target="_blank">CDC report</a> for details'
53
+ },
54
+ {
55
+ STATE: 'California',
56
+ Rate: 30,
57
+ Location: 'Home',
58
+ URL: 'https://www.cdc.gov/',
59
+ Notes: '<strong>Leading state</strong> in program participation'
60
+ },
61
+ {
62
+ STATE: 'Colorado',
63
+ Rate: 40,
64
+ Location: 'Vehicle',
65
+ URL: 'https://www.cdc.gov/',
66
+ Notes: 'Data validated by <em>state health dept</em>'
67
+ },
68
+ {
69
+ STATE: 'Connecticut',
70
+ Rate: 55,
71
+ Location: 'Home',
72
+ URL: 'https://www.cdc.gov/',
73
+ Notes: '<span style="color:#2e8540;">✓ Target achieved</span>'
74
+ },
75
+ { STATE: 'Deleware', Rate: '57', Location: 'Home', URL: 'https://www.cdc.gov/', Notes: '' },
76
+ { STATE: 'DC', Rate: 60, Location: 'Home', URL: 'https://www.cdc.gov/', Notes: '' },
77
+ {
78
+ STATE: 'Florida',
79
+ Rate: 30,
80
+ Location: 'Work',
81
+ URL: 'https://www.cdc.gov/',
82
+ Notes: 'Excludes <em>federal facilities</em>'
83
+ },
84
+ {
85
+ STATE: 'Georgia',
86
+ Rate: 40,
87
+ Location: 'Work',
88
+ URL: 'https://www.cdc.gov/',
89
+ Notes: 'Improved <strong>12 points</strong> since 2021'
90
+ },
91
+ {
92
+ STATE: 'Hawaii',
93
+ Rate: 57,
94
+ Location: 'School',
95
+ URL: 'https://www.cdc.gov/',
96
+ Notes: 'Island populations surveyed <em>separately</em>'
97
+ },
98
+ {
99
+ STATE: 'Idaho',
100
+ Rate: 60,
101
+ Location: 'School',
102
+ URL: 'https://www.cdc.gov/',
103
+ Notes: 'Rural adjustment applied — see <strong>methodology</strong>'
104
+ },
105
+ {
106
+ STATE: 'Illinois',
107
+ Rate: 30,
108
+ Location: 'Work',
109
+ URL: 'https://www.cdc.gov/',
110
+ Notes: 'Chicago metro reported <em>independently</em>'
111
+ },
112
+ {
113
+ STATE: 'Indiana',
114
+ Rate: 40,
115
+ Location: 'Vehicle',
116
+ URL: 'https://www.cdc.gov/',
117
+ Notes: 'Rate includes <strong>all age groups</strong>'
118
+ },
119
+ {
120
+ STATE: 'Iowa',
121
+ Rate: 55,
122
+ Location: 'Home',
123
+ URL: 'https://www.cdc.gov/',
124
+ Notes: 'Consistent with <em>national average</em>'
125
+ },
126
+ {
127
+ STATE: 'Kansas',
128
+ Rate: 57,
129
+ Location: 'Home',
130
+ URL: 'https://www.cdc.gov/',
131
+ Notes: 'Data from <strong>Q3 2023</strong> survey'
132
+ },
133
+ {
134
+ STATE: 'Kentucky',
135
+ Rate: 60,
136
+ Location: 'NA',
137
+ URL: 'https://www.cdc.gov/',
138
+ Notes: '<span style="color:#d54309;">Below regional median</span>'
139
+ },
140
+ {
141
+ STATE: 'Louisiana',
142
+ Rate: 30,
143
+ Location: 'Vehicle',
144
+ URL: 'https://www.cdc.gov/',
145
+ Notes: 'Post-storm data collection <em>delayed</em>'
146
+ },
147
+ {
148
+ STATE: 'Maine',
149
+ Rate: 40,
150
+ Location: 'Work',
151
+ URL: 'https://www.cdc.gov/',
152
+ Notes: 'Coastal counties weighted <strong>separately</strong>'
153
+ },
154
+ { STATE: 'Marshall Islands', Rate: 55, Location: 'Home', URL: 'https://www.cdc.gov/', Notes: '' },
155
+ {
156
+ STATE: 'Maryland',
157
+ Rate: 57,
158
+ Location: 'School',
159
+ URL: 'https://www.cdc.gov/',
160
+ Notes: 'Includes DC metro area <em>overlap</em>'
161
+ },
162
+ {
163
+ STATE: 'Massachusetts',
164
+ Rate: 60,
165
+ Location: 'School',
166
+ URL: 'https://www.cdc.gov/',
167
+ Notes: '<span style="color:#2e8540;">✓ Highest in region</span>'
168
+ },
169
+ {
170
+ STATE: 'Michigan',
171
+ Rate: 12,
172
+ Location: 'Work',
173
+ URL: 'https://www.cdc.gov/',
174
+ Notes: '<span style="color:#d54309;">⚠ Significant decline</span> noted'
175
+ },
176
+ { STATE: 'Micronesia', Rate: 65, Location: 'Vehicle', URL: 'https://www.cdc.gov/', Notes: '' },
177
+ {
178
+ STATE: 'Minnesota',
179
+ Rate: 55,
180
+ Location: 'Home',
181
+ URL: 'https://www.cdc.gov/',
182
+ Notes: 'Tribal nations surveyed <em>separately</em>'
183
+ },
184
+ {
185
+ STATE: 'Mississippi',
186
+ Rate: 57,
187
+ Location: 'Home',
188
+ URL: 'https://www.cdc.gov/',
189
+ Notes: 'Additional outreach <strong>planned for 2024</strong>'
190
+ },
191
+ {
192
+ STATE: 'Montana',
193
+ Rate: 60,
194
+ Location: 'Home',
195
+ URL: 'https://www.cdc.gov/',
196
+ Notes: 'Large geographic area — <em>sample size limited</em>'
197
+ },
198
+ { STATE: 'Montana', Rate: 30, Location: 'Vehicle', URL: 'https://www.cdc.gov/', Notes: '' },
199
+ {
200
+ STATE: 'Nebraska',
201
+ Rate: 40,
202
+ Location: 'Work',
203
+ URL: 'https://www.cdc.gov/',
204
+ Notes: 'Rate stable over <strong>3-year period</strong>'
205
+ },
206
+ {
207
+ STATE: 'Nevada',
208
+ Rate: 55,
209
+ Location: 'Home',
210
+ URL: 'https://www.cdc.gov/',
211
+ Notes: 'Las Vegas metro excluded from <em>rural rate</em>'
212
+ },
213
+ {
214
+ STATE: 'New Hampshire',
215
+ Rate: 57,
216
+ Location: 'School',
217
+ URL: 'https://www.cdc.gov/',
218
+ Notes: 'Highest participation in <strong>New England</strong>'
219
+ },
220
+ {
221
+ STATE: 'New Jersey',
222
+ Rate: 60,
223
+ Location: 'School',
224
+ URL: 'https://www.cdc.gov/',
225
+ Notes: 'Dense population — <em>high confidence interval</em>'
226
+ },
227
+ {
228
+ STATE: 'New Mexico',
229
+ Rate: 12,
230
+ Location: 'Work',
231
+ URL: 'https://www.cdc.gov/',
232
+ Notes: '<span style="color:#d54309;">Below target</span> — tribal programs expanding'
233
+ },
234
+ {
235
+ STATE: 'New York',
236
+ Rate: 40,
237
+ Location: 'Vehicle',
238
+ URL: 'https://www.cdc.gov/',
239
+ Notes: 'NYC data reported <em>separately</em>'
240
+ },
241
+ {
242
+ STATE: 'North Carolina',
243
+ Rate: 55,
244
+ Location: 'Home',
245
+ URL: 'https://www.cdc.gov/',
246
+ Notes: 'Urban/rural split — see <strong>supplemental table</strong>'
247
+ },
248
+ {
249
+ STATE: 'North Dakota',
250
+ Rate: 57,
251
+ Location: 'Home',
252
+ URL: 'https://www.cdc.gov/',
253
+ Notes: 'Oil field worker population <em>adjusted</em>'
254
+ },
255
+ { STATE: 'Northern Mariana Islands', Rate: '60', Location: 'Home', URL: 'https://www.cdc.gov/', Notes: '' },
256
+ {
257
+ STATE: 'Ohio',
258
+ Rate: 88,
259
+ Location: 'Vehicle',
260
+ URL: 'https://www.cdc.gov/',
261
+ Notes: '<span style="color:#2e8540;">✓ Above national average</span>'
262
+ },
263
+ {
264
+ STATE: 'Oklahoma',
265
+ Rate: 40,
266
+ Location: 'Work',
267
+ URL: 'https://www.cdc.gov/',
268
+ Notes: 'Native American populations <em>surveyed separately</em>'
269
+ },
270
+ {
271
+ STATE: 'Oregon',
272
+ Rate: 55,
273
+ Location: 'Home',
274
+ URL: 'https://www.cdc.gov/',
275
+ Notes: 'Coast vs inland rates <strong>vary significantly</strong>'
276
+ },
277
+ { STATE: 'Palau', Rate: 15, Location: 'School', URL: 'https://www.cdc.gov/', Notes: '' },
278
+ {
279
+ STATE: 'Pennsylvania',
280
+ Rate: 60,
281
+ Location: 'School',
282
+ URL: 'https://www.cdc.gov/',
283
+ Notes: 'Philadelphia metro weighted <em>separately</em>'
284
+ },
285
+ { STATE: 'Puerto Rico', Rate: 30, Location: 'Work', URL: 'https://www.cdc.gov/', Notes: '' },
286
+ {
287
+ STATE: 'Rhode Island',
288
+ Rate: 40,
289
+ Location: 'Vehicle',
290
+ URL: 'https://www.cdc.gov/',
291
+ Notes: '<strong>Smallest state</strong> — high confidence in data'
292
+ },
293
+ {
294
+ STATE: 'South Carolina',
295
+ Rate: 55,
296
+ Location: 'Home',
297
+ URL: 'https://www.cdc.gov/',
298
+ Notes: 'Rate improved after <em>2022 initiative</em>'
299
+ },
300
+ {
301
+ STATE: 'South Dakota',
302
+ Rate: 86,
303
+ Location: 'Home',
304
+ URL: 'https://www.cdc.gov/',
305
+ Notes: '<span style="color:#2e8540;">✓ Above target</span>'
306
+ },
307
+ {
308
+ STATE: 'Tennessee',
309
+ Rate: 60,
310
+ Location: 'Home',
311
+ URL: 'https://www.cdc.gov/',
312
+ Notes: 'Nashville metro drives <strong>overall rate</strong>'
313
+ },
314
+ {
315
+ STATE: 'Texas',
316
+ Rate: 30,
317
+ Location: 'Vehicle',
318
+ URL: 'https://www.cdc.gov/',
319
+ Notes: 'Border region data <em>collected separately</em>'
320
+ },
321
+ { STATE: 'Utah', Rate: 54, Location: 'Work', URL: 'https://www.cdc.gov/', Notes: '' },
322
+ {
323
+ STATE: 'Vermont',
324
+ Rate: 40,
325
+ Location: 'Home',
326
+ URL: 'https://www.cdc.gov/',
327
+ Notes: 'Near-complete <em>population coverage</em>'
328
+ },
329
+ { STATE: 'Virgin Islands', Rate: 55, Location: 'School', URL: 'https://www.cdc.gov/', Notes: '' },
330
+ {
331
+ STATE: 'Virginia',
332
+ Rate: 57,
333
+ Location: 'School',
334
+ URL: 'https://www.cdc.gov/',
335
+ Notes: 'Northern VA excluded — see <em>DC metro</em>'
336
+ },
337
+ {
338
+ STATE: 'Washington',
339
+ Rate: 62,
340
+ Location: 'Work',
341
+ URL: 'https://www.cdc.gov/',
342
+ Notes: '<span style="color:#2e8540;">✓ Strong program outcomes</span>'
343
+ },
344
+ {
345
+ STATE: 'West Virginia',
346
+ Rate: 25,
347
+ Location: 'Vehicle',
348
+ URL: 'https://www.cdc.gov/',
349
+ Notes: '<span style="color:#d54309;">⚠ Lowest in region</span>'
350
+ },
351
+ {
352
+ STATE: 'Wyoming',
353
+ Rate: 43,
354
+ Location: 'Vehicle',
355
+ URL: 'https://www.cdc.gov/',
356
+ Notes: 'Smallest population — <strong>widest confidence interval</strong>'
357
+ }
358
+ ]
359
+
360
+ export const USAStateMap: Story = {
361
+ name: 'USA State Map',
362
+ args: {
363
+ config: {
364
+ ...usaStateGradient,
365
+ data,
366
+ table: {
367
+ ...usaStateGradient.table,
368
+ expanded: true
369
+ },
370
+ columns: {
371
+ ...usaStateGradient.columns,
372
+ Notes: {
373
+ name: 'Notes',
374
+ label: 'Notes',
375
+ dataTable: true,
376
+ tooltip: false
377
+ }
378
+ }
379
+ },
380
+ isEditor: true
381
+ },
382
+ play: async ({ canvasElement }) => {
383
+ await assertVisualizationRendered(canvasElement)
384
+ }
385
+ }
@@ -100,7 +100,7 @@
100
100
  "layers": [
101
101
  {
102
102
  "name": "Layer One",
103
- "url": "./examples/testing-layer.json",
103
+ "url": "./examples/__data__/testing-layer.json",
104
104
  "namespace": "cove",
105
105
  "fill": "blue",
106
106
  "stroke": "orange",
@@ -108,7 +108,7 @@
108
108
  },
109
109
  {
110
110
  "name": "Layer Two",
111
- "url": "./examples/testing-layer-2.json",
111
+ "url": "./examples/__data__/testing-layer-2.json",
112
112
  "namespace": "cove",
113
113
  "fill": "blue",
114
114
  "stroke": "orange",
@@ -769,4 +769,4 @@
769
769
  "URL": "https://www.cdc.gov/"
770
770
  }
771
771
  ]
772
- }
772
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "general": {
3
+ "geoType": "single-state",
4
+ "geoBorderColor": "darkGray",
5
+ "headerColor": "theme-blue",
6
+ "showTitle": true,
7
+ "showSidebar": true,
8
+ "showDownloadButton": true,
9
+ "showDownloadMediaButton": false,
10
+ "displayAsHex": false,
11
+ "displayStateLabels": false,
12
+ "territoriesLabel": "Territories",
13
+ "language": "en",
14
+ "hasRegions": false,
15
+ "expandDataTable": false,
16
+ "fullBorder": false,
17
+ "type": "data",
18
+ "statesPicked": [
19
+ { "fipsCode": "01", "stateName": "Alabama" },
20
+ { "stateName": "Florida", "fipsCode": "12" },
21
+ { "stateName": "Georgia", "fipsCode": "13" },
22
+ { "stateName": "South Carolina", "fipsCode": "45" }
23
+ ],
24
+ "hideUnselectedStates": false,
25
+ "title": "Multi-State Map - Show Unselected States",
26
+ "subtext": "Unselected states are shown as light outlines for geographic context."
27
+ },
28
+ "type": "map",
29
+ "color": "orangered",
30
+ "columns": {
31
+ "geo": { "name": "FIPS Codes", "label": "Location", "tooltip": false, "dataTable": true },
32
+ "primary": {
33
+ "dataTable": true,
34
+ "tooltip": true,
35
+ "prefix": "",
36
+ "suffix": "%",
37
+ "name": "Percent Vaccinated",
38
+ "label": "Percent Vaccinated"
39
+ },
40
+ "navigate": { "name": "" }
41
+ },
42
+ "legend": {
43
+ "descriptions": {},
44
+ "specialClasses": [],
45
+ "unified": false,
46
+ "singleColumn": true,
47
+ "dynamicDescription": false,
48
+ "type": "equalinterval",
49
+ "numberOfItems": 4,
50
+ "position": "side",
51
+ "title": "Percent Vaccinated",
52
+ "description": ""
53
+ },
54
+ "filters": [],
55
+ "dataTable": { "title": "Data Table", "forceDisplay": true, "indexTitle": "Percent Vaccinated" },
56
+ "tooltips": { "appearanceType": "hover", "linkLabel": "Learn More", "capitalizeLabels": true },
57
+ "data": [
58
+ { "FIPS Codes": "01001", "County": "Autauga County", "Percent Vaccinated": 34.13 },
59
+ { "FIPS Codes": "01003", "County": "Baldwin County", "Percent Vaccinated": 37.55 },
60
+ { "FIPS Codes": "01005", "County": "Barbour County", "Percent Vaccinated": 32.78 },
61
+ { "FIPS Codes": "01073", "County": "Jefferson County", "Percent Vaccinated": 55.79 },
62
+ { "FIPS Codes": "01089", "County": "Madison County", "Percent Vaccinated": 57.67 },
63
+ { "FIPS Codes": "01097", "County": "Mobile County", "Percent Vaccinated": 39.18 },
64
+ { "FIPS Codes": "01101", "County": "Montgomery County", "Percent Vaccinated": 50.54 },
65
+ { "FIPS Codes": "12011", "County": "Broward County", "Percent Vaccinated": 73.98 },
66
+ { "FIPS Codes": "12031", "County": "Duval County", "Percent Vaccinated": 53.48 },
67
+ { "FIPS Codes": "12057", "County": "Hillsborough County", "Percent Vaccinated": 58.66 },
68
+ { "FIPS Codes": "12086", "County": "Miami-Dade County", "Percent Vaccinated": 91.5 },
69
+ { "FIPS Codes": "12095", "County": "Orange County", "Percent Vaccinated": 77.97 },
70
+ { "FIPS Codes": "12099", "County": "Palm Beach County", "Percent Vaccinated": 60.75 },
71
+ { "FIPS Codes": "13089", "County": "DeKalb County", "Percent Vaccinated": 50.4 },
72
+ { "FIPS Codes": "13121", "County": "Fulton County", "Percent Vaccinated": 44.58 },
73
+ { "FIPS Codes": "13067", "County": "Cobb County", "Percent Vaccinated": 51.43 },
74
+ { "FIPS Codes": "13135", "County": "Gwinnett County", "Percent Vaccinated": 42.55 },
75
+ { "FIPS Codes": "13051", "County": "Chatham County", "Percent Vaccinated": 50.47 },
76
+ { "FIPS Codes": "45019", "County": "Charleston County", "Percent Vaccinated": 63.1 },
77
+ { "FIPS Codes": "45045", "County": "Greenville County", "Percent Vaccinated": 45.84 },
78
+ { "FIPS Codes": "45079", "County": "Richland County", "Percent Vaccinated": 64.96 },
79
+ { "FIPS Codes": "45013", "County": "Beaufort County", "Percent Vaccinated": 60.82 },
80
+ { "FIPS Codes": "45051", "County": "Horry County", "Percent Vaccinated": 40.86 }
81
+ ]
82
+ }
@@ -1,9 +1,9 @@
1
- .map-container {
1
+ .visualization-container {
2
2
  &.full-border {
3
3
  border: #c2c2c2 1px solid;
4
4
  }
5
5
  }
6
6
 
7
- header + .map-container.full-border {
7
+ header + .visualization-container.full-border {
8
8
  border-top: 0; /* When they have a header, don't add a border top */
9
9
  }
@@ -1,18 +1,18 @@
1
- .cdc-open-viz-module.type-map .annotation__desktop-label {
1
+ .cove-visualization.type-map .annotation__desktop-label {
2
2
  display: none;
3
3
  }
4
4
 
5
- .cdc-open-viz-module.type-map {
5
+ .cove-visualization.type-map {
6
6
  .annotation__mobile-label-circle {
7
7
  stroke-width: 2;
8
8
  }
9
9
  }
10
10
 
11
11
  @container content (min-width: 700px) {
12
- .cdc-open-viz-module.type-map .annotation__mobile-label {
12
+ .cove-visualization.type-map .annotation__mobile-label {
13
13
  display: none;
14
14
  }
15
- .cdc-open-viz-module.type-map .annotation__desktop-label {
15
+ .cove-visualization.type-map .annotation__desktop-label {
16
16
  display: block;
17
17
  }
18
18
  }
@@ -1,4 +1,4 @@
1
- .cdc-open-viz-module.type-map {
1
+ .cove-visualization.type-map {
2
2
  .annotation__dropdown-list {
3
3
  list-style: none;
4
4
  }
@@ -1,29 +1,29 @@
1
- .cdc-open-viz-module.type-map {
1
+ .cove-visualization.type-map {
2
2
  .annotation__title-circle {
3
- display: flex;
4
- justify-content: center;
5
3
  align-items: center;
4
+
5
+ border: 2px solid #666;
6
6
  border-radius: 50%;
7
- padding: 8px;
8
- width: 16px;
7
+ display: flex;
8
+ font-size: 14px;
9
9
  height: 16px;
10
- margin-right: 5px;
10
+ justify-content: center;
11
11
  line-height: 1.5rem;
12
-
13
- border: 2px solid #666;
12
+ margin-right: 5px;
13
+ padding: 8px;
14
14
  text-align: center;
15
- font-size: 14px;
15
+ width: 16px;
16
16
  }
17
17
 
18
18
  .annotation__title-wrapper {
19
+ align-items: center;
19
20
  display: flex;
20
21
  flex-wrap: nowrap;
21
- align-items: center;
22
22
  }
23
23
 
24
24
  .annotation__title-wrapper .annotation__title-text {
25
- margin-left: 5px;
26
25
  font-size: 16px;
26
+ margin-left: 5px;
27
27
  }
28
28
 
29
29
  .annotation__subtext {
@@ -38,8 +38,8 @@
38
38
  margin-top: 5px;
39
39
  }
40
40
 
41
- .cove-component__content {
42
- container-type: inline-size;
41
+ .cove-visualization__body {
43
42
  container-name: content;
43
+ container-type: inline-size;
44
44
  }
45
45
  }
@@ -8,7 +8,7 @@ type AnnotationListProps = {
8
8
  }
9
9
 
10
10
  const AnnotationList: React.FC<AnnotationListProps> = ({ useBootstrapVisibilityClasses = true }) => {
11
- const { state: config } = useContext(ConfigContext)
11
+ const { config } = useContext(ConfigContext)
12
12
  const annotations = config.annotations || []
13
13
 
14
14
  const ulClasses = () => {