@cdc/map 4.24.1 → 4.24.3

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 (43) hide show
  1. package/dist/cdcmap.js +53648 -47918
  2. package/examples/508.json +548 -0
  3. package/examples/default-county.json +0 -28
  4. package/examples/default-hex.json +110 -13
  5. package/examples/default-usa.json +69 -28
  6. package/examples/test.json +0 -9614
  7. package/examples/usa-special-class-legend.json +501 -0
  8. package/examples/{private/zika-issue.json → zika.json} +47 -51
  9. package/index.html +11 -5
  10. package/package.json +3 -3
  11. package/src/CdcMap.tsx +84 -32
  12. package/src/components/BubbleList.jsx +9 -1
  13. package/src/components/CityList.jsx +94 -31
  14. package/src/components/DataTable.jsx +7 -7
  15. package/src/components/EditorPanel/components/EditorPanel.tsx +181 -46
  16. package/src/components/EditorPanel/components/HexShapeSettings.tsx +18 -3
  17. package/src/components/Geo.jsx +4 -2
  18. package/src/components/Legend/components/Legend.tsx +67 -13
  19. package/src/components/Legend/components/LegendItem.Hex.tsx +5 -9
  20. package/src/components/Legend/components/index.scss +31 -5
  21. package/src/components/UsaMap/components/HexIcon.tsx +41 -0
  22. package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +38 -19
  23. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +10 -21
  24. package/src/components/UsaMap/components/UsaMap.Region.tsx +11 -37
  25. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +0 -1
  26. package/src/components/UsaMap/components/UsaMap.State.tsx +62 -61
  27. package/src/components/UsaMap/helpers/patternSizes.tsx +5 -0
  28. package/src/components/WorldMap/components/WorldMap.jsx +16 -8
  29. package/src/components/WorldMap/data/world-topo-guiana-update.json +1 -0
  30. package/src/components/WorldMap/data/world-topo-old.json +1 -0
  31. package/{examples/private/new-world.json → src/components/WorldMap/data/world-topo-recent.json} +23137 -22280
  32. package/src/components/WorldMap/data/world-topo.json +1 -1
  33. package/src/data/initial-state.js +5 -2
  34. package/src/data/supported-geos.js +21 -1
  35. package/src/hooks/useTooltip.ts +4 -4
  36. package/src/scss/editor-panel.scss +5 -3
  37. package/src/scss/main.scss +2 -1
  38. package/src/scss/map.scss +22 -12
  39. package/src/types/MapConfig.ts +7 -0
  40. package/examples/private/map-text-wrap.json +0 -574
  41. package/examples/private/map-world-data.json +0 -1046
  42. package/examples/world-geocode-data.json +0 -18
  43. package/examples/world-geocode.json +0 -108
@@ -487,7 +487,27 @@ export const supportedCountries = {
487
487
  YEM: ['Yemen'],
488
488
  ZMB: ['Zambia'],
489
489
  ZWE: ['Zimbabwe'],
490
- IOT: ['British Indian Ocean Territory']
490
+ IOT: ['British Indian Ocean Territory'],
491
+ Alaska: ['Alaska'],
492
+ Hawaii: ['Hawaii'],
493
+ Sardinia: ['Sardinia'],
494
+ Sicily: ['Sicily'],
495
+ Corsica: ['Corsica'],
496
+ 'Easter Island': ['Easter Island'],
497
+ 'Canary Islands': ['Canary Islands'],
498
+ Antarctica: ['Antarctica'],
499
+ ATA: ['Antarctica'],
500
+ 'Madeira Islands': ['Madeira Islands'],
501
+ 'Gaza/West Bank': ['Gaza/West Bank'],
502
+ 'Saint Paul and Amsterdam Islands': ['Saint Paul and Amsterdam Islands'],
503
+ 'Sovereign Base Areas of Akrotiri and Dhekelia': ['Sovereign Base Areas of Akrotiri and Dhekelia'],
504
+ 'Plazas de Soberania': ['Plazas de Soberania'],
505
+ Akrotiri: ['Akrotiri'],
506
+ Dhekelia: ['Dhekelia'],
507
+ Sicily: ['Sicily'],
508
+ Sardinia: ['Sardinia'],
509
+ 'US-AK': ['Alaska'],
510
+ 'US-HI': ['Hawaii']
491
511
  }
492
512
 
