@cdc/map 4.26.3 → 4.26.5

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 (105) hide show
  1. package/CONFIG.md +268 -0
  2. package/README.md +74 -24
  3. package/dist/cdcmap-CY9IcPSi.es.js +6 -0
  4. package/dist/cdcmap-DlpiY3fQ.es.js +4 -0
  5. package/dist/cdcmap.js +29168 -27482
  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 +6 -3
  11. package/examples/minimal-example.json +73 -0
  12. package/examples/private/annotation-bug.json +2 -2
  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/CdcMapComponent.tsx +107 -14
  18. package/src/_stories/CdcMap.AltText.stories.tsx +122 -0
  19. package/src/_stories/CdcMap.Editor.ColumnsSectionTests.stories.tsx +600 -0
  20. package/src/_stories/CdcMap.Editor.DataTableSectionTests.stories.tsx +404 -0
  21. package/src/_stories/CdcMap.Editor.FiltersSectionTests.stories.tsx +229 -0
  22. package/src/_stories/CdcMap.Editor.GeneralSectionTests.stories.tsx +262 -0
  23. package/src/_stories/CdcMap.Editor.LegendSectionTests.stories.tsx +541 -0
  24. package/src/_stories/CdcMap.Editor.MultiCountryWorldMapTests.stories.tsx +359 -0
  25. package/src/_stories/CdcMap.Editor.PatternSettingsSectionTests.stories.tsx +516 -0
  26. package/src/_stories/CdcMap.Editor.SmallMultiplesSectionTests.stories.tsx +165 -0
  27. package/src/_stories/CdcMap.Editor.TextAnnotationsSectionTests.stories.tsx +145 -0
  28. package/src/_stories/CdcMap.Editor.TypeSectionTests.stories.tsx +312 -0
  29. package/src/_stories/CdcMap.Editor.VisualSectionTests.stories.tsx +359 -0
  30. package/src/_stories/CdcMap.Editor.ZoomControlsTests.stories.tsx +88 -0
  31. package/src/_stories/CdcMap.FocusVisibility.stories.tsx +87 -0
  32. package/src/_stories/CdcMap.HiddenMount.stories.tsx +69 -0
  33. package/src/_stories/CdcMap.ResetBehavior.stories.tsx +32 -0
  34. package/src/_stories/CdcMap.Zoom.stories.tsx +111 -0
  35. package/src/_stories/{CdcMap.stories.tsx → CdcMap.smoke.stories.tsx} +60 -0
  36. package/src/_stories/_mock/alt_text_metadata.json +65 -0
  37. package/src/_stories/_mock/legends/legend-tests.json +3 -3
  38. package/src/_stories/_mock/world-bubble-reset.json +138 -0
  39. package/src/_stories/_mock/world-data-zoom-filters.json +166 -0
  40. package/src/components/Annotation/AnnotationList.tsx +1 -1
  41. package/src/components/BubbleList.tsx +13 -0
  42. package/src/components/EditorPanel/components/EditorPanel.tsx +637 -382
  43. package/src/components/EditorPanel/components/HexShapeSettings.tsx +1 -1
  44. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +112 -117
  45. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +26 -13
  46. package/src/components/EditorPanel/components/editorPanel.styles.css +22 -2
  47. package/src/components/FilterControls.tsx +21 -0
  48. package/src/components/Legend/components/Legend.tsx +3 -3
  49. package/src/components/Legend/components/LegendItem.Hex.tsx +4 -2
  50. package/src/components/SmallMultiples/SmallMultiples.tsx +2 -2
  51. package/src/components/SmallMultiples/SynchronizedTooltip.tsx +1 -1
  52. package/src/components/UsaMap/components/UsaMap.County.tsx +309 -108
  53. package/src/components/UsaMap/components/UsaMap.Region.tsx +5 -2
  54. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +33 -10
  55. package/src/components/UsaMap/components/UsaMap.State.tsx +10 -3
  56. package/src/components/UsaMap/data/cb_2019_us_county_20m.json +75817 -1
  57. package/src/components/UsaMap/data/hsa_fips_mapping.json +3144 -0
  58. package/src/components/WorldMap/WorldMap.tsx +37 -4
  59. package/src/components/WorldMap/data/world-topo.json +1 -1
  60. package/src/components/ZoomableGroup.tsx +23 -3
  61. package/src/components/filterControls.styles.css +6 -0
  62. package/src/data/initial-state.js +3 -0
  63. package/src/data/supported-counties.json +1 -1
  64. package/src/helpers/countyTerritories.ts +38 -0
  65. package/src/helpers/dataTableHelpers.ts +35 -6
  66. package/src/helpers/generateRuntimeFilters.ts +2 -1
  67. package/src/helpers/handleMapAriaLabels.ts +45 -30
  68. package/src/helpers/shouldAutoResetSingleStateZoom.ts +22 -0
  69. package/src/helpers/tests/countyTerritories.test.ts +87 -0
  70. package/src/helpers/tests/handleMapAriaLabels.test.ts +71 -0
  71. package/src/helpers/tests/shouldAutoResetSingleStateZoom.test.ts +71 -0
  72. package/src/hooks/useApplyTooltipsToGeo.tsx +7 -4
  73. package/src/hooks/useGeoClickHandler.ts +13 -1
  74. package/src/hooks/useMapLayers.tsx +1 -1
  75. package/src/hooks/useStateZoom.tsx +39 -20
  76. package/src/hooks/useTooltip.test.tsx +2 -16
  77. package/src/hooks/useTooltip.ts +18 -7
  78. package/src/index.jsx +5 -2
  79. package/src/scss/main.scss +6 -21
  80. package/src/scss/map.scss +20 -0
  81. package/src/store/map.actions.ts +5 -2
  82. package/src/store/map.reducer.ts +12 -3
  83. package/src/test/CdcMap.test.jsx +24 -0
  84. package/src/types/MapConfig.ts +11 -0
  85. package/src/types/MapContext.ts +6 -1
  86. package/topojson-updater/README.txt +1 -1
  87. package/dist/cdcmap-vr9HZwRt.es.js +0 -6
  88. package/examples/__data__/city-state-data.json +0 -668
  89. package/examples/city-state.json +0 -434
  90. package/examples/default-world-data.json +0 -1450
  91. package/examples/new-cities.json +0 -656
  92. package/src/_stories/CdcMap.Editor.stories.tsx +0 -3648
  93. package/topojson-updater/package-lock.json +0 -223
  94. /package/src/_stories/{CdcMap.ColumnWrap.stories.tsx → CdcMap.ColumnWrap.smoke.stories.tsx} +0 -0
  95. /package/src/_stories/{CdcMap.Defaults.stories.tsx → CdcMap.Defaults.smoke.stories.tsx} +0 -0
  96. /package/src/_stories/{CdcMap.DistrictOfColumbia.stories.tsx → CdcMap.DistrictOfColumbia.smoke.stories.tsx} +0 -0
  97. /package/src/_stories/{CdcMap.Filters.stories.tsx → CdcMap.Filters.smoke.stories.tsx} +0 -0
  98. /package/src/_stories/{CdcMap.Legend.Gradient.stories.tsx → CdcMap.Legend.Gradient.smoke.stories.tsx} +0 -0
  99. /package/src/_stories/{CdcMap.Legend.stories.tsx → CdcMap.Legend.smoke.stories.tsx} +0 -0
  100. /package/src/_stories/{CdcMap.Patterns.stories.tsx → CdcMap.Patterns.smoke.stories.tsx} +0 -0
  101. /package/src/_stories/{CdcMap.SmallMultiples.stories.tsx → CdcMap.SmallMultiples.smoke.stories.tsx} +0 -0
  102. /package/src/_stories/{CdcMap.Table.stories.tsx → CdcMap.Table.smoke.stories.tsx} +0 -0
  103. /package/src/_stories/{CdcMap.ZeroColor.stories.tsx → CdcMap.ZeroColor.smoke.stories.tsx} +0 -0
  104. /package/src/_stories/{GoogleMap.stories.tsx → GoogleMap.smoke.stories.tsx} +0 -0
  105. /package/src/_stories/{UsaMap.NoData.stories.tsx → UsaMap.NoData.smoke.stories.tsx} +0 -0
