@cdc/map 4.25.3 → 4.25.6

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 (119) hide show
  1. package/.idea/map.iml +12 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/vcs.xml +6 -0
  4. package/dist/cdcmap.js +31254 -32242
  5. package/examples/hex-colors.json +3 -3
  6. package/examples/m2.json +32904 -0
  7. package/examples/private/test.json +470 -1457
  8. package/examples/private/{mmr.json → wastewatermap.json} +86 -115
  9. package/index.html +36 -63
  10. package/package.json +7 -19
  11. package/src/CdcMap.tsx +56 -1552
  12. package/src/CdcMapComponent.tsx +608 -0
  13. package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +10 -0
  14. package/src/_stories/CdcMap.Legend.stories.tsx +67 -0
  15. package/src/_stories/CdcMap.Table.stories.tsx +19 -0
  16. package/src/_stories/CdcMap.stories.tsx +12 -1
  17. package/src/_stories/UsaMap.NoData.stories.tsx +4 -4
  18. package/src/_stories/_mock/default-patterns.json +8 -5
  19. package/src/_stories/_mock/legend-bins.json +428 -0
  20. package/{examples/private/default-patterns.json → src/_stories/_mock/legends/legend-tests.json} +36 -131
  21. package/src/cdcMapComponent.styles.css +9 -0
  22. package/src/components/Annotation/Annotation.Draggable.tsx +27 -26
  23. package/src/components/Annotation/AnnotationDropdown.tsx +5 -6
  24. package/src/components/BubbleList.tsx +135 -49
  25. package/src/components/CityList.tsx +89 -87
  26. package/src/components/DataTable.tsx +8 -8
  27. package/src/components/EditorPanel/components/EditorPanel.tsx +823 -885
  28. package/src/components/EditorPanel/components/Error.tsx +9 -2
  29. package/src/components/EditorPanel/components/HexShapeSettings.tsx +127 -141
  30. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +55 -86
  31. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +89 -75
  32. package/src/components/EditorPanel/components/editorPanel.styles.css +95 -0
  33. package/src/components/Geo.tsx +9 -1
  34. package/src/components/GoogleMap/components/GoogleMap.tsx +1 -1
  35. package/src/components/Legend/components/Legend.tsx +92 -87
  36. package/src/components/Legend/components/LegendGroup/Legend.Group.tsx +128 -0
  37. package/src/components/Legend/components/LegendGroup/legend.group.css +27 -0
  38. package/src/components/Legend/components/LegendItem.Hex.tsx +4 -1
  39. package/src/components/Legend/components/index.scss +74 -17
  40. package/src/components/Modal.tsx +17 -7
  41. package/src/components/NavigationMenu.tsx +11 -9
  42. package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +12 -8
  43. package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +4 -4
  44. package/src/components/UsaMap/components/TerritoriesSection.tsx +33 -10
  45. package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +12 -10
  46. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +12 -14
  47. package/src/components/UsaMap/components/Territory/TerritoryShape.ts +2 -1
  48. package/src/components/UsaMap/components/UsaMap.County.tsx +138 -96
  49. package/src/components/UsaMap/components/UsaMap.Region.styles.css +72 -0
  50. package/src/components/UsaMap/components/UsaMap.Region.tsx +56 -103
  51. package/src/components/UsaMap/components/UsaMap.SingleState.styles.css +10 -0
  52. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +65 -74
  53. package/src/components/UsaMap/components/UsaMap.State.tsx +112 -91
  54. package/src/components/UsaMap/helpers/map.ts +1 -1
  55. package/src/components/UsaMap/helpers/shapes.ts +20 -7
  56. package/src/components/WorldMap/WorldMap.tsx +64 -118
  57. package/src/components/WorldMap/worldMap.styles.css +28 -0
  58. package/src/components/ZoomControls.tsx +15 -13
  59. package/src/components/zoomControls.styles.css +53 -0
  60. package/src/context.ts +17 -9
  61. package/src/data/initial-state.js +5 -2
  62. package/src/helpers/addUIDs.ts +150 -0
  63. package/src/helpers/applyColorToLegend.ts +39 -64
  64. package/src/helpers/applyLegendToRow.ts +51 -0
  65. package/src/helpers/colorDistributions.ts +12 -0
  66. package/src/helpers/constants.ts +44 -0
  67. package/src/helpers/displayGeoName.ts +9 -2
  68. package/src/helpers/formatLegendLocation.ts +3 -2
  69. package/src/helpers/generateColorsArray.ts +2 -1
  70. package/src/helpers/generateRuntimeData.ts +78 -0
  71. package/src/helpers/generateRuntimeFilters.ts +63 -0
  72. package/src/helpers/generateRuntimeLegend.ts +566 -0
  73. package/src/helpers/generateRuntimeLegendHash.ts +16 -15
  74. package/src/helpers/getColumnNames.ts +19 -0
  75. package/src/helpers/getMapContainerClasses.ts +23 -0
  76. package/src/helpers/getStatePicked.ts +8 -0
  77. package/src/helpers/handleMapTabbing.ts +31 -0
  78. package/src/helpers/hashObj.ts +1 -1
  79. package/src/helpers/index.ts +22 -0
  80. package/src/helpers/navigationHandler.ts +3 -3
  81. package/src/helpers/resetLegendToggles.ts +13 -0
  82. package/src/helpers/setBinNumbers.ts +5 -0
  83. package/src/helpers/sortSpecialClassesLast.ts +7 -0
  84. package/src/helpers/tests/getColumnNames.test.ts +52 -0
  85. package/src/helpers/titleCase.ts +1 -1
  86. package/src/helpers/toggleLegendActive.ts +25 -0
  87. package/src/hooks/useApplyTooltipsToGeo.tsx +51 -0
  88. package/src/hooks/useColumnsRequiredChecker.ts +51 -0
  89. package/src/hooks/useGeoClickHandler.ts +45 -0
  90. package/src/hooks/useLegendSeparators.ts +26 -0
  91. package/src/hooks/useMapLayers.tsx +34 -60
  92. package/src/hooks/useModal.ts +22 -0
  93. package/src/hooks/useResizeObserver.ts +4 -5
  94. package/src/hooks/useStateZoom.tsx +52 -75
  95. package/src/hooks/useTooltip.ts +2 -3
  96. package/src/index.jsx +3 -9
  97. package/src/scss/editor-panel.scss +3 -99
  98. package/src/scss/main.scss +1 -19
  99. package/src/scss/map.scss +15 -220
  100. package/src/store/map.actions.ts +46 -0
  101. package/src/store/map.reducer.ts +96 -0
  102. package/src/types/Annotations.ts +24 -0
  103. package/src/types/MapConfig.ts +23 -3
  104. package/src/types/MapContext.ts +36 -35
  105. package/src/types/Modal.ts +1 -0
  106. package/src/types/RuntimeData.ts +3 -0
  107. package/examples/private/DEV-9644.json +0 -184
  108. package/examples/private/DEV-9989.json +0 -229
  109. package/examples/private/ardi.json +0 -180
  110. package/examples/private/colors 2.json +0 -416
  111. package/examples/private/colors.json +0 -416
  112. package/examples/private/colors.json.zip +0 -0
  113. package/examples/private/customColors.json +0 -45348
  114. package/examples/test.json +0 -183
  115. package/src/helpers/closeModal.ts +0 -9
  116. package/src/scss/btn.scss +0 -69
  117. package/src/scss/filters.scss +0 -27
  118. package/src/scss/variables.scss +0 -1
  119. /package/src/hooks/{useActiveElement.js → useActiveElement.ts} +0 -0
