@cdc/map 4.24.9-1 → 4.24.10
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 +22650 -22303
- package/package.json +3 -3
- package/src/CdcMap.tsx +8 -5
- package/src/_stories/CdcMap.stories.tsx +2 -6
- package/src/components/Annotation/AnnotationDropdown.styles.css +0 -1
- package/src/components/CityList.tsx +55 -10
- package/src/components/DataTable.tsx +94 -17
- package/src/components/EditorPanel/components/EditorPanel.tsx +81 -17
- package/src/components/Legend/components/Legend.tsx +0 -2
- package/src/components/Legend/components/index.scss +18 -12
- package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +2 -2
- package/src/components/UsaMap/components/UsaMap.County.tsx +48 -47
- package/src/components/UsaMap/components/UsaMap.State.tsx +2 -1
- package/src/components/UsaMap/helpers/shapes.ts +206 -0
- package/src/coreStyles_map.scss +3 -0
- package/src/data/initial-state.js +1 -0
- package/src/index.jsx +7 -1
- package/src/scss/editor-panel.scss +5 -10
- package/src/scss/main.scss +4 -5
- package/src/scss/map.scss +6 -2
- package/src/scss/mixins.scss +47 -0
- package/src/types/MapConfig.ts +5 -2
- package/src/types/MapContext.ts +0 -1
|
@@ -135,11 +135,11 @@ const TerritoryHexagon = ({ label, text, stroke, strokeWidth, textColor, territo
|
|
|
135
135
|
)
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
return (
|
|
138
|
+
return territoryData && (
|
|
139
139
|
<svg viewBox='0 0 45 51' className='territory-wrapper--hex'>
|
|
140
140
|
<g {...props}>
|
|
141
141
|
<polygon stroke={stroke} strokeWidth={strokeWidth} points='22 0 44 12.702 44 38.105 22 50.807 0 38.105 0 12.702' />
|
|
142
|
-
{state.general.displayAsHex && hexagonLabel(territoryData
|
|
142
|
+
{state.general.displayAsHex && hexagonLabel(territoryData, stroke, false)}
|
|
143
143
|
</g>
|
|
144
144
|
</svg>
|
|
145
145
|
)
|
|
@@ -11,7 +11,16 @@ import ErrorBoundary from '@cdc/core/components/ErrorBoundary'
|
|
|
11
11
|
|
|
12
12
|
import useMapLayers from '../../../hooks/useMapLayers'
|
|
13
13
|
import ConfigContext from '../../../context'
|
|
14
|
-
import
|
|
14
|
+
import {
|
|
15
|
+
drawCircle,
|
|
16
|
+
drawDiamond,
|
|
17
|
+
drawSquare,
|
|
18
|
+
drawTriangle,
|
|
19
|
+
drawPin,
|
|
20
|
+
drawStar,
|
|
21
|
+
drawShape,
|
|
22
|
+
createShapeProperties
|
|
23
|
+
} from '../helpers/shapes'
|
|
15
24
|
|
|
16
25
|
const getCountyTopoURL = year => {
|
|
17
26
|
return `https://www.cdc.gov/TemplatePackage/contrib/data/county-topography/cb_${year}_us_county_20m.json`
|
|
@@ -265,7 +274,6 @@ const CountyMap = props => {
|
|
|
265
274
|
// Redraw with focus on state
|
|
266
275
|
setFocus({ id: clickedState.id, index: focusIndex, center: geoCentroid(clickedState), feature: clickedState })
|
|
267
276
|
}
|
|
268
|
-
|
|
269
277
|
if (state.general.type === 'us-geocode') {
|
|
270
278
|
const geoRadius = (state.visual.geoCodeCircleSize || 5) * (focus.id ? 2 : 1)
|
|
271
279
|
let clickedGeo
|
|
@@ -304,7 +312,7 @@ const CountyMap = props => {
|
|
|
304
312
|
let pointCoordinates = topoData.projection.invert([x, y])
|
|
305
313
|
|
|
306
314
|
const currentTooltipIndex = parseInt(tooltipRef.current.getAttribute('data-index'))
|
|
307
|
-
const geoRadius = (state.visual.geoCodeCircleSize || 5) * 1
|
|
315
|
+
const geoRadius = (state.visual.geoCodeCircleSize || 5) * (focus.id ? 2 : 1)
|
|
308
316
|
|
|
309
317
|
const context = canvas.getContext('2d')
|
|
310
318
|
const path = geoPath(topoData.projection, context)
|
|
@@ -397,8 +405,9 @@ const CountyMap = props => {
|
|
|
397
405
|
data[runtimeKeys[i]][state.columns.longitude.name],
|
|
398
406
|
data[runtimeKeys[i]][state.columns.latitude.name]
|
|
399
407
|
])
|
|
408
|
+
let includedShapes = ['circle', 'diamond', 'star', 'triangle', 'square'].includes(state.visual.cityStyle)
|
|
400
409
|
if (
|
|
401
|
-
|
|
410
|
+
includedShapes &&
|
|
402
411
|
pixelCoords &&
|
|
403
412
|
Math.sqrt(Math.pow(pixelCoords[0] - x, 2) + Math.pow(pixelCoords[1] - y, 2)) < geoRadius &&
|
|
404
413
|
applyLegendToRow(data[runtimeKeys[i]])
|
|
@@ -530,59 +539,50 @@ const CountyMap = props => {
|
|
|
530
539
|
})
|
|
531
540
|
}
|
|
532
541
|
|
|
533
|
-
const drawPin = (pin, ctx) => {
|
|
534
|
-
ctx.save()
|
|
535
|
-
ctx.translate(pin.x, pin.y)
|
|
536
|
-
ctx.beginPath()
|
|
537
|
-
ctx.moveTo(0, 0)
|
|
538
|
-
ctx.bezierCurveTo(2, -10, -20, -25, 0, -30)
|
|
539
|
-
ctx.bezierCurveTo(20, -25, -2, -10, 0, 0)
|
|
540
|
-
ctx.fillStyle = pin.color
|
|
541
|
-
ctx.fill()
|
|
542
|
-
ctx.strokeStyle = 'black'
|
|
543
|
-
ctx.lineWidth = 1.5
|
|
544
|
-
ctx.stroke()
|
|
545
|
-
ctx.beginPath()
|
|
546
|
-
ctx.arc(0, -21, 3, 0, Math.PI * 2)
|
|
547
|
-
ctx.closePath()
|
|
548
|
-
ctx.fill()
|
|
549
|
-
ctx.restore()
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
const drawCircle = (circle, context) => {
|
|
553
|
-
const adjustedGeoRadius = Number(circle.geoRadius)
|
|
554
|
-
context.lineWidth = lineWidth
|
|
555
|
-
context.fillStyle = circle.color
|
|
556
|
-
context.beginPath()
|
|
557
|
-
context.arc(circle.x, circle.y, adjustedGeoRadius, 0, 2 * Math.PI)
|
|
558
|
-
context.fill()
|
|
559
|
-
context.stroke()
|
|
560
|
-
}
|
|
561
|
-
|
|
562
542
|
if (state.general.type === 'us-geocode') {
|
|
563
543
|
context.strokeStyle = 'black'
|
|
564
|
-
const geoRadius = state.visual.geoCodeCircleSize || 5
|
|
544
|
+
const geoRadius = (state.visual.geoCodeCircleSize || 5) * (focus.id ? 2 : 1)
|
|
545
|
+
const { additionalCityStyles } = state.visual || []
|
|
546
|
+
const cityStyles = Object.values(data)
|
|
547
|
+
.filter(d => additionalCityStyles.some(style => String(d[style.column]) === String(style.value)))
|
|
548
|
+
.map(d => {
|
|
549
|
+
const conditionsMatched = additionalCityStyles.find(
|
|
550
|
+
style => String(d[style.column]) === String(style.value)
|
|
551
|
+
)
|
|
552
|
+
return { ...conditionsMatched, ...d }
|
|
553
|
+
})
|
|
554
|
+
|
|
555
|
+
let cityPixelCoords = []
|
|
556
|
+
cityStyles.forEach(city => {
|
|
557
|
+
cityPixelCoords = topoData.projection([city[state.columns.longitude.name], city[state.columns.latitude.name]])
|
|
558
|
+
|
|
559
|
+
if (cityPixelCoords) {
|
|
560
|
+
const legendValues = applyLegendToRow(data[city?.value])
|
|
561
|
+
if (legendValues) {
|
|
562
|
+
const shapeType = city?.shape?.toLowerCase()
|
|
563
|
+
const shapeProperties = createShapeProperties(shapeType, cityPixelCoords, legendValues, state, geoRadius)
|
|
564
|
+
if (shapeProperties) {
|
|
565
|
+
drawShape(shapeProperties, context, state, lineWidth)
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
})
|
|
565
570
|
|
|
566
571
|
runtimeKeys.forEach(key => {
|
|
572
|
+
const citiesList = new Set(cityStyles.map(item => item.value))
|
|
573
|
+
|
|
567
574
|
const pixelCoords = topoData.projection([
|
|
568
575
|
data[key][state.columns.longitude.name],
|
|
569
576
|
data[key][state.columns.latitude.name]
|
|
570
577
|
])
|
|
571
|
-
|
|
572
|
-
if (pixelCoords) {
|
|
578
|
+
if (pixelCoords && !citiesList.has(key)) {
|
|
573
579
|
const legendValues = data[key] !== undefined ? applyLegendToRow(data[key]) : false
|
|
574
|
-
if (legendValues
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
geoRadius: geoRadius
|
|
580
|
+
if (legendValues) {
|
|
581
|
+
const shapeType = state.visual.cityStyle.toLowerCase()
|
|
582
|
+
const shapeProperties = createShapeProperties(shapeType, pixelCoords, legendValues, state, geoRadius)
|
|
583
|
+
if (shapeProperties) {
|
|
584
|
+
drawShape(shapeProperties, context, state, lineWidth)
|
|
580
585
|
}
|
|
581
|
-
drawCircle(circle, context)
|
|
582
|
-
}
|
|
583
|
-
if (legendValues && state.visual.cityStyle === 'pin') {
|
|
584
|
-
const pin = { x: pixelCoords[0], y: pixelCoords[1], color: legendValues[0] }
|
|
585
|
-
drawPin(pin, context)
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
588
|
})
|
|
@@ -603,6 +603,7 @@ const CountyMap = props => {
|
|
|
603
603
|
onClick={canvasClick}
|
|
604
604
|
className='county-map-canvas'
|
|
605
605
|
></canvas>
|
|
606
|
+
|
|
606
607
|
<button className={`btn btn--reset`} onClick={onReset} ref={resetButton} tabIndex='0'>
|
|
607
608
|
Reset Zoom
|
|
608
609
|
</button>
|
|
@@ -595,7 +595,8 @@ const UsaMap = () => {
|
|
|
595
595
|
|
|
596
596
|
{territories.length > 0 && (
|
|
597
597
|
<>
|
|
598
|
-
|
|
598
|
+
{/* Temporarily make the max width fit the image width */}
|
|
599
|
+
<div className='two-col' style={{ maxWidth: 'calc(100% - 75px)' }}>
|
|
599
600
|
<div>
|
|
600
601
|
<span className='territories-label label'>{state.general.territoriesLabel}</span>
|
|
601
602
|
</div>
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
export const drawCircle = (circle, context, state) => {
|
|
2
|
+
const percentOfOriginalSize = 0.75
|
|
3
|
+
const adjustedGeoRadius =
|
|
4
|
+
state.mapPosition.zoom > 1 ? Number(circle.geoRadius) * percentOfOriginalSize : circle.geoRadius
|
|
5
|
+
context.lineWidth = 3
|
|
6
|
+
context.fillStyle = circle.color
|
|
7
|
+
context.beginPath()
|
|
8
|
+
context.arc(circle.x, circle.y, adjustedGeoRadius, 0, 2 * Math.PI)
|
|
9
|
+
context.fill()
|
|
10
|
+
context.stroke()
|
|
11
|
+
}
|
|
12
|
+
export const drawSquare = (square, context, state) => {
|
|
13
|
+
const percentOfOriginalSize = 0.75
|
|
14
|
+
const sideLength = square.size
|
|
15
|
+
|
|
16
|
+
const adjustedSize = state.mapPosition.zoom > 1 ? sideLength * percentOfOriginalSize : sideLength
|
|
17
|
+
|
|
18
|
+
context.lineWidth = square.lineWidth
|
|
19
|
+
context.fillStyle = square.color
|
|
20
|
+
context.beginPath()
|
|
21
|
+
|
|
22
|
+
const halfSize = adjustedSize / 2
|
|
23
|
+
const topLeftX = square.x - halfSize
|
|
24
|
+
const topLeftY = square.y - halfSize
|
|
25
|
+
|
|
26
|
+
context.rect(topLeftX, topLeftY, adjustedSize, adjustedSize)
|
|
27
|
+
context.fill()
|
|
28
|
+
context.stroke()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const drawDiamond = (diamond, context, state) => {
|
|
32
|
+
const percentOfOriginalSize = 0.75
|
|
33
|
+
const fullSize = diamond.size
|
|
34
|
+
|
|
35
|
+
const adjustedSize = state.mapPosition.zoom > 1 ? fullSize * percentOfOriginalSize : fullSize
|
|
36
|
+
|
|
37
|
+
context.lineWidth = diamond.lineWidth
|
|
38
|
+
context.fillStyle = diamond.color
|
|
39
|
+
context.beginPath()
|
|
40
|
+
|
|
41
|
+
// Calculate the vertices of the diamond
|
|
42
|
+
|
|
43
|
+
const Ax = diamond.x
|
|
44
|
+
const Ay = diamond.y - adjustedSize / 2
|
|
45
|
+
|
|
46
|
+
// Vertex B (right vertex)
|
|
47
|
+
const Bx = diamond.x + adjustedSize / 2
|
|
48
|
+
const By = diamond.y
|
|
49
|
+
|
|
50
|
+
// Vertex C (bottom vertex)
|
|
51
|
+
const Cx = diamond.x
|
|
52
|
+
const Cy = diamond.y + adjustedSize / 2
|
|
53
|
+
|
|
54
|
+
// Vertex D (left vertex)
|
|
55
|
+
const Dx = diamond.x - adjustedSize / 2
|
|
56
|
+
const Dy = diamond.y
|
|
57
|
+
|
|
58
|
+
// Draw the diamond
|
|
59
|
+
context.moveTo(Ax, Ay)
|
|
60
|
+
context.lineTo(Bx, By)
|
|
61
|
+
context.lineTo(Cx, Cy)
|
|
62
|
+
context.lineTo(Dx, Dy)
|
|
63
|
+
context.closePath()
|
|
64
|
+
context.fill()
|
|
65
|
+
context.stroke()
|
|
66
|
+
}
|
|
67
|
+
export const drawTriangle = (triangle, context, state) => {
|
|
68
|
+
const percentOfOriginalSize = 0.75
|
|
69
|
+
const baseLength = triangle.size
|
|
70
|
+
|
|
71
|
+
// Adjust the size
|
|
72
|
+
const adjustedSize = state.mapPosition.zoom > 1 ? baseLength * percentOfOriginalSize : baseLength
|
|
73
|
+
|
|
74
|
+
// Calculate height
|
|
75
|
+
const height = (adjustedSize * Math.sqrt(3)) / 2
|
|
76
|
+
|
|
77
|
+
context.lineWidth = triangle.lineWidth
|
|
78
|
+
context.fillStyle = triangle.color
|
|
79
|
+
context.beginPath()
|
|
80
|
+
|
|
81
|
+
// Calculatef the triangle
|
|
82
|
+
const Ax = triangle.x
|
|
83
|
+
const Ay = triangle.y - height / 2
|
|
84
|
+
|
|
85
|
+
const Bx = triangle.x - adjustedSize / 2
|
|
86
|
+
const By = triangle.y + height / 2
|
|
87
|
+
|
|
88
|
+
const Cx = triangle.x + adjustedSize / 2
|
|
89
|
+
const Cy = By
|
|
90
|
+
|
|
91
|
+
// Draw the triangle
|
|
92
|
+
context.moveTo(Ax, Ay)
|
|
93
|
+
context.lineTo(Bx, By)
|
|
94
|
+
context.lineTo(Cx, Cy)
|
|
95
|
+
context.closePath()
|
|
96
|
+
context.fill()
|
|
97
|
+
context.stroke()
|
|
98
|
+
}
|
|
99
|
+
export const drawStar = (star, context, state) => {
|
|
100
|
+
const percentOfOriginalSize = 0.75
|
|
101
|
+
const spikes = star.spikes
|
|
102
|
+
const outerRadius = star.outerRadius
|
|
103
|
+
const innerRadius = star.innerRadius
|
|
104
|
+
|
|
105
|
+
const adjustedOuterRadius = state.mapPosition.zoom > 1 ? outerRadius * percentOfOriginalSize : outerRadius
|
|
106
|
+
const adjustedInnerRadius = state.mapPosition.zoom > 1 ? innerRadius * percentOfOriginalSize : innerRadius
|
|
107
|
+
|
|
108
|
+
context.lineWidth = star.lineWidth
|
|
109
|
+
context.fillStyle = star.color
|
|
110
|
+
context.beginPath()
|
|
111
|
+
|
|
112
|
+
let rot = (Math.PI / 2) * 3
|
|
113
|
+
let step = Math.PI / spikes
|
|
114
|
+
|
|
115
|
+
// Starting coordinates for the first point
|
|
116
|
+
let x = star.x
|
|
117
|
+
let y = star.y
|
|
118
|
+
context.moveTo(x, y - adjustedOuterRadius)
|
|
119
|
+
|
|
120
|
+
for (let i = 0; i < spikes; i++) {
|
|
121
|
+
x = star.x + Math.cos(rot) * adjustedOuterRadius
|
|
122
|
+
y = star.y + Math.sin(rot) * adjustedOuterRadius
|
|
123
|
+
context.lineTo(x, y)
|
|
124
|
+
rot += step
|
|
125
|
+
|
|
126
|
+
x = star.x + Math.cos(rot) * adjustedInnerRadius
|
|
127
|
+
y = star.y + Math.sin(rot) * adjustedInnerRadius
|
|
128
|
+
context.lineTo(x, y)
|
|
129
|
+
rot += step
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
context.lineTo(star.x, star.y - adjustedOuterRadius)
|
|
133
|
+
context.closePath()
|
|
134
|
+
context.fill()
|
|
135
|
+
context.stroke()
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export const drawPin = (pin, ctx) => {
|
|
139
|
+
ctx.save()
|
|
140
|
+
ctx.translate(pin.x, pin.y)
|
|
141
|
+
ctx.beginPath()
|
|
142
|
+
ctx.moveTo(0, 0)
|
|
143
|
+
ctx.bezierCurveTo(2, -10, -20, -25, 0, -30)
|
|
144
|
+
ctx.bezierCurveTo(20, -25, -2, -10, 0, 0)
|
|
145
|
+
ctx.fillStyle = pin.color
|
|
146
|
+
ctx.fill()
|
|
147
|
+
ctx.strokeStyle = 'black'
|
|
148
|
+
ctx.lineWidth = 1.5
|
|
149
|
+
ctx.stroke()
|
|
150
|
+
ctx.beginPath()
|
|
151
|
+
ctx.arc(0, -21, 3, 0, Math.PI * 2)
|
|
152
|
+
ctx.closePath()
|
|
153
|
+
ctx.fill()
|
|
154
|
+
ctx.restore()
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export const drawShape = (shape, context, state, additionalParams) => {
|
|
158
|
+
const shapeMap = {
|
|
159
|
+
circle: drawCircle,
|
|
160
|
+
square: drawSquare,
|
|
161
|
+
diamond: drawDiamond,
|
|
162
|
+
triangle: drawTriangle,
|
|
163
|
+
star: drawStar,
|
|
164
|
+
pin: drawPin
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const drawFunction = shapeMap[shape.type]
|
|
168
|
+
|
|
169
|
+
if (drawFunction) {
|
|
170
|
+
drawFunction(shape, context, state, additionalParams)
|
|
171
|
+
} else {
|
|
172
|
+
console.error('Shape type not recognized or draw function not available:', shape.type)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export const createShapeProperties = (type, pixelCoords, legendValues, state, geoRadius) => {
|
|
177
|
+
const baseProps = {
|
|
178
|
+
x: pixelCoords[0],
|
|
179
|
+
y: pixelCoords[1],
|
|
180
|
+
color: legendValues[0],
|
|
181
|
+
size: geoRadius
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
switch (type) {
|
|
185
|
+
case 'circle':
|
|
186
|
+
return { ...baseProps, geoRadius: geoRadius / 2, type: 'circle' }
|
|
187
|
+
case 'pin':
|
|
188
|
+
return { ...baseProps, type: 'pin' }
|
|
189
|
+
case 'square':
|
|
190
|
+
return { ...baseProps, type: 'square' }
|
|
191
|
+
case 'triangle':
|
|
192
|
+
return { ...baseProps, type: 'triangle' }
|
|
193
|
+
case 'diamond':
|
|
194
|
+
return { ...baseProps, type: 'diamond' }
|
|
195
|
+
case 'star':
|
|
196
|
+
return {
|
|
197
|
+
...baseProps,
|
|
198
|
+
spikes: 5,
|
|
199
|
+
outerRadius: state.visual.geoCodeCircleSize / 3,
|
|
200
|
+
innerRadius: (state.visual.geoCodeCircleSize / 3) * 2,
|
|
201
|
+
type: 'star'
|
|
202
|
+
}
|
|
203
|
+
default:
|
|
204
|
+
return null
|
|
205
|
+
}
|
|
206
|
+
}
|
package/src/index.jsx
CHANGED
|
@@ -4,6 +4,7 @@ import ReactDOM from 'react-dom/client'
|
|
|
4
4
|
import CdcMap from './CdcMap'
|
|
5
5
|
|
|
6
6
|
import 'react-tooltip/dist/react-tooltip.css'
|
|
7
|
+
import './coreStyles_map.scss'
|
|
7
8
|
|
|
8
9
|
let isEditor = window.location.href.includes('editor=true')
|
|
9
10
|
let isDebug = window.location.href.includes('debug=true')
|
|
@@ -11,6 +12,11 @@ let domContainer = document.getElementsByClassName('react-container')[0]
|
|
|
11
12
|
|
|
12
13
|
ReactDOM.createRoot(domContainer).render(
|
|
13
14
|
<React.StrictMode>
|
|
14
|
-
<CdcMap
|
|
15
|
+
<CdcMap
|
|
16
|
+
isEditor={isEditor}
|
|
17
|
+
isDebug={isDebug}
|
|
18
|
+
configUrl={domContainer.attributes['data-config'].value}
|
|
19
|
+
containerEl={domContainer}
|
|
20
|
+
/>
|
|
15
21
|
</React.StrictMode>
|
|
16
22
|
)
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
.geo-buttons {
|
|
19
19
|
list-style: none;
|
|
20
20
|
display: flex;
|
|
21
|
-
color:
|
|
21
|
+
color: var(--mediumGray);
|
|
22
22
|
svg {
|
|
23
23
|
display: block;
|
|
24
24
|
max-width: 80px;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
background: transparent;
|
|
34
34
|
padding: 0.3em 0.75em;
|
|
35
35
|
display: flex;
|
|
36
|
-
border:
|
|
36
|
+
border: var(--lightGray) 1px solid;
|
|
37
37
|
width: 40%;
|
|
38
38
|
align-items: center;
|
|
39
39
|
margin-right: 1em;
|
|
@@ -110,11 +110,6 @@
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
.editor-panel {
|
|
113
|
-
//TODO: Remove after COVE refactor
|
|
114
|
-
&.cove {
|
|
115
|
-
@import '@cdc/core/styles/v2/layout/tooltip.scss';
|
|
116
|
-
}
|
|
117
|
-
|
|
118
113
|
.cove-input-group,
|
|
119
114
|
.cove-accordion__small-inputs {
|
|
120
115
|
position: relative;
|
|
@@ -191,10 +186,10 @@
|
|
|
191
186
|
}
|
|
192
187
|
|
|
193
188
|
.accordion__heading {
|
|
194
|
-
background:
|
|
189
|
+
background: var(--lightestGray);
|
|
195
190
|
}
|
|
196
191
|
.form-container {
|
|
197
|
-
border-right:
|
|
192
|
+
border-right: var(--lightGray) 1px solid;
|
|
198
193
|
flex-grow: 1;
|
|
199
194
|
}
|
|
200
195
|
.guidance-link {
|
|
@@ -207,7 +202,7 @@
|
|
|
207
202
|
}
|
|
208
203
|
svg {
|
|
209
204
|
width: 60px;
|
|
210
|
-
color:
|
|
205
|
+
color: var(--blue);
|
|
211
206
|
margin-right: 1rem;
|
|
212
207
|
height: 60px; // IE11
|
|
213
208
|
path {
|
package/src/scss/main.scss
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
@import '
|
|
2
|
-
|
|
1
|
+
@import 'mixins';
|
|
2
|
+
|
|
3
3
|
@import 'variables';
|
|
4
4
|
@import 'editor-panel';
|
|
5
5
|
@import 'filters';
|
|
6
|
-
@import '@cdc/core/styles/v2/components/ui/tooltip';
|
|
7
6
|
|
|
8
7
|
.type-map--has-error {
|
|
9
8
|
overflow: hidden !important;
|
|
@@ -39,7 +38,7 @@
|
|
|
39
38
|
|
|
40
39
|
@include breakpointClass(md) {
|
|
41
40
|
.map-container.modal-background::before {
|
|
42
|
-
border-bottom:
|
|
41
|
+
border-bottom: var(--lightGray) 1px solid;
|
|
43
42
|
margin-bottom: -1px;
|
|
44
43
|
bottom: 1px;
|
|
45
44
|
}
|
|
@@ -194,7 +193,7 @@
|
|
|
194
193
|
padding: 1em;
|
|
195
194
|
z-index: 6;
|
|
196
195
|
width: 100%;
|
|
197
|
-
border-top:
|
|
196
|
+
border-top: var(--lightGray) 1px solid;
|
|
198
197
|
label {
|
|
199
198
|
flex-grow: 1;
|
|
200
199
|
> div.select-heading {
|
package/src/scss/map.scss
CHANGED
|
@@ -31,7 +31,7 @@ header + .map-container.full-border {
|
|
|
31
31
|
// World Specific Styles
|
|
32
32
|
.map-container.world {
|
|
33
33
|
&.data .geography-container {
|
|
34
|
-
border-bottom:
|
|
34
|
+
border-bottom: var(--lightGray) 1px solid;
|
|
35
35
|
}
|
|
36
36
|
.geography-container {
|
|
37
37
|
cursor: move;
|
|
@@ -129,6 +129,7 @@ $medium: 768px;
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.territories-label {
|
|
132
|
+
color: black;
|
|
132
133
|
margin: 2em 5px 2em 1em;
|
|
133
134
|
font-size: 1.1em;
|
|
134
135
|
display: block;
|
|
@@ -158,13 +159,16 @@ $medium: 768px;
|
|
|
158
159
|
&--mobile {
|
|
159
160
|
@extend .territories;
|
|
160
161
|
width: 60%;
|
|
162
|
+
svg {
|
|
163
|
+
margin-bottom: 0.5em;
|
|
164
|
+
}
|
|
161
165
|
}
|
|
162
166
|
|
|
163
167
|
&--tablet {
|
|
164
168
|
@extend .territories;
|
|
165
169
|
width: 70%;
|
|
166
170
|
svg {
|
|
167
|
-
margin-bottom: 0.
|
|
171
|
+
margin-bottom: 0.5em;
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@mixin breakpoint($class) {
|
|
2
|
+
@if $class == xs {
|
|
3
|
+
@media (max-width: 767px) {
|
|
4
|
+
@content;
|
|
5
|
+
}
|
|
6
|
+
} @else if $class == sm {
|
|
7
|
+
@media (min-width: 768px) {
|
|
8
|
+
@content;
|
|
9
|
+
}
|
|
10
|
+
} @else if $class == md {
|
|
11
|
+
@media (min-width: 960px) {
|
|
12
|
+
@content;
|
|
13
|
+
}
|
|
14
|
+
} @else if $class == lg {
|
|
15
|
+
@media (min-width: 1300px) {
|
|
16
|
+
@content;
|
|
17
|
+
}
|
|
18
|
+
} @else {
|
|
19
|
+
@warn "Breakpoint mixin supports: xs, sm, md, lg";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin breakpointClass($class) {
|
|
24
|
+
@if $class == xs {
|
|
25
|
+
&.xs,
|
|
26
|
+
&.xxs {
|
|
27
|
+
@content;
|
|
28
|
+
}
|
|
29
|
+
} @else if $class == sm {
|
|
30
|
+
&.sm,
|
|
31
|
+
&.md,
|
|
32
|
+
&.lg {
|
|
33
|
+
@content;
|
|
34
|
+
}
|
|
35
|
+
} @else if $class == md {
|
|
36
|
+
&.md,
|
|
37
|
+
&.lg {
|
|
38
|
+
@content;
|
|
39
|
+
}
|
|
40
|
+
} @else if $class == lg {
|
|
41
|
+
&.lg {
|
|
42
|
+
@content;
|
|
43
|
+
}
|
|
44
|
+
} @else {
|
|
45
|
+
@warn "Breakpoint Class mixin supports: xs, sm, md, lg";
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/types/MapConfig.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type MapVisualSettings = {
|
|
|
10
10
|
/** extraBubbleBorder - Bubble Maps > adds a white circle around the bubble to show contrast on other bubbles */
|
|
11
11
|
extraBubbleBorder: boolean
|
|
12
12
|
/** cityStyle - visual indicator of cities on state maps */
|
|
13
|
-
cityStyle: 'circle' | 'pin'
|
|
13
|
+
cityStyle: 'circle' | 'pin' | 'star' | 'diamond' | 'triangle' | 'square'
|
|
14
14
|
/** cityStyle - optional visual indicator of label on the Legend */
|
|
15
15
|
cityStyleLabel: string
|
|
16
16
|
/** geoCodeCircleSize - controls the size of the city style option (circle or pin) */
|
|
@@ -40,7 +40,10 @@ export type GeoColumnProperties = Pick<EditorColumnProperties, 'name' | 'label'
|
|
|
40
40
|
export type LatitudeColumnProperties = Pick<EditorColumnProperties, 'name'>
|
|
41
41
|
export type LongitudeColumnProperties = Pick<EditorColumnProperties, 'name'>
|
|
42
42
|
export type NavigateColumnProperties = Pick<EditorColumnProperties, 'name'>
|
|
43
|
-
export type PrimaryColumnProperties = Pick<
|
|
43
|
+
export type PrimaryColumnProperties = Pick<
|
|
44
|
+
EditorColumnProperties,
|
|
45
|
+
'dataTable' | 'label' | 'name' | 'prefix' | 'suffix' | 'tooltip'
|
|
46
|
+
>
|
|
44
47
|
export type ViewportSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg'
|
|
45
48
|
export type LegendShapeItem = {
|
|
46
49
|
column: string
|