@cdc/map 4.24.5 → 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 (67) hide show
  1. package/dist/cdcmap.js +71853 -64936
  2. package/examples/annotation/index.json +552 -0
  3. package/examples/annotation/usa-map.json +900 -0
  4. package/examples/county-year.csv +10 -0
  5. package/examples/default-geocode.json +44 -10
  6. package/examples/default-patterns.json +0 -2
  7. package/examples/default-single-state.json +279 -108
  8. package/examples/map-issue-3.json +646 -0
  9. package/examples/single-state-filter.json +153 -0
  10. package/index.html +10 -6
  11. package/package.json +6 -5
  12. package/src/CdcMap.tsx +367 -199
  13. package/src/_stories/CdcMap.stories.tsx +14 -0
  14. package/src/_stories/_mock/DEV-7286.json +165 -0
  15. package/src/_stories/_mock/DEV-8942.json +270 -0
  16. package/src/components/Annotation/Annotation.Draggable.styles.css +18 -0
  17. package/src/components/Annotation/Annotation.Draggable.tsx +152 -0
  18. package/src/components/Annotation/AnnotationDropdown.styles.css +14 -0
  19. package/src/components/Annotation/AnnotationDropdown.tsx +70 -0
  20. package/src/components/Annotation/AnnotationList.styles.css +45 -0
  21. package/src/components/Annotation/AnnotationList.tsx +42 -0
  22. package/src/components/Annotation/index.tsx +11 -0
  23. package/src/components/{BubbleList.jsx → BubbleList.tsx} +1 -1
  24. package/src/components/{CityList.jsx → CityList.tsx} +28 -2
  25. package/src/components/{DataTable.jsx → DataTable.tsx} +2 -2
  26. package/src/components/EditorPanel/components/EditorPanel.tsx +650 -129
  27. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +336 -0
  28. package/src/components/EditorPanel/components/{Panel.PatternSettings.tsx → Panels/Panel.PatternSettings.tsx} +63 -13
  29. package/src/components/EditorPanel/components/{Panels.tsx → Panels/index.tsx} +3 -0
  30. package/src/components/Legend/components/Legend.tsx +125 -42
  31. package/src/components/Legend/components/index.scss +42 -42
  32. package/src/components/Modal.tsx +25 -0
  33. package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +74 -0
  34. package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +29 -0
  35. package/src/components/UsaMap/components/SingleState/index.tsx +9 -0
  36. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +4 -3
  37. package/src/components/UsaMap/components/UsaMap.County.tsx +114 -36
  38. package/src/components/UsaMap/components/UsaMap.Region.tsx +2 -0
  39. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +175 -206
  40. package/src/components/UsaMap/components/UsaMap.State.tsx +188 -44
  41. package/src/components/UsaMap/data/us-extended-geography.json +1 -0
  42. package/src/components/UsaMap/helpers/map.ts +111 -0
  43. package/src/components/WorldMap/WorldMap.tsx +17 -32
  44. package/src/components/ZoomControls.tsx +41 -0
  45. package/src/data/initial-state.js +11 -2
  46. package/src/data/supported-geos.js +15 -4
  47. package/src/helpers/generateColorsArray.ts +13 -0
  48. package/src/helpers/generateRuntimeLegendHash.ts +23 -0
  49. package/src/helpers/getUniqueValues.ts +19 -0
  50. package/src/helpers/hashObj.ts +25 -0
  51. package/src/helpers/tests/generateColorsArray.test.ts +18 -0
  52. package/src/helpers/tests/generateRuntimeLegendHash.test.ts +11 -0
  53. package/src/helpers/tests/hashObj.test.ts +10 -0
  54. package/src/hooks/useStateZoom.tsx +157 -0
  55. package/src/hooks/{useZoomPan.js → useZoomPan.ts} +6 -5
  56. package/src/scss/editor-panel.scss +0 -4
  57. package/src/scss/main.scss +23 -1
  58. package/src/scss/map.scss +14 -3
  59. package/src/types/MapConfig.ts +9 -1
  60. package/src/types/MapContext.ts +16 -2
  61. package/LICENSE +0 -201
  62. package/src/components/Modal.jsx +0 -22
  63. package/src/test/CdcMap.test.jsx +0 -19
  64. /package/src/components/EditorPanel/components/{Panel.PatternSettings-style.css → Panels/Panel.PatternSettings-style.css} +0 -0
  65. /package/src/components/{Geo.jsx → Geo.tsx} +0 -0
  66. /package/src/components/{NavigationMenu.jsx → NavigationMenu.tsx} +0 -0
  67. /package/src/components/{ZoomableGroup.jsx → ZoomableGroup.tsx} +0 -0
