@cdc/map 4.25.10 → 4.25.11
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.
- package/.claude/agents/typescript-organizer.md +118 -0
- package/dist/{cdcmap-fce76882.es.js → cdcmap-BnB1QM5d.es.js} +6 -13
- package/dist/{cdcmap-c55ac1ea.es.js → cdcmap-D6CG2-Hb.es.js} +5 -12
- package/dist/{cdcmap-31a33da1.es.js → cdcmap-MXgURbdZ.es.js} +6 -13
- package/dist/{cdcmap-1a1724a1.es.js → cdcmap-dgT_1dIT.es.js} +136 -151
- package/dist/cdcmap.js +27405 -25783
- package/examples/example-city-state.json +9 -1
- package/examples/multi-country-centering.json +45 -0
- package/examples/private/colors-2.json +221 -0
- package/examples/private/colors.json +221 -0
- package/index.html +2 -1
- package/package.json +4 -4
- package/src/CdcMapComponent.tsx +44 -20
- package/src/_stories/CdcMap.ColumnWrap.stories.tsx +31 -0
- package/src/_stories/CdcMap.DistrictOfColumbia.stories.tsx +320 -0
- package/src/_stories/CdcMap.Editor.stories.tsx +3371 -0
- package/src/_stories/CdcMap.SmallMultiples.stories.tsx +35 -0
- package/src/_stories/CdcMap.stories.tsx +22 -4
- package/src/_stories/_mock/column-wrap-test.json +265 -0
- package/src/_stories/_mock/multi-country-hide.json +78 -0
- package/src/_stories/_mock/multi-country.json +95 -0
- package/src/_stories/_mock/multi-state.json +887 -20403
- package/src/_stories/_mock/small_multiples/multi-state-small-multiples.json +8399 -0
- package/src/_stories/_mock/small_multiples/region-small-multiples.json +657 -0
- package/src/_stories/_mock/small_multiples/wastewater-map-small-multiples.json +221 -0
- package/src/_stories/_mock/usa-state-gradient.json +2 -4
- package/src/components/BubbleList.tsx +1 -1
- package/src/components/EditorPanel/components/EditorPanel.tsx +630 -564
- package/src/components/EditorPanel/components/HexShapeSettings.tsx +55 -93
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +27 -37
- package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.tsx +354 -0
- package/src/components/EditorPanel/components/Panels/index.tsx +3 -1
- package/src/components/Geo.tsx +20 -3
- package/src/components/Legend/components/Legend.tsx +34 -34
- package/src/components/Legend/components/index.scss +1 -1
- package/src/components/NavigationMenu.tsx +16 -13
- package/src/components/SmallMultiples/SmallMultipleTile.tsx +163 -0
- package/src/components/SmallMultiples/SmallMultiples.css +32 -0
- package/src/components/SmallMultiples/SmallMultiples.tsx +150 -0
- package/src/components/SmallMultiples/SynchronizedTooltip.tsx +105 -0
- package/src/components/SmallMultiples/index.tsx +3 -0
- package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +18 -3
- package/src/components/UsaMap/components/TerritoriesSection.tsx +26 -12
- package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +30 -4
- package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +23 -4
- package/src/components/UsaMap/components/Territory/TerritoryShape.ts +6 -0
- package/src/components/UsaMap/components/UsaMap.County.tsx +14 -2
- package/src/components/UsaMap/components/UsaMap.Region.tsx +14 -1
- package/src/components/UsaMap/components/UsaMap.SingleState.tsx +25 -5
- package/src/components/UsaMap/components/UsaMap.State.tsx +26 -3
- package/src/components/UsaMap/helpers/map.ts +2 -2
- package/src/components/UsaMap/helpers/shapes.ts +9 -6
- package/src/components/WorldMap/WorldMap.tsx +81 -11
- package/src/data/initial-state.js +10 -0
- package/src/data/supported-geos.js +8 -76
- package/src/helpers/addUIDs.ts +13 -2
- package/src/helpers/applyColorToLegend.ts +25 -1
- package/src/helpers/constants.ts +1 -15
- package/src/helpers/displayGeoName.ts +19 -4
- package/src/helpers/generateRuntimeLegend.ts +0 -2
- package/src/helpers/getCountriesPicked.ts +103 -0
- package/src/helpers/getMapContainerClasses.ts +7 -0
- package/src/helpers/getPatternForRow.ts +2 -5
- package/src/helpers/index.ts +1 -9
- package/src/helpers/smallMultiplesHelpers.ts +359 -0
- package/src/helpers/tests/titleCase.test.ts +76 -0
- package/src/helpers/titleCase.ts +13 -13
- package/src/helpers/urlDataHelpers.ts +1 -1
- package/src/hooks/useCountryZoom.tsx +241 -0
- package/src/hooks/useGeoClickHandler.ts +1 -1
- package/src/hooks/useProgrammaticMapTooltip.ts +110 -0
- package/src/hooks/useResizeObserver.ts +5 -2
- package/src/hooks/useStateZoom.tsx +5 -2
- package/src/hooks/useSynchronizedGeographies.ts +56 -0
- package/src/index.jsx +1 -0
- package/src/scss/editor-panel.scss +4 -440
- package/src/scss/main.scss +1 -1
- package/src/scss/map.scss +12 -15
- package/src/store/map.actions.ts +7 -7
- package/src/types/MapConfig.ts +30 -11
- package/src/types/MapContext.ts +6 -0
- package/src/types/runtimeLegend.ts +1 -1
- package/src/components/DataTable.tsx +0 -413
- package/src/components/EditorPanel/components/Inputs.tsx +0 -59
- package/src/hooks/useActiveElement.ts +0 -19
- package/src/scss/mixins.scss +0 -47
- package/src/types/Annotations.ts +0 -24
- /package/dist/{cdcmap-548642e6.es.js → cdcmap-Ct2SB0vL.es.js} +0 -0
|
@@ -19,7 +19,15 @@
|
|
|
19
19
|
"displayStateLabels": false,
|
|
20
20
|
"fullBorder": false,
|
|
21
21
|
"palette": {
|
|
22
|
-
"isReversed": false
|
|
22
|
+
"isReversed": false,
|
|
23
|
+
"customColors": [
|
|
24
|
+
"red",
|
|
25
|
+
"red",
|
|
26
|
+
"orange",
|
|
27
|
+
"orange",
|
|
28
|
+
"yellow",
|
|
29
|
+
"yellow"
|
|
30
|
+
]
|
|
23
31
|
},
|
|
24
32
|
"allowMapZoom": true,
|
|
25
33
|
"hideGeoColumnInTooltip": false,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"geo": "US",
|
|
5
|
+
"value": 100
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"geo": "CA",
|
|
9
|
+
"value": 200
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"geo": "MX",
|
|
13
|
+
"value": 150
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"columns": {
|
|
17
|
+
"geo": {
|
|
18
|
+
"name": "geo"
|
|
19
|
+
},
|
|
20
|
+
"primary": {
|
|
21
|
+
"name": "value"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "world",
|
|
25
|
+
"general": {
|
|
26
|
+
"geoType": "world",
|
|
27
|
+
"type": "data",
|
|
28
|
+
"title": "Multi-Country Centering Test",
|
|
29
|
+
"showTitle": true,
|
|
30
|
+
"countriesPicked": [
|
|
31
|
+
{ "iso": "US", "name": "United States" },
|
|
32
|
+
{ "iso": "CA", "name": "Canada" },
|
|
33
|
+
{ "iso": "MX", "name": "Mexico" }
|
|
34
|
+
],
|
|
35
|
+
"hideUnselectedCountries": true,
|
|
36
|
+
"allowMapZoom": true
|
|
37
|
+
},
|
|
38
|
+
"legend": {
|
|
39
|
+
"descriptions": {
|
|
40
|
+
"US": "United States",
|
|
41
|
+
"CA": "Canada",
|
|
42
|
+
"MX": "Mexico"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
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
|
+
"showSidebar": true,
|
|
12
|
+
"showDownloadMediaButton": false,
|
|
13
|
+
"displayAsHex": false,
|
|
14
|
+
"displayStateLabels": false,
|
|
15
|
+
"territoriesAlwaysShow": false,
|
|
16
|
+
"language": "en",
|
|
17
|
+
"geoType": "us-county",
|
|
18
|
+
"geoLabelOverride": "Sewershed",
|
|
19
|
+
"hasRegions": false,
|
|
20
|
+
"fullBorder": false,
|
|
21
|
+
"type": "us-geocode",
|
|
22
|
+
"convertFipsCodes": true,
|
|
23
|
+
"palette": {
|
|
24
|
+
"isReversed": false,
|
|
25
|
+
"name": "sequential_pink_purple",
|
|
26
|
+
"version": "1.0",
|
|
27
|
+
"customColors": [
|
|
28
|
+
"#6b0057",
|
|
29
|
+
"#6b0057",
|
|
30
|
+
"#6b0057",
|
|
31
|
+
"#5bc2b9",
|
|
32
|
+
"#e0e0e0",
|
|
33
|
+
"#e0e0e0"
|
|
34
|
+
],
|
|
35
|
+
"backups": [
|
|
36
|
+
{
|
|
37
|
+
"name": "sequential_pink_purple",
|
|
38
|
+
"version": "1.0",
|
|
39
|
+
"isReversed": false
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"allowMapZoom": false,
|
|
44
|
+
"hideGeoColumnInTooltip": false,
|
|
45
|
+
"hidePrimaryColumnInTooltip": false,
|
|
46
|
+
"statesPicked": [
|
|
47
|
+
{
|
|
48
|
+
"fipsCode": "01",
|
|
49
|
+
"stateName": "Alabama"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"expandDataTable": false,
|
|
53
|
+
"introText": "",
|
|
54
|
+
"subtext": "<div class=\"text-left ml-3 pb-3\" >\nWastewater measles data available on this site may not represent all jurisdictions currently conducting monitoring. Some states and local health departments may publish additional data on their own webpages. CDC continues to work closely with partners to integrate these data into national reporting.\n\nFor Utah, please visit: <a href=\"https://avrpublic.dhhs.utah.gov/uwss/\">Utah Department of Health and Human Services</a>.\n</div>\n\n<div class=\"text-left ml-3 pb-3\">Data <span class=\"date\">FromDB</span></div>\n<p class=\"float-right\"><a href=\"/wcms/vizdata/NCEZID_DIDRI/measles/nwssmeaslessitemapnocoords.csv\">Download Data</a></p>",
|
|
55
|
+
"footnotes": ""
|
|
56
|
+
},
|
|
57
|
+
"type": "map",
|
|
58
|
+
"columns": {
|
|
59
|
+
"geo": {
|
|
60
|
+
"name": "Sewershed",
|
|
61
|
+
"label": "Location",
|
|
62
|
+
"tooltip": false,
|
|
63
|
+
"dataTable": true
|
|
64
|
+
},
|
|
65
|
+
"primary": {
|
|
66
|
+
"dataTable": true,
|
|
67
|
+
"tooltip": true,
|
|
68
|
+
"prefix": "",
|
|
69
|
+
"suffix": "",
|
|
70
|
+
"name": "Detection_Category",
|
|
71
|
+
"label": "Detection Category",
|
|
72
|
+
"roundToPlace": 0
|
|
73
|
+
},
|
|
74
|
+
"navigate": {
|
|
75
|
+
"name": ""
|
|
76
|
+
},
|
|
77
|
+
"latitude": {
|
|
78
|
+
"name": "Latitude"
|
|
79
|
+
},
|
|
80
|
+
"longitude": {
|
|
81
|
+
"name": "Longitude"
|
|
82
|
+
},
|
|
83
|
+
"additionalColumn1": {
|
|
84
|
+
"label": "State/Territory",
|
|
85
|
+
"dataTable": true,
|
|
86
|
+
"tooltips": false,
|
|
87
|
+
"prefix": "",
|
|
88
|
+
"suffix": "",
|
|
89
|
+
"name": "State/Territory",
|
|
90
|
+
"tooltip": true
|
|
91
|
+
},
|
|
92
|
+
"additionalColumn2": {
|
|
93
|
+
"label": "Counties Served",
|
|
94
|
+
"dataTable": true,
|
|
95
|
+
"tooltips": false,
|
|
96
|
+
"prefix": "",
|
|
97
|
+
"suffix": "",
|
|
98
|
+
"name": "Counties_Served",
|
|
99
|
+
"tooltip": true
|
|
100
|
+
},
|
|
101
|
+
"additionalColumn4": {
|
|
102
|
+
"label": "Population Served",
|
|
103
|
+
"dataTable": true,
|
|
104
|
+
"tooltips": false,
|
|
105
|
+
"prefix": "",
|
|
106
|
+
"suffix": "",
|
|
107
|
+
"name": "Population_Served",
|
|
108
|
+
"useCommas": true,
|
|
109
|
+
"tooltip": true
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"legend": {
|
|
113
|
+
"descriptions": {},
|
|
114
|
+
"specialClasses": [],
|
|
115
|
+
"unified": false,
|
|
116
|
+
"singleColumn": false,
|
|
117
|
+
"singleRow": true,
|
|
118
|
+
"verticalSorted": false,
|
|
119
|
+
"showSpecialClassesLast": false,
|
|
120
|
+
"dynamicDescription": false,
|
|
121
|
+
"type": "category",
|
|
122
|
+
"numberOfItems": 3,
|
|
123
|
+
"position": "bottom",
|
|
124
|
+
"title": "Select a detection type below to add or remove it from the map.",
|
|
125
|
+
"style": "circles",
|
|
126
|
+
"subStyle": "linear blocks",
|
|
127
|
+
"tickRotation": "",
|
|
128
|
+
"singleColumnLegend": false,
|
|
129
|
+
"hideBorder": false,
|
|
130
|
+
"groupBy": "",
|
|
131
|
+
"categoryValuesOrder": [
|
|
132
|
+
"Detection",
|
|
133
|
+
"No Detection",
|
|
134
|
+
"No Data",
|
|
135
|
+
"H5 Detection",
|
|
136
|
+
"No Samples in Last Week"
|
|
137
|
+
],
|
|
138
|
+
"additionalCategories": [
|
|
139
|
+
"Detection",
|
|
140
|
+
""
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"filters": [],
|
|
144
|
+
"table": {
|
|
145
|
+
"wrapColumns": false,
|
|
146
|
+
"label": "Data Table",
|
|
147
|
+
"expanded": false,
|
|
148
|
+
"limitHeight": false,
|
|
149
|
+
"height": "",
|
|
150
|
+
"caption": "",
|
|
151
|
+
"showDownloadUrl": false,
|
|
152
|
+
"showDataTableLink": true,
|
|
153
|
+
"showDownloadLinkBelow": false,
|
|
154
|
+
"showFullGeoNameInCSV": false,
|
|
155
|
+
"forceDisplay": true,
|
|
156
|
+
"download": false,
|
|
157
|
+
"indexLabel": "Sewershed",
|
|
158
|
+
"cellMinWidth": "0",
|
|
159
|
+
"collapsible": true
|
|
160
|
+
},
|
|
161
|
+
"tooltips": {
|
|
162
|
+
"appearanceType": "hover",
|
|
163
|
+
"linkLabel": "Learn More",
|
|
164
|
+
"opacity": 90,
|
|
165
|
+
"capitalizeLabels": true
|
|
166
|
+
},
|
|
167
|
+
"visual": {
|
|
168
|
+
"minBubbleSize": 1,
|
|
169
|
+
"maxBubbleSize": 20,
|
|
170
|
+
"extraBubbleBorder": false,
|
|
171
|
+
"cityStyle": "circle",
|
|
172
|
+
"cityStyleLabel": "",
|
|
173
|
+
"showBubbleZeros": false,
|
|
174
|
+
"additionalCityStyles": [],
|
|
175
|
+
"geoCodeCircleSize": "5"
|
|
176
|
+
},
|
|
177
|
+
"mapPosition": {
|
|
178
|
+
"coordinates": [
|
|
179
|
+
0,
|
|
180
|
+
30
|
|
181
|
+
],
|
|
182
|
+
"zoom": 1
|
|
183
|
+
},
|
|
184
|
+
"map": {
|
|
185
|
+
"layers": [],
|
|
186
|
+
"patterns": []
|
|
187
|
+
},
|
|
188
|
+
"hexMap": {
|
|
189
|
+
"type": "",
|
|
190
|
+
"shapeGroups": [
|
|
191
|
+
{
|
|
192
|
+
"legendTitle": "",
|
|
193
|
+
"legendDescription": "",
|
|
194
|
+
"items": [
|
|
195
|
+
{
|
|
196
|
+
"key": "",
|
|
197
|
+
"shape": "Arrow Up",
|
|
198
|
+
"column": "",
|
|
199
|
+
"operator": "=",
|
|
200
|
+
"value": ""
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"filterBehavior": "Filter Change",
|
|
207
|
+
"filterIntro": "",
|
|
208
|
+
"markupVariables": [],
|
|
209
|
+
"enableMarkupVariables": false,
|
|
210
|
+
"dataFileName": "/wcms/vizdata/NCEZID_DIDRI/measles/nwssmeaslessitemap.json",
|
|
211
|
+
"dataFileSourceType": "url",
|
|
212
|
+
"dataDescription": {
|
|
213
|
+
"horizontal": false,
|
|
214
|
+
"series": false
|
|
215
|
+
},
|
|
216
|
+
"version": "4.25.10",
|
|
217
|
+
"dataUrl": "https://www.cdc.gov/wcms/vizdata/NCEZID_DIDRI/measles/nwssmeaslessitemap.json",
|
|
218
|
+
"migrations": {
|
|
219
|
+
"addColorMigration": true
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
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
|
+
"showSidebar": true,
|
|
12
|
+
"showDownloadMediaButton": false,
|
|
13
|
+
"displayAsHex": false,
|
|
14
|
+
"displayStateLabels": false,
|
|
15
|
+
"territoriesAlwaysShow": false,
|
|
16
|
+
"language": "en",
|
|
17
|
+
"geoType": "us-county",
|
|
18
|
+
"geoLabelOverride": "Sewershed",
|
|
19
|
+
"hasRegions": false,
|
|
20
|
+
"fullBorder": false,
|
|
21
|
+
"type": "us-geocode",
|
|
22
|
+
"convertFipsCodes": true,
|
|
23
|
+
"palette": {
|
|
24
|
+
"isReversed": false,
|
|
25
|
+
"name": "sequential_pink_purple",
|
|
26
|
+
"version": "1.0",
|
|
27
|
+
"customColors": [
|
|
28
|
+
"#6b0057",
|
|
29
|
+
"#6b0057",
|
|
30
|
+
"#6b0057",
|
|
31
|
+
"#5bc2b9",
|
|
32
|
+
"#e0e0e0",
|
|
33
|
+
"#e0e0e0"
|
|
34
|
+
],
|
|
35
|
+
"backups": [
|
|
36
|
+
{
|
|
37
|
+
"name": "sequential_pink_purple",
|
|
38
|
+
"version": "1.0",
|
|
39
|
+
"isReversed": false
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"allowMapZoom": false,
|
|
44
|
+
"hideGeoColumnInTooltip": false,
|
|
45
|
+
"hidePrimaryColumnInTooltip": false,
|
|
46
|
+
"statesPicked": [
|
|
47
|
+
{
|
|
48
|
+
"fipsCode": "01",
|
|
49
|
+
"stateName": "Alabama"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"expandDataTable": false,
|
|
53
|
+
"introText": "",
|
|
54
|
+
"subtext": "<div class=\"text-left ml-3 pb-3\" >\nWastewater measles data available on this site may not represent all jurisdictions currently conducting monitoring. Some states and local health departments may publish additional data on their own webpages. CDC continues to work closely with partners to integrate these data into national reporting.\n\nFor Utah, please visit: <a href=\"https://avrpublic.dhhs.utah.gov/uwss/\">Utah Department of Health and Human Services</a>.\n</div>\n\n<div class=\"text-left ml-3 pb-3\">Data <span class=\"date\">FromDB</span></div>\n<p class=\"float-right\"><a href=\"/wcms/vizdata/NCEZID_DIDRI/measles/nwssmeaslessitemapnocoords.csv\">Download Data</a></p>",
|
|
55
|
+
"footnotes": ""
|
|
56
|
+
},
|
|
57
|
+
"type": "map",
|
|
58
|
+
"columns": {
|
|
59
|
+
"geo": {
|
|
60
|
+
"name": "Sewershed",
|
|
61
|
+
"label": "Location",
|
|
62
|
+
"tooltip": false,
|
|
63
|
+
"dataTable": true
|
|
64
|
+
},
|
|
65
|
+
"primary": {
|
|
66
|
+
"dataTable": true,
|
|
67
|
+
"tooltip": true,
|
|
68
|
+
"prefix": "",
|
|
69
|
+
"suffix": "",
|
|
70
|
+
"name": "Detection_Category",
|
|
71
|
+
"label": "Detection Category",
|
|
72
|
+
"roundToPlace": 0
|
|
73
|
+
},
|
|
74
|
+
"navigate": {
|
|
75
|
+
"name": ""
|
|
76
|
+
},
|
|
77
|
+
"latitude": {
|
|
78
|
+
"name": "Latitude"
|
|
79
|
+
},
|
|
80
|
+
"longitude": {
|
|
81
|
+
"name": "Longitude"
|
|
82
|
+
},
|
|
83
|
+
"additionalColumn1": {
|
|
84
|
+
"label": "State/Territory",
|
|
85
|
+
"dataTable": true,
|
|
86
|
+
"tooltips": false,
|
|
87
|
+
"prefix": "",
|
|
88
|
+
"suffix": "",
|
|
89
|
+
"name": "State/Territory",
|
|
90
|
+
"tooltip": true
|
|
91
|
+
},
|
|
92
|
+
"additionalColumn2": {
|
|
93
|
+
"label": "Counties Served",
|
|
94
|
+
"dataTable": true,
|
|
95
|
+
"tooltips": false,
|
|
96
|
+
"prefix": "",
|
|
97
|
+
"suffix": "",
|
|
98
|
+
"name": "Counties_Served",
|
|
99
|
+
"tooltip": true
|
|
100
|
+
},
|
|
101
|
+
"additionalColumn4": {
|
|
102
|
+
"label": "Population Served",
|
|
103
|
+
"dataTable": true,
|
|
104
|
+
"tooltips": false,
|
|
105
|
+
"prefix": "",
|
|
106
|
+
"suffix": "",
|
|
107
|
+
"name": "Population_Served",
|
|
108
|
+
"useCommas": true,
|
|
109
|
+
"tooltip": true
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"legend": {
|
|
113
|
+
"descriptions": {},
|
|
114
|
+
"specialClasses": [],
|
|
115
|
+
"unified": false,
|
|
116
|
+
"singleColumn": false,
|
|
117
|
+
"singleRow": true,
|
|
118
|
+
"verticalSorted": false,
|
|
119
|
+
"showSpecialClassesLast": false,
|
|
120
|
+
"dynamicDescription": false,
|
|
121
|
+
"type": "category",
|
|
122
|
+
"numberOfItems": 3,
|
|
123
|
+
"position": "bottom",
|
|
124
|
+
"title": "Select a detection type below to add or remove it from the map.",
|
|
125
|
+
"style": "circles",
|
|
126
|
+
"subStyle": "linear blocks",
|
|
127
|
+
"tickRotation": "",
|
|
128
|
+
"singleColumnLegend": false,
|
|
129
|
+
"hideBorder": false,
|
|
130
|
+
"groupBy": "",
|
|
131
|
+
"categoryValuesOrder": [
|
|
132
|
+
"Detection",
|
|
133
|
+
"No Detection",
|
|
134
|
+
"No Data",
|
|
135
|
+
"H5 Detection",
|
|
136
|
+
"No Samples in Last Week"
|
|
137
|
+
],
|
|
138
|
+
"additionalCategories": [
|
|
139
|
+
"Detection",
|
|
140
|
+
""
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"filters": [],
|
|
144
|
+
"table": {
|
|
145
|
+
"wrapColumns": false,
|
|
146
|
+
"label": "Data Table",
|
|
147
|
+
"expanded": false,
|
|
148
|
+
"limitHeight": false,
|
|
149
|
+
"height": "",
|
|
150
|
+
"caption": "",
|
|
151
|
+
"showDownloadUrl": false,
|
|
152
|
+
"showDataTableLink": true,
|
|
153
|
+
"showDownloadLinkBelow": false,
|
|
154
|
+
"showFullGeoNameInCSV": false,
|
|
155
|
+
"forceDisplay": true,
|
|
156
|
+
"download": false,
|
|
157
|
+
"indexLabel": "Sewershed",
|
|
158
|
+
"cellMinWidth": "0",
|
|
159
|
+
"collapsible": true
|
|
160
|
+
},
|
|
161
|
+
"tooltips": {
|
|
162
|
+
"appearanceType": "hover",
|
|
163
|
+
"linkLabel": "Learn More",
|
|
164
|
+
"opacity": 90,
|
|
165
|
+
"capitalizeLabels": true
|
|
166
|
+
},
|
|
167
|
+
"visual": {
|
|
168
|
+
"minBubbleSize": 1,
|
|
169
|
+
"maxBubbleSize": 20,
|
|
170
|
+
"extraBubbleBorder": false,
|
|
171
|
+
"cityStyle": "circle",
|
|
172
|
+
"cityStyleLabel": "",
|
|
173
|
+
"showBubbleZeros": false,
|
|
174
|
+
"additionalCityStyles": [],
|
|
175
|
+
"geoCodeCircleSize": "5"
|
|
176
|
+
},
|
|
177
|
+
"mapPosition": {
|
|
178
|
+
"coordinates": [
|
|
179
|
+
0,
|
|
180
|
+
30
|
|
181
|
+
],
|
|
182
|
+
"zoom": 1
|
|
183
|
+
},
|
|
184
|
+
"map": {
|
|
185
|
+
"layers": [],
|
|
186
|
+
"patterns": []
|
|
187
|
+
},
|
|
188
|
+
"hexMap": {
|
|
189
|
+
"type": "",
|
|
190
|
+
"shapeGroups": [
|
|
191
|
+
{
|
|
192
|
+
"legendTitle": "",
|
|
193
|
+
"legendDescription": "",
|
|
194
|
+
"items": [
|
|
195
|
+
{
|
|
196
|
+
"key": "",
|
|
197
|
+
"shape": "Arrow Up",
|
|
198
|
+
"column": "",
|
|
199
|
+
"operator": "=",
|
|
200
|
+
"value": ""
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"filterBehavior": "Filter Change",
|
|
207
|
+
"filterIntro": "",
|
|
208
|
+
"markupVariables": [],
|
|
209
|
+
"enableMarkupVariables": false,
|
|
210
|
+
"dataFileName": "/wcms/vizdata/NCEZID_DIDRI/measles/nwssmeaslessitemap.json",
|
|
211
|
+
"dataFileSourceType": "url",
|
|
212
|
+
"dataDescription": {
|
|
213
|
+
"horizontal": false,
|
|
214
|
+
"series": false
|
|
215
|
+
},
|
|
216
|
+
"version": "4.25.10",
|
|
217
|
+
"dataUrl": "https://www.cdc.gov/wcms/vizdata/NCEZID_DIDRI/measles/nwssmeaslessitemap.json",
|
|
218
|
+
"migrations": {
|
|
219
|
+
"addColorMigration": true
|
|
220
|
+
}
|
|
221
|
+
}
|
package/index.html
CHANGED
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
|
|
31
31
|
<body>
|
|
32
32
|
<!-- DEFAULT EXAMPLES -->
|
|
33
|
-
<div class="react-container" data-config="/examples/example-city-state.json"></div>
|
|
33
|
+
<!-- <div class="react-container" data-config="/examples/example-city-state.json"></div> -->
|
|
34
|
+
<div class="react-container" data-config="/examples/private/measles.json"></div>
|
|
34
35
|
|
|
35
36
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
36
37
|
<script type="module" src="./src/index.jsx"></script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/map",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.11",
|
|
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,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@cdc/core": "^4.25.
|
|
28
|
+
"@cdc/core": "^4.25.11",
|
|
29
29
|
"@googlemaps/markerclusterer": "^2.5.3",
|
|
30
30
|
"@hello-pangea/dnd": "^16.2.0",
|
|
31
31
|
"@react-google-maps/api": "^2.20.6",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"resize-observer-polyfill": "^1.5.1",
|
|
58
58
|
"topojson-client": "^3.1.0",
|
|
59
59
|
"use-debounce": "^10.0.5",
|
|
60
|
-
"vite": "^
|
|
60
|
+
"vite": "^5.4.21",
|
|
61
61
|
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
62
62
|
"vite-plugin-svgr": "^2.4.0",
|
|
63
63
|
"whatwg-fetch": "3.6.20"
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"react": "^18.2.0",
|
|
67
67
|
"react-dom": "^18.2.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "5f09a137c22f454111ab5f4cd7fdf1d2d58e31bd"
|
|
70
70
|
}
|
package/src/CdcMapComponent.tsx
CHANGED
|
@@ -40,12 +40,13 @@ import {
|
|
|
40
40
|
hashObj,
|
|
41
41
|
navigationHandler
|
|
42
42
|
} from './helpers'
|
|
43
|
-
import generateRuntimeLegend from './helpers/generateRuntimeLegend'
|
|
43
|
+
import { generateRuntimeLegend } from './helpers/generateRuntimeLegend'
|
|
44
44
|
import generateRuntimeData from './helpers/generateRuntimeData'
|
|
45
45
|
import { reloadURLData } from './helpers/urlDataHelpers'
|
|
46
46
|
import { observeMapSvgLoaded } from './helpers/mapObserverHelpers'
|
|
47
47
|
import { buildSectionClassNames } from './helpers/componentHelpers'
|
|
48
48
|
import { shouldShowDataTable } from './helpers/dataTableHelpers'
|
|
49
|
+
import { prepareSmallMultiplesDataTable } from './helpers/smallMultiplesHelpers'
|
|
49
50
|
|
|
50
51
|
// Child Components
|
|
51
52
|
import Annotation from './components/Annotation'
|
|
@@ -169,7 +170,7 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
169
170
|
const tooltipId = 'tooltipId'
|
|
170
171
|
|
|
171
172
|
// hooks
|
|
172
|
-
const { currentViewport, dimensions, container, outerContainerRef } = useResizeObserver(isEditor)
|
|
173
|
+
const { currentViewport, vizViewport, dimensions, container, outerContainerRef } = useResizeObserver(isEditor)
|
|
173
174
|
|
|
174
175
|
useEffect(() => {
|
|
175
176
|
if (!mapSvg.current || coveLoadedHasRan) return
|
|
@@ -229,7 +230,10 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
229
230
|
} else {
|
|
230
231
|
if (hashLegend !== runtimeLegend?.fromHash && undefined === runtimeData?.init) {
|
|
231
232
|
const legend = generateRuntimeLegend(
|
|
232
|
-
|
|
233
|
+
{
|
|
234
|
+
...config,
|
|
235
|
+
legend: { ...config.legend, unified: config.smallMultiples?.mode ? true : config.legend?.unified }
|
|
236
|
+
},
|
|
233
237
|
runtimeData,
|
|
234
238
|
hashLegend,
|
|
235
239
|
setConfig,
|
|
@@ -245,7 +249,11 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
245
249
|
useEffect(() => {
|
|
246
250
|
const hashLegend = generateRuntimeLegendHash(config, runtimeFilters)
|
|
247
251
|
const legend = generateRuntimeLegend(
|
|
248
|
-
{
|
|
252
|
+
{
|
|
253
|
+
...config,
|
|
254
|
+
data: configObj.data,
|
|
255
|
+
legend: { ...config.legend, unified: config.smallMultiples?.mode ? true : config.legend?.unified }
|
|
256
|
+
},
|
|
249
257
|
runtimeData,
|
|
250
258
|
hashLegend,
|
|
251
259
|
setConfig,
|
|
@@ -327,6 +335,7 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
327
335
|
container,
|
|
328
336
|
content: modal,
|
|
329
337
|
currentViewport,
|
|
338
|
+
vizViewport,
|
|
330
339
|
customNavigationHandler,
|
|
331
340
|
dimensions,
|
|
332
341
|
filteredCountryCode,
|
|
@@ -379,6 +388,17 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
379
388
|
</a>
|
|
380
389
|
)
|
|
381
390
|
|
|
391
|
+
// Prepare data table props (pivot if small multiples mode is enabled)
|
|
392
|
+
let dataTableConfig = config
|
|
393
|
+
let dataTableColumns = columns
|
|
394
|
+
let dataTableRuntimeData = runtimeData
|
|
395
|
+
if (config.smallMultiples?.mode) {
|
|
396
|
+
const prepared = prepareSmallMultiplesDataTable(config, columns, runtimeData)
|
|
397
|
+
dataTableConfig = prepared.config
|
|
398
|
+
dataTableColumns = prepared.columns
|
|
399
|
+
dataTableRuntimeData = prepared.runtimeData
|
|
400
|
+
}
|
|
401
|
+
|
|
382
402
|
return (
|
|
383
403
|
<LegendMemoProvider legendMemo={legendMemo} legendSpecialClassLastMemo={legendSpecialClassLastMemo}>
|
|
384
404
|
<ConfigContext.Provider value={mapProps}>
|
|
@@ -487,13 +507,13 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
487
507
|
|
|
488
508
|
{shouldShowDataTable(config, table, general, loading) && (
|
|
489
509
|
<DataTable
|
|
490
|
-
columns={
|
|
491
|
-
config={
|
|
510
|
+
columns={dataTableColumns}
|
|
511
|
+
config={dataTableConfig}
|
|
492
512
|
currentViewport={currentViewport}
|
|
493
513
|
displayGeoName={displayGeoName}
|
|
494
514
|
expandDataTable={table.expanded}
|
|
495
515
|
formatLegendLocation={key =>
|
|
496
|
-
formatLegendLocation(key,
|
|
516
|
+
formatLegendLocation(key, dataTableRuntimeData?.[key]?.[config.columns.geo.name])
|
|
497
517
|
}
|
|
498
518
|
headerColor={general.headerColor}
|
|
499
519
|
imageRef={imageId}
|
|
@@ -503,8 +523,8 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
503
523
|
legendSpecialClassLastMemo={legendSpecialClassLastMemo}
|
|
504
524
|
navigationHandler={navigationHandler}
|
|
505
525
|
outerContainerRef={outerContainerRef}
|
|
506
|
-
rawData={
|
|
507
|
-
runtimeData={
|
|
526
|
+
rawData={dataTableConfig.data}
|
|
527
|
+
runtimeData={dataTableRuntimeData}
|
|
508
528
|
runtimeLegend={runtimeLegend}
|
|
509
529
|
showDownloadImgButton={showDownloadImgButton}
|
|
510
530
|
showDownloadPdfButton={showDownloadPdfButton}
|
|
@@ -526,16 +546,14 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
526
546
|
{accessibleStatus}
|
|
527
547
|
</div>
|
|
528
548
|
|
|
529
|
-
{!isDraggingAnnotation &&
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
/>
|
|
538
|
-
)}
|
|
549
|
+
{!isDraggingAnnotation && 'hover' === tooltips.appearanceType && (
|
|
550
|
+
<ReactTooltip
|
|
551
|
+
id={`tooltip__${tooltipId}`}
|
|
552
|
+
float={true}
|
|
553
|
+
className={`tooltip tooltip-test`}
|
|
554
|
+
style={{ background: `rgba(255,255,255, ${config.tooltips.opacity / 100})`, color: 'black' }}
|
|
555
|
+
/>
|
|
556
|
+
)}
|
|
539
557
|
<div
|
|
540
558
|
ref={tooltipRef}
|
|
541
559
|
id={`tooltip__${tooltipId}-canvas`}
|
|
@@ -547,7 +565,13 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
|
|
|
547
565
|
display: 'none' // can't use d-none here
|
|
548
566
|
}}
|
|
549
567
|
></div>
|
|
550
|
-
<FootnotesStandAlone
|
|
568
|
+
<FootnotesStandAlone
|
|
569
|
+
config={config.footnotes}
|
|
570
|
+
filters={config.filters?.filter(f => f.filterFootnotes)}
|
|
571
|
+
markupVariables={config.markupVariables}
|
|
572
|
+
enableMarkupVariables={config.enableMarkupVariables}
|
|
573
|
+
data={config.data}
|
|
574
|
+
/>
|
|
551
575
|
</Layout.Responsive>
|
|
552
576
|
</Layout.VisualizationWrapper>
|
|
553
577
|
</MapDispatchContext.Provider>
|