@cdc/map 4.24.12-2 → 4.25.1

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 (52) hide show
  1. package/dist/cdcmap.js +47146 -45979
  2. package/examples/annotation/index.json +1 -1
  3. package/examples/custom-map-layers.json +1 -1
  4. package/examples/default-geocode.json +2 -2
  5. package/examples/private/mmr.json +246 -0
  6. package/index.html +12 -14
  7. package/package.json +8 -3
  8. package/src/CdcMap.tsx +85 -362
  9. package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +9 -0
  10. package/src/_stories/CdcMap.stories.tsx +1 -1
  11. package/src/_stories/GoogleMap.stories.tsx +19 -0
  12. package/src/_stories/_mock/DEV-10148.json +859 -0
  13. package/src/_stories/_mock/DEV-9989.json +229 -0
  14. package/src/_stories/_mock/example-city-state.json +1 -1
  15. package/src/_stories/_mock/google-map.json +819 -0
  16. package/src/components/Annotation/Annotation.Draggable.tsx +34 -43
  17. package/src/components/Annotation/AnnotationDropdown.tsx +4 -4
  18. package/src/components/CityList.tsx +2 -2
  19. package/src/components/DataTable.tsx +8 -9
  20. package/src/components/EditorPanel/components/EditorPanel.tsx +90 -17
  21. package/src/components/GoogleMap/components/GoogleMap.tsx +67 -0
  22. package/src/components/GoogleMap/index.tsx +3 -0
  23. package/src/components/Legend/components/Legend.tsx +40 -30
  24. package/src/components/Legend/components/LegendItem.Hex.tsx +7 -3
  25. package/src/components/Legend/components/index.scss +22 -16
  26. package/src/components/Modal.tsx +6 -5
  27. package/src/components/NavigationMenu.tsx +5 -4
  28. package/src/components/UsaMap/components/TerritoriesSection.tsx +56 -0
  29. package/src/components/UsaMap/components/UsaMap.County.tsx +1 -1
  30. package/src/components/UsaMap/components/UsaMap.Region.tsx +12 -8
  31. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +2 -2
  32. package/src/components/UsaMap/components/UsaMap.State.tsx +22 -28
  33. package/src/components/WorldMap/WorldMap.tsx +3 -5
  34. package/src/context.ts +0 -12
  35. package/src/data/initial-state.js +2 -2
  36. package/src/data/supported-geos.js +23 -3
  37. package/src/helpers/applyColorToLegend.ts +3 -3
  38. package/src/helpers/closeModal.ts +9 -0
  39. package/src/helpers/handleMapAriaLabels.ts +38 -0
  40. package/src/helpers/indexOfIgnoreType.ts +8 -0
  41. package/src/helpers/navigationHandler.ts +21 -0
  42. package/src/helpers/toTitleCase.ts +44 -0
  43. package/src/helpers/validateFipsCodeLength.ts +30 -0
  44. package/src/hooks/useResizeObserver.ts +42 -0
  45. package/src/hooks/useTooltip.ts +4 -2
  46. package/src/index.jsx +1 -0
  47. package/src/scss/editor-panel.scss +2 -1
  48. package/src/scss/filters.scss +0 -5
  49. package/src/scss/main.scss +57 -61
  50. package/src/scss/map.scss +1 -13
  51. package/src/types/MapConfig.ts +19 -11
  52. package/src/types/MapContext.ts +4 -12
@@ -549,4 +549,4 @@
549
549
  "validated": 4.23,
550
550
  "version": "4.24.4",
551
551
  "showEditorPanel": true
552
- }
552
+ }
@@ -769,4 +769,4 @@
769
769
  "URL": "https://www.cdc.gov/"
770
770
  }
771
771
  ]
772
- }
772
+ }
@@ -651,7 +651,7 @@
651
651
  "Value": 82
652
652
  },