@@ -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",
@@ -33,12 +33,12 @@
33
33
  "layers": [
34
34
  {
35
35
  "name": "Layer One",
36
- "url": "./examples/testing-layer.json",
36
+ "url": "./examples/__data__/testing-layer.json",
37
37
  "namespace": "cove"
38
38
  },
39
39
  {
40
40
  "name": "Layer Two",
41
- "url": "./examples/testing-layer.json",
41
+ "url": "./examples/__data__/testing-layer.json",
42
42
  "namespace": "cove"
43
43
  }
44
44
  ]
@@ -97,6 +97,9 @@
97
97
  "runtime": {
98
98
  "editorErrorMessage": []
99
99
  },
100
+ "migrations": {
101
+ "showPuertoRico": false
102
+ },
100
103
  "visual": {
101
104
  "minBubbleSize": 1,
102
105
  "maxBubbleSize": 20,
@@ -140,4 +143,4 @@
140
143
  "link": ""
141
144
  }
142
145
  ]
143
- }
146
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "version": "4.26.4",
3
+ "general": {
4
+ "title": "Minimal US Map",
5
+ "geoType": "us",
6
+ "type": "data",
7
+ "showTitle": true,
8
+ "palette": {
9
+ "name": "sequential_blue",
10
+ "version": "2.0",
11
+ "isReversed": false
12
+ }
13
+ },
14
+ "type": "map",
15
+ "columns": {
16
+ "geo": {
17
+ "name": "FIPS Codes",
18
+ "label": "Location",
19
+ "tooltip": false,
20
+ "dataTable": true
21
+ },
22
+ "primary": {
23
+ "name": "Rate",
24
+ "label": "Rate",
25
+ "prefix": "",
26
+ "suffix": "%",
27
+ "tooltip": true,
28
+ "dataTable": true
29
+ },
30
+ "navigate": {
31
+ "name": ""
32
+ },
33
+ "latitude": {
34
+ "name": ""
35
+ },
36
+ "longitude": {
37
+ "name": ""
38
+ }
39
+ },
40
+ "legend": {
41
+ "type": "equalnumber",
42
+ "numberOfItems": 3,
43
+ "position": "side",
44
+ "style": "circles",
45
+ "title": "Legend",
46
+ "description": "",
47
+ "descriptions": {},
48
+ "specialClasses": [],
49
+ "unified": false,
50
+ "singleColumn": false,
51
+ "singleRow": false,
52
+ "verticalSorted": false,
53
+ "showSpecialClassesLast": false,
54
+ "dynamicDescription": false,
55
+ "hideBorder": false
56
+ },
57
+ "filters": [],
58
+ "filterBehavior": "Filter Change",
59
+ "data": [
60
+ {
61
+ "FIPS Codes": "01",
62
+ "Rate": 10
63
+ },
64
+ {
65
+ "FIPS Codes": "02",
66
+ "Rate": 20
67
+ },
68
+ {
69
+ "FIPS Codes": "04",
70
+ "Rate": 30
71
+ }
72
+ ]
73
+ }
@@ -277,7 +277,7 @@
277
277
  "horizontal": false,
