@cdc/map 4.24.7 → 4.24.9

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 (46) hide show
  1. package/dist/cdcmap.js +40720 -38422
  2. package/examples/county-year.csv +10 -0
  3. package/examples/default-geocode.json +44 -10
  4. package/examples/default-patterns.json +0 -2
  5. package/examples/default-single-state.json +279 -108
  6. package/examples/map-issue-3.json +646 -0
  7. package/examples/single-state-filter.json +153 -0
  8. package/index.html +9 -6
  9. package/package.json +3 -3
  10. package/src/CdcMap.tsx +322 -126
  11. package/src/_stories/CdcMap.stories.tsx +7 -0
  12. package/src/_stories/_mock/DEV-8942.json +270 -0
  13. package/src/components/Annotation/AnnotationDropdown.tsx +1 -0
  14. package/src/components/{BubbleList.jsx → BubbleList.tsx} +1 -1
  15. package/src/components/{CityList.jsx → CityList.tsx} +28 -2
  16. package/src/components/{DataTable.jsx → DataTable.tsx} +2 -2
  17. package/src/components/EditorPanel/components/EditorPanel.tsx +647 -127
  18. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +0 -22
  19. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +61 -11
  20. package/src/components/Legend/components/Legend.tsx +125 -36
  21. package/src/components/Legend/components/index.scss +42 -42
  22. package/src/components/Modal.tsx +25 -0
  23. package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +74 -0
  24. package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +29 -0
  25. package/src/components/UsaMap/components/SingleState/index.tsx +9 -0
  26. package/src/components/UsaMap/components/UsaMap.County.tsx +84 -33
  27. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +173 -206
  28. package/src/components/UsaMap/components/UsaMap.State.tsx +161 -26
  29. package/src/components/UsaMap/data/us-extended-geography.json +1 -0
  30. package/src/components/UsaMap/helpers/map.ts +111 -0
  31. package/src/components/WorldMap/WorldMap.tsx +17 -32
  32. package/src/components/ZoomControls.tsx +41 -0
  33. package/src/data/initial-state.js +7 -1
  34. package/src/data/supported-geos.js +15 -4
  35. package/src/helpers/generateRuntimeLegendHash.ts +2 -2
  36. package/src/hooks/useStateZoom.tsx +157 -0
  37. package/src/hooks/{useZoomPan.js → useZoomPan.ts} +6 -5
  38. package/src/scss/editor-panel.scss +0 -4
  39. package/src/scss/main.scss +23 -1
  40. package/src/scss/map.scss +8 -0
  41. package/src/types/MapConfig.ts +9 -1
  42. package/src/types/MapContext.ts +14 -2
  43. package/src/components/Modal.jsx +0 -22
  44. /package/src/components/{Geo.jsx → Geo.tsx} +0 -0
  45. /package/src/components/{NavigationMenu.jsx → NavigationMenu.tsx} +0 -0
  46. /package/src/components/{ZoomableGroup.jsx → ZoomableGroup.tsx} +0 -0