653
653
  {
654
- "City": "Richmond",
654
+ "City": "Richmond, Virginia",
655
655
  "Longitude": "-77.43605",
656
656
  "Latitude": "37.540726",
657
657
  "Value": 83
@@ -811,4 +811,4 @@
811
811
  "fullBorder": false,
812
812
  "validated": 4.23,
813
813
  "version": "4.24.11"
814
- }
814
+ }
@@ -0,0 +1,246 @@
1
+ {
2
+ "annotations": [],
3
+ "general": {
4
+ "noStateFoundMessage": "Map Unavailable",
5
+ "annotationDropdownText": "Annotations",
6
+ "geoBorderColor": "darkGray",
7
+ "headerColor": "theme-blue",
8
+ "title": "",
9
+ "showTitle": true,
10
+ "showSidebar": true,
11
+ "showDownloadButton": true,
12
+ "showDownloadMediaButton": false,
13
+ "displayAsHex": false,
14
+ "displayStateLabels": false,
15
+ "territoriesLabel": "Territories",
16
+ "territoriesAlwaysShow": false,
17
+ "language": "en",
18
+ "geoType": "us",
19
+ "geoLabelOverride": "",
20
+ "hasRegions": false,
21
+ "fullBorder": false,
22
+ "type": "map",
23
+ "convertFipsCodes": true,
24
+ "palette": {
25
+ "isReversed": false
26
+ },
27
+ "allowMapZoom": false,
28
+ "hideGeoColumnInTooltip": true,
29
+ "hidePrimaryColumnInTooltip": false,
30
+ "statePicked": {
31
+ "fipsCode": "01",
32
+ "stateName": "Alabama"
33
+ },
34
+ "expandDataTable": false,
35
+ "footnotes": "Note: Alabama, Florida, Georgia, Iowa, Mississippi, New Hampshire, and New Jersey did not assess coverage for individual vaccines. Estimates shown are the percentage of kindergartners who received all doses of all vaccines required for school entry."
36
+ },
37
+ "type": "map",
38
+ "color": "pinkpurple",
39
+ "columns": {
40
+ "geo": {
41
+ "name": "geography",
42
+ "label": "Location",
43
+ "tooltip": false,
44
+ "dataTable": true
45
+ },
46
+ "primary": {
47
+ "dataTable": true,
48
+ "tooltip": false,
49
+ "prefix": "",
50
+ "suffix": "",
51
+ "name": "categories",
52
+ "label": "Category",
53
+ "roundToPlace": 0
54
+ },
55
+ "navigate": {
56
+ "name": ""
57
+ },
58
+ "latitude": {
59
+ "name": ""
60
+ },
61
+ "longitude": {
62
+ "name": ""
63
+ },
64
+ "additionalColumn1": {
65
+ "label": "Estimated Percent Vaccinated",
66
+ "dataTable": true,
67
+ "tooltips": false,
68
+ "prefix": "",
69
+ "suffix": "",
70
+ "name": "estimate_pct",
71
+ "tooltip": true
72
+ },
73
+ "additionalColumn2": {
74
+ "label": "School Year",
75
+ "dataTable": true,
76
+ "tooltips": false,
77
+ "prefix": "",
78
+ "suffix": "",
79
+ "name": "school_year",
80
+ "tooltip": true
81
+ },
82
+ "additionalColumn3": {
83
+ "label": "Population Size",
84
+ "dataTable": true,
85
+ "tooltips": false,
86
+ "prefix": "",
87
+ "suffix": "",
88
+ "name": "population_size",
89
+ "useCommas": true,
90
+ "tooltip": false
91
+ },
92
+ "additionalColumn4": {
93
+ "label": "Percent Surveyed",
94
+ "dataTable": true,
95
+ "tooltips": false,
96
+ "prefix": "",
97
+ "suffix": "%",
98
+ "name": "percent_surveyed",
99
+ "tooltip": false
100
+ },
101
+ "additionalColumn5": {
102
+ "label": "Survey Type",
103
+ "dataTable": true,
104
+ "tooltips": false,
105
+ "prefix": "",
106
+ "suffix": "",
107
+ "name": "survey_type",
108
+ "tooltip": false
109
+ }
110
+ },
111
+ "legend": {
112
+ "descriptions": {},
113
+ "specialClasses": [
114
+ {
115
+ "key": "categories",
116
+ "value": "NA",
117
+ "label": "Not available"
118
+ },
119
+ {
120
+ "key": "estimate_pct",
121
+ "value": "NA",
122
+ "label": "Not available"
123
+ },
124
+ {}
125
+ ],
126
+ "unified": true,
127
+ "singleColumn": false,
128
+ "singleRow": false,
129
+ "verticalSorted": false,
130
+ "showSpecialClassesLast": true,
131
+ "dynamicDescription": false,
132
+ "type": "category",
133
+ "numberOfItems": 3,
134
+ "position": "bottom",
135
+ "title": "Percent Vaccinated",
136
+ "style": "circles",
137
+ "subStyle": "linear blocks",
138
+ "tickRotation": "",
139
+ "singleColumnLegend": false,
140
+ "hideBorder": false,
141
+ "categoryValuesOrder": [
142
+ "Less than 90%",
143
+ "90-94.9%",
144
+ "95%+",
145
+ "NA"
146
+ ]
147
+ },
148
+ "filters": [
149
+ {
150
+ "order": "desc",
151
+ "label": "",
152
+ "columnName": "school_year",
153
+ "values": [
154
+ "2009-10",
155
+ "2010-11",
156
+ "2011-12",
157
+ "2012-13",
158
+ "2013-14",
159
+ "2014-15",
160
+ "2015-16",
161
+ "2016-17",
162
+ "2017-18",
163
+ "2018-19",
164
+ "2019-20",
165
+ "2020-21",
166
+ "2021-22",
167
+ "2022-23",
168
+ "2023-24"
169
+ ],
170
+ "filterStyle": "dropdown"
171
+ }
172
+ ],
173
+ "table": {
174
+ "wrapColumns": true,
175
+ "label": "Data Table",
176
+ "expanded": false,
177
+ "limitHeight": false,
178
+ "height": "",
179
+ "caption": "",
180
+ "showDownloadUrl": false,
181
+ "showDataTableLink": true,
182
+ "showFullGeoNameInCSV": false,
183
+ "forceDisplay": true,
184
+ "download": true,
185
+ "indexLabel": ""
186
+ },
187
+ "tooltips": {
188
+ "appearanceType": "hover",
189
+ "linkLabel": "Learn More",
190
+ "capitalizeLabels": true,
191
+ "opacity": 90
192
+ },
193
+ "visual": {
194
+ "minBubbleSize": 1,
195
+ "maxBubbleSize": 20,
196
+ "extraBubbleBorder": false,
197
+ "cityStyle": "circle",
198
+ "cityStyleLabel": "",
199
+ "showBubbleZeros": false,
200
+ "additionalCityStyles": [],
201
+ "geoCodeCircleSize": 8
202
+ },
203
+ "mapPosition": {
204
+ "coordinates": [
205
+ 0,
206
+ 30
207
+ ],
208
+ "zoom": 1
209
+ },
210
+ "map": {
211
+ "layers": [],
212
+ "patterns": []
213
+ },
214
+ "hexMap": {
215
+ "type": "",
216
+ "shapeGroups": [
217
+ {
218
+ "legendTitle": "",
219
+ "legendDescription": "",
220
+ "items": [
221
+ {
222
+ "key": "",
223
+ "shape": "Arrow Up",
224
+ "column": "",
225
+ "operator": "=",
226
+ "value": ""
227
+ }
228
+ ]
229
+ }
230
+ ]
231
+ },
232
+ "filterBehavior": "Filter Change",
233
+ "dataUrl": "https://www.cdc.gov/wcms/vizdata/measles/MeaslesKindergartenVaxcovExemptions.json",
234
+ "dataFileName": "/wcms/vizdata/measles/MeaslesKindergartenVaxcovExemptions.json",
235
+ "dataFileSourceType": "url",
236
+ "version": "4.24.9",
237
+ "customColors": [
238
+ "#EB7723",
239
+ "#EB7723",
240
+ "#F2A46C",
241
+ "#F2A46C",
242
+ "#9BBFDC",
243
+ "#9BBFDC",
244
+ "#9BBFDC"
245
+ ]
246
+ }
package/index.html CHANGED
@@ -13,19 +13,13 @@
13
13
  min-height: 100vh;
