@cdc/map 4.25.5-1 → 4.25.6-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.
- package/.idea/map.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/LICENSE +201 -0
- package/dist/cdcmap.js +19455 -18752
- package/examples/private/m.json +427 -0
- package/index.html +33 -32
- package/package.json +7 -13
- package/src/CdcMap.tsx +10 -2
- package/src/CdcMapComponent.tsx +23 -9
- package/src/_stories/CdcMap.Table.stories.tsx +19 -0
- package/src/_stories/CdcMap.stories.tsx +8 -0
- package/src/_stories/_mock/default-patterns.json +8 -5
- package/src/_stories/_mock/legend-bins.json +428 -0
- package/src/components/EditorPanel/components/EditorPanel.tsx +120 -76
- package/src/components/Legend/components/index.scss +56 -11
- package/src/components/UsaMap/components/UsaMap.SingleState.tsx +16 -18
- package/src/helpers/addUIDs.ts +1 -2
- package/src/helpers/formatLegendLocation.ts +3 -2
- package/src/helpers/generateRuntimeData.ts +6 -2
- package/src/helpers/generateRuntimeLegend.ts +88 -59
- package/src/helpers/getStatePicked.ts +8 -0
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
{
|
|
2
|
+
"general": {
|
|
3
|
+
"geoType": "us",
|
|
4
|
+
"geoBorderColor": "darkGray",
|
|
5
|
+
"showTitle": false,
|
|
6
|
+
"showSidebar": true,
|
|
7
|
+
"showDownloadButton": false,
|
|
8
|
+
"showDownloadMediaButton": false,
|
|
9
|
+
"displayAsHex": true,
|
|
10
|
+
"displayStateLabels": false,
|
|
11
|
+
"territoriesLabel": "Territories",
|
|
12
|
+
"language": "en",
|
|
13
|
+
"hasRegions": false,
|
|
14
|
+
"expandDataTable": false,
|
|
15
|
+
"fullBorder": false,
|
|
16
|
+
"type": "data",
|
|
17
|
+
"palette": {
|
|
18
|
+
"isReversed": true
|
|
19
|
+
},
|
|
20
|
+
"geoLabelOverride": "",
|
|
21
|
+
"convertFipsCodes": true,
|
|
22
|
+
"allowMapZoom": true,
|
|
23
|
+
"hideGeoColumnInTooltip": false,
|
|
24
|
+
"hidePrimaryColumnInTooltip": false,
|
|
25
|
+
"superTitle": "",
|
|
26
|
+
"equalNumberOptIn": true,
|
|
27
|
+
"navigationTarget": "_self",
|
|
28
|
+
"noStateFoundMessage": "Map Unavailable",
|
|
29
|
+
"annotationDropdownText": "Annotations",
|
|
30
|
+
"headerColor": "theme-blue",
|
|
31
|
+
"title": "",
|
|
32
|
+
"territoriesAlwaysShow": false,
|
|
33
|
+
"statePicked": {
|
|
34
|
+
"fipsCode": "01",
|
|
35
|
+
"stateName": "Alabama"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"type": "map",
|
|
39
|
+
"customColors": [
|
|
40
|
+
"gray",
|
|
41
|
+
"#edf8fb",
|
|
42
|
+
"gray",
|
|
43
|
+
"#b3cde3",
|
|
44
|
+
"gray",
|
|
45
|
+
"#8c96c6",
|
|
46
|
+
"#8856a7",
|
|
47
|
+
"#810f7c"
|
|
48
|
+
],
|
|
49
|
+
"columns": {
|
|
50
|
+
"geo": {
|
|
51
|
+
"name": "state",
|
|
52
|
+
"label": "Location",
|
|
53
|
+
"tooltip": false,
|
|
54
|
+
"dataTable": true
|
|
55
|
+
},
|
|
56
|
+
"primary": {
|
|
57
|
+
"dataTable": true,
|
|
58
|
+
"tooltip": true,
|
|
59
|
+
"prefix": "",
|
|
60
|
+
"suffix": "%",
|
|
61
|
+
"name": "value",
|
|
62
|
+
"label": "",
|
|
63
|
+
"roundToPlace": 1
|
|
64
|
+
},
|
|
65
|
+
"navigate": {
|
|
66
|
+
"name": ""
|
|
67
|
+
},
|
|
68
|
+
"latitude": {
|
|
69
|
+
"name": ""
|
|
70
|
+
},
|
|
71
|
+
"longitude": {
|
|
72
|
+
"name": ""
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"legend": {
|
|
76
|
+
"descriptions": {},
|
|
77
|
+
"specialClasses": [
|
|
78
|
+
{
|
|
79
|
+
"key": "value",
|
|
80
|
+
"value": "",
|
|
81
|
+
"label": "No data"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"unified": false,
|
|
85
|
+
"singleColumn": false,
|
|
86
|
+
"dynamicDescription": false,
|
|
87
|
+
"type": "equalnumber",
|
|
88
|
+
"numberOfItems": 5,
|
|
89
|
+
"position": "side",
|
|
90
|
+
"title": "Legend",
|
|
91
|
+
"singleRow": false,
|
|
92
|
+
"verticalSorted": false,
|
|
93
|
+
"showSpecialClassesLast": true,
|
|
94
|
+
"categoryValuesOrder": [
|
|
95
|
+
"No",
|
|
96
|
+
"Yes"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"filters": [],
|
|
100
|
+
"table": {
|
|
101
|
+
"wrapColumns": false,
|
|
102
|
+
"label": "Data Table",
|
|
103
|
+
"expanded": false,
|
|
104
|
+
"limitHeight": false,
|
|
105
|
+
"height": "",
|
|
106
|
+
"caption": "",
|
|
107
|
+
"showDownloadUrl": false,
|
|
108
|
+
"showDataTableLink": false,
|
|
109
|
+
"showFullGeoNameInCSV": false,
|
|
110
|
+
"forceDisplay": false,
|
|
111
|
+
"download": true,
|
|
112
|
+
"indexLabel": "",
|
|
113
|
+
"showDownloadLinkBelow": true,
|
|
114
|
+
"cellMinWidth": "0"
|
|
115
|
+
},
|
|
116
|
+
"tooltips": {
|
|
117
|
+
"appearanceType": "hover",
|
|
118
|
+
"linkLabel": "Learn More",
|
|
119
|
+
"capitalizeLabels": true,
|
|
120
|
+
"opacity": 90
|
|
121
|
+
},
|
|
122
|
+
"visual": {
|
|
123
|
+
"minBubbleSize": 1,
|
|
124
|
+
"maxBubbleSize": 20,
|
|
125
|
+
"extraBubbleBorder": false,
|
|
126
|
+
"cityStyle": "circle",
|
|
127
|
+
"cityStyleLabel": "",
|
|
128
|
+
"showBubbleZeros": false,
|
|
129
|
+
"additionalCityStyles": [],
|
|
130
|
+
"geoCodeCircleSize": 8
|
|
131
|
+
},
|
|
132
|
+
"mapPosition": {
|
|
133
|
+
"coordinates": [
|
|
134
|
+
0,
|
|
135
|
+
30
|
|
136
|
+
],
|
|
137
|
+
"zoom": 1
|
|
138
|
+
},
|
|
139
|
+
"map": {
|
|
140
|
+
"layers": [],
|
|
141
|
+
"patterns": []
|
|
142
|
+
},
|
|
143
|
+
"filterBehavior": "Filter Change",
|
|
144
|
+
"dataTable": {
|
|
145
|
+
"title": "Data Table",
|
|
146
|
+
"forceDisplay": true,
|
|
147
|
+
"caption": "Lorem Ipsum - Text added to Data Table Caption",
|
|
148
|
+
"limitHeight": true,
|
|
149
|
+
"height": "100"
|
|
150
|
+
},
|
|
151
|
+
"orientation": null,
|
|
152
|
+
"visualizationSubType": null,
|
|
153
|
+
"validated": "4.24.3",
|
|
154
|
+
"version": "4.24.12",
|
|
155
|
+
"data": [
|
|
156
|
+
{
|
|
157
|
+
"state": "Alaska",
|
|
158
|
+
"stratification": "Total",
|
|
159
|
+
"value": "33.3"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"state": "Alabama",
|
|
163
|
+
"stratification": "Total",
|
|
164
|
+
"value": "32.7"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"state": "Arkansas",
|
|
168
|
+
"stratification": "Total",
|
|
169
|
+
"value": "31.8"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"state": "Arizona",
|
|
173
|
+
"stratification": "Total",
|
|
174
|
+
"value": "34.5"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"state": "California",
|
|
178
|
+
"stratification": "Total",
|
|
179
|
+
"value": "36.4"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"state": "Colorado",
|
|
183
|
+
"stratification": "Total",
|
|
184
|
+
"value": "35.0"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"state": "Connecticut",
|
|
188
|
+
"stratification": "Total",
|
|
189
|
+
"value": "36.5"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"state": "District of Columbia",
|
|
193
|
+
"stratification": "Total",
|
|
194
|
+
"value": "33.5"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"state": "Delaware",
|
|
198
|
+
"stratification": "Total",
|
|
199
|
+
"value": "35.6"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"state": "Florida",
|
|
203
|
+
"stratification": "Total",
|
|
204
|
+
"value": "35.6"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"state": "Georgia",
|
|
208
|
+
"stratification": "Total",
|
|
209
|
+
"value": "33.7"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"state": "Guam",
|
|
213
|
+
"stratification": "Total",
|
|
214
|
+
"value": "34.9"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"state": "Hawaii",
|
|
218
|
+
"stratification": "Total",
|
|
219
|
+
"value": "34.4"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"state": "Iowa",
|
|
223
|
+
"stratification": "Total",
|
|
224
|
+
"value": "34.3"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"state": "Idaho",
|
|
228
|
+
"stratification": "Total",
|
|
229
|
+
"value": "35.7"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"state": "Illinois",
|
|
233
|
+
"stratification": "Total",
|
|
234
|
+
"value": "35.0"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"state": "Indiana",
|
|
238
|
+
"stratification": "Total",
|
|
239
|
+
"value": "33.3"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"state": "Kansas",
|
|
243
|
+
"stratification": "Total",
|
|
244
|
+
"value": "33.3"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"state": "Kentucky",
|
|
248
|
+
"stratification": "Total",
|
|
249
|
+
"value": ""
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"state": "Louisiana",
|
|
253
|
+
"stratification": "Total",
|
|
254
|
+
"value": "32.1"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"state": "Massachusetts",
|
|
258
|
+
"stratification": "Total",
|
|
259
|
+
"value": "35.2"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"state": "Maryland",
|
|
263
|
+
"stratification": "Total",
|
|
264
|
+
"value": "34.7"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"state": "Maine",
|
|
268
|
+
"stratification": "Total",
|
|
269
|
+
"value": "35.3"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"state": "Michigan",
|
|
273
|
+
"stratification": "Total",
|
|
274
|
+
"value": "33.4"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"state": "Minnesota",
|
|
278
|
+
"stratification": "Total",
|
|
279
|
+
"value": "34.2"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"state": "Missouri",
|
|
283
|
+
"stratification": "Total",
|
|
284
|
+
"value": "34.3"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"state": "Mississippi",
|
|
288
|
+
"stratification": "Total",
|
|
289
|
+
"value": "31.6"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"state": "Montana",
|
|
293
|
+
"stratification": "Total",
|
|
294
|
+
"value": "35.2"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"state": "North Carolina",
|
|
298
|
+
"stratification": "Total",
|
|
299
|
+
"value": "35.0"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"state": "North Dakota",
|
|
303
|
+
"stratification": "Total",
|
|
304
|
+
"value": "35.8"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"state": "Nebraska",
|
|
308
|
+
"stratification": "Total",
|
|
309
|
+
"value": "34.8"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"state": "New Hampshire",
|
|
313
|
+
"stratification": "Total",
|
|
314
|
+
"value": "35.6"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"state": "New Jersey",
|
|
318
|
+
"stratification": "Total",
|
|
319
|
+
"value": "35.9"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"state": "New Mexico",
|
|
323
|
+
"stratification": "Total",
|
|
324
|
+
"value": "33.9"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"state": "Nevada",
|
|
328
|
+
"stratification": "Total",
|
|
329
|
+
"value": "35.6"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"state": "New York",
|
|
333
|
+
"stratification": "Total",
|
|
334
|
+
"value": "36.1"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"state": "Ohio",
|
|
338
|
+
"stratification": "Total",
|
|
339
|
+
"value": "33.2"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"state": "Oklahoma",
|
|
343
|
+
"stratification": "Total",
|
|
344
|
+
"value": "31.9"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"state": "Oregon",
|
|
348
|
+
"stratification": "Total",
|
|
349
|
+
"value": "33.4"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"state": "Pennsylvania",
|
|
353
|
+
"stratification": "Total",
|
|
354
|
+
"value": ""
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"state": "Puerto Rico",
|
|
358
|
+
"stratification": "Total",
|
|
359
|
+
"value": "35.1"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"state": "Rhode Island",
|
|
363
|
+
"stratification": "Total",
|
|
364
|
+
"value": "34.8"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"state": "South Carolina",
|
|
368
|
+
"stratification": "Total",
|
|
369
|
+
"value": "33.9"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"state": "South Dakota",
|
|
373
|
+
"stratification": "Total",
|
|
374
|
+
"value": "34.3"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"state": "Tennessee",
|
|
378
|
+
"stratification": "Total",
|
|
379
|
+
"value": "33.1"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"state": "Texas",
|
|
383
|
+
"stratification": "Total",
|
|
384
|
+
"value": "35.0"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"state": "Utah",
|
|
388
|
+
"stratification": "Total",
|
|
389
|
+
"value": "34.3"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"state": "Virginia",
|
|
393
|
+
"stratification": "Total",
|
|
394
|
+
"value": "34.3"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"state": "Virgin Islands",
|
|
398
|
+
"stratification": "Total",
|
|
399
|
+
"value": "38.2"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"state": "Vermont",
|
|
403
|
+
"stratification": "Total",
|
|
404
|
+
"value": "34.8"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"state": "Washington",
|
|
408
|
+
"stratification": "Total",
|
|
409
|
+
"value": "35.2"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"state": "Wisconsin",
|
|
413
|
+
"stratification": "Total",
|
|
414
|
+
"value": "34.1"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"state": "West Virginia",
|
|
418
|
+
"stratification": "Total",
|
|
419
|
+
"value": "32.0"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"state": "Wyoming",
|
|
423
|
+
"stratification": "Total",
|
|
424
|
+
"value": "35.7"
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
}
|
package/index.html
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
6
|
-
<style type="text/css">
|
|
7
|
-
body {
|
|
8
|
-
margin: 0;
|
|
9
|
-
border-top: none !important;
|
|
10
|
-
}
|
|
11
3
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
7
|
+
<style type="text/css">
|
|
8
|
+
body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
border-top: none !important;
|
|
11
|
+
}
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
font-weight: 900;
|
|
24
|
-
font-display: swap;
|
|
25
|
-
src: url('https://app.unpkg.com/@fontsource/nunito@5.0.18/files/files/nunito-latin-900-normal.woff2')
|
|
26
|
-
format('woff2');
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
29
|
-
</head>
|
|
13
|
+
.cdc-map-outer-container {
|
|
14
|
+
min-height: 100vh;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
<link rel="stylesheet prefetch" href="https://www.cdc.gov/TemplatePackage/5.0/css/app.min.css?_=71669" />
|
|
30
18
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
<!-- This is temporary and for testing until Nunito/900 is added to TP -->
|
|
20
|
+
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@900&display=swap" rel="stylesheet" />
|
|
21
|
+
<style type="text/css">
|
|
22
|
+
@font-face {
|
|
23
|
+
font-family: 'Nunito';
|
|
24
|
+
font-weight: 900;
|
|
25
|
+
font-display: swap;
|
|
26
|
+
src: url('https://app.unpkg.com/@fontsource/nunito@5.0.18/files/files/nunito-latin-900-normal.woff2') format('woff2');
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
29
|
+
</head>
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
<body>
|
|
32
|
+
<!-- DEFAULT EXAMPLES -->
|
|
33
|
+
<div class="react-container" data-config="/examples/default-hex.json"></div>
|
|
34
|
+
|
|
35
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
36
|
+
<script type="module" src="./src/index.jsx"></script>
|
|
37
|
+
</body>
|
|
38
|
+
|
|
39
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/map",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.6-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,31 +25,25 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@cdc/core": "^4.25.
|
|
29
|
-
"@emotion/core": "^10.0.28",
|
|
30
|
-
"@emotion/react": "^11.1.5",
|
|
28
|
+
"@cdc/core": "^4.25.6-1",
|
|
31
29
|
"@googlemaps/markerclusterer": "^2.5.3",
|
|
32
30
|
"@hello-pangea/dnd": "^16.2.0",
|
|
33
|
-
"@react-google-maps/api": "^2.20.
|
|
34
|
-
"@visx/geo": "^
|
|
31
|
+
"@react-google-maps/api": "^2.20.6",
|
|
32
|
+
"@visx/geo": "^3.12.0",
|
|
35
33
|
"chroma": "0.0.1",
|
|
36
|
-
"d3": "^7.
|
|
34
|
+
"d3": "^7.9.0",
|
|
37
35
|
"d3-composite-projections": "^1.4.0",
|
|
38
36
|
"d3-selection": "^3.0.0",
|
|
39
37
|
"d3-zoom": "^3.0.0",
|
|
40
|
-
"html2canvas": "^1.0.0-rc.7",
|
|
41
38
|
"leaflet": "^1.9.4",
|
|
42
39
|
"lodash.debounce": "^4.0.8",
|
|
43
40
|
"react-accessible-accordion": "^3.0.1",
|
|
44
|
-
"react-leaflet": "^4.2.1",
|
|
45
|
-
"react-leaflet-markercluster": "^4.1.1",
|
|
46
|
-
"react-tag-autocomplete": "^6.0.0",
|
|
47
41
|
"topojson-client": "^3.1.0",
|
|
48
|
-
"use-debounce": "^
|
|
42
|
+
"use-debounce": "^10.0.5"
|
|
49
43
|
},
|
|
50
44
|
"peerDependencies": {
|
|
51
45
|
"react": "^18.2.0",
|
|
52
46
|
"react-dom": "^18.2.0"
|
|
53
47
|
},
|
|
54
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "ac45ee0f1d6a4045648c4e083992fc091795e084"
|
|
55
49
|
}
|
package/src/CdcMap.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import coveUpdateWorker from '@cdc/core/helpers/coveUpdateWorker'
|
|
|
7
7
|
import { addUIDs, validateFipsCodeLength } from './helpers'
|
|
8
8
|
import EditorContext from '@cdc/editor/src/ConfigContext'
|
|
9
9
|
import { MapConfig } from './types/MapConfig'
|
|
10
|
-
import _ from 'lodash'
|
|
10
|
+
import _, { set } from 'lodash'
|
|
11
11
|
|
|
12
12
|
type CdcMapProps = {
|
|
13
13
|
config: MapConfig
|
|
@@ -30,7 +30,7 @@ const CdcMap: React.FC<CdcMapProps> = ({
|
|
|
30
30
|
config: editorsConfig
|
|
31
31
|
}) => {
|
|
32
32
|
const editorContext = useContext(EditorContext)
|
|
33
|
-
const [config, _setConfig] = useState(null)
|
|
33
|
+
const [config, _setConfig] = useState(editorsConfig ?? null)
|
|
34
34
|
|
|
35
35
|
const setConfig = newConfig => {
|
|
36
36
|
_setConfig(newConfig)
|
|
@@ -113,6 +113,14 @@ const CdcMap: React.FC<CdcMapProps> = ({
|
|
|
113
113
|
init()
|
|
114
114
|
}, [])
|
|
115
115
|
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
init()
|
|
118
|
+
}, [configUrl])
|
|
119
|
+
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
setConfig(editorsConfig)
|
|
122
|
+
}, [editorsConfig])
|
|
123
|
+
|
|
116
124
|
if (loading) return null
|
|
117
125
|
|
|
118
126
|
return (
|