@cdc/map 4.24.12 → 4.25.2-25

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 (64) hide show
  1. package/dist/cdcmap.js +50119 -48822
  2. package/examples/annotation/index.json +1 -1
  3. package/examples/custom-map-layers.json +1 -1
  4. package/examples/default-geocode.json +2 -2
  5. package/examples/example-city-state.json +1 -1
  6. package/examples/private/DEV-9989.json +229 -0
  7. package/examples/private/ardi.json +180 -0
  8. package/examples/private/colors 2.json +416 -0
  9. package/examples/private/colors.json +416 -0
  10. package/examples/private/colors.json.zip +0 -0
  11. package/examples/private/customColors.json +45348 -0
  12. package/examples/private/mmr.json +246 -0
  13. package/examples/private/test.json +1632 -0
  14. package/index.html +12 -14
  15. package/package.json +8 -3
  16. package/src/CdcMap.tsx +126 -396
  17. package/src/_stories/CdcMap.Filters.stories.tsx +19 -0
  18. package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +9 -0
  19. package/src/_stories/CdcMap.stories.tsx +1 -1
  20. package/src/_stories/GoogleMap.stories.tsx +19 -0
  21. package/src/_stories/_mock/DEV-10148.json +859 -0
  22. package/src/_stories/_mock/DEV-9989.json +229 -0
  23. package/src/_stories/_mock/example-city-state.json +1 -1
  24. package/src/_stories/_mock/google-map.json +819 -0
  25. package/src/_stories/_mock/wastewater-map.json +210 -206
  26. package/src/components/Annotation/Annotation.Draggable.tsx +34 -43
  27. package/src/components/Annotation/AnnotationDropdown.tsx +4 -4
  28. package/src/components/CityList.tsx +3 -9
  29. package/src/components/DataTable.tsx +8 -9
  30. package/src/components/EditorPanel/components/EditorPanel.tsx +255 -490
  31. package/src/components/GoogleMap/components/GoogleMap.tsx +67 -0
  32. package/src/components/GoogleMap/index.tsx +3 -0
  33. package/src/components/Legend/components/Legend.tsx +40 -30
  34. package/src/components/Legend/components/LegendItem.Hex.tsx +7 -3
  35. package/src/components/Legend/components/index.scss +22 -16
  36. package/src/components/Modal.tsx +6 -5
  37. package/src/components/NavigationMenu.tsx +4 -3
  38. package/src/components/UsaMap/components/TerritoriesSection.tsx +66 -0
  39. package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +15 -16
  40. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +3 -3
  41. package/src/components/UsaMap/components/UsaMap.County.tsx +1 -1
  42. package/src/components/UsaMap/components/UsaMap.Region.tsx +12 -8
  43. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +2 -2
  44. package/src/components/UsaMap/components/UsaMap.State.tsx +23 -29
  45. package/src/components/WorldMap/WorldMap.tsx +3 -5
  46. package/src/context.ts +0 -12
  47. package/src/data/initial-state.js +2 -2
  48. package/src/data/supported-geos.js +23 -3
  49. package/src/helpers/applyColorToLegend.ts +3 -3
  50. package/src/helpers/closeModal.ts +9 -0
  51. package/src/helpers/handleMapAriaLabels.ts +38 -0
  52. package/src/helpers/indexOfIgnoreType.ts +8 -0
  53. package/src/helpers/navigationHandler.ts +21 -0
  54. package/src/helpers/toTitleCase.ts +44 -0
  55. package/src/helpers/validateFipsCodeLength.ts +30 -0
  56. package/src/hooks/useResizeObserver.ts +42 -0
  57. package/src/hooks/useTooltip.ts +4 -2
  58. package/src/index.jsx +1 -0
  59. package/src/scss/editor-panel.scss +2 -1
  60. package/src/scss/filters.scss +0 -5
  61. package/src/scss/main.scss +57 -61
  62. package/src/scss/map.scss +1 -13
  63. package/src/types/MapConfig.ts +20 -11
  64. package/src/types/MapContext.ts +4 -12