14
14
  }
15
15
  </style>
16
- <link
17
- rel="stylesheet prefetch"
18
- href="https://www.cdc.gov/TemplatePackage/contrib/libs/bootstrap/latest/css/bootstrap.min.css?_=39423"
19
- />
20
- <link rel="stylesheet prefetch" href="https://www.cdc.gov/TemplatePackage/4.0/assets/css/app.min.css?_=39423" />
16
+ <link rel="stylesheet prefetch" href="https://www.cdc.gov/TemplatePackage/5.0/css/app.min.css?_=71669" />
21
17
  </head>
22
18
 
23
19
  <body>
24
20
  <!-- DEFAULT EXAMPLES -->
25
- <!-- <div class="react-container" data-config="/examples/private/default-patterns.json"></div>-->
21
+ <div class="react-container" data-config="/examples/private/ardi.json"></div>
26
22
  <!-- <div class="react-container" data-config="/examples/hex-colors.json"></div> -->
27
- <!-- <div class="react-container" data-config="/examples/private/map.json"></div> -->
28
- <!-- <div class="react-container" data-config="/examples/private/zika-issue.json"></div> -->
29
23
  <!-- <div class="react-container react-container--maps" data-config="/examples/annotation/index.json">/</div> -->
30
24
 
31
25
  <!-- <div class="react-container react-container--maps" data-config="/examples/private/tooltip-issue.json"></div> -->
@@ -34,9 +28,12 @@
34
28
  <!-- <div class="react-container react-container--maps" data-config="/examples/private/map-text-wrap.json"></div> -->
