@cdc/map 4.25.7 → 4.25.10
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/settings.local.json +30 -0
- package/CLAUDE.local.md +0 -0
- package/dist/cdcmap.js +54785 -53159
- package/examples/private/c.json +290 -0
- package/examples/private/canvas-city-hover.json +787 -0
- package/examples/private/d.json +345 -0
- package/examples/private/filter-map.json +909 -0
- package/examples/private/g.json +1 -0
- package/examples/private/h.json +105911 -0
- package/examples/private/measles-data.json +378 -0
- package/examples/private/measles.json +211 -0
- package/examples/private/north-dakota.json +1132 -0
- package/examples/private/rsv-data.json +532 -0
- package/examples/private/state-with-pattern.json +883 -0
- package/examples/private/test.json +222 -640
- package/index.html +1 -1
- package/package.json +26 -5
- package/src/CdcMap.tsx +28 -8
- package/src/CdcMapComponent.tsx +230 -306
- package/src/_stories/CdcMap.Filters.stories.tsx +2 -2
- package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +3 -3
- package/src/_stories/CdcMap.Legend.stories.tsx +7 -4
- package/src/_stories/CdcMap.Patterns.stories.tsx +2 -2
- package/src/_stories/CdcMap.Table.stories.tsx +2 -2
- package/src/_stories/CdcMap.stories.tsx +18 -11
- package/src/_stories/GoogleMap.stories.tsx +2 -2
- package/src/_stories/UsaMap.NoData.stories.tsx +2 -2
- package/src/_stories/_mock/equal-number.json +1109 -0
- package/src/_stories/_mock/multi-state.json +21389 -0
- package/src/_stories/_mock/us-bubble-cities.json +306 -0
- package/src/components/BubbleList.tsx +16 -12
- package/src/components/CityList.tsx +88 -110
- package/src/components/DataTable.tsx +44 -12
- package/src/components/EditorPanel/components/EditorPanel.tsx +201 -203
- package/src/components/EditorPanel/components/HexShapeSettings.tsx +3 -2
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +7 -5
- package/src/components/Geo.tsx +2 -0
- package/src/components/Legend/components/Legend.tsx +117 -93
- package/src/components/Legend/components/LegendGroup/Legend.Group.tsx +10 -7
- package/src/components/MapContainer.tsx +52 -0
- package/src/components/MapControls.tsx +44 -0
- package/src/components/Modal.tsx +2 -8
- package/src/components/NavigationMenu.tsx +13 -1
- package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +24 -7
- package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +21 -15
- package/src/components/UsaMap/components/TerritoriesSection.tsx +2 -2
- package/src/components/UsaMap/components/UsaMap.County.tsx +112 -33
- package/src/components/UsaMap/components/UsaMap.Region.tsx +23 -5
- package/src/components/UsaMap/components/UsaMap.SingleState.tsx +38 -26
- package/src/components/UsaMap/components/UsaMap.State.tsx +28 -10
- package/src/components/UsaMap/helpers/map.ts +16 -8
- package/src/components/WorldMap/WorldMap.tsx +116 -11
- package/src/components/ZoomControls.tsx +6 -9
- package/src/context/LegendMemoContext.tsx +30 -0
- package/src/context.ts +1 -39
- package/src/data/initial-state.js +143 -128
- package/src/data/supported-geos.js +202 -4
- package/src/helpers/addUIDs.ts +8 -8
- package/src/helpers/applyColorToLegend.ts +122 -45
- package/src/helpers/applyLegendToRow.ts +15 -13
- package/src/helpers/componentHelpers.ts +8 -0
- package/src/helpers/constants.ts +12 -0
- package/src/helpers/dataTableHelpers.ts +6 -0
- package/src/helpers/displayGeoName.ts +12 -7
- package/src/helpers/formatLegendLocation.ts +1 -3
- package/src/helpers/generateRuntimeLegend.ts +192 -340
- package/src/helpers/generateRuntimeLegendHash.ts +4 -2
- package/src/helpers/getColumnNames.ts +1 -1
- package/src/helpers/getPatternForRow.ts +36 -0
- package/src/helpers/getStatesPicked.ts +14 -0
- package/src/helpers/handleMapAriaLabels.ts +2 -2
- package/src/helpers/index.ts +11 -3
- package/src/helpers/isLegendItemDisabled.ts +16 -0
- package/src/helpers/mapObserverHelpers.ts +40 -0
- package/src/helpers/resetLegendToggles.ts +3 -2
- package/src/helpers/toggleLegendActive.ts +6 -11
- package/src/helpers/urlDataHelpers.ts +70 -0
- package/src/hooks/useGeoClickHandler.ts +35 -1
- package/src/hooks/useLegendMemo.ts +17 -0
- package/src/hooks/useMapLayers.tsx +5 -4
- package/src/hooks/useStateZoom.tsx +137 -88
- package/src/hooks/useTooltip.ts +1 -2
- package/src/index.jsx +6 -3
- package/src/scss/main.scss +23 -12
- package/src/store/map.actions.ts +2 -2
- package/src/store/map.reducer.ts +21 -10
- package/src/test/CdcMap.test.jsx +11 -0
- package/src/types/MapConfig.ts +25 -17
- package/src/types/MapContext.ts +2 -8
- package/src/types/runtimeLegend.ts +12 -10
- package/vite.config.js +2 -7
- package/vitest.config.ts +16 -0
- package/src/_stories/_mock/floating-point.json +0 -427
- package/src/coreStyles_map.scss +0 -3
- package/src/helpers/colorDistributions.ts +0 -12
- package/src/helpers/generateColorsArray.ts +0 -14
- package/src/helpers/getStatePicked.ts +0 -8
- package/src/helpers/tests/generateColorsArray.test.ts +0 -18
- package/src/helpers/tests/generateRuntimeLegendHash.test.ts +0 -11
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dashboard": {
|
|
3
|
+
"theme": "theme-blue",
|
|
4
|
+
"sharedFilters": [
|
|
5
|
+
{
|
|
6
|
+
"key": "New Dashboard Filter 1",
|
|
7
|
+
"showDropdown": true,
|
|
8
|
+
"type": "urlfilter",
|
|
9
|
+
"orderedValues": [],
|
|
10
|
+
"datasetKey": "rt_substate_map",
|
|
11
|
+
"apiFilter": {
|
|
12
|
+
"apiEndpoint": "https://cfa-public-git-test1-ideas.apps.ecpaas-dev.cdc.gov/od-public?$datakey=rt_estimates_map&location_type=%22State%22&$limit=60\n",
|
|
13
|
+
"valueSelector": "state",
|
|
14
|
+
"textSelector": ""
|
|
15
|
+
},
|
|
16
|
+
"usedBy": [
|
|
17
|
+
"map1749061009678"
|
|
18
|
+
],
|
|
19
|
+
"tier": 1
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"rows": [
|
|
24
|
+
{
|
|
25
|
+
"columns": [
|
|
26
|
+
{
|
|
27
|
+
"width": 12,
|
|
28
|
+
"widget": "dashboardFilters1758563094998"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"uuid": 1758563248622
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"uuid": 1758563248622,
|
|
35
|
+
"toggle": true,
|
|
36
|
+
"equalHeight": "__undefined__",
|
|
37
|
+
"columns": [
|
|
38
|
+
{
|
|
39
|
+
"toggleName": "County",
|
|
40
|
+
"width": 12,
|
|
41
|
+
"widget": "map1749061009678"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"toggleName": "__undefined__",
|
|
45
|
+
"width": 12
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"visualizations": {
|
|
51
|
+
"map1749061009678": {
|
|
52
|
+
"annotations": [],
|
|
53
|
+
"color": "qualitative",
|
|
54
|
+
"general": {
|
|
55
|
+
"navigationTarget": "_self",
|
|
56
|
+
"noDataMessage": "No State Selected",
|
|
57
|
+
"annotationDropdownText": "Annotations",
|
|
58
|
+
"geoBorderColor": "darkGray",
|
|
59
|
+
"headerColor": "theme-blue",
|
|
60
|
+
"title": "",
|
|
61
|
+
"showTitle": true,
|
|
62
|
+
"showSidebar": true,
|
|
63
|
+
"showDownloadMediaButton": false,
|
|
64
|
+
"displayAsHex": false,
|
|
65
|
+
"displayStateLabels": true,
|
|
66
|
+
"territoriesAlwaysShow": false,
|
|
67
|
+
"language": "en",
|
|
68
|
+
"geoType": "single-state",
|
|
69
|
+
"geoLabelOverride": "",
|
|
70
|
+
"hasRegions": false,
|
|
71
|
+
"fullBorder": false,
|
|
72
|
+
"type": "data",
|
|
73
|
+
"convertFipsCodes": true,
|
|
74
|
+
"palette": {
|
|
75
|
+
"isReversed": false,
|
|
76
|
+
"name": "sequential_pink_purple",
|
|
77
|
+
"version": "1.0",
|
|
78
|
+
"customColors": [
|
|
79
|
+
"#6d085a",
|
|
80
|
+
"#b83d93",
|
|
81
|
+
"#e3e3e3",
|
|
82
|
+
"#3bbbb0",
|
|
83
|
+
"#006166",
|
|
84
|
+
"#ffffff"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"allowMapZoom": false,
|
|
88
|
+
"hideGeoColumnInTooltip": false,
|
|
89
|
+
"hidePrimaryColumnInTooltip": false,
|
|
90
|
+
"statesPicked": [
|
|
91
|
+
{
|
|
92
|
+
"fipsCode": "01",
|
|
93
|
+
"stateName": "Alabama"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"filterControlsStatesPicked": "state"
|
|
97
|
+
},
|
|
98
|
+
"type": "map",
|
|
99
|
+
"columns": {
|
|
100
|
+
"geo": {
|
|
101
|
+
"name": "fips",
|
|
102
|
+
"label": "Location",
|
|
103
|
+
"tooltip": false,
|
|
104
|
+
"dataTable": true
|
|
105
|
+
},
|
|
106
|
+
"primary": {
|
|
107
|
+
"dataTable": true,
|
|
108
|
+
"tooltip": true,
|
|
109
|
+
"prefix": "",
|
|
110
|
+
"suffix": "",
|
|
111
|
+
"name": "category",
|
|
112
|
+
"label": "category",
|
|
113
|
+
"roundToPlace": 0
|
|
114
|
+
},
|
|
115
|
+
"navigate": {
|
|
116
|
+
"name": ""
|
|
117
|
+
},
|
|
118
|
+
"latitude": {
|
|
119
|
+
"name": ""
|
|
120
|
+
},
|
|
121
|
+
"longitude": {
|
|
122
|
+
"name": ""
|
|
123
|
+
},
|
|
124
|
+
"additionalColumn1": {
|
|
125
|
+
"label": "hsa",
|
|
126
|
+
"dataTable": false,
|
|
127
|
+
"tooltips": false,
|
|
128
|
+
"prefix": "",
|
|
129
|
+
"suffix": "",
|
|
130
|
+
"name": "hsa_no",
|
|
131
|
+
"tooltip": true
|
|
132
|
+
},
|
|
133
|
+
"additionalColumn2": {
|
|
134
|
+
"label": "fips",
|
|
135
|
+
"dataTable": false,
|
|
136
|
+
"tooltips": false,
|
|
137
|
+
"prefix": "",
|
|
138
|
+
"suffix": "",
|
|
139
|
+
"name": "fips",
|
|
140
|
+
"tooltip": true
|
|
141
|
+
},
|
|
142
|
+
"additionalColumn3": {
|
|
143
|
+
"label": "hsa-desc",
|
|
144
|
+
"dataTable": false,
|
|
145
|
+
"tooltips": false,
|
|
146
|
+
"prefix": "",
|
|
147
|
+
"suffix": "",
|
|
148
|
+
"name": "hsa_description",
|
|
149
|
+
"tooltip": true
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"legend": {
|
|
153
|
+
"descriptions": {},
|
|
154
|
+
"specialClasses": [],
|
|
155
|
+
"unified": false,
|
|
156
|
+
"singleColumn": true,
|
|
157
|
+
"singleRow": false,
|
|
158
|
+
"verticalSorted": false,
|
|
159
|
+
"showSpecialClassesLast": false,
|
|
160
|
+
"dynamicDescription": false,
|
|
161
|
+
"type": "category",
|
|
162
|
+
"numberOfItems": 6,
|
|
163
|
+
"position": "side",
|
|
164
|
+
"title": "Epidemic Trends",
|
|
165
|
+
"style": "circles",
|
|
166
|
+
"subStyle": "linear blocks",
|
|
167
|
+
"tickRotation": "",
|
|
168
|
+
"singleColumnLegend": false,
|
|
169
|
+
"hideBorder": false,
|
|
170
|
+
"groupBy": "",
|
|
171
|
+
"categoryValuesOrder": [
|
|
172
|
+
"Growing",
|
|
173
|
+
"Likely Growing",
|
|
174
|
+
"Not Changing",
|
|
175
|
+
"Likely Declining",
|
|
176
|
+
"Declining",
|
|
177
|
+
"Not Estimated"
|
|
178
|
+
],
|
|
179
|
+
"additionalCategories": [
|
|
180
|
+
"Growing",
|
|
181
|
+
"Likely Growing",
|
|
182
|
+
"Not Changing",
|
|
183
|
+
"Likely Declining",
|
|
184
|
+
"Declining",
|
|
185
|
+
"Not Estimated"
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"filters": [],
|
|
189
|
+
"table": {
|
|
190
|
+
"wrapColumns": false,
|
|
191
|
+
"label": "Data Table",
|
|
192
|
+
"expanded": false,
|
|
193
|
+
"limitHeight": false,
|
|
194
|
+
"height": "",
|
|
195
|
+
"caption": "",
|
|
196
|
+
"showDownloadUrl": false,
|
|
197
|
+
"showDataTableLink": false,
|
|
198
|
+
"showDownloadLinkBelow": true,
|
|
199
|
+
"showFullGeoNameInCSV": false,
|
|
200
|
+
"forceDisplay": true,
|
|
201
|
+
"download": false,
|
|
202
|
+
"indexLabel": "",
|
|
203
|
+
"cellMinWidth": "0",
|
|
204
|
+
"collapsible": true,
|
|
205
|
+
"sharedFilterColumns": [
|
|
206
|
+
"State"
|
|
207
|
+
],
|
|
208
|
+
"showNonGeoData": true
|
|
209
|
+
},
|
|
210
|
+
"tooltips": {
|
|
211
|
+
"appearanceType": "hover",
|
|
212
|
+
"linkLabel": "Learn More",
|
|
213
|
+
"opacity": 90,
|
|
214
|
+
"capitalizeLabels": true
|
|
215
|
+
},
|
|
216
|
+
"visual": {
|
|
217
|
+
"minBubbleSize": 1,
|
|
218
|
+
"maxBubbleSize": 20,
|
|
219
|
+
"extraBubbleBorder": false,
|
|
220
|
+
"cityStyle": "circle",
|
|
221
|
+
"cityStyleLabel": "",
|
|
222
|
+
"showBubbleZeros": false,
|
|
223
|
+
"additionalCityStyles": [],
|
|
224
|
+
"geoCodeCircleSize": 8
|
|
225
|
+
},
|
|
226
|
+
"mapPosition": {
|
|
227
|
+
"coordinates": [
|
|
228
|
+
0,
|
|
229
|
+
30
|
|
230
|
+
],
|
|
231
|
+
"zoom": 1
|
|
232
|
+
},
|
|
233
|
+
"map": {
|
|
234
|
+
"layers": [],
|
|
235
|
+
"patterns": []
|
|
236
|
+
},
|
|
237
|
+
"hexMap": {
|
|
238
|
+
"type": "",
|
|
239
|
+
"shapeGroups": [
|
|
240
|
+
{
|
|
241
|
+
"legendTitle": "",
|
|
242
|
+
"legendDescription": "",
|
|
243
|
+
"items": [
|
|
244
|
+
{
|
|
245
|
+
"key": "",
|
|
246
|
+
"shape": "Arrow Up",
|
|
247
|
+
"column": "",
|
|
248
|
+
"operator": "=",
|
|
249
|
+
"value": ""
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
"filterBehavior": "Filter Change",
|
|
256
|
+
"filterIntro": "",
|
|
257
|
+
"openModal": true,
|
|
258
|
+
"uid": "map1749061009678",
|
|
259
|
+
"dataDescription": {
|
|
260
|
+
"horizontal": false,
|
|
261
|
+
"series": false
|
|
262
|
+
},
|
|
263
|
+
"dataKey": "rt_substate_map"
|
|
264
|
+
},
|
|
265
|
+
"dashboardFilters1758563094998": {
|
|
266
|
+
"filters": [],
|
|
267
|
+
"filterBehavior": "Filter Change",
|
|
268
|
+
"newViz": true,
|
|
269
|
+
"openModal": true,
|
|
270
|
+
"uid": "dashboardFilters1758563094998",
|
|
271
|
+
"type": "dashboardFilters",
|
|
272
|
+
"sharedFilterIndexes": [
|
|
273
|
+
0
|
|
274
|
+
],
|
|
275
|
+
"visualizationType": "dashboardFilters"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"table": {
|
|
279
|
+
"label": "Data Table",
|
|
280
|
+
"show": false,
|
|
281
|
+
"showDownloadUrl": false,
|
|
282
|
+
"showVertical": true
|
|
283
|
+
},
|
|
284
|
+
"id": 15,
|
|
285
|
+
"category": "General",
|
|
286
|
+
"type": "dashboard",
|
|
287
|
+
"subType": null,
|
|
288
|
+
"orientation": null,
|
|
289
|
+
"content": "Present multiple data visualizations with shared filter controls.",
|
|
290
|
+
"visualizationType": null,
|
|
291
|
+
"activeVizButtonID": 15,
|
|
292
|
+
"version": "4.25.9",
|
|
293
|
+
"migrations": {
|
|
294
|
+
"addColorMigration": true
|
|
295
|
+
},
|
|
296
|
+
"uuid": 1758563086392,
|
|
297
|
+
"label": "COVID-19",
|
|
298
|
+
"runtime": {},
|
|
299
|
+
"general": {
|
|
300
|
+
"palette": {
|
|
301
|
+
"version": "1.0",
|
|
302
|
+
"backups": [
|
|
303
|
+
{
|
|
304
|
+
"name": "__undefined__",
|
|
305
|
+
"version": "1.0",
|
|
306
|
+
"isReversed": "__undefined__"
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"datasets": {
|
|
312
|
+
"rt_covid_states": {
|
|
313
|
+
"dataFileSize": 7186,
|
|
314
|
+
"dataFileFormat": "CSV",
|
|
315
|
+
"preview": false,
|
|
316
|
+
"dataUrl": "/wcms/vizdata/cfa/RtEstimates/covid/covid_map_data_with_burden.csv",
|
|
317
|
+
"dataFileName": "/wcms/vizdata/cfa/RtEstimates/covid/covid_map_data_with_burden.csv",
|
|
318
|
+
"dataFileSourceType": "url"
|
|
319
|
+
},
|
|
320
|
+
"substate_data": {
|
|
321
|
+
"dataFileSize": 976856,
|
|
322
|
+
"dataFileName": "/wcms/vizdata/cfa/RtEstimates/substate/combined_file_poc/substate_combined_file_poc.csv",
|
|
323
|
+
"dataFileSourceType": "url",
|
|
324
|
+
"dataFileFormat": "CSV",
|
|
325
|
+
"preview": false,
|
|
326
|
+
"dataUrl": "/wcms/vizdata/cfa/RtEstimates/substate/combined_file_poc/substate_combined_file_poc.csv"
|
|
327
|
+
},
|
|
328
|
+
"rt_estimates_map": {
|
|
329
|
+
"dataFileSize": 20855,
|
|
330
|
+
"dataFileName": "https://cfa-public-git-test1-ideas.apps.ecpaas-dev.cdc.gov/od-public?$datakey=rt_estimates_map&location_type=%22State%22&$limit=60",
|
|
331
|
+
"dataFileSourceType": "url",
|
|
332
|
+
"dataFileFormat": "JSON",
|
|
333
|
+
"preview": false,
|
|
334
|
+
"dataUrl": "https://cfa-public-git-test1-ideas.apps.ecpaas-dev.cdc.gov/od-public?$datakey=rt_estimates_map&location_type=%22State%22&$limit=60"
|
|
335
|
+
},
|
|
336
|
+
"rt_substate_map": {
|
|
337
|
+
"dataFileSize": 71882,
|
|
338
|
+
"dataFileName": "https://cfa-public-git-test1-ideas.apps.ecpaas-dev.cdc.gov/od-public?$datakey=rt_estimates_map&pathogen=%22COVID-19%22&$limit=200",
|
|
339
|
+
"dataFileSourceType": "url",
|
|
340
|
+
"dataFileFormat": "JSON",
|
|
341
|
+
"preview": true,
|
|
342
|
+
"dataUrl": "https://cfa-public-git-test1-ideas.apps.ecpaas-dev.cdc.gov/od-public?$datakey=rt_estimates_map&pathogen=%22COVID-19%22&$limit=200"
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|