@cdc/map 4.24.10 → 4.24.11
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 +21026 -20881
- package/examples/private/DEV-9644.json +184 -0
- package/package.json +3 -3
- package/src/CdcMap.tsx +11 -4
- package/src/_stories/CdcMapLegend.stories.tsx +86 -0
- package/src/_stories/_mock/usa-state-gradient.json +238 -0
- package/src/_stories/_mock/wastewater-map.json +208 -0
- package/src/components/EditorPanel/components/EditorPanel.tsx +38 -48
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +27 -23
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +75 -16
- package/src/components/Legend/components/Legend.tsx +23 -17
- package/src/components/Legend/components/index.scss +9 -2
- package/src/components/UsaMap/components/HexIcon.tsx +7 -1
- package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +57 -12
- package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +88 -15
- package/src/components/UsaMap/components/Territory/TerritoryShape.ts +13 -0
- package/src/components/UsaMap/components/UsaMap.County.tsx +1 -1
- package/src/components/UsaMap/components/UsaMap.State.tsx +3 -3
- package/src/components/UsaMap/helpers/shapes.ts +5 -4
- package/src/scss/editor-panel.scss +0 -3
- package/src/scss/filters.scss +2 -7
- package/src/scss/main.scss +0 -4
- package/src/scss/map.scss +0 -4
- package/src/types/MapConfig.ts +1 -1
|
@@ -15,18 +15,22 @@ import useDataVizClasses from '@cdc/core/helpers/useDataVizClasses'
|
|
|
15
15
|
import ConfigContext from '../../../context'
|
|
16
16
|
import { PatternLines, PatternCircles, PatternWaves } from '@visx/pattern'
|
|
17
17
|
import { GlyphStar, GlyphTriangle, GlyphDiamond, GlyphSquare, GlyphCircle } from '@visx/glyph'
|
|
18
|
-
import { type ViewportSize } from '../../../types/MapConfig'
|
|
19
18
|
import { Group } from '@visx/group'
|
|
20
19
|
import './index.scss'
|
|
20
|
+
import { ViewportSize } from '@cdc/chart/src/types/ChartConfig'
|
|
21
|
+
import { isMobileHeightViewport } from '@cdc/core/helpers/viewports'
|
|
22
|
+
|
|
23
|
+
const LEGEND_PADDING = 30
|
|
21
24
|
|
|
22
25
|
type LegendProps = {
|
|
23
26
|
skipId: string
|
|
24
|
-
currentViewport: ViewportSize
|
|
25
27
|
dimensions: DimensionsType
|
|
28
|
+
containerWidthPadding: number
|
|
29
|
+
currentViewport: ViewportSize
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
const Legend = forwardRef<HTMLDivElement, LegendProps>((props, ref) => {
|
|
29
|
-
const { skipId,
|
|
33
|
+
const { skipId, dimensions, containerWidthPadding, currentViewport } = props
|
|
30
34
|
|
|
31
35
|
const {
|
|
32
36
|
// prettier-ignore
|
|
@@ -99,13 +103,14 @@ const Legend = forwardRef<HTMLDivElement, LegendProps>((props, ref) => {
|
|
|
99
103
|
})
|
|
100
104
|
}
|
|
101
105
|
|
|
102
|
-
const legendList = () => {
|
|
103
|
-
const formattedItems = getFormattedLegendItems()
|
|
106
|
+
const legendList = (patternsOnly = false) => {
|
|
107
|
+
const formattedItems = patternsOnly ? [] : getFormattedLegendItems()
|
|
108
|
+
const patternsOnlyFont = isMobileHeightViewport(currentViewport) ? '12px' : '14px'
|
|
104
109
|
let legendItems
|
|
105
110
|
|
|
106
111
|
legendItems = formattedItems.map((item, idx) => {
|
|
107
112
|
const handleListItemClass = () => {
|
|
108
|
-
let classes = ['legend-container__li']
|
|
113
|
+
let classes = ['legend-container__li', 'd-flex', 'align-items-center']
|
|
109
114
|
if (item.disabled) classes.push('legend-container__li--disabled')
|
|
110
115
|
if (item.special) classes.push('legend-container__li--special-class')
|
|
111
116
|
return classes.join(' ')
|
|
@@ -126,11 +131,7 @@ const Legend = forwardRef<HTMLDivElement, LegendProps>((props, ref) => {
|
|
|
126
131
|
}}
|
|
127
132
|
tabIndex={0}
|
|
128
133
|
>
|
|
129
|
-
<LegendShape
|
|
130
|
-
shape={state.legend.style === 'boxes' ? 'square' : 'circle'}
|
|
131
|
-
viewport={viewport}
|
|
132
|
-
fill={item.color}
|
|
133
|
-
/>
|
|
134
|
+
<LegendShape shape={state.legend.style === 'boxes' ? 'square' : 'circle'} fill={item.color} />
|
|
134
135
|
<span>{item.label}</span>
|
|
135
136
|
</li>
|
|
136
137
|
)
|
|
@@ -195,7 +196,9 @@ const Legend = forwardRef<HTMLDivElement, LegendProps>((props, ref) => {
|
|
|
195
196
|
/>
|
|
196
197
|
</svg>
|
|
197
198
|
</span>
|
|
198
|
-
<p style={{ lineHeight: '22.4px'
|
|
199
|
+
<p style={{ lineHeight: '22.4px', fontSize: patternsOnly ? patternsOnlyFont : '16px' }}>
|
|
200
|
+
{patternData.label || patternData.dataValue || ''}
|
|
201
|
+
</p>
|
|
199
202
|
</li>
|
|
200
203
|
</>
|
|
201
204
|
)
|
|
@@ -204,6 +207,8 @@ const Legend = forwardRef<HTMLDivElement, LegendProps>((props, ref) => {
|
|
|
204
207
|
|
|
205
208
|
return legendItems
|
|
206
209
|
}
|
|
210
|
+
const legendListItems = legendList(state.legend.style === 'gradient')
|
|
211
|
+
|
|
207
212
|
const { legendClasses } = useDataVizClasses(state, viewport)
|
|
208
213
|
|
|
209
214
|
const handleReset = e => {
|
|
@@ -273,14 +278,15 @@ const Legend = forwardRef<HTMLDivElement, LegendProps>((props, ref) => {
|
|
|
273
278
|
<LegendGradient
|
|
274
279
|
labels={getFormattedLegendItems().map(item => item?.label) ?? []}
|
|
275
280
|
colors={getFormattedLegendItems().map(item => item?.color) ?? []}
|
|
276
|
-
values={getFormattedLegendItems().map(item => item?.value) ?? []}
|
|
277
281
|
dimensions={dimensions}
|
|
278
|
-
|
|
282
|
+
parentPaddingToSubtract={containerWidthPadding + (legend.hideBorder ? 0 : LEGEND_PADDING)}
|
|
279
283
|
config={state}
|
|
280
284
|
/>
|
|
281
|
-
|
|
282
|
-
{
|
|
283
|
-
|
|
285
|
+
{!!legendListItems.length && (
|
|
286
|
+
<ul className={legendClasses.ul.join(' ') || ''} aria-label='Legend items'>
|
|
287
|
+
{legendListItems}
|
|
288
|
+
</ul>
|
|
289
|
+
)}
|
|
284
290
|
{(state.visual.additionalCityStyles.some(c => c.label) || state.visual.cityStyleLabel) && (
|
|
285
291
|
<>
|
|
286
292
|
<hr />
|
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
background-color: #fff;
|
|
17
17
|
z-index: 6;
|
|
18
18
|
border-top: var(--lightGray) 1px solid;
|
|
19
|
+
|
|
19
20
|
@include breakpointClass(md) {
|
|
20
|
-
&.bottom,
|
|
21
|
+
&.bottom,
|
|
22
|
+
&.top {
|
|
21
23
|
border: var(--lightGray) 1px solid;
|
|
22
24
|
}
|
|
23
25
|
&.side {
|
|
@@ -65,8 +67,10 @@
|
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
.legend-container {
|
|
68
|
-
padding: 1em;
|
|
69
70
|
position: relative;
|
|
71
|
+
&.legend-padding {
|
|
72
|
+
padding: 15px;
|
|
73
|
+
}
|
|
70
74
|
.legend-container__title {
|
|
71
75
|
font-size: 1.3em;
|
|
72
76
|
padding-bottom: 0;
|
|
@@ -166,6 +170,9 @@
|
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
172
|
}
|
|
173
|
+
.legend-container__ul.patterns-only {
|
|
174
|
+
margin-top: 10px;
|
|
175
|
+
}
|
|
169
176
|
}
|
|
170
177
|
|
|
171
178
|
.bottom .legend-container__ul--single-column:not(.vertical-sorted) {
|
|
@@ -30,7 +30,13 @@ const HexIcon: React.FC<HexIconProps> = props => {
|
|
|
30
30
|
)
|
|
31
31
|
}
|
|
32
32
|
return (
|
|
33
|
-
<Group
|
|
33
|
+
<Group
|
|
34
|
+
top={centroid[1] - 5}
|
|
35
|
+
left={centroid[0] - iconSize}
|
|
36
|
+
color={textColor}
|
|
37
|
+
textAnchor='start'
|
|
38
|
+
key={`hex--${item.key}-${item.value}-${index}`}
|
|
39
|
+
>
|
|
34
40
|
{item.shape === 'Arrow Down' && <AiOutlineArrowDown />}
|
|
35
41
|
{item.shape === 'Arrow Up' && <AiOutlineArrowUp />}
|
|
36
42
|
{item.shape === 'Arrow Right' && <AiOutlineArrowRight />}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react'
|
|
2
|
-
import { geoCentroid
|
|
2
|
+
import { geoCentroid } from 'd3-geo'
|
|
3
3
|
import ConfigContext from './../../../../context'
|
|
4
4
|
import { MapContext } from './../../../../types/MapContext'
|
|
5
5
|
import HexIcon from '../HexIcon'
|
|
@@ -31,7 +31,19 @@ const nudges = {
|
|
|
31
31
|
|
|
32
32
|
// todo: combine hexagonLabel & geoLabel functions
|
|
33
33
|
// todo: move geoLabel functions outside of components for reusability
|
|
34
|
-
const TerritoryHexagon = ({
|
|
34
|
+
const TerritoryHexagon = ({
|
|
35
|
+
dataTooltipHtml,
|
|
36
|
+
dataTooltipId,
|
|
37
|
+
handleShapeClick,
|
|
38
|
+
label,
|
|
39
|
+
stroke,
|
|
40
|
+
strokeWidth,
|
|
41
|
+
territory,
|
|
42
|
+
territoryData,
|
|
43
|
+
text,
|
|
44
|
+
textColor,
|
|
45
|
+
...props
|
|
46
|
+
}) => {
|
|
35
47
|
const { state } = useContext<MapContext>(ConfigContext)
|
|
36
48
|
|
|
37
49
|
const isHex = state.general.displayAsHex
|
|
@@ -115,7 +127,17 @@ const TerritoryHexagon = ({ label, text, stroke, strokeWidth, textColor, territo
|
|
|
115
127
|
let y = state.hexMap.type === 'shapes' ? '30%' : '50%'
|
|
116
128
|
return (
|
|
117
129
|
<>
|
|
118
|
-
<Text
|
|
130
|
+
<Text
|
|
131
|
+
fontSize={14}
|
|
132
|
+
x={'50%'}
|
|
133
|
+
y={y}
|
|
134
|
+
style={{ fill: 'currentColor', stroke: 'initial', fontWeight: 400, opacity: 1, fillOpacity: 1 }}
|
|
135
|
+
textAnchor='middle'
|
|
136
|
+
verticalAnchor='middle'
|
|
137
|
+
onClick={handleShapeClick}
|
|
138
|
+
data-tooltip-id={dataTooltipId}
|
|
139
|
+
data-tooltip-html={dataTooltipHtml}
|
|
140
|
+
>
|
|
119
141
|
{abbr.substring(3)}
|
|
120
142
|
</Text>
|
|
121
143
|
{state.general.displayAsHex && state.hexMap.type === 'shapes' && getArrowDirection(territoryData, geo, true)}
|
|
@@ -127,21 +149,44 @@ const TerritoryHexagon = ({ label, text, stroke, strokeWidth, textColor, territo
|
|
|
127
149
|
|
|
128
150
|
return (
|
|
129
151
|
<g>
|
|
130
|
-
<line
|
|
131
|
-
|
|
152
|
+
<line
|
|
153
|
+
x1={centroid[0]}
|
|
154
|
+
y1={centroid[1]}
|
|
155
|
+
x2={centroid[0] + dx}
|
|
156
|
+
y2={centroid[1] + dy}
|
|
157
|
+
stroke='rgba(0,0,0,.5)'
|
|
158
|
+
strokeWidth={1}
|
|
159
|
+
/>
|
|
160
|
+
<text
|
|
161
|
+
x={4}
|
|
162
|
+
strokeWidth='0'
|
|
163
|
+
fontSize={13}
|
|
164
|
+
style={{ fill: '#202020' }}
|
|
165
|
+
alignmentBaseline='middle'
|
|
166
|
+
transform={`translate(${centroid[0] + dx}, ${centroid[1] + dy})`}
|
|
167
|
+
onClick={handleShapeClick}
|
|
168
|
+
data-tooltip-id={dataTooltipId}
|
|
169
|
+
data-tooltip-html={dataTooltipHtml}
|
|
170
|
+
>
|
|
132
171
|
{abbr.substring(3)}
|
|
133
172
|
</text>
|
|
134
173
|
</g>
|
|
135
174
|
)
|
|
136
175
|
}
|
|
137
176
|
|
|
138
|
-
return
|
|
139
|
-
|
|
140
|
-
<
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
177
|
+
return (
|
|
178
|
+
territoryData && (
|
|
179
|
+
<svg viewBox='0 0 45 51' className='territory-wrapper--hex'>
|
|
180
|
+
<g {...props} data-tooltip-html={dataTooltipHtml} data-tooltip-id={dataTooltipId} onClick={handleShapeClick}>
|
|
181
|
+
<polygon
|
|
182
|
+
stroke={stroke}
|
|
183
|
+
strokeWidth={strokeWidth}
|
|
184
|
+
points='22 0 44 12.702 44 38.105 22 50.807 0 38.105 0 12.702'
|
|
185
|
+
/>
|
|
186
|
+
{state.general.displayAsHex && hexagonLabel(territoryData, stroke, false)}
|
|
187
|
+
</g>
|
|
188
|
+
</svg>
|
|
189
|
+
)
|
|
145
190
|
)
|
|
146
191
|
}
|
|
147
192
|
|
|
@@ -4,21 +4,50 @@ import ConfigContext from './../../../../context'
|
|
|
4
4
|
import { type MapContext } from '../../../../types/MapContext'
|
|
5
5
|
import { patternSizes } from './../../helpers/patternSizes'
|
|
6
6
|
import { getContrastColor } from '@cdc/core/helpers/cove/accessibility'
|
|
7
|
+
import { type TerritoryShape } from './TerritoryShape'
|
|
7
8
|
|
|
8
|
-
const TerritoryRectangle = ({
|
|
9
|
+
const TerritoryRectangle: React.FC<TerritoryShape> = ({
|
|
10
|
+
dataTooltipId,
|
|
11
|
+
dataTooltipHtml,
|
|
12
|
+
handleShapeClick,
|
|
13
|
+
hasPattern,
|
|
14
|
+
label,
|
|
15
|
+
stroke,
|
|
16
|
+
strokeWidth,
|
|
17
|
+
territory,
|
|
18
|
+
text,
|
|
19
|
+
textColor,
|
|
20
|
+
...props
|
|
21
|
+
}) => {
|
|
9
22
|
const { state, supportedTerritories } = useContext<MapContext>(ConfigContext)
|
|
10
23
|
const { territoryData, ...otherProps } = props
|
|
24
|
+
const rectanglePath =
|
|
25
|
+
'M40,0.5 C41.2426407,0.5 42.3676407,1.00367966 43.1819805,1.81801948 C43.9963203,2.63235931 44.5,3.75735931 44.5,5 L44.5,5 L44.5,23 C44.5,24.2426407 43.9963203,25.3676407 43.1819805,26.1819805 C42.3676407,26.9963203 41.2426407,27.5 40,27.5 L40,27.5 L5,27.5 C3.75735931,27.5 2.63235931,26.9963203 1.81801948,26.1819805 C1.00367966,25.3676407 0.5,24.2426407 0.5,23 L0.5,23 L0.5,5 C0.5,3.75735931 1.00367966,2.63235931 1.81801948,1.81801948 C2.63235931,1.00367966 3.75735931,0.5 5,0.5 L5,0.5 Z'
|
|
11
26
|
|
|
12
27
|
return (
|
|
13
28
|
<svg viewBox='0 0 45 28' key={territory} className={territory}>
|
|
14
|
-
<g
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
<g
|
|
30
|
+
{...otherProps}
|
|
31
|
+
strokeLinejoin='round'
|
|
32
|
+
tabIndex={-1}
|
|
33
|
+
onClick={handleShapeClick}
|
|
34
|
+
data-tooltip-id={dataTooltipId}
|
|
35
|
+
data-tooltip-html={dataTooltipHtml}
|
|
36
|
+
>
|
|
37
|
+
<path stroke={stroke} strokeWidth={strokeWidth} d={rectanglePath} {...otherProps} />
|
|
38
|
+
<text
|
|
39
|
+
textAnchor='middle'
|
|
40
|
+
dominantBaseline='middle'
|
|
41
|
+
x='50%'
|
|
42
|
+
y='54%'
|
|
43
|
+
fill={text}
|
|
44
|
+
style={{ stroke: textColor, strokeWidth: 1 }}
|
|
45
|
+
className='territory-text'
|
|
46
|
+
paintOrder='stroke'
|
|
47
|
+
onClick={handleShapeClick}
|
|
48
|
+
data-tooltip-id={dataTooltipId}
|
|
49
|
+
data-tooltip-html={dataTooltipHtml}
|
|
50
|
+
>
|
|
22
51
|
{label}
|
|
23
52
|
</text>
|
|
24
53
|
|
|
@@ -31,18 +60,62 @@ const TerritoryRectangle = ({ label, text, stroke, strokeWidth, textColor, hasPa
|
|
|
31
60
|
|
|
32
61
|
return (
|
|
33
62
|
<>
|
|
34
|
-
{patternData?.pattern === 'waves' &&
|
|
35
|
-
|
|
36
|
-
|
|
63
|
+
{patternData?.pattern === 'waves' && (
|
|
64
|
+
<PatternWaves
|
|
65
|
+
id={`territory-${patternData?.dataKey}--${patternIndex}`}
|
|
66
|
+
height={patternSizes[patternData?.size] ?? 10}
|
|
67
|
+
width={patternSizes[patternData?.size] ?? 10}
|
|
68
|
+
fill={patternColor}
|
|
69
|
+
complement
|
|
70
|
+
/>
|
|
71
|
+
)}
|
|
72
|
+
{patternData?.pattern === 'circles' && (
|
|
73
|
+
<PatternCircles
|
|
74
|
+
id={`territory-${patternData?.dataKey}--${patternIndex}`}
|
|
75
|
+
height={patternSizes[patternData?.size] ?? 10}
|
|
76
|
+
width={patternSizes[patternData?.size] ?? 10}
|
|
77
|
+
fill={patternColor}
|
|
78
|
+
complement
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
{patternData?.pattern === 'lines' && (
|
|
82
|
+
<PatternLines
|
|
83
|
+
id={`territory-${patternData?.dataKey}--${patternIndex}`}
|
|
84
|
+
height={patternSizes[patternData?.size] ?? 6}
|
|
85
|
+
width={patternSizes[patternData?.size] ?? 6}
|
|
86
|
+
stroke={patternColor}
|
|
87
|
+
strokeWidth={1}
|
|
88
|
+
orientation={['diagonalRightToLeft']}
|
|
89
|
+
/>
|
|
90
|
+
)}
|
|
37
91
|
<path
|
|
38
92
|
stroke={stroke}
|
|
39
93
|
strokeWidth={strokeWidth}
|
|
40
|
-
d=
|
|
94
|
+
d={rectanglePath}
|
|
41
95
|
fill={`url(#territory-${patternData?.dataKey}--${patternIndex})`}
|
|
42
96
|
color={patternData ? 'white' : textColor}
|
|
43
|
-
className={[
|
|
97
|
+
className={[
|
|
98
|
+
`territory-pattern-${patternData.dataKey}`,
|
|
99
|
+
`territory-pattern-${patternData.dataKey}--${patternData.dataValue}`
|
|
100
|
+
].join(' ')}
|
|
44
101
|
/>
|
|
45
|
-
<text
|
|
102
|
+
<text
|
|
103
|
+
textAnchor='middle'
|
|
104
|
+
dominantBaseline='middle'
|
|
105
|
+
x='50%'
|
|
106
|
+
y='54%'
|
|
107
|
+
fill={text}
|
|
108
|
+
style={{
|
|
109
|
+
fill: patternData ? 'white' : 'black',
|
|
110
|
+
stroke: patternData ? 'black' : textColor,
|
|
111
|
+
strokeWidth: patternData ? 6 : 0
|
|
112
|
+
}}
|
|
113
|
+
className='territory-text'
|
|
114
|
+
paint-order='stroke'
|
|
115
|
+
onClick={handleShapeClick}
|
|
116
|
+
data-tooltip-id={dataTooltipId}
|
|
117
|
+
data-tooltip-html={dataTooltipHtml}
|
|
118
|
+
>
|
|
46
119
|
{label}
|
|
47
120
|
</text>
|
|
48
121
|
</>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type TerritoryShape = {
|
|
2
|
+
handleShapeClick: () => void
|
|
3
|
+
dataTooltipHtml: string
|
|
4
|
+
dataTooltipId: string
|
|
5
|
+
hasPattern: boolean
|
|
6
|
+
label: string
|
|
7
|
+
stroke: string
|
|
8
|
+
strokeWidth: number
|
|
9
|
+
territory: string
|
|
10
|
+
territoryData: object
|
|
11
|
+
text: string
|
|
12
|
+
textColor: string
|
|
13
|
+
}
|
|
@@ -604,7 +604,7 @@ const CountyMap = props => {
|
|
|
604
604
|
className='county-map-canvas'
|
|
605
605
|
></canvas>
|
|
606
606
|
|
|
607
|
-
<button className={`btn btn--reset`} onClick={onReset} ref={resetButton} tabIndex='0'>
|
|
607
|
+
<button className={`btn btn-primary btn--reset`} onClick={onReset} ref={resetButton} tabIndex='0'>
|
|
608
608
|
Reset Zoom
|
|
609
609
|
</button>
|
|
610
610
|
</ErrorBoundary>
|
|
@@ -195,9 +195,9 @@ const UsaMap = () => {
|
|
|
195
195
|
text={styles.color}
|
|
196
196
|
strokeWidth={1.5}
|
|
197
197
|
textColor={textColor}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
handleShapeClick={() => geoClickHandler(territory, territoryData)}
|
|
199
|
+
dataTooltipId={`tooltip__${tooltipId}`}
|
|
200
|
+
dataTooltipHtml={toolTip}
|
|
201
201
|
territory={territory}
|
|
202
202
|
territoryData={territoryData}
|
|
203
203
|
tabIndex={-1}
|
|
@@ -2,7 +2,7 @@ export const drawCircle = (circle, context, state) => {
|
|
|
2
2
|
const percentOfOriginalSize = 0.75
|
|
3
3
|
const adjustedGeoRadius =
|
|
4
4
|
state.mapPosition.zoom > 1 ? Number(circle.geoRadius) * percentOfOriginalSize : circle.geoRadius
|
|
5
|
-
context.lineWidth =
|
|
5
|
+
context.lineWidth = 1
|
|
6
6
|
context.fillStyle = circle.color
|
|
7
7
|
context.beginPath()
|
|
8
8
|
context.arc(circle.x, circle.y, adjustedGeoRadius, 0, 2 * Math.PI)
|
|
@@ -145,7 +145,7 @@ export const drawPin = (pin, ctx) => {
|
|
|
145
145
|
ctx.fillStyle = pin.color
|
|
146
146
|
ctx.fill()
|
|
147
147
|
ctx.strokeStyle = 'black'
|
|
148
|
-
ctx.lineWidth = 1
|
|
148
|
+
ctx.lineWidth = 1
|
|
149
149
|
ctx.stroke()
|
|
150
150
|
ctx.beginPath()
|
|
151
151
|
ctx.arc(0, -21, 3, 0, Math.PI * 2)
|
|
@@ -178,12 +178,13 @@ export const createShapeProperties = (type, pixelCoords, legendValues, state, ge
|
|
|
178
178
|
x: pixelCoords[0],
|
|
179
179
|
y: pixelCoords[1],
|
|
180
180
|
color: legendValues[0],
|
|
181
|
-
size: geoRadius
|
|
181
|
+
size: geoRadius,
|
|
182
|
+
lineWidth: 1
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
switch (type) {
|
|
185
186
|
case 'circle':
|
|
186
|
-
return { ...baseProps, geoRadius: geoRadius
|
|
187
|
+
return { ...baseProps, geoRadius: geoRadius, type: 'circle' }
|
|
187
188
|
case 'pin':
|
|
188
189
|
return { ...baseProps, type: 'pin' }
|
|
189
190
|
case 'square':
|
package/src/scss/filters.scss
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
.cdc-open-viz-module .cdc-map-inner-container .filters-section,
|
|
2
2
|
.cove .cdc-map-inner-container .filters-section {
|
|
3
|
-
margin-left: 1rem;
|
|
4
|
-
margin-right: 1rem;
|
|
5
3
|
|
|
6
4
|
&__title {
|
|
7
5
|
margin: 15px 0;
|
|
@@ -23,17 +21,14 @@
|
|
|
23
21
|
@include breakpoint(md) {
|
|
24
22
|
display: flex;
|
|
25
23
|
gap: 30px;
|
|
24
|
+
flex-wrap: wrap;
|
|
26
25
|
}
|
|
27
26
|
|
|
27
|
+
|
|
28
28
|
label:not(:empty) {
|
|
29
29
|
margin-right: 0.4em;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
select {
|
|
33
|
-
font-size: 1em;
|
|
34
|
-
padding-right: 5px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
32
|
.single-filter {
|
|
38
33
|
margin-bottom: 0.5em;
|
|
39
34
|
}
|
package/src/scss/main.scss
CHANGED
package/src/scss/map.scss
CHANGED
package/src/types/MapConfig.ts
CHANGED