@@ -1,416 +0,0 @@
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
- "statePicked": {
21
- "fipsCode": "01",
22
- "stateName": "Alabama"
23
- },
24
- "territoriesAlwaysShow": false,
25
- "geoLabelOverride": "",
26
- "convertFipsCodes": true,
27
- "allowMapZoom": true,
28
- "hideGeoColumnInTooltip": false,
29
- "hidePrimaryColumnInTooltip": false,
30
- "superTitle": "",
31
- "noStateFoundMessage": "Map Unavailable",
32
- "annotationDropdownText": "Annotations",
33
- "headerColor": "theme-blue",
34
- "title": ""
35
- },
36
- "type": "map",
37
- "customColors": [
38
- "#edf8fb",
39
- "#b3cde3",
40
- "#8c96c6",
41
- "#8856a7",
42
- "#810f7c"
43
- ],
44
- "columns": {
45
- "geo": {
46
- "name": "state",
47
- "label": "Location",
48
- "tooltip": false,
49
- "dataTable": true
50
- },
51
- "primary": {
52
- "dataTable": true,
53
- "tooltip": true,
54
- "prefix": "",
55
- "suffix": "%",
56
- "name": "value",
57
- "label": ""
58
- },
59
- "navigate": {
60
- "name": ""
61
- },
62
- "latitude": {
63
- "name": ""
64
- },
65
- "longitude": {
66
- "name": ""
67
- }
68
- },
69
- "legend": {
70
- "descriptions": {},
71
- "specialClasses": [],
72
- "unified": false,
73
- "singleColumn": false,
74
- "dynamicDescription": false,
75
- "type": "equalnumber",
76
- "numberOfItems": 5,
77
- "position": "side",
78
- "title": "Legend",
79
- "singleRow": false,
80
- "verticalSorted": false,
81
- "showSpecialClassesLast": false,
82
- "style": "circles",
83
- "subStyle": "linear blocks",
84
- "tickRotation": "",
85
- "singleColumnLegend": false,
86
- "hideBorder": false
87
- },
88
- "filters": [],
89
- "table": {
90
- "wrapColumns": false,
91
- "label": "Data Table",
92
- "expanded": false,
93
- "limitHeight": false,
94
- "height": "",
95
- "caption": "",
96
- "showDownloadUrl": false,
97
- "showDataTableLink": false,
98
- "showFullGeoNameInCSV": false,
99
- "forceDisplay": false,
100
- "download": true,
101
- "indexLabel": "",
102
- "showDownloadLinkBelow": true
103
- },
104
- "tooltips": {
105
- "appearanceType": "hover",
106
- "linkLabel": "Learn More",
107
- "capitalizeLabels": true,
108
- "opacity": 90
109
- },
110
- "visual": {
111
- "minBubbleSize": 1,
112
- "maxBubbleSize": 20,
113
- "extraBubbleBorder": false,
114
- "cityStyle": "circle",
115
- "cityStyleLabel": "",
116
- "showBubbleZeros": false,
117
- "additionalCityStyles": [],
118
- "geoCodeCircleSize": 8
119
- },
120
- "mapPosition": {
121
- "coordinates": [
122
- 0,
123
- 30
124
- ],
125
- "zoom": 1
126
- },
127
- "map": {
128
- "layers": [],
129
- "patterns": []
130
- },
131
- "filterBehavior": "Filter Change",
132
- "dataTable": {
133
- "title": "Data Table",
134
- "forceDisplay": true,
135
- "caption": "Lorem Ipsum - Text added to Data Table Caption",
136
- "limitHeight": true,
137
- "height": "100"
138
- },
139
- "orientation": null,
140
- "visualizationSubType": null,
141
- "validated": "4.24.3",
142
- "data": [
143
- {
144
- "state": "Alabama",
145
- "stratification": "Total",
146
- "value": "33.7"
147
- },
148
- {
149
- "state": "Connecticut",
150
- "stratification": "Total",
151
- "value": "35.6"
152
- },
153
- {
154
- "state": "Alaska",
155
- "stratification": "Total",
156
- "value": "36.4"
157
- },
158
- {
159
- "state": "Arkansas",
160
- "stratification": "Total",
161
- "value": "33.6"
162
- },
163
- {
164
- "state": "Arizona",
165
- "stratification": "Total",
166
- "value": "33.5"
167
- },
168
- {
169
- "state": "California",
170
- "stratification": "Total",
171
- "value": "34.7"
172
- },
173
- {
174
- "state": "Colorado",
175
- "stratification": "Total",
176
- "value": "35.6"
177
- },
178
- {
179
- "state": "District of Columbia",
180
- "stratification": "Total",
181
- "value": "30.9"
182
- },
183
- {
184
- "state": "Delaware",
185
- "stratification": "Total",
186
- "value": "33.9"
187
- },
188
- {
189
- "state": "Florida",
190
- "stratification": "Total",
191
- "value": "34.5"
192
- },
193
- {
194
- "state": "Texas",
195
- "stratification": "Total",
196
- "value": "34.7"
197
- },
198
- {
199
- "state": "Georgia",
200
- "stratification": "Total",
201
- "value": "31.9"
202
- },
203
- {
204
- "state": "Guam",
205
- "stratification": "Total",
206
- "value": "34.5"
207
- },
208
- {
209
- "state": "Hawaii",
210
- "stratification": "Total",
211
- "value": "33.8"
212
- },
213
- {
214
- "state": "Iowa",
215
- "stratification": "Total",
216
- "value": "33.8"
217
- },
218
- {
219
- "state": "Idaho",
220
- "stratification": "Total",
221
- "value": "35.4"
222
- },
223
- {
224
- "state": "Illinois",
225
- "stratification": "Total",
226
- "value": "33.9"
227
- },
228
- {
229
- "state": "Indiana",
230
- "stratification": "Total",
231
- "value": "33.3"
232
- },
233
- {
234
- "state": "Kansas",
235
- "stratification": "Total",
236
- "value": "33.4"
237
- },
238
- {
239
- "state": "Kentucky",
240
- "stratification": "Total",
241
- "value": "34.1"
242
- },
243
- {
244
- "state": "Louisiana",
245
- "stratification": "Total",
246
- "value": "31.7"
247
- },
248
- {
249
- "state": "Massachusetts",
250
- "stratification": "Total",
251
- "value": "34.7"
252
- },
253
- {
254
- "state": "Maryland",
255
- "stratification": "Total",
256
- "value": "34.4"
257
- },
258
- {
259
- "state": "Maine",
260
- "stratification": "Total",
261
- "value": "33.0"
262
- },
263
- {
264
- "state": "Michigan",
265
- "stratification": "Total",
266
- "value": "32.8"
267
- },
268
- {
269
- "state": "Minnesota",
270
- "stratification": "Total",
271
- "value": "34.9"
272
- },
273
- {
274
- "state": "Missouri",
275
- "stratification": "Total",
276
- "value": "33.9"
277
- },
278
- {
279
- "state": "Mississippi",
280
- "stratification": "Total",
281
- "value": "32.7"
282
- },
283
- {
284
- "state": "Montana",
285
- "stratification": "Total",
286
- "value": "35.4"
287
- },
288
- {
289
- "state": "North Carolina",
290
- "stratification": "Total",
291
- "value": "35.2"
292
- },
293
- {
294
- "state": "North Dakota",
295
- "stratification": "Total",
296
- "value": "35.6"
297
- },
298
- {
299
- "state": "Nebraska",
300
- "stratification": "Total",
301
- "value": "35.1"
302
- },
303
- {
304
- "state": "New Hampshire",
305
- "stratification": "Total",
306
- "value": "36.7"
307
- },
308
- {
309
- "state": "New Jersey",
310
- "stratification": "Total",
311
- "value": "36.7"
312
- },
313
- {
314
- "state": "New Mexico",
315
- "stratification": "Total",
316
- "value": "36.9"
317
- },
318
- {
319
- "state": "Nevada",
320
- "stratification": "Total",
321
- "value": "33.8"
322
- },
323
- {
324
- "state": "New York",
325
- "stratification": "Total",
326
- "value": "33.9"
327
- },
328
- {
329
- "state": "Ohio",
330
- "stratification": "Total",
331
- "value": "32.8"
332
- },
333
- {
334
- "state": "Oklahoma",
335
- "stratification": "Total",
336
- "value": "32.3"
337
- },
338
- {
339
- "state": "Oregon",
340
- "stratification": "Total",
341
- "value": "36.0"
342
- },
343
- {
344
- "state": "Pennsylvania",
345
- "stratification": "Total",
346
- "value": "34.3"
347
- },
348
- {
349
- "state": "Puerto Rico",
350
- "stratification": "Total",
351
- "value": "36.6"
352
- },
353
- {
354
- "state": "Rhode Island",
355
- "stratification": "Total",
356
- "value": "36.5"
357
- },
358
- {
359
- "state": "South Carolina",
360
- "stratification": "Total",
361
- "value": "34.8"
362
- },
363
- {
364
- "state": "South Dakota",
365
- "stratification": "Total",
366
- "value": "35.4"
367
- },
368
- {
369
- "state": "Tennessee",
370
- "stratification": "Total",
371
- "value": "32.0"
372
- },
373
- {
374
- "state": "Utah",
375
- "stratification": "Total",
376
- "value": "34.2"
377
- },
378
- {
379
- "state": "Virginia",
380
- "stratification": "Total",
381
- "value": "32.1"
382
- },
383
- {
384
- "state": "Virgin Islands",
385
- "stratification": "Total",
386
- "value": "37.0"
387
- },
388
- {
389
- "state": "Vermont",
390
- "stratification": "Total",
391
- "value": "34.1"
392
- },
393
- {
394
- "state": "Washington",
395
- "stratification": "Total",
396
- "value": "34.6"
397
- },
398
- {
399
- "state": "Wisconsin",
400
- "stratification": "Total",
401
- "value": "33.0"
402
- },
403
- {
404
- "state": "West Virginia",
405
- "stratification": "Total",
406
- "value": "33.4"
407
- },
408
- {
409
- "state": "Wyoming",
410
- "stratification": "Total",
411
- "value": "35.6"
412
- }
413
- ],
414
- "color": "",
415
- "version": "4.24.12"
416
- }