@cdc/map 4.26.3 → 4.26.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) 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 +27405 -26257
  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 +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 +96 -13
  18. package/src/_stories/CdcMap.Editor.ColumnsSectionTests.stories.tsx +601 -0
  19. package/src/_stories/CdcMap.Editor.DataTableSectionTests.stories.tsx +404 -0
  20. package/src/_stories/CdcMap.Editor.FiltersSectionTests.stories.tsx +229 -0
  21. package/src/_stories/CdcMap.Editor.GeneralSectionTests.stories.tsx +262 -0
  22. package/src/_stories/CdcMap.Editor.LegendSectionTests.stories.tsx +541 -0
  23. package/src/_stories/CdcMap.Editor.MultiCountryWorldMapTests.stories.tsx +359 -0
  24. package/src/_stories/CdcMap.Editor.PatternSettingsSectionTests.stories.tsx +516 -0
  25. package/src/_stories/CdcMap.Editor.SmallMultiplesSectionTests.stories.tsx +165 -0
  26. package/src/_stories/CdcMap.Editor.TextAnnotationsSectionTests.stories.tsx +145 -0
  27. package/src/_stories/CdcMap.Editor.TypeSectionTests.stories.tsx +312 -0
  28. package/src/_stories/CdcMap.Editor.VisualSectionTests.stories.tsx +359 -0
  29. package/src/_stories/CdcMap.Editor.ZoomControlsTests.stories.tsx +88 -0
  30. package/src/_stories/{CdcMap.stories.tsx → CdcMap.smoke.stories.tsx} +12 -0
  31. package/src/_stories/_mock/legends/legend-tests.json +3 -3
  32. package/src/components/Annotation/AnnotationList.tsx +1 -1
  33. package/src/components/EditorPanel/components/EditorPanel.tsx +504 -383
  34. package/src/components/EditorPanel/components/HexShapeSettings.tsx +1 -1
  35. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +112 -117
  36. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +26 -13
  37. package/src/components/EditorPanel/components/editorPanel.styles.css +22 -2
  38. package/src/components/Legend/components/Legend.tsx +3 -3
  39. package/src/components/Legend/components/LegendItem.Hex.tsx +4 -2
  40. package/src/components/SmallMultiples/SynchronizedTooltip.tsx +1 -1
  41. package/src/components/UsaMap/components/UsaMap.County.tsx +271 -100
  42. package/src/components/UsaMap/components/UsaMap.State.tsx +1 -1
  43. package/src/components/UsaMap/data/cb_2019_us_county_20m.json +75817 -1
  44. package/src/components/UsaMap/data/hsa_fips_mapping.json +3144 -0
  45. package/src/components/WorldMap/data/world-topo.json +1 -1
  46. package/src/data/initial-state.js +1 -0
  47. package/src/data/supported-counties.json +1 -1
  48. package/src/helpers/countyTerritories.ts +38 -0
  49. package/src/helpers/dataTableHelpers.ts +35 -6
  50. package/src/helpers/tests/countyTerritories.test.ts +87 -0
  51. package/src/hooks/useApplyTooltipsToGeo.tsx +7 -4
  52. package/src/hooks/useMapLayers.tsx +1 -1
  53. package/src/hooks/useTooltip.ts +18 -7
  54. package/src/store/map.actions.ts +5 -2
  55. package/src/store/map.reducer.ts +12 -3
  56. package/src/test/CdcMap.test.jsx +24 -0
  57. package/src/types/MapConfig.ts +6 -0
  58. package/src/types/MapContext.ts +3 -1
  59. package/topojson-updater/README.txt +1 -1
  60. package/LICENSE +0 -201
  61. package/dist/cdcmap-vr9HZwRt.es.js +0 -6
  62. package/examples/__data__/city-state-data.json +0 -668
  63. package/examples/city-state.json +0 -434
  64. package/examples/default-world-data.json +0 -1450
  65. package/examples/new-cities.json +0 -656
  66. package/src/_stories/CdcMap.Editor.stories.tsx +0 -3648
  67. package/topojson-updater/package-lock.json +0 -223
  68. /package/src/_stories/{CdcMap.ColumnWrap.stories.tsx → CdcMap.ColumnWrap.smoke.stories.tsx} +0 -0
  69. /package/src/_stories/{CdcMap.Defaults.stories.tsx → CdcMap.Defaults.smoke.stories.tsx} +0 -0
  70. /package/src/_stories/{CdcMap.DistrictOfColumbia.stories.tsx → CdcMap.DistrictOfColumbia.smoke.stories.tsx} +0 -0
  71. /package/src/_stories/{CdcMap.Filters.stories.tsx → CdcMap.Filters.smoke.stories.tsx} +0 -0
  72. /package/src/_stories/{CdcMap.Legend.Gradient.stories.tsx → CdcMap.Legend.Gradient.smoke.stories.tsx} +0 -0
  73. /package/src/_stories/{CdcMap.Legend.stories.tsx → CdcMap.Legend.smoke.stories.tsx} +0 -0
  74. /package/src/_stories/{CdcMap.Patterns.stories.tsx → CdcMap.Patterns.smoke.stories.tsx} +0 -0
  75. /package/src/_stories/{CdcMap.SmallMultiples.stories.tsx → CdcMap.SmallMultiples.smoke.stories.tsx} +0 -0
  76. /package/src/_stories/{CdcMap.Table.stories.tsx → CdcMap.Table.smoke.stories.tsx} +0 -0
  77. /package/src/_stories/{CdcMap.ZeroColor.stories.tsx → CdcMap.ZeroColor.smoke.stories.tsx} +0 -0
  78. /package/src/_stories/{GoogleMap.stories.tsx → GoogleMap.smoke.stories.tsx} +0 -0
  79. /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
  ]
