@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.
- package/dist/cdcmap.js +50119 -48822
- package/examples/annotation/index.json +1 -1
- package/examples/custom-map-layers.json +1 -1
- package/examples/default-geocode.json +2 -2
- package/examples/example-city-state.json +1 -1
- package/examples/private/DEV-9989.json +229 -0
- package/examples/private/ardi.json +180 -0
- package/examples/private/colors 2.json +416 -0
- package/examples/private/colors.json +416 -0
- package/examples/private/colors.json.zip +0 -0
- package/examples/private/customColors.json +45348 -0
- package/examples/private/mmr.json +246 -0
- package/examples/private/test.json +1632 -0
- package/index.html +12 -14
- package/package.json +8 -3
- package/src/CdcMap.tsx +126 -396
- package/src/_stories/CdcMap.Filters.stories.tsx +19 -0
- package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +9 -0
- package/src/_stories/CdcMap.stories.tsx +1 -1
- package/src/_stories/GoogleMap.stories.tsx +19 -0
- package/src/_stories/_mock/DEV-10148.json +859 -0
- package/src/_stories/_mock/DEV-9989.json +229 -0
- package/src/_stories/_mock/example-city-state.json +1 -1
- package/src/_stories/_mock/google-map.json +819 -0
- package/src/_stories/_mock/wastewater-map.json +210 -206
- package/src/components/Annotation/Annotation.Draggable.tsx +34 -43
- package/src/components/Annotation/AnnotationDropdown.tsx +4 -4
- package/src/components/CityList.tsx +3 -9
- package/src/components/DataTable.tsx +8 -9
- package/src/components/EditorPanel/components/EditorPanel.tsx +255 -490
- package/src/components/GoogleMap/components/GoogleMap.tsx +67 -0
- package/src/components/GoogleMap/index.tsx +3 -0
- package/src/components/Legend/components/Legend.tsx +40 -30
- package/src/components/Legend/components/LegendItem.Hex.tsx +7 -3
- package/src/components/Legend/components/index.scss +22 -16
- package/src/components/Modal.tsx +6 -5
- package/src/components/NavigationMenu.tsx +4 -3
- package/src/components/UsaMap/components/TerritoriesSection.tsx +66 -0
- package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +15 -16
- package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +3 -3
- package/src/components/UsaMap/components/UsaMap.County.tsx +1 -1
- package/src/components/UsaMap/components/UsaMap.Region.tsx +12 -8
- package/src/components/UsaMap/components/UsaMap.SingleState.tsx +2 -2
- package/src/components/UsaMap/components/UsaMap.State.tsx +23 -29
- package/src/components/WorldMap/WorldMap.tsx +3 -5
- package/src/context.ts +0 -12
- package/src/data/initial-state.js +2 -2
- package/src/data/supported-geos.js +23 -3
- package/src/helpers/applyColorToLegend.ts +3 -3
- package/src/helpers/closeModal.ts +9 -0
- package/src/helpers/handleMapAriaLabels.ts +38 -0
- package/src/helpers/indexOfIgnoreType.ts +8 -0
- package/src/helpers/navigationHandler.ts +21 -0
- package/src/helpers/toTitleCase.ts +44 -0
- package/src/helpers/validateFipsCodeLength.ts +30 -0
- package/src/hooks/useResizeObserver.ts +42 -0
- package/src/hooks/useTooltip.ts +4 -2
- package/src/index.jsx +1 -0
- package/src/scss/editor-panel.scss +2 -1
- package/src/scss/filters.scss +0 -5
- package/src/scss/main.scss +57 -61
- package/src/scss/map.scss +1 -13
- package/src/types/MapConfig.ts +20 -11
- package/src/types/MapContext.ts +4 -12
|
@@ -1,208 +1,212 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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,
|
|
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,
|
|
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 {
|
|
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, ${
|
|
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' &&
|
|
107
|
+
{annotation.connectionType === 'line' && (
|
|
108
|
+
<Connector type='line' pathProps={{ markerStart: 'url(#marker-start)' }} />
|
|
109
|
+
)}
|
|
135
110
|
|
|
136
|
-
{annotation.connectionType === 'elbow' &&
|
|
111
|
+
{annotation.connectionType === 'elbow' && (
|
|
112
|
+
<Connector type='elbow' pathProps={{ markerStart: 'url(#marker-start)' }} />
|
|
113
|
+
)}
|
|
137
114
|
|
|
138
115
|
{/* MARKERS */}
|
|
139
|
-
{annotation.marker === 'circle' &&
|
|
140
|
-
|
|
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 {
|
|
5
|
+
import { appFontSize } from '@cdc/core/helpers/cove/fontSettings'
|
|
6
6
|
import AnnotationList from './AnnotationList'
|
|
7
7
|
|
|
8
8
|
const AnnotationDropdown = () => {
|
|
9
|
-
const {
|
|
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' : `${
|
|
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 {
|
|
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 &&
|