35
29
  <!-- <div class="react-container react-container--maps" data-config="/examples/private/tooltip-issue.json"></div> -->
36
30
  <!-- <div class="react-container react-container--maps" data-config="/examples/test.json"></div> -->
37
- <div class="react-container react-container--maps" data-config="/examples/default-usa-regions.json"></div>
31
+ <!-- <div class="react-container react-container--maps" data-config="/examples/default-usa-regions.json"></div> -->
38
32
  <!-- <div class="react-container react-container--maps" data-config="/examples/default-usa.json"></div> -->
39
- <!-- <div class="react-container react-container--maps" data-config="https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/US-County-Level-Map.json"></div> -->
33
+ <div
34
+ class="react-container react-container--maps"
35
+ data-config="https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/US-County-Level-Map.json"
36
+ ></div>
40
37
  <!-- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/default-geocode.json"></div> -->
41
38
  <!-- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/default-single-state.json"></div> -->
42
39
  <!-- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/bubble-us.json"></div> -->
@@ -46,17 +43,18 @@
46
43
  <!-- <div class="react-container" data-config="/examples/private/wastewater.json"></div> -->
47
44
 
48
45
  <!-- TP4 EXAMPLES -->
49
- <!-- <div class="react-container react-container--maps" data-config="/examples/private/solr.json"></div> -->
50
46
  <!-- <div class="react-container react-container--maps" data-config="/examples/custom-map-layers.json"></div> -->
51
- <!-- <div class="react-container react-container--maps" data-config="/examples/example-city-stateBAD.json"></div> -->
52
47
  <!-- <div class="react-container react-container--maps" data-config="/examples/private/world-map.json"></div> -->
53
48
  <!-- <div class="react-container react-container--maps" data-config="/examples/default-hex.json"></div> -->
54
49
  <!-- <div class="react-container react-container--maps" data-config="/examples/default-hex.json"></div> -->
55
50
  <!-- <div class="react-container react-container--maps" data-config="/examples/hex-with-arrows.json"></div> -->
56
51
 
57
52
  <!-- TP4 EXAMPLES -->
58
- <div class="react-container react-container--maps" data-config="/examples/example-city-state.json"></div>
59
- <!-- <div class="react-container react-container--maps" data-config="/examples/example-city-state-no-territories.json"></div> -->
53
+ <!-- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/example-city-state.json"></div>-->
54
+ <div
55
+ class="react-container react-container--maps"
56
+ data-config="/examples/example-city-state-no-territories.json"
57
+ ></div>
60
58
  <!-- <div class="react-container react-container--maps" data-config="/examples/example-world-map.json"></div> -->
61
59
  <!-- <div class="react-container react-container--maps" data-config="/examples/default-hex.json"></div> -->
62
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/map",
3
- "version": "4.24.12-2",
3
+ "version": "4.25.1",
4
4
  "description": "React component for visualizing tabular data on a map of the United States or the world.",
5
5
  "moduleName": "CdcMap",
6
6
  "main": "dist/cdcmap",
@@ -25,10 +25,12 @@
25
25
  },
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@cdc/core": "^4.24.12-2",
28
+ "@cdc/core": "^4.25.1",
29
29
  "@emotion/core": "^10.0.28",
30
30
  "@emotion/react": "^11.1.5",
31
+ "@googlemaps/markerclusterer": "^2.5.3",
31
32
  "@hello-pangea/dnd": "^16.2.0",
33
+ "@react-google-maps/api": "^2.20.3",
32
34
  "@visx/geo": "^1.13.0",
33
35
  "chroma": "0.0.1",
34
36
  "chroma-js": "^2.1.0",
@@ -38,9 +40,12 @@
38
40
  "d3-zoom": "^3.0.0",
39
41
  "html-react-parser": "^3.0.8",
40
42
  "html2canvas": "^1.0.0-rc.7",
43
+ "leaflet": "^1.9.4",
41
44
  "lodash.debounce": "^4.0.8",
42
45
  "papaparse": "^5.3.0",
43
46
  "react-accessible-accordion": "^3.0.1",
47
+ "react-leaflet": "^4.2.1",
48
+ "react-leaflet-markercluster": "^4.1.1",
44
49
  "react-table": "^7.5.0",
45
50
  "react-tag-autocomplete": "^6.0.0",
46
51
  "react-tooltip": "5.8.2-beta.3",
@@ -52,5 +57,5 @@
52
57
  "react": "^18.2.0",
53
58
  "react-dom": "^18.2.0"
54
59
  },
55
- "gitHead": "a60edf1148396309eb473ac9f65426ee40797ddf"
60
+ "gitHead": "c32d727f516fe3525178e3a6480abbe70b2a20d6"
56
61
  }