@@ -140,4 +140,4 @@
140
140
  "link": ""
141
141
  }
142
142
  ]
143
- }
143
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "version": "4.26.4",
3
+ "color": "pinkpurple",
4
+ "general": {
5
+ "title": "Minimal US Map",
6
+ "geoType": "us",
7
+ "type": "data",
8
+ "showTitle": true
9
+ },
10
+ "type": "map",
11
+ "columns": {
12
+ "geo": {
13
+ "name": "FIPS Codes",
14
+ "label": "Location",
15
+ "tooltip": false,
16
+ "dataTable": true
17
+ },
18
+ "primary": {
19
+ "name": "Rate",
20
+ "label": "Rate",
21
+ "prefix": "",
22
+ "suffix": "%",
23
+ "tooltip": true,
24
+ "dataTable": true
25
+ },
26
+ "navigate": {
27
+ "name": ""
28
+ },
29
+ "latitude": {
30
+ "name": ""
31
+ },
32
+ "longitude": {
33
+ "name": ""
34
+ }
35
+ },
36
+ "legend": {
37
+ "type": "equalnumber",
38
+ "numberOfItems": 3,
39
+ "position": "side",
40
+ "style": "circles",
41
+ "title": "Legend",
42
+ "description": "",
43
+ "descriptions": {},
44
+ "specialClasses": [],
45
+ "unified": false,
46
+ "singleColumn": false,
47
+ "singleRow": false,
48
+ "verticalSorted": false,
49
+ "showSpecialClassesLast": false,
50
+ "dynamicDescription": false,
51
+ "hideBorder": false
52
+ },
53
+ "filters": [],
54
+ "filterBehavior": "Filter Change",
55
+ "data": [
56
+ {
57
+ "FIPS Codes": "01",
58
+ "Rate": 10
59
+ },
60
+ {
61
+ "FIPS Codes": "02",
62
+ "Rate": 20
63
+ },
64
+ {
65
+ "FIPS Codes": "04",
66
+ "Rate": 30
67
+ }
68
+ ]
69
+ }
@@ -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
+ }