@@ -0,0 +1,646 @@
1
+ {
2
+ "annotations": [],
3
+ "general": {
4
+ "geoBorderColor": "darkGray",
5
+ "headerColor": "theme-blue",
6
+ "title": "",
7
+ "showTitle": true,
8
+ "showSidebar": true,
9
+ "showDownloadButton": true,
10
+ "showDownloadMediaButton": false,
11
+ "displayAsHex": false,
12
+ "displayStateLabels": false,
13
+ "territoriesLabel": "Territories",
14
+ "territoriesAlwaysShow": false,
15
+ "language": "en",
16
+ "geoType": "us",
17
+ "geoLabelOverride": "State/Territory",
18
+ "hasRegions": false,
19
+ "fullBorder": false,
20
+ "type": "map",
21
+ "convertFipsCodes": true,
22
+ "palette": {
23
+ "isReversed": true
24
+ },
25
+ "allowMapZoom": true,
26
+ "hideGeoColumnInTooltip": false,
27
+ "hidePrimaryColumnInTooltip": false,
28
+ "statePicked": {
29
+ "fipsCode": "01",
30
+ "stateName": "Alabama"
31
+ },
32
+ "equalNumberOptIn": true,
33
+ "subtext": "</div><div class=\"text-left ml-3 pb-3\">* Based on a small segment (less than 5%) of the population and may not be representative of the state/territory.</div> <div class=\"text-left ml-3 pb-3\">Data last updated <span class=\"date\">FromDB</span></div>",
34
+ "introText": "",
35
+ "footnotes": "",
36
+ "annotationDropdownText": "Annotations",
37
+ "expandDataTable": false
38
+ },
39
+ "type": "map",
40
+ "color": "greenbluereverse",
41
+ "columns": {
42
+ "geo": {
43
+ "name": "State",
44
+ "label": "Location",
45
+ "tooltip": false,
46
+ "dataTable": true
47
+ },
48
+ "primary": {
49
+ "dataTable": true,
50
+ "tooltip": true,
51
+ "prefix": "",
52
+ "suffix": "",
53
+ "name": "activity_level_label",
54
+ "label": "Viral Activity Level",
55
+ "roundToPlace": 0
56
+ },
57
+ "navigate": {
58
+ "name": ""
59
+ },
60
+ "latitude": {
61
+ "name": ""
62
+ },
63
+ "longitude": {
64
+ "name": ""
65
+ },
66
+ "additionalColumn1": {
67
+ "label": "New Column",
68
+ "dataTable": false,
69
+ "tooltips": false,
70
+ "prefix": "",
71
+ "suffix": ""
72
+ },
73
+ "additionalColumn2": {
74
+ "label": "Sites Currently Reporting",
75
+ "dataTable": true,
76
+ "tooltips": false,
77
+ "prefix": "",
78
+ "suffix": "",
79
+ "name": "num_sites",
80
+ "tooltip": true
81
+ },
82
+ "additionalColumn3": {
83
+ "label": "Limited Coverage",
84
+ "dataTable": true,
85
+ "tooltips": false,
86
+ "prefix": "",
87
+ "suffix": "",
88
+ "name": "hatch"
89
+ },
90
+ "additionalColumn4": {
91
+ "label": "",
92
+ "dataTable": false,
93
+ "tooltips": false,
94
+ "prefix": "",
95
+ "suffix": "",
96
+ "name": "hatch",
97
+ "tooltip": true
98
+ }
99
+ },
100
+ "legend": {
101
+ "descriptions": {},
102
+ "specialClasses": [],
103
+ "unified": false,
104
+ "singleColumn": false,
105
+ "singleRow": true,
106
+ "verticalSorted": false,
107
+ "showSpecialClassesLast": true,
108
+ "dynamicDescription": false,
109
+ "type": "category",
110
+ "numberOfItems": 8,
111
+ "position": "bottom",
112
+ "title": "SARS-CoV-2 Wastewater Viral Activity Levels",
113
+ "categoryValuesOrder": [
114
+ "Very High",
115
+ "High",
116
+ "Moderate",
117
+ "Low",
118
+ "Minimal",
119
+ "No Data"
120
+ ],
121
+ "additionalCategories": [
122
+ "No Data",
123
+ "Minimal",
124
+ "Low",
125
+ "Moderate",
126
+ "High",
127
+ "Very High"
128
+ ],
129
+ "description": "Select a level to add or remove from map."
130
+ },
131
+ "filters": [],
132
+ "table": {
133
+ "label": "Data Table",
134
+ "expanded": false,
135
+ "limitHeight": true,
136
+ "height": "500",
137
+ "caption": "",
138
+ "showDownloadUrl": true,
139
+ "showDataTableLink": true,
140
+ "showFullGeoNameInCSV": false,
141
+ "forceDisplay": true,
142
+ "download": true,
143
+ "indexLabel": "State/Territory",
144
+ "wrapColumns": false
145
+ },
146
+ "tooltips": {
147
+ "appearanceType": "hover",
148
+ "linkLabel": "Learn More",
149
+ "capitalizeLabels": true,
150
+ "opacity": 90
151
+ },
152
+ "visual": {
153
+ "minBubbleSize": 1,
154
+ "maxBubbleSize": 20,
155
+ "extraBubbleBorder": false,
156
+ "cityStyle": "circle",
157
+ "geoCodeCircleSize": 2,
158
+ "showBubbleZeros": false,
159
+ "cityStyleLabel": "",
160
+ "additionalCityStyles": []
161
+ },
162
+ "mapPosition": {
163
+ "coordinates": [
164
+ 0,
165
+ 30
166
+ ],
167
+ "zoom": 1
168
+ },
169
+ "map": {
170
+ "layers": [],
171
+ "patterns": [
172
+ {
173
+ "dataKey": "hatch",
174
+ "pattern": "lines",
175
+ "dataValue": "Limited Coverage",
176
+ "label": "*Limited Coverage",
177
+ "size": "medium"
178
+ }
179
+ ]
180
+ },
181
+ "hexMap": {
182
+ "type": "",
183
+ "shapeGroups": [
184
+ {
185
+ "legendTitle": "",
186
+ "legendDescription": "",
187
+ "items": [
188
+ {
189
+ "key": "",
190
+ "shape": "Arrow up",
191
+ "column": "",
192
+ "operator": "=",
193
+ "value": ""
194
+ }
195
+ ]
196
+ }
197
+ ]
198
+ },
199
+ "filterBehavior": "Filter Change",
200
+ "customColors": [
201
+ "#34547B",
202
+ "#4B7F9B",
203
+ "#4B7F9B",
204
+ "#6BB0BD",
205
+ "#9FDAD0",
206
+ "#C8EFDA",
207
+ "#B4B4B4",
208
+ "#B4B4B4",
209
+ "#B4B4B4",
210
+ "#B4B4B4"
211
+ ],
212
+ "dataFileName": "../../wcms/vizdata/NCEZID_DIDRI/NWSSStateMap.json",
213
+ "dataFileSourceType": "url",
214
+ "dataDescription": {
215
+ "horizontal": false,
216
+ "series": false
217
+ },
218
+ "validated": 4.23,
219
+ "data": [
220
+ {
221
+ "State": "Alabama",
222
+ "state_abbrev": "AL",
223
+ "activity_level": "8",
224
+ "activity_level_label": "High",
225
+ "num_sites": "7",
226
+ "hatch": null
227
+ },
228
+ {
229
+ "State": "Alaska",
230
+ "state_abbrev": "AK",
231
+ "activity_level": "9",
232
+ "activity_level_label": "Very High",
233
+ "num_sites": "4",
234
+ "hatch": null
235
+ },
236
+ {
237
+ "State": "Arizona",
238
+ "state_abbrev": "AZ",
239
+ "activity_level": "No Data",
240
+ "activity_level_label": "No Data",
241
+ "num_sites": "0",
242
+ "hatch": null
243
+ },
244
+ {
245
+ "State": "Arkansas",
246
+ "state_abbrev": "AR",
247
+ "activity_level": "10",
248
+ "activity_level_label": "Very High",
249
+ "num_sites": "8",
250
+ "hatch": null
251
+ },
252
+ {
253
+ "State": "California",
254
+ "state_abbrev": "CA",
255
+ "activity_level": "8",
256
+ "activity_level_label": "High",
257
+ "num_sites": "41",
258
+ "hatch": null
259
+ },
260
+ {
261
+ "State": "Colorado",
262
+ "state_abbrev": "CO",
263
+ "activity_level": "10",
264
+ "activity_level_label": "Very High",
265
+ "num_sites": "18",
266
+ "hatch": null
267
+ },
268
+ {
269
+ "State": "Connecticut",
270
+ "state_abbrev": "CT",
271
+ "activity_level": "7",
272
+ "activity_level_label": "High",
273
+ "num_sites": "5",
274
+ "hatch": null
275
+ },
276
+ {
277
+ "State": "Delaware",
278
+ "state_abbrev": "DE",
279
+ "activity_level": "9",
280
+ "activity_level_label": "Very High",
281
+ "num_sites": "8",
282
+ "hatch": null
283
+ },
284
+ {
285
+ "State": "District of Columbia",
286
+ "state_abbrev": "DC",
287
+ "activity_level": "8",
288
+ "activity_level_label": "High",
289
+ "num_sites": "1",
290
+ "hatch": null
291
+ },
292
+ {
293
+ "State": "Florida",
294
+ "state_abbrev": "FL",
295
+ "activity_level": "9",
296
+ "activity_level_label": "Very High",
297
+ "num_sites": "19",
298
+ "hatch": null
299
+ },
300
+ {
301
+ "State": "Georgia",
302
+ "state_abbrev": "GA",
303
+ "activity_level": "7",
304
+ "activity_level_label": "High",
305
+ "num_sites": "8",
306
+ "hatch": null
307
+ },
308
+ {
309
+ "State": "Guam",
310
+ "state_abbrev": "GU",
311
+ "activity_level": "No Data",
312
+ "activity_level_label": "No Data",
313
+ "num_sites": "0",
314
+ "hatch": null
315
+ },
316
+ {
317
+ "State": "Hawaii",
318
+ "state_abbrev": "HI",
319
+ "activity_level": "6",
320
+ "activity_level_label": "Moderate",
321
+ "num_sites": "9",
322
+ "hatch": null
323
+ },
324
+ {
325
+ "State": "Idaho",
326
+ "state_abbrev": "ID",
327
+ "activity_level": "8",
328
+ "activity_level_label": "High",
329
+ "num_sites": "4",
330
+ "hatch": null
331
+ },
332
+ {
333
+ "State": "Illinois",
334
+ "state_abbrev": "IL",
335
+ "activity_level": "8",
336
+ "activity_level_label": "High",
337
+ "num_sites": "72",
338
+ "hatch": null
339
+ },
340
+ {
341
+ "State": "Indiana",
342
+ "state_abbrev": "IN",
343
+ "activity_level": "10",
344
+ "activity_level_label": "Very High",
345
+ "num_sites": "21",
346
+ "hatch": null
347
+ },
348
+ {
349
+ "State": "Iowa",
350
+ "state_abbrev": "IA",
351
+ "activity_level": "9",
352
+ "activity_level_label": "Very High",
353
+ "num_sites": "9",
354
+ "hatch": null
355
+ },
356
+ {
357
+ "State": "Kansas",
358
+ "state_abbrev": "KS",
359
+ "activity_level": "9",
360
+ "activity_level_label": "Very High",
361
+ "num_sites": "13",
362
+ "hatch": null
363
+ },
364
+ {
365
+ "State": "Kentucky",
366
+ "state_abbrev": "KY",
367
+ "activity_level": "9",
368
+ "activity_level_label": "Very High",
369
+ "num_sites": "13",
370
+ "hatch": null
371
+ },
372
+ {
373
+ "State": "Louisiana",
374
+ "state_abbrev": "LA",
375
+ "activity_level": "9",
376
+ "activity_level_label": "Very High",
377
+ "num_sites": "8",
378
+ "hatch": null
379
+ },
380
+ {
381
+ "State": "Maine",
382
+ "state_abbrev": "ME",
383
+ "activity_level": "10",
384
+ "activity_level_label": "Very High",
385
+ "num_sites": "14",
386
+ "hatch": null
387
+ },
388
+ {
389
+ "State": "Maryland",
390
+ "state_abbrev": "MD",
391
+ "activity_level": "8",
392
+ "activity_level_label": "High",
393
+ "num_sites": "10",
394
+ "hatch": null
395
+ },
396
+ {
397
+ "State": "Massachusetts",
398
+ "state_abbrev": "MA",
399
+ "activity_level": "8",
400
+ "activity_level_label": "High",
401
+ "num_sites": "6",
402
+ "hatch": null
403
+ },
404
+ {
405
+ "State": "Michigan",
406
+ "state_abbrev": "MI",
407
+ "activity_level": "5",
408
+ "activity_level_label": "Moderate",
409
+ "num_sites": "42",
410
+ "hatch": null
411
+ },
412
+ {
413
+ "State": "Minnesota",
414
+ "state_abbrev": "MN",
415
+ "activity_level": "10",
416
+ "activity_level_label": "Very High",
417
+ "num_sites": "32",
418
+ "hatch": null
419
+ },
420
+ {
421
+ "State": "Mississippi",
422
+ "state_abbrev": "MS",
423
+ "activity_level": "5",
424
+ "activity_level_label": "Moderate",
425
+ "num_sites": "2",
426
+ "hatch": "Limited Coverage"
427
+ },
428
+ {
429
+ "State": "Missouri",
430
+ "state_abbrev": "MO",
431
+ "activity_level": "8",
432
+ "activity_level_label": "High",
433
+ "num_sites": "46",
434
+ "hatch": null
435
+ },
436
+ {
437
+ "State": "Montana",
438
+ "state_abbrev": "MT",
439
+ "activity_level": "5",
440
+ "activity_level_label": "Moderate",
441
+ "num_sites": "6",
442
+ "hatch": null
443
+ },
444
+ {
445
+ "State": "Nebraska",
446
+ "state_abbrev": "NE",
447
+ "activity_level": "7",
448
+ "activity_level_label": "High",
449
+ "num_sites": "16",
450
+ "hatch": null
451
+ },
452
+ {
453
+ "State": "Nevada",
454
+ "state_abbrev": "NV",
455
+ "activity_level": "7",
456
+ "activity_level_label": "High",
457
+ "num_sites": "1",
458
+ "hatch": null
459
+ },
460
+ {
461
+ "State": "New Hampshire",
462
+ "state_abbrev": "NH",
463
+ "activity_level": "10",
464
+ "activity_level_label": "Very High",
465
+ "num_sites": "12",
466
+ "hatch": null
467
+ },
468
+ {
469
+ "State": "New Jersey",
470
+ "state_abbrev": "NJ",
471
+ "activity_level": "7",
472
+ "activity_level_label": "High",
473
+ "num_sites": "18",
474
+ "hatch": null
475
+ },
476
+ {
477
+ "State": "New Mexico",
478
+ "state_abbrev": "NM",
479
+ "activity_level": "10",
480
+ "activity_level_label": "Very High",
481
+ "num_sites": "2",
482
+ "hatch": null
483
+ },
484
+ {
485
+ "State": "New York",
486
+ "state_abbrev": "NY",
487
+ "activity_level": "7",
488
+ "activity_level_label": "High",
489
+ "num_sites": "114",
490
+ "hatch": null
491
+ },
492
+ {
493
+ "State": "North Carolina",
494
+ "state_abbrev": "NC",
495
+ "activity_level": "10",
496
+ "activity_level_label": "Very High",
497
+ "num_sites": "34",
498
+ "hatch": null
499
+ },
500
+ {
501
+ "State": "North Dakota",
502
+ "state_abbrev": "ND",
503
+ "activity_level": "No Data",
504
+ "activity_level_label": "No Data",
505
+ "num_sites": "0",
506
+ "hatch": null
507
+ },
508
+ {
509
+ "State": "Ohio",
510
+ "state_abbrev": "OH",
511
+ "activity_level": "10",
512
+ "activity_level_label": "Very High",
513
+ "num_sites": "69",
514
+ "hatch": null
515
+ },
516
+ {
517
+ "State": "Oklahoma",
518
+ "state_abbrev": "OK",
519
+ "activity_level": "10",
520
+ "activity_level_label": "Very High",
521
+ "num_sites": "13",
522
+ "hatch": null
523
+ },
524
+ {
525
+ "State": "Oregon",
526
+ "state_abbrev": "OR",
527
+ "activity_level": "10",
528
+ "activity_level_label": "Very High",
529
+ "num_sites": "6",
530
+ "hatch": null
531
+ },
532
+ {
533
+ "State": "Pennsylvania",
534
+ "state_abbrev": "PA",
535
+ "activity_level": "8",
536
+ "activity_level_label": "High",
537
+ "num_sites": "29",
538
+ "hatch": null
539
+ },
540
+ {
541
+ "State": "Rhode Island",
542
+ "state_abbrev": "RI",
543
+ "activity_level": "7",
544
+ "activity_level_label": "High",
545
+ "num_sites": "9",
546
+ "hatch": null
547
+ },
548
+ {
549
+ "State": "South Carolina",
550
+ "state_abbrev": "SC",
551
+ "activity_level": "9",
552
+ "activity_level_label": "Very High",
553
+ "num_sites": "19",
554
+ "hatch": null
555
+ },
556
+ {
557
+ "State": "South Dakota",
558
+ "state_abbrev": "SD",
559
+ "activity_level": "7",
560
+ "activity_level_label": "High",
561
+ "num_sites": "2",
562
+ "hatch": "Limited Coverage"
563
+ },
564
+ {
565
+ "State": "Tennessee",
566
+ "state_abbrev": "TN",
567
+ "activity_level": "10",
568
+ "activity_level_label": "Very High",
569
+ "num_sites": "4",
570
+ "hatch": null
571
+ },
572
+ {
573
+ "State": "Texas",
574
+ "state_abbrev": "TX",
575
+ "activity_level": "7",
576
+ "activity_level_label": "High",
577
+ "num_sites": "30",
578
+ "hatch": null
579
+ },
580
+ {
581
+ "State": "Utah",
582
+ "state_abbrev": "UT",
583
+ "activity_level": "9",
584
+ "activity_level_label": "Very High",
585
+ "num_sites": "31",
586
+ "hatch": null
587
+ },
588
+ {
589
+ "State": "Vermont",
590
+ "state_abbrev": "VT",
591
+ "activity_level": "7",
592
+ "activity_level_label": "High",
593
+ "num_sites": "4",
594
+ "hatch": null
595
+ },
596
+ {
597
+ "State": "Virgin Islands",
598
+ "state_abbrev": "VI",
599
+ "activity_level": "No Data",
600
+ "activity_level_label": "No Data",
601
+ "num_sites": "0",
602
+ "hatch": null
603
+ },
604
+ {
605
+ "State": "Virginia",
606
+ "state_abbrev": "VA",
607
+ "activity_level": "7",
608
+ "activity_level_label": "High",
609
+ "num_sites": "30",
610
+ "hatch": null
611
+ },
612
+ {
613
+ "State": "Washington",
614
+ "state_abbrev": "WA",
615
+ "activity_level": "10",
616
+ "activity_level_label": "Very High",
617
+ "num_sites": "29",
618
+ "hatch": null
619
+ },
620
+ {
621
+ "State": "West Virginia",
622
+ "state_abbrev": "WV",
623
+ "activity_level": "7",
624
+ "activity_level_label": "High",
625
+ "num_sites": "13",
626
+ "hatch": null
627
+ },
628
+ {
629
+ "State": "Wisconsin",
630
+ "state_abbrev": "WI",
631
+ "activity_level": "8",
632
+ "activity_level_label": "High",
633
+ "num_sites": "34",
634
+ "hatch": null
635
+ },
636
+ {
637
+ "State": "Wyoming",
638
+ "state_abbrev": "WY",
639
+ "activity_level": "10",
640
+ "activity_level_label": "Very High",
641
+ "num_sites": "2",
642
+ "hatch": null
643
+ }
644
+ ],
645
+ "version": "4.24.9"
646
+ }