@@ -1,208 +1,212 @@
1
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": { "isReversed": false },
23
- "allowMapZoom": true,
24
- "hideGeoColumnInTooltip": false,
25
- "hidePrimaryColumnInTooltip": false,
26
- "statePicked": { "fipsCode": "01", "stateName": "Alabama" },
27
- "expandDataTable": false,
28
- "annotationDropdownText": "Annotations",
29
- "noStateFoundMessage": "Map Unavailable",
30
- "subtext": "<div class=\"text-left\">Data last updated on <span data-timestamp=\"nwss_rsv_sc2_flua_combined_state_map:Data_as_of\"></span> and presented through <span data-timestamp=\"nwss_rsv_sc2_flua_combined_state_map:Data_Presented_Through\"></span>. "
31
- },
32
- "type": "map",
33
- "color": "greenbluereverse",
34
- "columns": {
35
- "geo": {
36
- "name": "State",
37
- "label": "Location",
38
- "tooltip": false,
39
- "dataTable": true
40
- },
41
- "primary": {
42
- "dataTable": true,
43
- "tooltip": true,
44
- "prefix": "",
45
- "suffix": "",
46
- "name": "activity_level_label",
47
- "label": "Viral Activity Level",
48
- "roundToPlace": 0
49
- },
50
- "navigate": { "name": "" },
51
- "latitude": { "name": "" },
52
- "longitude": { "name": "" },
53
- "additionalColumn1": {
54
- "label": "Sites Currently Reporting",
55
- "dataTable": true,
56
- "tooltips": false,
57
- "prefix": "",
58
- "suffix": "",
59
- "name": "num_sites",
60
- "tooltip": true
61
- },
62
- "additionalColumn2": {
63
- "label": "Limited Coverage",
64
- "dataTable": true,
65
- "tooltips": false,
66
- "prefix": "",
67
- "suffix": "",
68
- "tooltip": false,
69
- "name": "hatch"
70
- },
71
- "additionalColumn3": {
72
- "label": "",
73
- "dataTable": false,
74
- "tooltips": false,
75
- "prefix": "",
76
- "suffix": "",
77
- "tooltip": true,
78
- "useCommas": true,
79
- "name": "hatch"
80
- }
81
- },
82
- "legend": {
83
- "descriptions": {},
84
- "specialClasses": [],
85
- "unified": false,
86
- "singleColumn": false,
87
- "singleRow": true,
88
- "verticalSorted": false,
89
- "showSpecialClassesLast": true,
90
- "dynamicDescription": false,
91
- "type": "category",
92
- "numberOfItems": 8,
93
- "position": "bottom",
94
- "title": "Wastewater Viral Activity Level",
95
- "categoryValuesOrder": [
96
- "Very High",
97
- "High",
98
- "Moderate",
99
- "Low",
100
- "Minimal",
101
- "No Data"
102
- ],
103
- "additionalCategories": [
104
- "No Data",
105
- "Minimal",
106
- "Low",
107
- "Moderate",
108
- "High",
109
- "Very High"
110
- ],
111
- "description": "",
112
- "style": "gradient",
113
- "subStyle": "linear blocks",
114
- "tickRotation": "",
115
- "singleColumnLegend": false,
116
- "hideBorder": false
117
- },
118
- "filters": [
119
- {
120
- "order": "asc",
121
- "label": "Select a virus from the dropdown:",
122
- "columnName": "pathogen",
123
- "values": ["COVID-19", "Influenza A", "RSV"],
124
- "active": "COVID-19",
125
- "filterStyle": "dropdown"
126
- }
127
- ],
128
- "table": {
129
- "label": "Data Table",
130
- "expanded": false,
131
- "limitHeight": true,
132
- "height": "500",
133
- "caption": "",
134
- "showDownloadUrl": true,
135
- "showDataTableLink": true,
136
- "showFullGeoNameInCSV": false,
137
- "forceDisplay": true,
138
- "download": true,
139
- "indexLabel": "State/Territory",
140
- "wrapColumns": false
141
- },
142
- "tooltips": {
143
- "appearanceType": "hover",
144
- "linkLabel": "Learn More",
145
- "capitalizeLabels": true,
146
- "opacity": 90
147
- },
148
- "visual": {
149
- "minBubbleSize": 1,
150
- "maxBubbleSize": 20,
151
- "extraBubbleBorder": false,
152
- "cityStyle": "circle",
153
- "geoCodeCircleSize": 2,
154
- "showBubbleZeros": false,
155
- "cityStyleLabel": "",
156
- "additionalCityStyles": []
157
- },
158
- "mapPosition": { "coordinates": [0, 30], "zoom": 1 },
159
- "map": {
160
- "layers": [],
161
- "patterns": [
162
- {
163
- "dataKey": "hatch",
164
- "pattern": "lines",
165
- "dataValue": "Limited Coverage",
166
- "label": "Limited Coverage*",
167
- "size": "medium"
168
- }
169
- ]
170
- },
171
- "hexMap": {
172
- "type": "",
173
- "shapeGroups": [
174
- {
175
- "legendTitle": "",
176
- "legendDescription": "",
177
- "items": [
178
- {
179
- "key": "",
180
- "shape": "Arrow Up",
181
- "column": "",
182
- "operator": "=",
183
- "value": ""
184
- }
185
- ]
186
- }
187
- ]
188
- },
189
- "filterBehavior": "Filter Change",
190
- "customColors": [
191
- "#34547B",
192
- "#4B7F9B",
193
- "#4B7F9B",
194
- "#6BB0BD",
195
- "#9FDAD0",
196
- "#C8EFDA",
197
- "#B4B4B4",
198
- "#B4B4B4",
199
- "#B4B4B4",
200
- "#B4B4B4"
201
- ],
202
- "datasets": {},
203
- "dataFileName": "https://www.cdc.gov/wcms/vizdata/ncezid_didri/NWSSStateMapCombined.json",
204
- "dataFileSourceType": "url",
205
- "dataDescription": { "horizontal": false, "series": false },
206
- "version": "4.24.9",
207
- "dataUrl": "https://www.cdc.gov/wcms/vizdata/ncezid_didri/NWSSStateMapCombined.json"
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
+ "expandDataTable": false,
33
+ "annotationDropdownText": "Annotations",
34
+ "noStateFoundMessage": "Map Unavailable",
35
+ "subtext": "<div class=\"text-left\">Data last updated on <span data-timestamp=\"nwss_rsv_sc2_flua_combined_state_map:Data_as_of\"></span> and presented through <span data-timestamp=\"nwss_rsv_sc2_flua_combined_state_map:Data_Presented_Through\"></span>. "
36
+ },
37
+ "type": "map",
38
+ "color": "greenbluereverse",
39
+ "columns": {
40
+ "geo": {
41
+ "name": "State",
42
+ "label": "Location",
43
+ "tooltip": false,
44
+ "dataTable": true
45
+ },
46
+ "primary": {
47
+ "dataTable": true,
48
+ "tooltip": true,
49
+ "prefix": "",
50
+ "suffix": "",
51
+ "name": "activity_level_label",
52
+ "label": "Viral Activity Level",
53
+ "roundToPlace": 0
54
+ },
55
+ "navigate": {
56
+ "name": ""
57
+ },
58
+ "latitude": {
59
+ "name": ""
60
+ },
61
+ "longitude": {
62
+ "name": ""
63
+ },
64
+ "additionalColumn1": {
65
+ "label": "Sites Currently Reporting",
66
+ "dataTable": true,
67
+ "tooltips": false,
68
+ "prefix": "",
69
+ "suffix": "",
70
+ "name": "num_sites",
71
+ "tooltip": true
72
+ },
73
+ "additionalColumn2": {
74
+ "label": "Limited Coverage",
75
+ "dataTable": true,
76
+ "tooltips": false,
77
+ "prefix": "",
78
+ "suffix": "",
79
+ "tooltip": false,
80
+ "name": "hatch"
81
+ },
82
+ "additionalColumn3": {
83
+ "label": "",
84
+ "dataTable": false,
85
+ "tooltips": false,
86
+ "prefix": "",
87
+ "suffix": "",
88
+ "tooltip": true,
89
+ "useCommas": true,
90
+ "name": "hatch"
91
+ }
92
+ },
93
+ "legend": {
94
+ "descriptions": {},
95
+ "specialClasses": [],
96
+ "unified": false,
97
+ "singleColumn": false,
98
+ "singleRow": true,
99
+ "verticalSorted": false,
100
+ "showSpecialClassesLast": true,
101
+ "dynamicDescription": false,
102
+ "type": "category",
103
+ "numberOfItems": 8,
104
+ "position": "top",
105
+ "title": "Wastewater Viral Activity Level",
106
+ "categoryValuesOrder": ["Minimal", "Low", "Moderate", "High", "Very High", "No Data"],
107
+ "additionalCategories": ["No Data", "Minimal", "Low", "Moderate", "High", "Very High"],
108
+ "description": "",
109
+ "style": "gradient",
110
+ "subStyle": "linear blocks",
111
+ "tickRotation": "",
112
+ "singleColumnLegend": false,
113
+ "hideBorder": true
114
+ },
115
+ "filters": [
116
+ {
117
+ "order": "asc",
118
+ "label": "Select a virus from the tabs:",
119
+ "columnName": "pathogen",
120
+ "values": ["COVID-19", "Influenza A", "RSV"],
121
+ "active": "COVID-19",
122
+ "filterStyle": "tab-simple"
123
+ }
124
+ ],
125
+ "table": {
126
+ "label": "Data Table",
127
+ "expanded": false,
128
+ "limitHeight": true,
129
+ "height": "500",
130
+ "caption": "",
131
+ "showDownloadUrl": true,
132
+ "showDataTableLink": true,
133
+ "showFullGeoNameInCSV": false,
134
+ "forceDisplay": true,
135
+ "download": true,
136
+ "indexLabel": "State/Territory",
137
+ "wrapColumns": false,
138
+ "showDownloadLinkBelow": true
139
+ },
140
+ "tooltips": {
141
+ "appearanceType": "hover",
142
+ "linkLabel": "Learn More",
143
+ "capitalizeLabels": true,
144
+ "opacity": 90
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": [0, 30],
158
+ "zoom": 1
159
+ },
160
+ "map": {
161
+ "layers": [],
162
+ "patterns": [
163
+ {
164
+ "dataKey": "hatch",
165
+ "pattern": "lines",
166
+ "dataValue": "Limited Coverage",
167
+ "label": "Limited Coverage*",
168
+ "size": "medium"
169
+ }
170
+ ]
171
+ },
172
+ "hexMap": {
173
+ "type": "",
174
+ "shapeGroups": [
175
+ {
176
+ "legendTitle": "",
177
+ "legendDescription": "",
178
+ "items": [
179
+ {
180
+ "key": "",
181
+ "shape": "Arrow Up",
182
+ "column": "",
183
+ "operator": "=",
184
+ "value": ""
185
+ }
186
+ ]
187
+ }
188
+ ]
189
+ },
190
+ "filterBehavior": "Filter Change",
191
+ "customColors": [
192
+ "#C8EFDA",
193
+ "#9FDAD0",
194
+ "#9FDAD0",
195
+ "#6BB0BD",
196
+ "#4B7F9B",
197
+ "#34547B",
198
+ "#B4B4B4",
199
+ "#B4B4B4",
200
+ "#B4B4B4",
201
+ "#B4B4B4"
202
+ ],
203
+ "datasets": {},
204
+ "dataFileName": "https://www.cdc.gov/wcms/vizdata/ncezid_didri/NWSSStateMapCombined.json",
205
+ "dataFileSourceType": "url",
206
+ "dataDescription": {
207
+ "horizontal": false,
208
+ "series": false
209
+ },
210
+ "version": "4.24.10",
211
+ "dataUrl": "https://www.cdc.gov/wcms/vizdata/ncezid_didri/NWSSStateMapCombined.json"
208
212
  }