@@ -0,0 +1,552 @@
1
+ {
2
+ "annotations": [
3
+ {
4
+ "text": "Utah",
5
+ "snapToNearestPoint": false,
6
+ "fontSize": 16,
7
+ "show": {
8
+ "desktop": true,
9
+ "tablet": true,
10
+ "mobile": true
11
+ },
12
+ "markerType": "arrow",
13
+ "connectorType": "line",
14
+ "colors": {
15
+ "label": "black",
16
+ "connector": "black",
17
+ "marker": "black"
18
+ },
19
+ "selected": true,
20
+ "anchor": {
21
+ "vertical": false,
22
+ "horizontal": false
23
+ },
24
+ "connectionType": "line",
25
+ "marker": "arrow",
26
+ "edit": {
27
+ "subject": true,
28
+ "label": true
29
+ },
30
+ "seriesKey": "none",
31
+ "x": 243.4174346923828,
32
+ "y": 206.672119140625,
33
+ "xKey": null,
34
+ "yKey": null,
35
+ "dx": 54.76988220214844,
36
+ "dy": -33.62369155883789,
37
+ "opacity": 100,
38
+ "savedDimensions": [
39
+ 638.02,
40
+ 567.59375
41
+ ],
42
+ "connectionLocation": "auto"
43
+ }
44
+ ],
45
+ "general": {
46
+ "geoType": "us",
47
+ "type": "data",
48
+ "geoBorderColor": "darkGray",
49
+ "headerColor": "theme-blue",
50
+ "title": "",
51
+ "showTitle": true,
52
+ "showSidebar": true,
53
+ "showDownloadButton": true,
54
+ "showDownloadMediaButton": false,
55
+ "displayAsHex": false,
56
+ "displayStateLabels": false,
57
+ "territoriesLabel": "Territories",
58
+ "territoriesAlwaysShow": false,
59
+ "language": "en",
60
+ "geoLabelOverride": "",
61
+ "hasRegions": false,
62
+ "fullBorder": false,
63
+ "convertFipsCodes": true,
64
+ "palette": {
65
+ "isReversed": false
66
+ },
67
+ "allowMapZoom": true,
68
+ "hideGeoColumnInTooltip": false,
69
+ "hidePrimaryColumnInTooltip": false,
70
+ "statePicked": {
71
+ "fipsCode": "01",
72
+ "stateName": "Alabama"
73
+ },
74
+ "expandDataTable": false
75
+ },
76
+ "type": "map",
77
+ "color": "pinkpurple",
78
+ "columns": {
79
+ "geo": {
80
+ "name": "STATE",
81
+ "label": "Location",
82
+ "tooltip": false,
83
+ "dataTable": true
84
+ },
85
+ "primary": {
86
+ "dataTable": true,
87
+ "tooltip": true,
88
+ "prefix": "",
89
+ "suffix": "",
90
+ "name": "Rate",
91
+ "label": ""
92
+ },
93
+ "navigate": {
94
+ "name": ""
95
+ },
96
+ "latitude": {
97
+ "name": ""
98
+ },
99
+ "longitude": {
100
+ "name": ""
101
+ }
102
+ },
103
+ "legend": {
104
+ "descriptions": {},
105
+ "specialClasses": [
106
+ {
107
+ "key": "Location",
108
+ "value": "NA"
109
+ }
110
+ ],
111
+ "unified": false,
112
+ "singleColumn": false,
113
+ "singleRow": false,
114
+ "verticalSorted": false,
115
+ "showSpecialClassesLast": true,
116
+ "dynamicDescription": false,
117
+ "type": "equalnumber",
118
+ "numberOfItems": 3,
119
+ "position": "side",
120
+ "title": "Legend"
121
+ },
122
+ "filters": [],
123
+ "table": {
124
+ "wrapColumns": false,
125
+ "label": "Data Table",
126
+ "expanded": false,
127
+ "limitHeight": false,
128
+ "height": "",
129
+ "caption": "",
130
+ "showDownloadUrl": false,
131
+ "showDataTableLink": true,
132
+ "showFullGeoNameInCSV": false,
133
+ "forceDisplay": true,
134
+ "download": true,
135
+ "indexLabel": ""
136
+ },
137
+ "tooltips": {
138
+ "appearanceType": "hover",
139
+ "linkLabel": "Learn More",
140
+ "capitalizeLabels": true,
141
+ "opacity": 90
142
+ },
143
+ "runtime": {
144
+ "editorErrorMessage": []
145
+ },
146
+ "visual": {
147
+ "minBubbleSize": 1,
148
+ "maxBubbleSize": 20,
149
+ "extraBubbleBorder": false,
150
+ "cityStyle": "circle",
151
+ "geoCodeCircleSize": 2,
152
+ "showBubbleZeros": false,
153
+ "cityStyleLabel": "",
154
+ "additionalCityStyles": []
155
+ },
156
+ "mapPosition": {
157
+ "coordinates": [
158
+ 0,
159
+ 30
160
+ ],
161
+ "zoom": 1
162
+ },
163
+ "map": {
164
+ "layers": [],
165
+ "patterns": []
166
+ },
167
+ "hexMap": {
168
+ "type": "",
169
+ "shapeGroups": [
170
+ {
171
+ "legendTitle": "",
172
+ "legendDescription": "",
173
+ "items": [
174
+ {
175
+ "key": "",
176
+ "shape": "Arrow up",
177
+ "column": "",
178
+ "operator": "=",
179
+ "value": ""
180
+ }
181
+ ]
182
+ }
183
+ ]
184
+ },
185
+ "filterBehavior": "Filter Change",
186
+ "datasets": {},
187
+ "data": [
188
+ {
189
+ "STATE": "Overall",
190
+ "Rate": "55",
191
+ "Location": "Vehicle",
192
+ "URL": "https://www.cdc.gov"
193
+ },
194
+ {
195
+ "STATE": "Alabama",
196
+ "Rate": 130,
197
+ "Location": "Vehicle",
198
+ "URL": "https://www.cdc.gov/"
199
+ },
200
+ {
201
+ "STATE": "Alaska",
202
+ "Rate": 40,
203
+ "Location": "Work",
204
+ "URL": "https://www.cdc.gov/"
205
+ },
206
+ {
207
+ "STATE": "American Samoa",
208
+ "Rate": 55,
209
+ "Location": "Home",
210
+ "URL": "https://www.cdc.gov/"
211
+ },
212
+ {
213
+ "STATE": "Arizona",
214
+ "Rate": 57,
215
+ "Location": "School",
216
+ "URL": "https://www.cdc.gov/"
217
+ },
218
+ {
219
+ "STATE": "Arkansas",
220
+ "Rate": 60,
221
+ "Location": "School",
222
+ "URL": "https://www.cdc.gov/"
223
+ },
224
+ {
225
+ "STATE": "California",
226
+ "Rate": 30,
227
+ "Location": "Home",
228
+ "URL": "https://www.cdc.gov/"
229
+ },
230
+ {
231
+ "STATE": "Colorado",
232
+ "Rate": 40,
233
+ "Location": "Vehicle",
234
+ "URL": "https://www.cdc.gov/"
235
+ },
236
+ {
237
+ "STATE": "Connecticut",
238
+ "Rate": 55,
239
+ "Location": "Home",
240
+ "URL": "https://www.cdc.gov/"
241
+ },
242
+ {
243
+ "STATE": "Deleware",
244
+ "Rate": "57",
245
+ "Location": "Home",
246
+ "URL": "https://www.cdc.gov/"
247
+ },
248
+ {
249
+ "STATE": "DC",
250
+ "Rate": 60,
251
+ "Location": "Home",
252
+ "URL": "https://www.cdc.gov/"
253
+ },
254
+ {
255
+ "STATE": "Florida",
256
+ "Rate": 30,
257
+ "Location": "Work",
258
+ "URL": "https://www.cdc.gov/"
259
+ },
260
+ {
261
+ "STATE": "Georgia",
262
+ "Rate": 40,
263
+ "Location": "Work",
264
+ "URL": "https://www.cdc.gov/"
265
+ },
266
+ {
267
+ "STATE": "Guam",
268
+ "Rate": 55,
269
+ "Location": "Home",
270
+ "URL": "https://www.cdc.gov/"
271
+ },
272
+ {
273
+ "STATE": "Hawaii",
274
+ "Rate": 57,
275
+ "Location": "School",
276
+ "URL": "https://www.cdc.gov/"
277
+ },
278
+ {
279
+ "STATE": "Idaho",
280
+ "Rate": 60,
281
+ "Location": "School",
282
+ "URL": "https://www.cdc.gov/"
283
+ },
284
+ {
285
+ "STATE": "Illinois",
286
+ "Rate": 30,
287
+ "Location": "Work",
288
+ "URL": "https://www.cdc.gov/"
289
+ },
290
+ {
291
+ "STATE": "Indiana",
292
+ "Rate": 40,
293
+ "Location": "Vehicle",
294
+ "URL": "https://www.cdc.gov/"
295
+ },
296
+ {
297
+ "STATE": "Iowa",
298
+ "Rate": 55,
299
+ "Location": "Home",
300
+ "URL": "https://www.cdc.gov/"
301
+ },
302
+ {
303
+ "STATE": "Kansas",
304
+ "Rate": 57,
305
+ "Location": "Home",
306
+ "URL": "https://www.cdc.gov/"
307
+ },
308
+ {
309
+ "STATE": "Kentucky",
310
+ "Rate": 60,
311
+ "Location": "NA",
312
+ "URL": "https://www.cdc.gov/"
313
+ },
314
+ {
315
+ "STATE": "Louisiana",
316
+ "Rate": 30,
317
+ "Location": "Vehicle",
318
+ "URL": "https://www.cdc.gov/"
319
+ },
320
+ {
321
+ "STATE": "Maine",
322
+ "Rate": 40,
323
+ "Location": "Work",
324
+ "URL": "https://www.cdc.gov/"
325
+ },
326
+ {
327
+ "STATE": "Marshall Islands",
328
+ "Rate": 55,
329
+ "Location": "Home",
330
+ "URL": "https://www.cdc.gov/"
331
+ },
332
+ {
333
+ "STATE": "Maryland",
334
+ "Rate": 57,
335
+ "Location": "School",
336
+ "URL": "https://www.cdc.gov/"
337
+ },
338
+ {
339
+ "STATE": "Massachusetts",
340
+ "Rate": 60,
341
+ "Location": "School",
342
+ "URL": "https://www.cdc.gov/"
343
+ },
344
+ {
345
+ "STATE": "Michigan",
346
+ "Rate": 12,
347
+ "Location": "Work",
348
+ "URL": "https://www.cdc.gov/"
349
+ },
350
+ {
351
+ "STATE": "Micronesia",
352
+ "Rate": 65,
353
+ "Location": "Vehicle",
354
+ "URL": "https://www.cdc.gov/"
355
+ },
356
+ {
357
+ "STATE": "Minnesota",
358
+ "Rate": 55,
359
+ "Location": "Home",
360
+ "URL": "https://www.cdc.gov/"
361
+ },
362
+ {
363
+ "STATE": "Mississippi",
364
+ "Rate": 57,
365
+ "Location": "Home",
366
+ "URL": "https://www.cdc.gov/"
367
+ },
368
+ {
369
+ "STATE": "Montana",
370
+ "Rate": 60,
371
+ "Location": "Home",
372
+ "URL": "https://www.cdc.gov/"
373
+ },
374
+ {
375
+ "STATE": "Montana",
376
+ "Rate": 30,
377
+ "Location": "Vehicle",
378
+ "URL": "https://www.cdc.gov/"
379
+ },
380
+ {
381
+ "STATE": "Nebraska",
382
+ "Rate": 40,
383
+ "Location": "Work",
384
+ "URL": "https://www.cdc.gov/"
385
+ },
386
+ {
387
+ "STATE": "Nevada",
388
+ "Rate": 55,
389
+ "Location": "Home",
390
+ "URL": "https://www.cdc.gov/"
391
+ },
392
+ {
393
+ "STATE": "New Hampshire",
394
+ "Rate": 57,
395
+ "Location": "School",
396
+ "URL": "https://www.cdc.gov/"
397
+ },
398
+ {
399
+ "STATE": "New Jersey",
400
+ "Rate": 60,
401
+ "Location": "School",
402
+ "URL": "https://www.cdc.gov/"
403
+ },
404
+ {
405
+ "STATE": "New Mexico",
406
+ "Rate": 12,
407
+ "Location": "Work",
408
+ "URL": "https://www.cdc.gov/"
409
+ },
410
+ {
411
+ "STATE": "New York",
412
+ "Rate": 40,
413
+ "Location": "Vehicle",
414
+ "URL": "https://www.cdc.gov/"
415
+ },
416
+ {
417
+ "STATE": "North Carolina",
418
+ "Rate": 55,
419
+ "Location": "Home",
420
+ "URL": "https://www.cdc.gov/"
421
+ },
422
+ {
423
+ "STATE": "North Dakota",
424
+ "Rate": 57,
425
+ "Location": "Home",
426
+ "URL": "https://www.cdc.gov/"
427
+ },
428
+ {
429
+ "STATE": "Northern Mariana Islands",
430
+ "Rate": "60",
431
+ "Location": "Home",
432
+ "URL": "https://www.cdc.gov/"
433
+ },
434
+ {
435
+ "STATE": "Ohio",
436
+ "Rate": 88,
437
+ "Location": "Vehicle",
438
+ "URL": "https://www.cdc.gov/"
439
+ },
440
+ {
441
+ "STATE": "Oklahoma",
442
+ "Rate": 40,
443
+ "Location": "Work",
444
+ "URL": "https://www.cdc.gov/"
445
+ },
446
+ {
447
+ "STATE": "Oregon",
448
+ "Rate": 55,
449
+ "Location": "Home",
450
+ "URL": "https://www.cdc.gov/"
451
+ },
452
+ {
453
+ "STATE": "Palau",
454
+ "Rate": 15,
455
+ "Location": "School",
456
+ "URL": "https://www.cdc.gov/"
457
+ },
458
+ {
459
+ "STATE": "Pennsylvania",
460
+ "Rate": 60,
461
+ "Location": "School",
462
+ "URL": "https://www.cdc.gov/"
463
+ },
464
+ {
465
+ "STATE": "Puerto Rico",
466
+ "Rate": 30,
467
+ "Location": "Work",
468
+ "URL": "https://www.cdc.gov/"
469
+ },
470
+ {
471
+ "STATE": "Rhode Island",
472
+ "Rate": 40,
473
+ "Location": "Vehicle",
474
+ "URL": "https://www.cdc.gov/"
475
+ },
476
+ {
477
+ "STATE": "South Carolina",
478
+ "Rate": 55,
479
+ "Location": "Home",
480
+ "URL": "https://www.cdc.gov/"
481
+ },
482
+ {
483
+ "STATE": "South Dakota",
484
+ "Rate": 86,
485
+ "Location": "Home",
486
+ "URL": "https://www.cdc.gov/"
487
+ },
488
+ {
489
+ "STATE": "Tennessee",
490
+ "Rate": 60,
491
+ "Location": "Home",
492
+ "URL": "https://www.cdc.gov/"
493
+ },
494
+ {
495
+ "STATE": "Texas",
496
+ "Rate": 30,
497
+ "Location": "Vehicle",
498
+ "URL": "https://www.cdc.gov/"
499
+ },
500
+ {
501
+ "STATE": "Utah",
502
+ "Rate": 54,
503
+ "Location": "Work",
504
+ "URL": "https://www.cdc.gov/"
505
+ },
506
+ {
507
+ "STATE": "Vermont",
508
+ "Rate": 40,
509
+ "Location": "Home",
510
+ "URL": "https://www.cdc.gov/"
511
+ },
512
+ {
513
+ "STATE": "Virgin Islands",
514
+ "Rate": 55,
515
+ "Location": "School",
516
+ "URL": "https://www.cdc.gov/"
517
+ },
518
+ {
519
+ "STATE": "Virginia",
520
+ "Rate": 57,
521
+ "Location": "School",
522
+ "URL": "https://www.cdc.gov/"
523
+ },
524
+ {
525
+ "STATE": "Washington",
526
+ "Rate": 62,
527
+ "Location": "Work",
528
+ "URL": "https://www.cdc.gov/"
529
+ },
530
+ {
531
+ "STATE": "West Virginia",
532
+ "Rate": 25,
533
+ "Location": "Vehicle",
534
+ "URL": "https://www.cdc.gov/"
535
+ },
536
+ {
537
+ "STATE": "Wyoming",
538
+ "Rate": 43,
539
+ "Location": "Vehicle",
540
+ "URL": "https://www.cdc.gov/"
541
+ }
542
+ ],
543
+ "dataFileName": "valid-data-map.csv",
544
+ "dataFileSourceType": "file",
545
+ "dataDescription": {
546
+ "horizontal": false,
547
+ "series": false
548
+ },
549
+ "validated": 4.23,
550
+ "version": "4.24.4",
551
+ "showEditorPanel": true
552
+ }