@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,56 @@
|
|
|
1
|
+
import { useContext } from 'react'
|
|
2
|
+
import ConfigContext from '../context'
|
|
3
|
+
import { useProgrammaticMapTooltip } from './useProgrammaticMapTooltip'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hook to enable synchronized tooltips for map geographies in small multiples
|
|
7
|
+
*
|
|
8
|
+
* This abstracts all the small multiples synchronization logic so it can be
|
|
9
|
+
* easily added to any map type (US, Region, SingleState, World, etc.)
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export const useSynchronizedGeographies = () => {
|
|
13
|
+
const { handleSmallMultipleHover, mapRefForSync, tooltipId } = useContext(ConfigContext)
|
|
14
|
+
|
|
15
|
+
// Set up programmatic tooltip control for this map
|
|
16
|
+
const { registerGeoElement, unregisterGeoElement } = useProgrammaticMapTooltip({
|
|
17
|
+
mapRef: mapRefForSync || { current: null },
|
|
18
|
+
tooltipId
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns props to spread onto geography elements for synchronized tooltip support
|
|
23
|
+
* Includes ref for programmatic control and data-geo-id for tooltip tracking
|
|
24
|
+
*
|
|
25
|
+
* @param geoKey - Geography identifier (FIPS code, state abbreviation, etc.)
|
|
26
|
+
*/
|
|
27
|
+
const getSyncProps = (geoKey: string) => ({
|
|
28
|
+
ref: (el: SVGElement | null) => {
|
|
29
|
+
if (el) {
|
|
30
|
+
registerGeoElement(geoKey, el)
|
|
31
|
+
} else {
|
|
32
|
+
unregisterGeoElement(geoKey)
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
'data-geo-id': geoKey
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Event handler helpers for synchronized tooltips
|
|
40
|
+
* Call these inside your existing event handlers
|
|
41
|
+
*/
|
|
42
|
+
const syncHandlers = {
|
|
43
|
+
onMouseEnter: (geoKey: string, clientY: number) => {
|
|
44
|
+
handleSmallMultipleHover?.(geoKey, clientY)
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
onMouseLeave: () => {
|
|
48
|
+
handleSmallMultipleHover?.(null)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
getSyncProps,
|
|
54
|
+
syncHandlers
|
|
55
|
+
}
|
|
56
|
+
}
|
package/src/index.jsx
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Map-specific Editor Panel Styles
|
|
2
|
+
// Common editor panel styles are imported from @cdc/core/styles/editor-panel-base via cove-main.scss
|
|
3
|
+
|
|
1
4
|
.post-type-cdc_visualization {
|
|
2
5
|
.cove {
|
|
3
6
|
// Temp Radio button fix
|
|
@@ -14,8 +17,8 @@
|
|
|
14
17
|
// End Temp Radio button fix
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
|
-
.cdc-open-viz-module {
|
|
18
20
|
|
|
21
|
+
.cdc-open-viz-module {
|
|
19
22
|
.editor-panel {
|
|
20
23
|
.cove-input-group,
|
|
21
24
|
.cove-accordion__small-inputs {
|
|
@@ -92,287 +95,9 @@
|
|
|
92
95
|
margin-left: 0.3rem;
|
|
93
96
|
}
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
.form-container {
|
|
97
|
-
border-right: var(--lightGray) 1px solid;
|
|
98
|
-
flex-grow: 1;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.guidance-link {
|
|
102
|
-
margin: 2em 1em 0;
|
|
103
|
-
padding: 0.75em 1em;
|
|
104
|
-
align-items: center;
|
|
105
|
-
.heading-3 {
|
|
106
|
-
font-weight: 600;
|
|
107
|
-
font-size: 1.2em;
|
|
108
|
-
}
|
|
109
|
-
svg {
|
|
110
|
-
width: 60px;
|
|
111
|
-
color: var(--blue);
|
|
112
|
-
margin-right: 1rem;
|
|
113
|
-
height: 60px; // IE11
|
|
114
|
-
path {
|
|
115
|
-
fill: currentColor;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
.warning {
|
|
120
|
-
color: #d8000c;
|
|
121
|
-
background-color: #ffd2d2;
|
|
122
|
-
padding: 0.75em 1em;
|
|
123
|
-
margin: 1em 0;
|
|
124
|
-
font-size: 0.8em;
|
|
125
|
-
border: #d8000c 1px solid;
|
|
126
|
-
border-radius: 0.4em;
|
|
127
|
-
strong {
|
|
128
|
-
font-weight: 600;
|
|
129
|
-
display: block;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
.accordion__button {
|
|
133
|
-
cursor: pointer;
|
|
134
|
-
font-size: 1em;
|
|
135
|
-
padding: 0.3em 1em;
|
|
136
|
-
width: 100%;
|
|
137
|
-
text-align: left;
|
|
138
|
-
position: relative;
|
|
139
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.accordion__button:before {
|
|
143
|
-
display: inline-block;
|
|
144
|
-
content: '';
|
|
145
|
-
height: 7px;
|
|
146
|
-
width: 7px;
|
|
147
|
-
margin-right: 1em;
|
|
148
|
-
border-bottom: 2px solid currentColor;
|
|
149
|
-
border-right: 2px solid currentColor;
|
|
150
|
-
right: 0;
|
|
151
|
-
position: absolute;
|
|
152
|
-
top: 50%;
|
|
153
|
-
transform: rotate(-45deg) translateY(-50%);
|
|
154
|
-
transition: 0.1s all;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.accordion__button[aria-expanded='true']::before,
|
|
158
|
-
.accordion__button[aria-selected='true']::before {
|
|
159
|
-
top: 45%;
|
|
160
|
-
transform: rotate(45deg) translateY(-50%);
|
|
161
|
-
margin-right: 1.3em;
|
|
162
|
-
transition: 0.1s all;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.accordion__panel {
|
|
166
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
167
|
-
padding: 1em 1.25em 2em;
|
|
168
|
-
animation: fadein 0.2s ease-in;
|
|
169
|
-
span.h5 {
|
|
170
|
-
font-size: 0.8em;
|
|
171
|
-
}
|
|
172
|
-
& p.layer-purpose-details {
|
|
173
|
-
margin-top: 1em;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.advanced {
|
|
178
|
-
padding: 0 1em 1em;
|
|
179
|
-
text-align: left;
|
|
180
|
-
p {
|
|
181
|
-
font-size: 0.8rem;
|
|
182
|
-
}
|
|
183
|
-
.advanced-toggle-link {
|
|
184
|
-
padding-top: 1em;
|
|
185
|
-
display: block;
|
|
186
|
-
text-align: left;
|
|
187
|
-
cursor: pointer;
|
|
188
|
-
text-decoration: underline;
|
|
189
|
-
span {
|
|
190
|
-
text-decoration: none;
|
|
191
|
-
display: inline-block;
|
|
192
|
-
font-family: monospace;
|
|
193
|
-
padding-right: 5px;
|
|
194
|
-
}
|
|
195
|
-
&:hover {
|
|
196
|
-
color: rgba(0, 0, 0, 0.7);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
textarea {
|
|
200
|
-
height: 400px;
|
|
201
|
-
width: 100%;
|
|
202
|
-
font-size: 0.9em;
|
|
203
|
-
padding: 0.5em;
|
|
204
|
-
font-family: monospace;
|
|
205
|
-
box-sizing: border-box;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
@keyframes fadein {
|
|
210
|
-
0% {
|
|
211
|
-
opacity: 0;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
100% {
|
|
215
|
-
opacity: 1;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.base-label {
|
|
220
|
-
background: #565656;
|
|
221
|
-
color: #fff;
|
|
222
|
-
font-size: 1.1em;
|
|
223
|
-
padding: 0.6em 1em;
|
|
224
|
-
position: relative;
|
|
225
|
-
border-bottom: #565656 3px solid;
|
|
226
|
-
z-index: 3;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
label {
|
|
230
|
-
text-transform: uppercase;
|
|
231
|
-
display: block;
|
|
232
|
-
font-size: 0.8em;
|
|
233
|
-
font-weight: 600;
|
|
234
|
-
&:not(:first-child) {
|
|
235
|
-
margin-top: 1em;
|
|
236
|
-
}
|
|
237
|
-
span.edit-label {
|
|
238
|
-
margin-bottom: 0.3em;
|
|
239
|
-
display: flex;
|
|
240
|
-
}
|
|
241
|
-
span.column-heading {
|
|
242
|
-
font-size: 1em;
|
|
243
|
-
}
|
|
244
|
-
&.checkbox {
|
|
245
|
-
margin-top: 0.5rem;
|
|
246
|
-
display: flex;
|
|
247
|
-
|
|
248
|
-
input {
|
|
249
|
-
margin-left: 0;
|
|
250
|
-
width: inherit;
|
|
251
|
-
display: inline;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
input[type='text'],
|
|
256
|
-
input[role='combobox'],
|
|
257
|
-
input[type='number'],
|
|
258
|
-
textarea {
|
|
259
|
-
min-width: 100%;
|
|
260
|
-
max-width: 100%; // Doing this prevents width of textarea from being changed
|
|
261
|
-
}
|
|
262
98
|
textarea {
|
|
263
99
|
min-height: 140px;
|
|
264
100
|
}
|
|
265
|
-
.header .color-palette li {
|
|
266
|
-
width: 21px;
|
|
267
|
-
height: 21px;
|
|
268
|
-
border-radius: 40px;
|
|
269
|
-
margin-right: 2.8px;
|
|
270
|
-
}
|
|
271
|
-
.color-palette {
|
|
272
|
-
display: flex;
|
|
273
|
-
max-width: 100%;
|
|
274
|
-
padding: 0;
|
|
275
|
-
margin: 0.5em 0 0 0;
|
|
276
|
-
list-style: none;
|
|
277
|
-
flex-wrap: wrap;
|
|
278
|
-
li {
|
|
279
|
-
width: 45px;
|
|
280
|
-
height: 23px;
|
|
281
|
-
margin-right: 4px;
|
|
282
|
-
margin-bottom: 10px;
|
|
283
|
-
display: flex;
|
|
284
|
-
border-radius: 5px;
|
|
285
|
-
overflow: hidden;
|
|
286
|
-
cursor: pointer;
|
|
287
|
-
position: relative;
|
|
288
|
-
.click-target {
|
|
289
|
-
position: absolute;
|
|
290
|
-
top: 0;
|
|
291
|
-
left: 0;
|
|
292
|
-
right: 0;
|
|
293
|
-
bottom: 0;
|
|
294
|
-
}
|
|
295
|
-
&.selected {
|
|
296
|
-
border: rgba(0, 0, 0, 0.8) 2px solid;
|
|
297
|
-
}
|
|
298
|
-
span {
|
|
299
|
-
width: 33.3%;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
fieldset {
|
|
305
|
-
display: block;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.primary-fieldset {
|
|
309
|
-
padding: 0;
|
|
310
|
-
margin: 0;
|
|
311
|
-
border: 0;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
ul.column-edit {
|
|
315
|
-
list-style: none;
|
|
316
|
-
li {
|
|
317
|
-
margin-top: 1em;
|
|
318
|
-
}
|
|
319
|
-
.three-col {
|
|
320
|
-
display: flex;
|
|
321
|
-
justify-content: space-between;
|
|
322
|
-
> label {
|
|
323
|
-
margin-top: 0;
|
|
324
|
-
width: 30%;
|
|
325
|
-
display: inline-block;
|
|
326
|
-
input[type='text'],
|
|
327
|
-
input[type='number'] {
|
|
328
|
-
width: 50px;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
&.hidden {
|
|
335
|
-
display: none;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.emove-column {
|
|
339
|
-
float: right;
|
|
340
|
-
text-transform: uppercase;
|
|
341
|
-
color: #c32b2b;
|
|
342
|
-
font-size: 0.7em;
|
|
343
|
-
line-height: 1.6em;
|
|
344
|
-
border-radius: 5px;
|
|
345
|
-
margin: 0 auto;
|
|
346
|
-
transition: 0.1s all;
|
|
347
|
-
border: 0;
|
|
348
|
-
text-decoration: underline;
|
|
349
|
-
outline: 0;
|
|
350
|
-
cursor: pointer;
|
|
351
|
-
font-weight: bold;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.edit-block {
|
|
355
|
-
padding-left: 1em;
|
|
356
|
-
border-left: rgba(0, 0, 0, 0.2) 4px solid;
|
|
357
|
-
transition: 0.2s all;
|
|
358
|
-
&:not(:first-child) {
|
|
359
|
-
margin-top: 2em;
|
|
360
|
-
}
|
|
361
|
-
input[type='text'],
|
|
362
|
-
input[type='number'] {
|
|
363
|
-
font-size: 1em;
|
|
364
|
-
}
|
|
365
|
-
label {
|
|
366
|
-
margin-top: 0;
|
|
367
|
-
}
|
|
368
|
-
label + label {
|
|
369
|
-
margin-top: 1em;
|
|
370
|
-
}
|
|
371
|
-
&:hover {
|
|
372
|
-
border-left: rgba(0, 0, 0, 0.7) 4px solid;
|
|
373
|
-
transition: 0.2s all;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
101
|
|
|
377
102
|
.data-toggle {
|
|
378
103
|
list-style: none;
|
|
@@ -443,167 +168,6 @@
|
|
|
443
168
|
}
|
|
444
169
|
}
|
|
445
170
|
}
|
|
446
|
-
|
|
447
|
-
span.subtext {
|
|
448
|
-
display: block;
|
|
449
|
-
color: rgba(0, 0, 0, 0.5);
|
|
450
|
-
text-transform: none;
|
|
451
|
-
font-weight: normal;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.sort-list {
|
|
455
|
-
list-style: none;
|
|
456
|
-
> li {
|
|
457
|
-
margin-right: 0.3em;
|
|
458
|
-
margin-bottom: 0.3em;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
.sort-list li > div {
|
|
462
|
-
display: block;
|
|
463
|
-
box-sizing: border-box;
|
|
464
|
-
border: 1px solid #d1d1d1;
|
|
465
|
-
border-radius: 2px;
|
|
466
|
-
background: #f1f1f1;
|
|
467
|
-
padding: 0.4em 0.6em;
|
|
468
|
-
font-size: 0.8em;
|
|
469
|
-
margin-bottom: 0.3em;
|
|
470
|
-
cursor: move;
|
|
471
|
-
z-index: 999;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.info {
|
|
475
|
-
font-size: 0.8em;
|
|
476
|
-
line-height: 1.4em;
|
|
477
|
-
font-style: italic;
|
|
478
|
-
padding-top: 10px;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.react-tags__search {
|
|
482
|
-
width: 100%;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
.react-tags {
|
|
486
|
-
position: relative;
|
|
487
|
-
input.react-tags__search-input {
|
|
488
|
-
font-size: 0.8rem;
|
|
489
|
-
}
|
|
490
|
-
/* clicking anywhere will focus the input */
|
|
491
|
-
cursor: text;
|
|
492
|
-
span {
|
|
493
|
-
display: inline;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.react-tags.is-focused {
|
|
498
|
-
border-color: rgba(0, 0, 0, 0.7);
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
.react-tags__selected {
|
|
502
|
-
display: inline;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.react-tags__selected-tag {
|
|
506
|
-
display: inline-block;
|
|
507
|
-
box-sizing: border-box;
|
|
508
|
-
border: 1px solid #d1d1d1;
|
|
509
|
-
border-radius: 2px;
|
|
510
|
-
background: #f1f1f1;
|
|
511
|
-
padding: 0.4em 0.6em;
|
|
512
|
-
font-size: 0.8em;
|
|
513
|
-
margin-right: 0.3em;
|
|
514
|
-
margin-bottom: 0.3em;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
.react-tags__selected-tag:after {
|
|
518
|
-
content: '\2715';
|
|
519
|
-
color: #aaa;
|
|
520
|
-
margin-left: 8px;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
.react-tags__selected-tag:hover,
|
|
524
|
-
.react-tags__selected-tag:focus {
|
|
525
|
-
border-color: #b1b1b1;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
.react-tags__search {
|
|
529
|
-
display: inline-block;
|
|
530
|
-
|
|
531
|
-
/* prevent autoresize overflowing the container */
|
|
532
|
-
max-width: 100%;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
@media screen and (min-width: 30em) {
|
|
536
|
-
.react-tags__search {
|
|
537
|
-
/* this will become the offsetParent for suggestions */
|
|
538
|
-
position: relative;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.react-tags__search input {
|
|
543
|
-
/* prevent autoresize overflowing the container */
|
|
544
|
-
max-width: 100%;
|
|
545
|
-
|
|
546
|
-
/* emove styles and layout from this element */
|
|
547
|
-
margin: 0;
|
|
548
|
-
outline: none;
|
|
549
|
-
padding: 0.5em 0.3em;
|
|
550
|
-
|
|
551
|
-
/* match the font styles */
|
|
552
|
-
font-size: inherit;
|
|
553
|
-
line-height: inherit;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
.react-tags__search input::-ms-clear {
|
|
557
|
-
display: none;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
.react-tags__suggestions {
|
|
561
|
-
position: absolute;
|
|
562
|
-
top: 100%;
|
|
563
|
-
left: 0;
|
|
564
|
-
width: 100%;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
@media screen and (min-width: 30em) {
|
|
568
|
-
.react-tags__suggestions {
|
|
569
|
-
width: 240px;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
.react-tags__suggestions ul {
|
|
574
|
-
margin: 4px -1px;
|
|
575
|
-
padding: 0;
|
|
576
|
-
list-style: none;
|
|
577
|
-
background: white;
|
|
578
|
-
border: 1px solid #d1d1d1;
|
|
579
|
-
border-radius: 2px;
|
|
580
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
.react-tags__suggestions li {
|
|
584
|
-
border-bottom: 1px solid #ddd;
|
|
585
|
-
padding: 6px 8px;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
.react-tags__suggestions li mark {
|
|
589
|
-
text-decoration: underline;
|
|
590
|
-
background: none;
|
|
591
|
-
font-weight: 600;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
.react-tags__suggestions li:hover {
|
|
595
|
-
cursor: pointer;
|
|
596
|
-
background: #eee;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.react-tags__suggestions li.is-active {
|
|
600
|
-
background: #b7cfe0;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
.react-tags__suggestions li.is-disabled {
|
|
604
|
-
opacity: 0.5;
|
|
605
|
-
cursor: auto;
|
|
606
|
-
}
|
|
607
171
|
}
|
|
608
172
|
|
|
609
173
|
@include breakpointClass(md) {
|
package/src/scss/main.scss
CHANGED
package/src/scss/map.scss
CHANGED
|
@@ -33,25 +33,28 @@ $medium: 768px;
|
|
|
33
33
|
&:focus {
|
|
34
34
|
outline: 0;
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
// Multi-country map states - use higher specificity
|
|
38
|
+
&.hidden {
|
|
39
|
+
display: none !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.grayed-out {
|
|
43
|
+
opacity: 0.3;
|
|
44
|
+
fill: #d3d3d3 !important;
|
|
45
|
+
}
|
|
36
46
|
}
|
|
37
47
|
|
|
38
48
|
.territories-label {
|
|
39
|
-
font-size: 0.8rem;
|
|
40
49
|
font-weight: 700;
|
|
41
50
|
}
|
|
42
51
|
|
|
43
|
-
@include breakpointClass(sm) {
|
|
44
|
-
.territories-label {
|
|
45
|
-
font-size: 1rem;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
52
|
// Cities and Territories
|
|
50
53
|
.territories {
|
|
51
54
|
gap: 0.5em;
|
|
52
55
|
svg {
|
|
53
|
-
max-width: 30px;
|
|
54
|
-
min-width: 30px;
|
|
56
|
+
max-width: var(--territory-svg-max-width, 30px);
|
|
57
|
+
min-width: var(--territory-svg-min-width, 30px);
|
|
55
58
|
transition: 0.3s all;
|
|
56
59
|
|
|
57
60
|
text {
|
|
@@ -73,11 +76,6 @@ $medium: 768px;
|
|
|
73
76
|
width: 2.5em;
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
|
-
.territories {
|
|
77
|
-
svg {
|
|
78
|
-
max-width: 45px;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
.state {
|
|
@@ -98,7 +96,6 @@ $medium: 768px;
|
|
|
98
96
|
display: none;
|
|
99
97
|
}
|
|
100
98
|
|
|
101
|
-
|
|
102
99
|
.county-borders {
|
|
103
100
|
fill: none;
|
|
104
101
|
stroke-width: 1px;
|
package/src/store/map.actions.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MapConfig, Coordinate } from '../types/MapConfig'
|
|
2
|
-
import {
|
|
3
|
-
import { VizFilter } from '@cdc/core/types/VizFilter'
|
|
1
|
+
import { type MapConfig, type Coordinate } from '../types/MapConfig'
|
|
2
|
+
import { type RuntimeLegend } from '../types/runtimeLegend'
|
|
3
|
+
import { type VizFilter } from '@cdc/core/types/VizFilter'
|
|
4
4
|
import { type Action } from '@cdc/core/types/Action'
|
|
5
|
-
import { RuntimeData } from '../types/RuntimeData'
|
|
6
|
-
import { Modal } from '../types/Modal'
|
|
5
|
+
import { type RuntimeData } from '../types/RuntimeData'
|
|
6
|
+
import { type Modal } from '../types/Modal'
|
|
7
7
|
|
|
8
8
|
// Action Types
|
|
9
9
|
type SET_ACCESSIBLE_STATUS = Action<'SET_ACCESSIBLE_STATUS', string>
|
|
@@ -18,13 +18,13 @@ type SET_POSITION = Action<'SET_POSITION', { coordinates: Coordinate; zoom: numb
|
|
|
18
18
|
type SET_REQUIRED_COLUMNS = Action<'SET_REQUIRED_COLUMNS', string[]>
|
|
19
19
|
type SET_RUNTIME_DATA = Action<'SET_RUNTIME_DATA', RuntimeData>
|
|
20
20
|
type SET_RUNTIME_FILTERS = Action<'SET_RUNTIME_FILTERS', VizFilter[]>
|
|
21
|
-
type SET_RUNTIME_LEGEND = Action<'SET_RUNTIME_LEGEND',
|
|
21
|
+
type SET_RUNTIME_LEGEND = Action<'SET_RUNTIME_LEGEND', RuntimeLegend | []>
|
|
22
22
|
type SET_SCALE = Action<'SET_SCALE', number>
|
|
23
23
|
type SET_STATES_TO_SHOW = Action<'SET_STATES_TO_SHOW', string[]>
|
|
24
24
|
type SET_TOPO_DATA = Action<'SET_TOPO_DATA', any>
|
|
25
25
|
type SET_TRANSLATE = Action<'SET_TRANSLATE', [number, number]>
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
type MapActions =
|
|
28
28
|
| SET_ACCESSIBLE_STATUS
|
|
29
29
|
| SET_CONFIG
|
|
30
30
|
| SET_COVE_LOADED_HAS_RAN
|
package/src/test/CdcMap.test.jsx
CHANGED