@cdc/map 4.23.5 → 4.23.7

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.
@@ -188,12 +188,18 @@ const UsaMap = props => {
188
188
 
189
189
  // Dynamic text color
190
190
  if (chroma.contrast(textColor, bgColor) < 3.5) {
191
- textColor = '#202020'
191
+ textColor = '#202020' // dark gray
192
+ }
193
+
194
+ // always make HI black since it is off to the side
195
+ if (abbr === 'US-HI') {
196
+ textColor = '#000'
192
197
  }
193
198
 
194
199
  let x = 0,
195
200
  y = 5
196
201
 
202
+ // used to nudge/move some of the labels for better readability
197
203
  if (nudges[abbr] && false === isHex) {
198
204
  x += nudges[abbr][0]
199
205
  y += nudges[abbr][1]
@@ -69,6 +69,7 @@ export default {
69
69
  caption: '',
70
70
  showDownloadUrl: false,
71
71
  showDataTableLink: true,
72
+ showFullGeoNameInCSV: false,
72
73
  forceDisplay: true,
73
74
  download: false,
74
75
  indexLabel: ''
@@ -76,7 +77,8 @@ export default {
76
77
  tooltips: {
77
78
  appearanceType: 'hover',
78
79
  linkLabel: 'Learn More',
79
- capitalizeLabels: true
80
+ capitalizeLabels: true,
81
+ opacity: 90
80
82
  },
81
83
  runtime: {
82
84
  editorErrorMessage: []
@@ -0,0 +1,165 @@
1
+ City,Latitude,Longitude
2
+ ALASKA NATIVE TRIBAL HEALTH CONSORTIUM,-149.8067,61.1827
3
+ ALBUQUERQUE,-106.650421,35.084385
4
+ ALEXANDRIA,-77.0469,38.8048
5
+ AMERICAN INDIAN CANCER FOUNDATION,-93.1777,45.0119
6
+ ANAHEIM,-117.914299,33.836594
7
+ ANCHORAGE,-149.900284,61.218056
8
+ ARCTIC SLOPE NATIVE ASSOCIATION LIMITED,-156.79225,71.2907
9
+ ARLINGTON,-97.108063,32.735687
10
+ ATLANTA,-84.387985,33.748997
11
+ AURORA,-93.717979,36.97089
12
+ AUSTIN,-97.743057,30.267153
13
+ BAKERSFIELD,-119.018715,35.373291
14
+ BALTIMORE,-76.61219,39.290386
15
+ BATON ROUGE,-91.187149,30.451468
16
+ BIRMINGHAM,-86.9902166,33.5314447
17
+ BOISE,-116.202316,43.615021
18
+ BOSTON,-71.058884,42.360081
19
+ BUFFALO,-78.878372,42.886448
20
+ CALIFORNIA RURAL INDIAN HEALTH BOARD INC.,-121.3605,38.6468
21
+ CHANDLER,-111.841248,33.30616
22
+ CHARLOTTE,-80.843124,35.227085
23
+ CHEROKEE NATION,-94.8936,36.3365
24
+ CHESAPEAKE,-76.287491,36.768208
25
+ CHEYENNE RIVER SIOUX TRIBE,-101.2358,45.00023
26
+ CHICAGO,-87.629799,41.878113
27
+ CHULA VISTA,-117.084198,32.640053
28
+ CINCINNATI,-84.512016,39.103119
29
+ CLEVELAND,-81.694359,41.499321
30
+ COLORADO SPRINGS,-104.821365,38.833881
31
+ COLUMBUS,-82.998795,39.961178
32
+ CORPUS CHRISTI,-97.396378,27.800583
33
+ DALLAS,-96.796989,32.776665
34
+ DENVER,-104.99025,39.739235
35
+ DETROIT,-83.045753,42.331429
36
+ DISTRICT OF COLUMBIA,-77.036873,38.907192
37
+ DURHAM,-78.898621,35.994034
38
+ EAU CLAIRE,-91.4985,44.8113
39
+ EL PASO,-106.485023,31.761877
40
+ "ELLENSBURG, WA",-120.5478,46.9965
41
+ "ELLENSBURG, WASHINGTON",-120.5478,46.9965
42
+ FOND DU LAC RESERVATION,-92.6002,46.7502
43
+ FORT WAYNE,-85.139351,41.079273
44
+ FORT WORTH,-97.330765,32.755489
45
+ FREMONT,-121.988571,37.548271
46
+ FRESNO,-119.787125,36.737797
47
+ FT WAYNE,-85.139351,41.079273
48
+ GAINESVILLE,-82.3248,29.6516
49
+ GARLAND,-96.638885,32.912624
50
+ GILBERT,-111.789024,33.352825
51
+ GLENDALE,-118.255074,34.142509
52
+ "GRAND RAPIDS, MI",-85.6681,42.9634
53
+ "GRAND RAPIDS, MICHIGAN",-85.6681,42.9634
54
+ GREAT PLAINS TRIBAL CHAIRMEN\S HEALTH BOARD,-103.22444,44.083054
55
+ GREENSBORO,-79.791977,36.072636
56
+ HENDERSON,-114.98172,36.039524
57
+ HERSHEY,-76.6779444,40.2849997
58
+ HIALEAH,-80.278107,25.857595
59
+ HONOLULU,-157.858337,21.306944
60
+ HOPI TRIBE,-110.5035,35.7833
61
+ HOUSTON,-86.136543,39.781029
62
+ INDIANAPOLIS,-86.158066,39.768402
63
+ "INTER-TRIBAL COUNCIL OF MICHIGAN, INC.",-84.35486,46.46462
64
+ IRVINE,-117.826508,33.684566
65
+ IRVING,-96.948891,32.814018
66
+ JACKSONVILLE,-81.655647,30.332184
67
+ JERSEY CITY,-77.199406,39.153515
68
+ KANSAS CITY,-94.578568,39.099728
69
+ KAW NATION OF OKLAHOMA,-96.8633,36.7669
70
+ LAKEVIEW,-104.9903,39.7392
71
+ LAREDO,-99.507553,27.503561
72
+ LAS VEGAS,-115.139832,36.169941
73
+ LEXINGTON,-84.503716,38.040585
74
+ LINCOLN,-95.262955,37.346134
75
+ LITTLE ROCK,-92.288,34.7445
76
+ LOCKPORT,-78.6903,43.1706
77
+ LONG BEACH,-118.193741,33.77005
78
+ LOS ANGELES COUNTY,-118.229362,34.058762
79
+ LOS ANGELES,-118.243683,34.052235
80
+ LOUISVILLE,-85.758453,38.252666
81
+ LUBBOCK,-101.855164,33.577862
82
+ MADISON,-89.40123,43.073051
83
+ "MARION COUNTY, INDIANA",-86.136543,39.781029
84
+ MARION,-88.9330556,37.7305556
85
+ MEMPHIS,-90.048981,35.149532
86
+ MESA,-111.831474,33.415184
87
+ MIAMI,-80.191788,25.761681
88
+ MILWAUKEE,-87.906471,43.038902
89
+ MINNEAPOLIS,-93.265015,44.977753
90
+ MODESTO,-120.997,37.6393
91
+ "MONTGOMERY COUNTY, MARYLAND",-77.199406,39.153515
92
+ NASHVILLE,-86.781601,36.162663
93
+ "NATIVE AMERICAN REHABILITATION ASSOCIATION OF THE NORTHWEST, INC.",-122.692,45.5184
94
+ NAVAJO NATION,-109.188,35.0672
95
+ NEW ORLEANS,-90.071533,29.951065
96
+ NEW YORK CITY,-74.005974,40.712776
97
+ NEWARK,-74.1724,40.7357
98
+ NORFOLK,-76.285873,36.850769
99
+ NORTH LAS VEGAS,-115.114571,36.19585
100
+ NORTHWEST PORTLAND AREA INDIAN HEALTH BOARD,-122.6863,45.5076
101
+ OAKLAND,-122.271111,37.804363
102
+ OKLAHOMA CITY,-97.516426,35.46756
103
+ OMAHA,-95.934502,41.256538
104
+ ORLANDO,-81.379234,28.538336
105
+ PASADENA,-95.209099,29.691063
106
+ PHILADELPHIA,-75.165222,39.952583
107
+ PHOENIX,-112.074036,33.448376
108
+ PITTSBURGH,-79.995888,40.440624
109
+ PLANO,-96.698883,33.019844
110
+ PORTLAND,-122.658722,45.51223
111
+ "PROVO, UT",-111.6585,40.2338
112
+ "PROVO, UTAH",-111.6585,40.2338
113
+ RALEIGH,-78.638176,35.779591
114
+ RENO,-119.813805,39.529633
115
+ RICHMOND,-77.43605,37.540726
116
+ RIVERSIDE,-117.375496,33.980602
117
+ "ROUND ROCK, TEXAS",-97.6789,30.5083
118
+ "ROUND ROCK, TX",-97.6789,30.5083
119
+ SACRAMENTO,-121.4944,38.581573
120
+ SAINT PAUL,-93.089958,44.953705
121
+ "SALEM, ALABAMA",-85.2386,32.5968
122
+ "SALEM, CONNECTICUT",-72.2754,41.4904
123
+ "SALEM, FLORIDA",-83.4129,29.8869
124
+ "SALEM, ILLINOIS",-88.945618,38.626991
125
+ "SALEM, MASSACHUSETTS",-70.8955,42.5197
126
+ "SALEM, OR",-123.0351,44.9429
127
+ "SALEM, OREGON",-123.0351,44.9429
128
+ "SALEM, OREGON",-123.0351,44.9429
129
+ SALT LAKE CITY,-112.0605644,40.7767833
130
+ "SALUDA, VA",-76.595,37.6064
131
+ "SALUDA, VIRGINIA",-76.595,37.6064
132
+ SAN ANTONIO,-98.493629,29.424122
133
+ SAN BENITO,-97.6311,26.1326
134
+ SAN BERNARDINO,-117.302399,34.115784
135
+ SAN DIEGO,-117.161087,32.715736
136
+ SAN FRANCISCO,-122.419418,37.774929
137
+ SAN JOSE,-121.88633,37.338207
138
+ SANTA ANA,-117.867653,33.745472
139
+ SANTA CLARA,-121.955238,37.354107
140
+ SCOTTSDALE,-111.926048,33.494171
141
+ SEATTLE,-122.332069,47.606209
142
+ SOUTH PUGET INTERTRIBAL PLANNING AGENCY,-123.0832,47.1241
143
+ SOUTHCENTRAL FOUNDATION,-149.7971,61.1821
144
+ SOUTHEAST ALASKA REGIONAL HEALTH CONSORTIUM,-135.3369,57.05479
145
+ SPOKANE,-117.426048,47.658779
146
+ ST PAUL,-93.089958,44.953705
147
+ ST. LOUIS,-90.199402,38.627003
148
+ ST. PETERSBURG,-82.640289,27.767601
149
+ STOCKTON,-121.290779,37.957703
150
+ SYRACUSE,-76.1742992,43.0352913
151
+ TAMPA,-82.457176,27.950575
152
+ TOLEDO,-83.537865,41.652805
153
+ TUCSON,-110.974709,32.222607
154
+ TULSA,-95.992775,36.15398
155
+ TUSCON,-110.974709,32.222607
156
+ US-DC,-77.036873,38.907192
157
+ VIRGINIA BEACH,-75.977982,36.852924
158
+ WARREN,-80.8184,41.2376
159
+ WASHINGTON D.C.,-77.036873,38.907192
160
+ WASHINGTON DC.,-77.036873,38.907192
161
+ WASHINGTON DC,-77.036873,38.907192
162
+ WICHITA,-97.330055,37.687176
163
+ WINSTON SALEM,-80.244217,36.099861
164
+ WINSTON-SALEM,-80.244217,36.099861
165
+ YUKON-KUSKOKWIM HEALTH CORPORATION,-161.7849,60.7881
@@ -496,6 +496,8 @@ export const supportedTerritories = {
496
496
  'US-MH': ['MARSHALL ISLANDS', 'MH', 'RMI'] // Note: Key is not an official ISO code
497
497
  }
498
498
 
499
+ // ! INFO: coordinates are [negative longitude, latitude]
500
+ // ie. Albuquerque coordinates are actually [35, 106]
499
501
  // prettier-ignore
500
502
  export const supportedCities = {
501
503
  'ALASKA NATIVE TRIBAL HEALTH CONSORTIUM': [-149.8067, 61.1827],
@@ -536,6 +538,8 @@ export const supportedCities = {
536
538
  'DURHAM': [-78.898621, 35.994034],
537
539
  'EAU CLAIRE': [-91.4985, 44.8113],
538
540
  'EL PASO': [-106.485023, 31.761877],
541
+ 'ELLENSBURG, WA': [-120.5478, 46.9965],
542
+ 'ELLENSBURG, WASHINGTON': [-120.5478, 46.9965],
539
543
  'FOND DU LAC RESERVATION': [-92.6002, 46.7502],
540
544
  'FORT WAYNE': [-85.139351, 41.079273],
541
545
  'FORT WORTH': [-97.330765, 32.755489],
@@ -546,6 +550,8 @@ export const supportedCities = {
546
550
  'GARLAND': [-96.638885, 32.912624],
547
551
  'GILBERT': [-111.789024, 33.352825],
548
552
  'GLENDALE': [-118.255074, 34.142509],
553
+ 'GRAND RAPIDS, MI': [-85.6681, 42.9634],
554
+ 'GRAND RAPIDS, MICHIGAN': [-85.6681, 42.9634],
549
555
  'GREAT PLAINS TRIBAL CHAIRMEN\'S HEALTH BOARD': [-103.22444, 44.083054],
550
556
  'GREENSBORO': [-79.791977, 36.072636],
551
557
  'HENDERSON': [-114.981720, 36.039524],
@@ -603,10 +609,14 @@ export const supportedCities = {
603
609
  'PITTSBURGH': [-79.995888, 40.440624],
604
610
  'PLANO': [-96.698883, 33.019844],
605
611
  'PORTLAND': [-122.658722, 45.512230],
612
+ 'PROVO, UT': [-111.6585, 40.2338],
613
+ 'PROVO, UTAH': [-111.6585, 40.2338],
606
614
  'RALEIGH': [-78.638176, 35.779591],
607
615
  'RENO': [-119.813805, 39.529633],
608
616
  'RICHMOND': [-77.436050, 37.540726],
609
617
  'RIVERSIDE': [-117.375496, 33.980602],
618
+ 'ROUND ROCK, TEXAS': [-97.6789, 30.5083],
619
+ 'ROUND ROCK, TX': [-97.6789, 30.5083],
610
620
  'SACRAMENTO': [-121.494400, 38.581573],
611
621
  'SAINT PAUL': [-93.089958, 44.953705],
612
622
  'SALEM, ALABAMA': [-85.2386, 32.5968],
@@ -614,8 +624,12 @@ export const supportedCities = {
614
624
  'SALEM, FLORIDA': [-83.4129, 29.8869],
615
625
  'SALEM, ILLINOIS':[-88.945618,38.626991],
616
626
  'SALEM, MASSACHUSETTS': [-70.8955, 42.5197],
627
+ 'SALEM, OR': [-123.0351, 44.9429],
628
+ 'SALEM, OREGON': [-123.0351, 44.9429],
617
629
  'SALEM, OREGON': [-123.0351, 44.9429],
618
630
  'SALT LAKE CITY': [-112.0605644, 40.7767833],
631
+ 'SALUDA, VA': [-76.5950, 37.6064],
632
+ 'SALUDA, VIRGINIA': [-76.5950, 37.6064],
619
633
  'SAN ANTONIO': [-98.493629, 29.424122],
620
634
  'SAN BENITO': [-97.6311, 26.1326],
621
635
  'SAN BERNARDINO':[-117.302399,34.115784],
@@ -83,78 +83,18 @@ export default function useMapLayers(config, setConfig, pathGenerator) {
83
83
  setConfig(updatedState)
84
84
  }
85
85
 
86
- /**
87
- * Updates the index of the layer tooltip
88
- * @param {Event} e
89
- * @param {Integer} index
90
- */
91
- const handleMapLayerTooltip = (e, index) => {
92
- e.preventDefault()
93
- let newLayers = [...config.map.layers]
94
-
95
- newLayers[index].tooltip = e.target.value
96
-
97
- setConfig({
98
- ...config,
99
- map: {
100
- ...config.map,
101
- layers: newLayers
102
- }
103
- })
104
- }
105
-
106
- /**
107
- * Changes the map layer url for a given index
108
- * @param {Event} e - on add custom layer click
109
- * @param {Integer} index - index of layer to update
110
- */
111
- const handleMapLayerUrl = (e, index) => {
112
- e.preventDefault()
113
- let newLayers = [...config.map.layers]
114
-
115
- newLayers[index].url = e.target.value
116
-
117
- setConfig({
118
- ...config,
119
- map: {
120
- ...config.map,
121
- layers: newLayers
122
- }
123
- })
124
- }
125
-
126
- /**
127
- * Changes the map layer name for a given index
128
- * @param {Event} e - on add custom layer click
129
- * @param {Integer} index - index of layer to update
130
- */
131
- const handleMapLayerName = (e, index) => {
86
+ const handleMapLayer = (e, index, layerKey) => {
132
87
  e.preventDefault()
133
88
 
134
- let newLayers = [...config.map.layers]
135
-
136
- newLayers[index].name = e.target.value
137
-
138
- setConfig({
139
- ...config,
140
- map: {
141
- ...config.map,
142
- layers: newLayers
143
- }
144
- })
145
- }
89
+ let layerValue = e.target.value
146
90
 
147
- /**
148
- * Changes the map layer namespace for a given index
149
- * @param {Event} e - on add custom layer click
150
- * @param {Integer} index - index of layer to update
151
- */
152
- const handleMapLayerNamespace = (e, index) => {
153
- e.preventDefault()
91
+ if (layerKey === 'fillOpacity') {
92
+ layerValue = layerValue / 100
93
+ }
154
94
 
155
95
  let newLayers = [...config.map.layers]
156
96
 
157
- newLayers[index].namespace = e.target.value
97
+ newLayers[index][layerKey] = layerValue
158
98
 
159
99
  setConfig({
160
100
  ...config,
@@ -207,17 +147,16 @@ export default function useMapLayers(config, setConfig, pathGenerator) {
207
147
 
208
148
  // feature array for county maps
209
149
  tempFeatureArray.push(item)
210
-
211
150
  tempArr.push(
212
151
  <Group className={layerClasses.join(' ')} key={`customMapLayer-${item.properties.name.replace(' ', '-')}-${index}`}>
213
152
  {/* prettier-ignore */}
214
153
  <path
215
154
  d={pathGenerator(item)}
216
- fill={item.properties.fill}
217
- fillOpacity={item.properties['fill-opacity']}
155
+ fill={config.map.layers[index].fill ? config.map.layers[index].fill : item.properties.fill ? item.properties.fill : 'transparent'}
156
+ fillOpacity={config.map.layers[index].fillOpacity ? config.map.layers[index].fillOpacity : item.properties['fill-opacity'] ? item.properties['fill-opacity'] : '1'}
218
157
  key={geoId} data-id={geoId}
219
- stroke={item.properties.stroke}
220
- strokeWidth={item.properties['stroke-width']}
158
+ stroke={config.map.layers[index].stroke ? config.map.layers[index].stroke : item.properties.stroke ? item.properties.stroke : 'transparent'}
159
+ strokeWidth={config.map.layers[index].strokeWidth ? config.map.layers[index].strokeWidth : item.properties['stroke-width']}
221
160
  data-tooltip-id='tooltip'
222
161
  data-tooltip-html={config.map.layers[index].tooltip ? config.map.layers[index].tooltip : ''}
223
162
  />
@@ -234,10 +173,7 @@ export default function useMapLayers(config, setConfig, pathGenerator) {
234
173
  const MapLayerHandlers = () => null
235
174
  MapLayerHandlers.handleRemoveLayer = handleRemoveLayer
236
175
  MapLayerHandlers.handleAddLayer = handleAddLayer
237
- MapLayerHandlers.handleMapLayerUrl = handleMapLayerUrl
238
- MapLayerHandlers.handleMapLayerName = handleMapLayerName
239
- MapLayerHandlers.handleMapLayerNamespace = handleMapLayerNamespace
240
- MapLayerHandlers.handleMapLayerTooltip = handleMapLayerTooltip
176
+ MapLayerHandlers.handleMapLayer = handleMapLayer
241
177
 
242
178
  return { pathArray, featureArray, MapLayerHandlers }
243
179
  }
@@ -0,0 +1,135 @@
1
+ const useTooltip = props => {
2
+ const { state, displayGeoName, displayDataAsText, supportedStatesFipsCodes } = props
3
+
4
+ /**
5
+ * On county maps there's a need to append the state name
6
+ * @param {String} toolTipText - previous tooltip text to build upon
7
+ * @param {Object} row - row of data to lookup fips code with using the geo column.
8
+ * @returns {String} toolTipText - new toolTipText
9
+ */
10
+ const handleTooltipStateNameColumn = (toolTipText, row) => {
11
+ const { geoType, type, hideGeoColumnInTooltip } = state.general
12
+ if (geoType === 'us-county' && type !== 'us-geocode') {
13
+ let stateFipsCode = row[state.columns.geo.name].substring(0, 2)
14
+ const stateName = supportedStatesFipsCodes[stateFipsCode]
15
+ toolTipText += hideGeoColumnInTooltip ? `<strong>${stateName}</strong><br/>` : `<strong>Location: ${stateName}</strong><br/>`
16
+ }
17
+ return toolTipText
18
+ }
19
+
20
+ /**
21
+ * On county and state maps, adds the ability to hide the geo column name (prefix)
22
+ * @param {String} geoName - feature name
23
+ * @returns {String} text to be appended to toolTipText
24
+ */
25
+ const handleTooltipGeoColumn = geoName => {
26
+ const { hideGeoColumnInTooltip } = state.general
27
+
28
+ const handleTooltipPrefix = toolTipText => {
29
+ const { geoType, geoLabelOverride } = state.general
30
+ switch (geoType) {
31
+ case 'us':
32
+ toolTipText = 'State: '
33
+ break
34
+ case 'us-county':
35
+ toolTipText = 'County: '
36
+ break
37
+ case 'single-state':
38
+ toolTipText = 'County: '
39
+ break
40
+ default:
41
+ toolTipText = ''
42
+ break
43
+ }
44
+
45
+ if (geoLabelOverride) toolTipText = `${geoLabelOverride}: `
46
+
47
+ return toolTipText
48
+ }
49
+
50
+ const prefix = handleTooltipPrefix()
51
+
52
+ if (hideGeoColumnInTooltip) return `<strong>${displayGeoName(geoName)}</strong>`
53
+ return `<p class="tooltip-heading">${prefix}${displayGeoName(geoName)}</p>`
54
+ }
55
+
56
+ /**
57
+ * Handles special class descriptions in tooltips
58
+ */
59
+ const handleTooltipSpecialClassText = (specialClasses, column, row, value, columnKey) => {
60
+ if (specialClasses && specialClasses.length && typeof specialClasses[0] === 'object') {
61
+ for (const specialClass of specialClasses) {
62
+ if (column.name === specialClass.key && String(row[specialClass.key]) === specialClass.value) {
63
+ value = displayDataAsText(specialClass.label, columnKey)
64
+ break
65
+ }
66
+ }
67
+ }
68
+ return value
69
+ }
70
+
71
+ const handleTooltipPrimaryColumn = (tooltipValue, column) => {
72
+ const { hidePrimaryColumnInTooltip } = state.general
73
+ let tooltipPrefix = column.label?.length > 0 ? column.label : ''
74
+ if (hidePrimaryColumnInTooltip || !tooltipPrefix) return `<li class="tooltip-body">${tooltipValue}</li>`
75
+ return `<li class="tooltip-body">${tooltipPrefix}: ${tooltipValue}</li>`
76
+ }
77
+
78
+ /**
79
+ *
80
+ * @param {String} toolTipText - previous tooltipText to build upon
81
+ * @param {Object} row - row of data
82
+ * @returns {String} new tooltipText value
83
+ */
84
+ const handleTooltipColumns = (toolTipText, row) => {
85
+ const tooltipEnabledMaps = ['data', 'bubble', 'us-geocode', 'world-geocode', 'map']
86
+ const {
87
+ general: { type: currentMapType },
88
+ columns,
89
+ legend: { specialClasses }
90
+ } = state
91
+
92
+ if (tooltipEnabledMaps.includes(currentMapType) && undefined !== row) {
93
+ toolTipText += `<ul className="capitalize">`
94
+
95
+ // if tooltips are allowed, loop through each column
96
+ Object.keys(columns).forEach(columnKey => {
97
+ const column = state.columns[columnKey]
98
+
99
+ if (column.tooltip) {
100
+ let tooltipValue = handleTooltipSpecialClassText(specialClasses, column, row, '', columnKey)
101
+
102
+ if (!tooltipValue) {
103
+ tooltipValue = displayDataAsText(row[column.name], columnKey)
104
+ }
105
+
106
+ toolTipText += handleTooltipPrimaryColumn(tooltipValue, column)
107
+ }
108
+ })
109
+ toolTipText += `</ul>`
110
+ }
111
+
112
+ return toolTipText
113
+ }
114
+
115
+ const buildTooltip = (row, geoName, toolTipText = '') => {
116
+ if (!row) return
117
+
118
+ // Handle County Location Columns
119
+ toolTipText += handleTooltipStateNameColumn(toolTipText, row)
120
+
121
+ // Handle Data > Geo Column In tooltips
122
+ toolTipText += handleTooltipGeoColumn(geoName)
123
+
124
+ // Handle Data > Primary Column in tooltips
125
+ toolTipText = handleTooltipColumns(toolTipText, row)
126
+
127
+ return toolTipText
128
+ }
129
+
130
+ return {
131
+ buildTooltip
132
+ }
133
+ }
134
+
135
+ export default useTooltip
@@ -130,13 +130,7 @@
130
130
  .remove-column {
131
131
  font-size: 13px;
132
132
  }
133
- .__react_component_tooltip {
134
- padding: 5px;
135
- max-width: 300px;
136
- }
137
- .tooltip {
138
- position: relative;
139
- }
133
+
140
134
  .helper {
141
135
  position: relative;
142
136
  opacity: 0.7;
@@ -3,6 +3,7 @@
3
3
  @import 'variables';
4
4
  @import 'editor-panel';
5
5
  @import 'filters';
6
+ @import '@cdc/core/styles/v2/components/ui/tooltip';
6
7
 
7
8
  .cdc-map-outer-container {
8
9
  position: relative;
@@ -20,7 +21,6 @@
20
21
  }
21
22
 
22
23
  .cdc-map-inner-container {
23
- @import './tooltips';
24
24
  @import './map';
25
25
  @import './sidebar';
26
26
  @import './datatable';