278
278
  "series": false
279
279
  },
280
- "version": "4.26.4",
280
+ "version": "4.26.3",
281
281
  "migrations": {
282
282
  "addColorMigration": true
283
283
  },
@@ -639,4 +639,4 @@
639
639
  }
640
640
  ],
641
641
  "datasets": {}
642
- }
642
+ }
@@ -0,0 +1,314 @@
1
+ {
2
+ "annotations": [],
3
+ "general": {
4
+ "navigationTarget": "_self",
5
+ "noDataMessage": "No State Selected",
6
+ "annotationDropdownText": "Annotations",
7
+ "geoBorderColor": "darkGray",
8
+ "headerColor": "theme-blue",
9
+ "title": "",
10
+ "showTitle": true,
11
+ "titleStyle": "small",
12
+ "showSidebar": true,
13
+ "showDownloadMediaButton": false,
14
+ "displayAsHex": false,
15
+ "displayStateLabels": false,
16
+ "territoriesAlwaysShow": false,
17
+ "language": "en",
18
+ "geoType": "us-county",
19
+ "geoLabelOverride": "Sewershed",
20
+ "hasRegions": false,
21
+ "fullBorder": false,
22
+ "type": "us-geocode",
23
+ "convertFipsCodes": true,
24
+ "palette": {
25
+ "isReversed": false,
26
+ "name": "sequential_pink_purple",
27
+ "version": "1.0",
28
+ "customColors": [
29
+ "#6b0057",
30
+ "#6b0057",
31
+ "#6b0057",
32
+ "#5bc2b9",
33
+ "#e0e0e0",
34
+ "#e0e0e0"
35
+ ],
36
+ "backups": [
37
+ {
38
+ "name": "sequential_pink_purple",
39
+ "version": "1.0",
40
+ "isReversed": false
41
+ },
42
+ {
43
+ "name": "sequential_pink_purple",
44
+ "version": "1.0",
45
+ "isReversed": false
46
+ },
47
+ {
48
+ "name": "sequential_pink_purple",
49
+ "version": "1.0",
50
+ "isReversed": false
51
+ },
52
+ {
53
+ "name": "sequential_pink_purple",
54
+ "version": "1.0",
55
+ "isReversed": false
56
+ },
57
+ {
58
+ "name": "sequential_pink_purple",
59
+ "version": "1.0",
60
+ "isReversed": false
61
+ },
62
+ {
63
+ "name": "sequential_pink_purple",
64
+ "version": "1.0",
65
+ "isReversed": false
66
+ },
67
+ {
68
+ "name": "sequential_pink_purple",
69
+ "version": "1.0",
70
+ "isReversed": false
71
+ },
72
+ {
73
+ "name": "sequential_pink_purple",
74
+ "version": "1.0",
75
+ "isReversed": false
76
+ },
77
+ {
78
+ "name": "sequential_pink_purple",
79
+ "version": "1.0",
80
+ "isReversed": false
81
+ },
82
+ {
83
+ "name": "sequential_pink_purple",
84
+ "version": "1.0",
85
+ "isReversed": false
86
+ },
87
+ {
88
+ "name": "sequential_pink_purple",
89
+ "version": "1.0",
90
+ "isReversed": false
91
+ },
92
+ {
93
+ "name": "sequential_pink_purple",
94
+ "version": "1.0",
95
+ "isReversed": false
96
+ }
97
+ ]
98
+ },
99
+ "allowMapZoom": false,
100
+ "hideGeoColumnInTooltip": true,
101
+ "hidePrimaryColumnInTooltip": false,
102
+ "hideUnselectedStates": true,
103
+ "statesPicked": [
104
+ {
105
+ "fipsCode": "01",
106
+ "stateName": "Alabama"
107
+ }
108
+ ],
109
+ "expandDataTable": false,
110
+ "introText": "",
111
+ "subtext": "",
112
+ "footnotes": ""
113
+ },
114
+ "type": "map",
115
+ "columns": {
116
+ "geo": {
117
+ "name": "Sewershed",
118
+ "label": "Location",
119
+ "tooltip": false,
120
+ "dataTable": true,
121
+ "displayColumn": "Sewershed"
122
+ },
123
+ "primary": {
124
+ "dataTable": true,
125
+ "tooltip": true,
126
+ "prefix": "",
127
+ "suffix": "",
128
+ "name": "Detection_Category",
129
+ "label": "Detection Category",
130
+ "roundToPlace": 0
131
+ },
132
+ "navigate": {
133
+ "name": ""
134
+ },
135
+ "latitude": {
136
+ "name": "Latitude"
137
+ },
138
+ "longitude": {
139
+ "name": "Longitude"
140
+ },
141
+ "additionalColumn1": {
142
+ "label": "State/Territory",
143
+ "dataTable": true,
144
+ "tooltips": false,
145
+ "prefix": "",
146
+ "suffix": "",
147
+ "name": "State/Territory",
148
+ "tooltip": true
149
+ },
150
+ "additionalColumn2": {
151
+ "label": "Counties Served",
152
+ "dataTable": true,
153
+ "tooltips": false,
154
+ "prefix": "",
155
+ "suffix": "",
156
+ "name": "Counties_Served",
157
+ "tooltip": true
158
+ },
159
+ "additionalColumn4": {
160
+ "label": "Detection Category",
161
+ "dataTable": false,
162
+ "tooltips": false,
163
+ "prefix": "",
164
+ "suffix": "",
165
+ "name": "Detection_Category",
166
+ "useCommas": false,
167
+ "tooltip": false
168
+ },
169
+ "additionalColumn5": {
170
+ "label": "Population Served",
171
+ "dataTable": true,
172
+ "tooltips": false,
173
+ "prefix": "",
174
+ "suffix": "",
175
+ "name": "Population_Served",
176
+ "tooltip": true,
177
+ "useCommas": true
178
+ }
179
+ },
180
+ "legend": {
181
+ "descriptions": {},
182
+ "specialClasses": [],
183
+ "unified": false,
184
+ "singleColumn": false,
185
+ "singleRow": true,
186
+ "verticalSorted": false,
187
+ "showSpecialClassesLast": false,
188
+ "dynamicDescription": false,
189
+ "type": "category",
190
+ "numberOfItems": 3,
191
+ "position": "bottom",
192
+ "title": "Measles Detection Status",
193
+ "style": "circles",
194
+ "subStyle": "linear blocks",
195
+ "tickRotation": "",
196
+ "singleColumnLegend": false,
197
+ "hideBorder": false,
198
+ "groupBy": "",
199
+ "categoryValuesOrder": [
200
+ "Detection",
201
+ "No Detection",
202
+ "No Data",
203
+ "H5 Detection",
204
+ "No Samples in Last Week"
205
+ ],
206
+ "additionalCategories": [
207
+ "Detection",
208
+ ""
209
+ ],
210
+ "description": "Select a detection type below to add or remove it from the map."
211
+ },
212
+ "filters": [],
213
+ "table": {
214
+ "wrapColumns": true,
215
+ "label": "Data Table",
216
+ "expanded": false,
217
+ "limitHeight": true,
218
+ "height": "499",
219
+ "caption": "",
220
+ "showDownloadUrl": false,
221
+ "showDataTableLink": true,
222
+ "showDownloadLinkBelow": false,
223
+ "showFullGeoNameInCSV": false,
224
+ "forceDisplay": true,
225
+ "download": true,
226
+ "indexLabel": "Site",
227
+ "cellMinWidth": "0",
228
+ "collapsible": true,
229
+ "defaultSort": {
230
+ "column": "additionalColumn4",
231
+ "sortDirection": "asc"
232
+ },
233
+ "downloadVisibleDataOnly": true
234
+ },
235
+ "tooltips": {
236
+ "appearanceType": "hover",
237
+ "linkLabel": "Learn More",
238
+ "opacity": 90,
239
+ "capitalizeLabels": true
240
+ },
241
+ "visual": {
242
+ "border": false,
243
+ "borderColorTheme": false,
244
+ "accent": false,
245
+ "background": false,
246
+ "hideBackgroundColor": false,
247
+ "tp5Treatment": false,
248
+ "tp5Background": false,
249
+ "minBubbleSize": 1,
250
+ "maxBubbleSize": 20,
251
+ "extraBubbleBorder": false,
252
+ "cityStyle": "circle",
253
+ "cityStyleLabel": "",
254
+ "showBubbleZeros": false,
255
+ "additionalCityStyles": [],
256
+ "geoCodeCircleSize": "5"
257
+ },
258
+ "mapPosition": {
259
+ "coordinates": [
260
+ 0,
261
+ 30
262
+ ],
263
+ "zoom": 1
264
+ },
265
+ "map": {
266
+ "layers": [],
267
+ "patterns": []
268
+ },
269
+ "hexMap": {
270
+ "type": "",
271
+ "shapeGroups": [
272
+ {
273
+ "legendTitle": "",
274
+ "legendDescription": "",
275
+ "items": [
276
+ {
277
+ "key": "",
278
+ "shape": "Arrow Up",
279
+ "column": "",
280
+ "operator": "=",
281
+ "value": ""
282
+ }
283
+ ]
284
+ }
285
+ ]
286
+ },
287
+ "filterBehavior": "Filter Change",
288
+ "filterIntro": "",
289
+ "smallMultiples": {
290
+ "mode": "",
291
+ "tileColumn": "",
292
+ "tilesPerRowDesktop": 2,
293
+ "tilesPerRowMobile": 1,
294
+ "tileOrderType": "asc",
295
+ "tileOrder": [],
296
+ "tileTitles": {},
297
+ "synchronizedTooltips": true
298
+ },
299
+ "markupVariables": [],
300
+ "enableMarkupVariables": false,
301
+ "dataFileName": "/wcms/vizdata/NCEZID_DIDRI/measles/nwssmeaslessitemap.json",
302
+ "dataFileSourceType": "url",
303
+ "dataDescription": {
304
+ "horizontal": false,
305
+ "series": false
306
+ },
307
+ "version": "4.26.3",
308
+ "dataUrl": "https://www.cdc.gov/wcms/vizdata/NCEZID_DIDRI/measles/nwssmeaslessitemap.json",
309
+ "migrations": {
310
+ "addColorMigration": true
311
+ },
312
+ "dataMetadata": {},
313
+ "locale": "en-US"
314
+ }