@cdc/map 4.25.10 → 4.26.1
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/.claude/agents/typescript-organizer.md +118 -0
- package/dist/{cdcmap-fce76882.es.js → cdcmap-BnB1QM5d.es.js} +6 -13
- package/dist/{cdcmap-c55ac1ea.es.js → cdcmap-D6CG2-Hb.es.js} +5 -12
- package/dist/{cdcmap-31a33da1.es.js → cdcmap-MXgURbdZ.es.js} +6 -13
- package/dist/{cdcmap-1a1724a1.es.js → cdcmap-dgT_1dIT.es.js} +136 -151
- package/dist/cdcmap.js +58397 -55987
- package/examples/example-city-state.json +9 -1
- package/examples/multi-country-centering.json +45 -0
- package/examples/private/city_styles_variable.json +877 -0
- package/examples/private/colors-2.json +221 -0
- package/examples/private/colors.json +221 -0
- package/examples/private/map-filter-issue.json +2260 -0
- package/examples/private/map-legend.json +5303 -0
- package/index.html +27 -36
- package/package.json +6 -5
- package/src/CdcMapComponent.tsx +86 -26
- package/src/_stories/CdcMap.ColumnWrap.stories.tsx +31 -0
- package/src/_stories/CdcMap.DistrictOfColumbia.stories.tsx +320 -0
- package/src/_stories/CdcMap.Editor.stories.tsx +3426 -0
- package/src/_stories/CdcMap.SmallMultiples.stories.tsx +35 -0
- package/src/_stories/CdcMap.stories.tsx +116 -4
- package/src/_stories/_mock/column-wrap-test.json +265 -0
- package/src/_stories/_mock/multi-country-hide.json +78 -0
- package/src/_stories/_mock/multi-country.json +95 -0
- package/src/_stories/_mock/multi-state.json +887 -20403
- package/src/_stories/_mock/small_multiples/multi-state-small-multiples.json +8399 -0
- package/src/_stories/_mock/small_multiples/region-small-multiples.json +657 -0
- package/src/_stories/_mock/small_multiples/wastewater-map-small-multiples.json +221 -0
- package/src/_stories/_mock/usa-state-gradient.json +3 -4
- package/src/components/BubbleList.tsx +1 -1
- package/src/components/CityList.tsx +24 -18
- package/src/components/EditorPanel/components/EditorPanel.tsx +2380 -2206
- package/src/components/EditorPanel/components/HexShapeSettings.tsx +55 -93
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +0 -19
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +27 -37
- package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.tsx +351 -0
- package/src/components/EditorPanel/components/Panels/index.tsx +3 -1
- package/src/components/Geo.tsx +20 -3
- package/src/components/Legend/components/Legend.tsx +58 -75
- package/src/components/Legend/components/LegendGroup/Legend.Group.tsx +1 -1
- package/src/components/Legend/components/index.scss +23 -6
- package/src/components/NavigationMenu.tsx +16 -13
- package/src/components/SmallMultiples/SmallMultipleTile.tsx +163 -0
- package/src/components/SmallMultiples/SmallMultiples.css +32 -0
- package/src/components/SmallMultiples/SmallMultiples.tsx +150 -0
- package/src/components/SmallMultiples/SynchronizedTooltip.tsx +105 -0
- package/src/components/SmallMultiples/index.tsx +3 -0
- package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +18 -3
- package/src/components/UsaMap/components/TerritoriesSection.tsx +26 -12
- package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +30 -4
- package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +29 -9
- package/src/components/UsaMap/components/Territory/TerritoryShape.ts +7 -0
- package/src/components/UsaMap/components/UsaMap.County.tsx +16 -4
- package/src/components/UsaMap/components/UsaMap.Region.tsx +14 -1
- package/src/components/UsaMap/components/UsaMap.SingleState.tsx +29 -12
- package/src/components/UsaMap/components/UsaMap.State.tsx +30 -5
- package/src/components/UsaMap/helpers/map.ts +2 -2
- package/src/components/UsaMap/helpers/shapes.ts +9 -6
- package/src/components/WorldMap/WorldMap.tsx +81 -11
- package/src/data/initial-state.js +11 -0
- package/src/data/supported-geos.js +8 -76
- package/src/helpers/addUIDs.ts +13 -2
- package/src/helpers/applyColorToLegend.ts +25 -1
- package/src/helpers/applyLegendToRow.ts +5 -3
- package/src/helpers/constants.ts +3 -15
- package/src/helpers/displayGeoName.ts +22 -4
- package/src/helpers/generateRuntimeFilters.ts +1 -1
- package/src/helpers/generateRuntimeLegend.ts +1 -3
- package/src/helpers/generateRuntimeLegendHash.ts +1 -1
- package/src/helpers/getCountriesPicked.ts +103 -0
- package/src/helpers/getMapContainerClasses.ts +7 -0
- package/src/helpers/getPatternForRow.ts +2 -5
- package/src/helpers/index.ts +2 -4
- package/src/helpers/isLegendItemDisabled.ts +2 -2
- package/src/helpers/resetLegendToggles.ts +1 -0
- package/src/helpers/smallMultiplesHelpers.ts +359 -0
- package/src/helpers/tests/hashObj.test.ts +1 -1
- package/src/helpers/tests/titleCase.test.ts +76 -0
- package/src/helpers/titleCase.ts +13 -13
- package/src/helpers/toggleLegendActive.ts +76 -8
- package/src/helpers/urlDataHelpers.ts +1 -1
- package/src/hooks/useCountryZoom.tsx +241 -0
- package/src/hooks/useGeoClickHandler.ts +1 -1
- package/src/hooks/useProgrammaticMapTooltip.ts +110 -0
- package/src/hooks/useResizeObserver.ts +8 -2
- package/src/hooks/useStateZoom.tsx +7 -4
- package/src/hooks/useSynchronizedGeographies.ts +56 -0
- package/src/index.jsx +1 -0
- package/src/scss/editor-panel.scss +4 -440
- package/src/scss/main.scss +1 -1
- package/src/scss/map.scss +12 -15
- package/src/store/map.actions.ts +7 -7
- package/src/test/CdcMap.test.jsx +1 -1
- package/src/types/MapConfig.ts +32 -11
- package/src/types/MapContext.ts +6 -0
- package/src/types/runtimeLegend.ts +2 -1
- package/LICENSE +0 -201
- package/src/components/DataTable.tsx +0 -413
- package/src/components/EditorPanel/components/Inputs.tsx +0 -59
- package/src/components/MapControls.tsx +0 -44
- package/src/helpers/getUniqueValues.ts +0 -19
- package/src/helpers/hashObj.ts +0 -25
- package/src/hooks/useActiveElement.ts +0 -19
- package/src/hooks/useLegendSeparators.ts +0 -26
- package/src/scss/mixins.scss +0 -47
- package/src/types/Annotations.ts +0 -24
- /package/dist/{cdcmap-548642e6.es.js → cdcmap-Ct2SB0vL.es.js} +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
{
|
|
2
|
+
"annotations": [],
|
|
3
|
+
"general": {
|
|
4
|
+
"geoBorderColor": "darkGray",
|
|
5
|
+
"headerColor": "theme-blue",
|
|
6
|
+
"title": "",
|
|
7
|
+
"showTitle": true,
|
|
8
|
+
"showSidebar": true,
|
|
9
|
+
"showDownloadButton": false,
|
|
10
|
+
"showDownloadMediaButton": false,
|
|
11
|
+
"displayAsHex": false,
|
|
12
|
+
"displayStateLabels": false,
|
|
13
|
+
"territoriesAlwaysShow": false,
|
|
14
|
+
"language": "en",
|
|
15
|
+
"geoType": "us",
|
|
16
|
+
"geoLabelOverride": "State/Territory",
|
|
17
|
+
"hasRegions": false,
|
|
18
|
+
"fullBorder": false,
|
|
19
|
+
"type": "map",
|
|
20
|
+
"convertFipsCodes": true,
|
|
21
|
+
"palette": {
|
|
22
|
+
"isReversed": true
|
|
23
|
+
},
|
|
24
|
+
"allowMapZoom": true,
|
|
25
|
+
"hideGeoColumnInTooltip": false,
|
|
26
|
+
"hidePrimaryColumnInTooltip": false,
|
|
27
|
+
"statePicked": {
|
|
28
|
+
"fipsCode": "01",
|
|
29
|
+
"stateName": "Alabama"
|
|
30
|
+
},
|
|
31
|
+
"expandDataTable": false,
|
|
32
|
+
"annotationDropdownText": "Annotations",
|
|
33
|
+
"noStateFoundMessage": "Map Unavailable",
|
|
34
|
+
"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>. ",
|
|
35
|
+
"navigationTarget": "_self"
|
|
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": ["Very Low", "Low", "Moderate", "High", "Very High", "No Data", "Minimal"],
|
|
107
|
+
"additionalCategories": ["No Data", "Very Low", "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
|
+
"table": {
|
|
117
|
+
"label": "Data Table",
|
|
118
|
+
"expanded": false,
|
|
119
|
+
"limitHeight": true,
|
|
120
|
+
"height": "500",
|
|
121
|
+
"caption": "",
|
|
122
|
+
"showDownloadUrl": false,
|
|
123
|
+
"showDataTableLink": true,
|
|
124
|
+
"showFullGeoNameInCSV": false,
|
|
125
|
+
"forceDisplay": true,
|
|
126
|
+
"download": true,
|
|
127
|
+
"indexLabel": "State/Territory",
|
|
128
|
+
"wrapColumns": false,
|
|
129
|
+
"showDownloadLinkBelow": true
|
|
130
|
+
},
|
|
131
|
+
"tooltips": {
|
|
132
|
+
"appearanceType": "hover",
|
|
133
|
+
"linkLabel": "Learn More",
|
|
134
|
+
"capitalizeLabels": true,
|
|
135
|
+
"opacity": 90
|
|
136
|
+
},
|
|
137
|
+
"visual": {
|
|
138
|
+
"minBubbleSize": 1,
|
|
139
|
+
"maxBubbleSize": 20,
|
|
140
|
+
"extraBubbleBorder": false,
|
|
141
|
+
"cityStyle": "circle",
|
|
142
|
+
"geoCodeCircleSize": 2,
|
|
143
|
+
"showBubbleZeros": false,
|
|
144
|
+
"cityStyleLabel": "",
|
|
145
|
+
"additionalCityStyles": []
|
|
146
|
+
},
|
|
147
|
+
"mapPosition": {
|
|
148
|
+
"coordinates": [0, 30],
|
|
149
|
+
"zoom": 1
|
|
150
|
+
},
|
|
151
|
+
"map": {
|
|
152
|
+
"layers": [],
|
|
153
|
+
"patterns": [
|
|
154
|
+
{
|
|
155
|
+
"dataKey": "hatch",
|
|
156
|
+
"pattern": "lines",
|
|
157
|
+
"dataValue": "Limited Coverage",
|
|
158
|
+
"label": "Limited Coverage*",
|
|
159
|
+
"size": "medium"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"hexMap": {
|
|
164
|
+
"type": "",
|
|
165
|
+
"shapeGroups": [
|
|
166
|
+
{
|
|
167
|
+
"legendTitle": "",
|
|
168
|
+
"legendDescription": "",
|
|
169
|
+
"items": [
|
|
170
|
+
{
|
|
171
|
+
"key": "",
|
|
172
|
+
"shape": "Arrow Up",
|
|
173
|
+
"column": "",
|
|
174
|
+
"operator": "=",
|
|
175
|
+
"value": ""
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
"smallMultiples": {
|
|
182
|
+
"mode": "by-column",
|
|
183
|
+
"tileColumn": "pathogen",
|
|
184
|
+
"tilesPerRowDesktop": 3,
|
|
185
|
+
"tilesPerRowMobile": "",
|
|
186
|
+
"tileOrderType": "custom",
|
|
187
|
+
"tileOrder": ["Influenza A", "RSV", "COVID-19"],
|
|
188
|
+
"tileTitles": {
|
|
189
|
+
"COVID-19": "COVID-19",
|
|
190
|
+
"Influenza A": "Influenza AAA",
|
|
191
|
+
"RSV": "RSV"
|
|
192
|
+
},
|
|
193
|
+
"synchronizedTooltips": true
|
|
194
|
+
},
|
|
195
|
+
"filterBehavior": "Filter Change",
|
|
196
|
+
"filterIntro": "",
|
|
197
|
+
"customColors": [
|
|
198
|
+
"#C8EFDA",
|
|
199
|
+
"#9FDAD0",
|
|
200
|
+
"#9FDAD0",
|
|
201
|
+
"#6BB0BD",
|
|
202
|
+
"#4B7F9B",
|
|
203
|
+
"#34547B",
|
|
204
|
+
"#B4B4B4",
|
|
205
|
+
"#B4B4B4",
|
|
206
|
+
"#B4B4B4",
|
|
207
|
+
"#B4B4B4"
|
|
208
|
+
],
|
|
209
|
+
"datasets": {},
|
|
210
|
+
"dataFileName": "https://www.cdc.gov/wcms/vizdata/ncezid_didri/NWSSStateMapCombined.json",
|
|
211
|
+
"dataFileSourceType": "url",
|
|
212
|
+
"dataDescription": {
|
|
213
|
+
"horizontal": false,
|
|
214
|
+
"series": false
|
|
215
|
+
},
|
|
216
|
+
"version": "4.25.1",
|
|
217
|
+
"dataUrl": "https://www.cdc.gov/wcms/vizdata/ncezid_didri/NWSSStateMapCombined.json",
|
|
218
|
+
"migrations": {
|
|
219
|
+
"addColorMigration": true
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"geoBorderColor": "darkGray",
|
|
9
9
|
"headerColor": "theme-blue",
|
|
10
10
|
"title": "",
|
|
11
|
+
"titleStyle": "small",
|
|
11
12
|
"showTitle": true,
|
|
12
13
|
"showSidebar": true,
|
|
13
14
|
"showDownloadButton": true,
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
{ "STATE": "Alabama", "Rate": 130, "Location": "Vehicle", "URL": "https://www.cdc.gov/" },
|
|
115
116
|
{ "STATE": "Alaska", "Rate": 40, "Location": "Work", "URL": "https://www.cdc.gov/" },
|
|
116
117
|
{ "STATE": "American Samoa", "Rate": 55, "Location": "Home", "URL": "https://www.cdc.gov/" },
|
|
117
|
-
{ "STATE": "Arizona", "Rate":
|
|
118
|
+
{ "STATE": "Arizona", "Rate": 0, "Location": "School", "URL": "https://www.cdc.gov/" },
|
|
118
119
|
{ "STATE": "Arkansas", "Rate": 60, "Location": "School", "URL": "https://www.cdc.gov/" },
|
|
119
120
|
{ "STATE": "California", "Rate": 30, "Location": "Home", "URL": "https://www.cdc.gov/" },
|
|
120
121
|
{ "STATE": "Colorado", "Rate": 40, "Location": "Vehicle", "URL": "https://www.cdc.gov/" },
|
|
@@ -123,7 +124,6 @@
|
|
|
123
124
|
{ "STATE": "DC", "Rate": 60, "Location": "Home", "URL": "https://www.cdc.gov/" },
|
|
124
125
|
{ "STATE": "Florida", "Rate": 30, "Location": "Work", "URL": "https://www.cdc.gov/" },
|
|
125
126
|
{ "STATE": "Georgia", "Rate": 40, "Location": "Work", "URL": "https://www.cdc.gov/" },
|
|
126
|
-
{ "STATE": "Guam", "Rate": 55, "Location": "Home", "URL": "https://www.cdc.gov/" },
|
|
127
127
|
{ "STATE": "Hawaii", "Rate": 57, "Location": "School", "URL": "https://www.cdc.gov/" },
|
|
128
128
|
{ "STATE": "Idaho", "Rate": 60, "Location": "School", "URL": "https://www.cdc.gov/" },
|
|
129
129
|
{ "STATE": "Illinois", "Rate": 30, "Location": "Work", "URL": "https://www.cdc.gov/" },
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
{ "STATE": "Alabama", "Rate": 130, "Location": "Vehicle", "URL": "https://www.cdc.gov/" },
|
|
178
178
|
{ "STATE": "Alaska", "Rate": 40, "Location": "Work", "URL": "https://www.cdc.gov/" },
|
|
179
179
|
{ "STATE": "American Samoa", "Rate": 55, "Location": "Home", "URL": "https://www.cdc.gov/" },
|
|
180
|
-
{ "STATE": "Arizona", "Rate":
|
|
180
|
+
{ "STATE": "Arizona", "Rate": 0, "Location": "School", "URL": "https://www.cdc.gov/" },
|
|
181
181
|
{ "STATE": "Arkansas", "Rate": 60, "Location": "School", "URL": "https://www.cdc.gov/" },
|
|
182
182
|
{ "STATE": "California", "Rate": 30, "Location": "Home", "URL": "https://www.cdc.gov/" },
|
|
183
183
|
{ "STATE": "Colorado", "Rate": 40, "Location": "Vehicle", "URL": "https://www.cdc.gov/" },
|
|
@@ -186,7 +186,6 @@
|
|
|
186
186
|
{ "STATE": "DC", "Rate": 60, "Location": "Home", "URL": "https://www.cdc.gov/" },
|
|
187
187
|
{ "STATE": "Florida", "Rate": 30, "Location": "Work", "URL": "https://www.cdc.gov/" },
|
|
188
188
|
{ "STATE": "Georgia", "Rate": 40, "Location": "Work", "URL": "https://www.cdc.gov/" },
|
|
189
|
-
{ "STATE": "Guam", "Rate": 55, "Location": "Home", "URL": "https://www.cdc.gov/" },
|
|
190
189
|
{ "STATE": "Hawaii", "Rate": 57, "Location": "School", "URL": "https://www.cdc.gov/" },
|
|
191
190
|
{ "STATE": "Idaho", "Rate": 60, "Location": "School", "URL": "https://www.cdc.gov/" },
|
|
192
191
|
{ "STATE": "Illinois", "Rate": 30, "Location": "Work", "URL": "https://www.cdc.gov/" },
|
|
@@ -17,7 +17,7 @@ type BubbleListProps = {
|
|
|
17
17
|
customProjection?: GeoProjection
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
const BubbleList: React.FC<BubbleListProps> = ({ customProjection }) => {
|
|
21
21
|
const { config, tooltipId, runtimeData, runtimeLegend } = useContext<MapContext>(ConfigContext)
|
|
22
22
|
const { legendMemo, legendSpecialClassLastMemo } = useLegendMemoContext()
|
|
23
23
|
const { columns, data, general, visual } = config
|
|
@@ -4,8 +4,7 @@ import { GlyphCircle, GlyphDiamond, GlyphSquare, GlyphStar, GlyphTriangle } from
|
|
|
4
4
|
import ConfigContext from '../context'
|
|
5
5
|
import { useLegendMemoContext } from '../context/LegendMemoContext'
|
|
6
6
|
import { supportedCities } from '../data/supported-geos'
|
|
7
|
-
import {
|
|
8
|
-
import { displayGeoName, getGeoStrokeColor, SVG_HEIGHT, SVG_PADDING, SVG_WIDTH, isLegendItemDisabled } from '../helpers'
|
|
7
|
+
import { displayGeoName, getGeoStrokeColor, isLegendItemDisabled } from '../helpers'
|
|
9
8
|
import useGeoClickHandler from '../hooks/useGeoClickHandler'
|
|
10
9
|
import useApplyTooltipsToGeo from '../hooks/useApplyTooltipsToGeo'
|
|
11
10
|
import { applyLegendToRow } from '../helpers/applyLegendToRow'
|
|
@@ -19,7 +18,7 @@ type CityListProps = {
|
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
const CityList: React.FC<CityListProps> = ({ setSharedFilterValue, isFilterValueSupported, tooltipId, projection }) => {
|
|
22
|
-
const { config,
|
|
21
|
+
const { config, runtimeData, position, runtimeLegend } = useContext(ConfigContext)
|
|
23
22
|
const { legendMemo, legendSpecialClassLastMemo } = useLegendMemoContext()
|
|
24
23
|
const { geoClickHandler } = useGeoClickHandler()
|
|
25
24
|
const { applyTooltipsToGeo } = useApplyTooltipsToGeo()
|
|
@@ -146,20 +145,12 @@ const CityList: React.FC<CityListProps> = ({ setSharedFilterValue, isFilterValue
|
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
if (geoData?.[longitudeColumnName] && geoData?.[latitudeColumnName] && config.general.geoType === 'single-state') {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
[SVG_WIDTH - SVG_PADDING, SVG_HEIGHT - SVG_PADDING]
|
|
156
|
-
],
|
|
157
|
-
_statesPickedData
|
|
158
|
-
)
|
|
159
|
-
let coords = [Number(geoData?.[longitudeColumnName]), Number(geoData?.[latitudeColumnName])]
|
|
160
|
-
transform = `translate(${newProjection(coords)}) scale(${
|
|
161
|
-
config.visual.geoCodeCircleSize / ((position as any).zoom > 1 ? (position as any).zoom : 1)
|
|
162
|
-
})`
|
|
148
|
+
// For single-state maps, the projection passed in is already fitted from CustomProjection
|
|
149
|
+
// We just need to project the coordinates and apply zoom adjustment
|
|
150
|
+
const coords = [Number(geoData?.[longitudeColumnName]), Number(geoData?.[latitudeColumnName])]
|
|
151
|
+
const projectedCoords = projection(coords)
|
|
152
|
+
const zoomScale = (position as any).zoom > 1 ? 1 / (position as any).zoom : 1
|
|
153
|
+
transform = `translate(${projectedCoords}) scale(${zoomScale})`
|
|
163
154
|
needsPointer = true
|
|
164
155
|
}
|
|
165
156
|
|
|
@@ -216,10 +207,25 @@ const CityList: React.FC<CityListProps> = ({ setSharedFilterValue, isFilterValue
|
|
|
216
207
|
triangle: <GlyphTriangle {...shapeProps} />
|
|
217
208
|
}
|
|
218
209
|
|
|
210
|
+
// Check if this city matches any additionalCityStyles
|
|
211
|
+
let shapeToUse = config.visual.cityStyle?.toLowerCase() || 'circle'
|
|
212
|
+
if (config.visual.additionalCityStyles && config.visual.additionalCityStyles.length > 0) {
|
|
213
|
+
for (const style of config.visual.additionalCityStyles) {
|
|
214
|
+
if (style.column && style.value && style.shape) {
|
|
215
|
+
const columnValue = geoData[style.column]
|
|
216
|
+
// Convert both to strings for comparison to handle different data types
|
|
217
|
+
if (String(columnValue) === String(style.value)) {
|
|
218
|
+
shapeToUse = style.shape.toLowerCase()
|
|
219
|
+
break
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
219
225
|
// Render the city marker
|
|
220
226
|
return (
|
|
221
227
|
<g key={i} transform={transform} style={styles} className='geo-point' tabIndex={-1}>
|
|
222
|
-
{cityStyleShapes[
|
|
228
|
+
{cityStyleShapes[shapeToUse]}
|
|
223
229
|
</g>
|
|
224
230
|
)
|
|
225
231
|
})
|