493
513
  export const supportedTerritories = {
@@ -52,7 +52,7 @@ const useTooltip = props => {
52
52
  const prefix = handleTooltipPrefix('')
53
53
 
54
54
  if (hideGeoColumnInTooltip) return `<strong>${displayGeoName(geoName)}</strong>`
55
- return `<p class="tooltip-heading">${prefix}${displayGeoName(geoName)}</p>`
55
+ return `<p class="tooltip-heading" style="text-transform: none;">${prefix}${displayGeoName(geoName)}</p>`
56
56
  }
57
57
 
58
58
  /**
@@ -92,7 +92,7 @@ const useTooltip = props => {
92
92
  } = config
93
93
 
94
94
  if (tooltipEnabledMaps.includes(currentMapType) && undefined !== row) {
95
- toolTipText += `<ul className="capitalize">`
95
+ toolTipText += `<ul>`
96
96
 
97
97
  // if tooltips are allowed, loop through each column
98
98
  Object.keys(columns).forEach(columnKey => {
@@ -120,10 +120,10 @@ const useTooltip = props => {
120
120
  // Handle County Location Columns
121
121
  toolTipText += handleTooltipStateNameColumn(toolTipText, row)
122
122
 
123
- // Handle Data > Geo Column In tooltips
123
+ // Handle Columns > Data Column In tooltips
124
124
  toolTipText += handleTooltipGeoColumn(geoName)
125
125
 
126
- // Handle Data > Primary Column in tooltips
126
+ // Handle Columns > Geography Column In tooltips
127
127
  toolTipText = handleTooltipColumns(toolTipText, row)
128
128
 
129
129
  return toolTipText
@@ -82,14 +82,13 @@
82
82
  color: #000;
83
83
  font-size: 1em;
84
84
  border: 0;
85
- position: fixed;
85
+ position: absolute;
86
86
  z-index: 100;
87
87
  transition: 0.1s background;
88
88
  cursor: pointer;
89
89
  width: 25px;
90
90
  height: 25px;
91
91
  left: 307px;
92
- top: 10px;
93
92
  box-shadow: rgba(0, 0, 0, 0.5) 0 1px 2px;
94
93
  &:before {
95
94
  top: 43%;
@@ -114,7 +113,7 @@
114
113
  background: #fff;
115
114
  width: $editorWidth;
116
115
  overflow-y: overlay;
117
- position: fixed;
116
+ position: absolute;
118
117
  z-index: 7;
119
118
  display: flex;
120
119
  flex-direction: column;
@@ -281,6 +280,9 @@
281
280
  span.h5 {
282
281
  font-size: 0.8em;
283
282
  }
283
+ & p.layer-purpose-details {
284
+ margin-top: 1em;
285
+ }
284
286
  }
285
287
 
286
288
  .advanced {
@@ -121,7 +121,7 @@
121
121
  cursor: pointer;
122
122
  width: 1em;
123
123
  }
124
- span.navigation-link {
124
+ a.navigation-link {
125
125
  text-decoration: underline;
126
126
  cursor: pointer;
127
127
  color: #075290;
@@ -129,6 +129,7 @@
129
129
  svg {
130
130
  display: inline-block;
131
131
  max-width: 13px;
132
+ margin-left: .5em;
132
133
  }
133
134
  }
134
135
  &.capitalize p {
package/src/scss/map.scss CHANGED
@@ -49,6 +49,11 @@ header + .map-container.full-border {
49
49
  flex-direction: row;
50
50
  }
51
51
  }
52
+ .map-container.map {
53
+ &.side {
54
+ flex-direction: row;
55
+ }
56
+ }
52
57
  // Bubble Specific
53
58
  .map-container.bubble {
54
59
  &.side {
@@ -83,13 +88,13 @@ $medium: 768px;
83
88
  }
84
89
  // make logo smaller on mobile
85
90
  @media screen and (max-width: $small) {
86
- .map-logo {
87
- position: absolute;
88
- bottom: 4em; // needed to align to top of Territories
89
- right: 1em;
90
- z-index: 3;
91
- width: 50px; // make it smaller
92
- }
91
+ .map-logo {
92
+ position: absolute;
93
+ bottom: 4em; // needed to align to top of Territories
94
+ right: 1em;
95
+ z-index: 3;
96
+ width: 50px; // make it smaller
97
+ }
93
98
  }
94
99
  // everything else but mobile
95
100
  @media screen and (min-width: $small) {
@@ -101,10 +106,8 @@ $medium: 768px;
101
106
  width: 75px;
102
107
  }
103
108
  }
104
-
105
109
  }
106
110
 
107
-
108
111
  .single-geo {
109
112
  transition: 0.2s fill;
110
113
  cursor: pointer;
@@ -117,16 +120,18 @@ $medium: 768px;
117
120
  .two-col {
118
121
  display: flex;
119
122
  margin-top: 0;
123
+
120
124
  justify-content: flex-start;
121
125
  > label {
122
126
  margin-top: 0;
123
127
  display: inline-block;
124
128
  }
125
129
  }
130
+
126
131
  .territories-label {
127
132
  margin: 2em 5px 2em 1em;
128
133
  font-size: 1.1em;
129
- display:block;
134
+ display: block;
130
135
  }
131
136
 
132
137
  // Cities and Territories
@@ -150,9 +155,14 @@ $medium: 768px;
150
155
  }
151
156
  }
152
157
 
153
- &--mobile {
158
+ &--mobile {
154
159
  @extend .territories;
155
- width: 70%;
160
+ width: 60%;
161
+ }
162
+ }
163
+
164
+ @media screen and (max-width: $small) {
165
+ .territories {
156
166
  }
157
167
  }
158
168
 
@@ -11,10 +11,15 @@ export type MapVisualSettings = {
11
11
  extraBubbleBorder: boolean
12
12
  /** cityStyle - visual indicator of cities on state maps */
13
13
  cityStyle: 'circle' | 'pin'
14
+ /** cityStyle - optional visual indicator of label on the Legend */
15
+ cityStyleLabel: string
14
16
  /** geoCodeCircleSize - controls the size of the city style option (circle or pin) */
17
+
15
18
  geoCodeCircleSize: number
16
19
  /** showBubbleZeros - shows circles on maps when the data is provided even if its a zero value */
17
20
  showBubbleZeros: boolean
21
+ /** additionalCityStyles - shows Circle, Square, Triangle, Rhombus/Diamond, Star, Map Pin on maps when the additionalCityStyles is added */
22
+ additionalCityStyles: [] | [{ label: string; column: string; value: string; shape: string }]
18
23
  }
19
24
 
20
25
  type PatternSelection = {
@@ -26,6 +31,8 @@ type PatternSelection = {
26
31
  pattern: 'lines' | 'circles' | 'waves'
27
32
  // optional legend update
28
33
  label: string
34
+ // size of pattern
35
+ size: 'small' | 'medium' | 'large'
29
36
  }
30
37
 
31
38
  export type GeoColumnProperties = Pick<EditorColumnProperties, 'name' | 'label' | 'tooltip' | 'dataTable'>