@@ -1,15 +1,9 @@
1
- import { useContext, useState, useEffect, useRef } from 'react'
2
-
3
- // helpers
4
- import { applyBandScaleOffset, handleConnectionHorizontalType, handleConnectionVerticalType, createPoints } from '@cdc/chart/src/components/Annotations/components/helpers'
1
+ import { useContext, useState, useRef } from 'react'
5
2
 
6
3
  // visx
7
- import { HtmlLabel, CircleSubject, LineSubject, EditableAnnotation, Connector, Annotation as VisxAnnotation } from '@visx/annotation'
4
+ import { HtmlLabel, CircleSubject, EditableAnnotation, Connector, Annotation as VisxAnnotation } from '@visx/annotation'
8
5
  import { Drag, raise } from '@visx/drag'
9
6
  import { MarkerArrow } from '@visx/marker'
10
- import { LinePath } from '@visx/shape'
11
- import * as allCurves from '@visx/curve'
12
- import { Annotation } from '@cdc/core/types/Annotation'
13
7
 
14
8
  // styles
15
9
  import './Annotation.Draggable.styles.css'
@@ -18,41 +12,18 @@ import { MapContext } from '../../types/MapContext'
18
12
 
19
13
  const Annotations = ({ xScale, yScale, xMax, svgRef, onDragStateChange }) => {
20
14
  const [draggingItems, setDraggingItems] = useState([])
21
- const { state: config, dimensions, setState: updateConfig, isEditor, isDraggingAnnotation } = useContext<MapContext>(ConfigContext)
15
+ const {
16
+ state: config,
17
+ setState: updateConfig,
18
+ isDraggingAnnotation,
19
+ isEditor,
20
+ dimensions
21
+ } = useContext<MapContext>(ConfigContext)
22
22
  const [width, height] = dimensions
23
23
  const { annotations } = config
24
- // const { colorScale } = useColorScale()
25
24
  const prevDimensions = useRef(dimensions)
26
25
  const AnnotationComponent = isEditor ? EditableAnnotation : VisxAnnotation
27
26
 
28
- const handleMobileXPosition = annotation => {
29
- if (annotation.snapToNearestPoint) {
30
- return Number(annotation.dx) + xScale(annotation.xKey) + (config.xAxis.type !== 'date-time' ? xScale.bandwidth() / 2 : 0) + Number(config.yAxis.size)
31
- }
32
- return Number(annotation.x) + Number(annotation.dx)
33
- }
34
-
35
- const handleMobileYPosition = annotation => {
36
- if (annotation.snapToNearestPoint) {
37
- return yScale(annotation.yKey) + Number(annotation.dy)
38
- }
39
- return Number(annotation.dy) + Number(annotation.y)
40
- }
41
-
42
- const handleTextX = annotation => {
43
- if (annotation.snapToNearestPoint) {
44
- return Number(annotation.dx) + Number(xScale(annotation.xKey)) + (config.xAxis.type !== 'date-time' ? xScale.bandwidth() / 2 : 0) + Number(config.yAxis.size) - 16 / 3
45
- }
46
- return Number(annotation.dx) + Number(annotation.x) - 16 / 3
47
- }
48
-
49
- const handleTextY = annotation => {
50
- if (annotation.snapToNearestPoint) {
51
- return yScale(annotation.yKey) + Number(annotation.dy) + 5
52
- }
53
- return Number(annotation.y) + Number(annotation.dy) + 16 / 3
54
- }
55
-
56
27
  return (
57
28
  annotations &&
58
29
  annotations.map((annotation, index) => {
@@ -118,7 +89,9 @@ const Annotations = ({ xScale, yScale, xMax, svgRef, onDragStateChange }) => {
118
89
  style={{
119
90
  padding: '10px',
120
91
  borderRadius: 5, // Optional: set border radius
121
- backgroundColor: `rgba(255, 255, 255, ${annotation?.opacity ? Number(annotation?.opacity) / 100 : 1})`
92
+ backgroundColor: `rgba(255, 255, 255, ${
93
+ annotation?.opacity ? Number(annotation?.opacity) / 100 : 1
94
+ })`
122
95
  }}
123
96
  role='presentation'
124
97
  // ! IMPORTANT: Workaround for 508
@@ -131,13 +104,31 @@ const Annotations = ({ xScale, yScale, xMax, svgRef, onDragStateChange }) => {
131
104
  />
132
105
  </HtmlLabel>
133
106
 
134
- {annotation.connectionType === 'line' && <Connector type='line' pathProps={{ markerStart: 'url(#marker-start)' }} />}
107
+ {annotation.connectionType === 'line' && (
108
+ <Connector type='line' pathProps={{ markerStart: 'url(#marker-start)' }} />
109
+ )}
135
110
 
136
- {annotation.connectionType === 'elbow' && <Connector type='elbow' pathProps={{ markerStart: 'url(#marker-start)' }} />}
111
+ {annotation.connectionType === 'elbow' && (
112
+ <Connector type='elbow' pathProps={{ markerStart: 'url(#marker-start)' }} />
113
+ )}
137
114
 
138
115
  {/* MARKERS */}
139
- {annotation.marker === 'circle' && <CircleSubject className='circle-subject' stroke={'black'} radius={8} />}
140
- {annotation.marker === 'arrow' && <MarkerArrow fill='black' id='marker-start' x={annotation.x} y={annotation.dy} stroke='#333' markerWidth={10} size={10} strokeWidth={1} orient='auto-start-reverse' />}
116
+ {annotation.marker === 'circle' && (
117
+ <CircleSubject className='circle-subject' stroke={'black'} radius={8} />
118
+ )}
119
+ {annotation.marker === 'arrow' && (
120
+ <MarkerArrow
121
+ fill='black'
122
+ id='marker-start'
123
+ x={annotation.x}
124
+ y={annotation.dy}
125
+ stroke='#333'
126
+ markerWidth={10}
127
+ size={10}
128
+ strokeWidth={1}
129
+ orient='auto-start-reverse'
130
+ />
131
+ )}
141
132
  </AnnotationComponent>
142
133
  </>
143
134
  )
@@ -2,14 +2,14 @@ import React, { useContext, useState } from 'react'
2
2
  import ConfigContext from '../../context'
3
3
  import './AnnotationDropdown.styles.css'
4
4
  import Icon from '@cdc/core/components/ui/Icon'
5
- import { fontSizes } from '@cdc/core/helpers/cove/fontSettings'
5
+ import { appFontSize } from '@cdc/core/helpers/cove/fontSettings'
6
6
  import AnnotationList from './AnnotationList'
7
7
 
8
8
  const AnnotationDropdown = () => {
9
- const { currentViewport: viewport, state: config } = useContext(ConfigContext)
9
+ const { state: config, isEditor, currentViewport: viewport } = useContext(ConfigContext)
10
10
  const [expanded, setExpanded] = useState(false)
11
11
 
12
- const titleFontSize = ['sm', 'xs', 'xxs'].includes(viewport) ? '13px' : `${fontSizes[config?.fontSize]}px`
12
+ const titleFontSize = ['sm', 'xs', 'xxs'].includes(viewport) ? '13px' : `${appFontSize}px`
13
13
 
14
14
  const annotations = config?.annotations || []
15
15
 
@@ -19,7 +19,7 @@ const AnnotationDropdown = () => {
19
19
  }
20
20
 
21
21
  const handleAccordionClassName = () => {
22
- const classNames = ['data-table-heading', 'annotation__dropdown-list']
22
+ const classNames = ['data-table-heading', 'annotation__dropdown-list', 'p-3']
23
23
  if (!expanded) {
24
24
  classNames.push('collapsed')
25
25
  }
@@ -5,6 +5,7 @@ import { supportedCities } from '../data/supported-geos'
5
5
  import { scaleLinear } from 'd3-scale'
6
6
  import { GlyphStar, GlyphTriangle, GlyphDiamond, GlyphSquare, GlyphCircle } from '@visx/glyph'
7
7
  import { getFilterControllingStatePicked } from './UsaMap/helpers/map'
8
+ import { titleCase } from '../helpers/titleCase'
8
9
 
9
10
  import ConfigContext from '../context'
10
11
  import { getGeoStrokeColor } from '../helpers/colors'
@@ -15,14 +16,13 @@ const CityList = ({
15
16
  applyTooltipsToGeo,
16
17
  displayGeoName,
17
18
  applyLegendToRow,
18
- titleCase,
19
19
  setSharedFilterValue,
20
20
  isFilterValueSupported,
21
21
  tooltipId,
22
22
  projection
23
23
  }) => {
24
24
  const [citiesData, setCitiesData] = useState({})
25
- const { scale, state, topoData, runtimeData, position } = useContext(ConfigContext)
25
+ const { state, topoData, runtimeData, position } = useContext(ConfigContext)
26
26
  if (!projection) return
27
27
 
28
28
  useEffect(() => {
@@ -149,13 +149,7 @@ const CityList = ({
149
149
 
150
150
  const styles = {
151
151
  fill: legendColors[0],
152
- opacity:
153
- setSharedFilterValue &&
154
- isFilterValueSupported &&
155
- data[city] &&
156
- data[city][state.columns.geo.name] !== setSharedFilterValue
157
- ? 0.5
158
- : 1,
152
+ opacity: !isFilterValueSupported || (isFilterValueSupported && city === setSharedFilterValue) ? 1 : 0.5,
159
153
  stroke:
160
154
  setSharedFilterValue &&
161
155
  isFilterValueSupported &&