@cdc/map 4.25.3 → 4.25.6
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/.idea/map.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/cdcmap.js +31254 -32242
- package/examples/hex-colors.json +3 -3
- package/examples/m2.json +32904 -0
- package/examples/private/test.json +470 -1457
- package/examples/private/{mmr.json → wastewatermap.json} +86 -115
- package/index.html +36 -63
- package/package.json +7 -19
- package/src/CdcMap.tsx +56 -1552
- package/src/CdcMapComponent.tsx +608 -0
- package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +10 -0
- package/src/_stories/CdcMap.Legend.stories.tsx +67 -0
- package/src/_stories/CdcMap.Table.stories.tsx +19 -0
- package/src/_stories/CdcMap.stories.tsx +12 -1
- package/src/_stories/UsaMap.NoData.stories.tsx +4 -4
- package/src/_stories/_mock/default-patterns.json +8 -5
- package/src/_stories/_mock/legend-bins.json +428 -0
- package/{examples/private/default-patterns.json → src/_stories/_mock/legends/legend-tests.json} +36 -131
- package/src/cdcMapComponent.styles.css +9 -0
- package/src/components/Annotation/Annotation.Draggable.tsx +27 -26
- package/src/components/Annotation/AnnotationDropdown.tsx +5 -6
- package/src/components/BubbleList.tsx +135 -49
- package/src/components/CityList.tsx +89 -87
- package/src/components/DataTable.tsx +8 -8
- package/src/components/EditorPanel/components/EditorPanel.tsx +823 -885
- package/src/components/EditorPanel/components/Error.tsx +9 -2
- package/src/components/EditorPanel/components/HexShapeSettings.tsx +127 -141
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +55 -86
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +89 -75
- package/src/components/EditorPanel/components/editorPanel.styles.css +95 -0
- package/src/components/Geo.tsx +9 -1
- package/src/components/GoogleMap/components/GoogleMap.tsx +1 -1
- package/src/components/Legend/components/Legend.tsx +92 -87
- package/src/components/Legend/components/LegendGroup/Legend.Group.tsx +128 -0
- package/src/components/Legend/components/LegendGroup/legend.group.css +27 -0
- package/src/components/Legend/components/LegendItem.Hex.tsx +4 -1
- package/src/components/Legend/components/index.scss +74 -17
- package/src/components/Modal.tsx +17 -7
- package/src/components/NavigationMenu.tsx +11 -9
- package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +12 -8
- package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +4 -4
- package/src/components/UsaMap/components/TerritoriesSection.tsx +33 -10
- package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +12 -10
- package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +12 -14
- package/src/components/UsaMap/components/Territory/TerritoryShape.ts +2 -1
- package/src/components/UsaMap/components/UsaMap.County.tsx +138 -96
- package/src/components/UsaMap/components/UsaMap.Region.styles.css +72 -0
- package/src/components/UsaMap/components/UsaMap.Region.tsx +56 -103
- package/src/components/UsaMap/components/UsaMap.SingleState.styles.css +10 -0
- package/src/components/UsaMap/components/UsaMap.SingleState.tsx +65 -74
- package/src/components/UsaMap/components/UsaMap.State.tsx +112 -91
- package/src/components/UsaMap/helpers/map.ts +1 -1
- package/src/components/UsaMap/helpers/shapes.ts +20 -7
- package/src/components/WorldMap/WorldMap.tsx +64 -118
- package/src/components/WorldMap/worldMap.styles.css +28 -0
- package/src/components/ZoomControls.tsx +15 -13
- package/src/components/zoomControls.styles.css +53 -0
- package/src/context.ts +17 -9
- package/src/data/initial-state.js +5 -2
- package/src/helpers/addUIDs.ts +150 -0
- package/src/helpers/applyColorToLegend.ts +39 -64
- package/src/helpers/applyLegendToRow.ts +51 -0
- package/src/helpers/colorDistributions.ts +12 -0
- package/src/helpers/constants.ts +44 -0
- package/src/helpers/displayGeoName.ts +9 -2
- package/src/helpers/formatLegendLocation.ts +3 -2
- package/src/helpers/generateColorsArray.ts +2 -1
- package/src/helpers/generateRuntimeData.ts +78 -0
- package/src/helpers/generateRuntimeFilters.ts +63 -0
- package/src/helpers/generateRuntimeLegend.ts +566 -0
- package/src/helpers/generateRuntimeLegendHash.ts +16 -15
- package/src/helpers/getColumnNames.ts +19 -0
- package/src/helpers/getMapContainerClasses.ts +23 -0
- package/src/helpers/getStatePicked.ts +8 -0
- package/src/helpers/handleMapTabbing.ts +31 -0
- package/src/helpers/hashObj.ts +1 -1
- package/src/helpers/index.ts +22 -0
- package/src/helpers/navigationHandler.ts +3 -3
- package/src/helpers/resetLegendToggles.ts +13 -0
- package/src/helpers/setBinNumbers.ts +5 -0
- package/src/helpers/sortSpecialClassesLast.ts +7 -0
- package/src/helpers/tests/getColumnNames.test.ts +52 -0
- package/src/helpers/titleCase.ts +1 -1
- package/src/helpers/toggleLegendActive.ts +25 -0
- package/src/hooks/useApplyTooltipsToGeo.tsx +51 -0
- package/src/hooks/useColumnsRequiredChecker.ts +51 -0
- package/src/hooks/useGeoClickHandler.ts +45 -0
- package/src/hooks/useLegendSeparators.ts +26 -0
- package/src/hooks/useMapLayers.tsx +34 -60
- package/src/hooks/useModal.ts +22 -0
- package/src/hooks/useResizeObserver.ts +4 -5
- package/src/hooks/useStateZoom.tsx +52 -75
- package/src/hooks/useTooltip.ts +2 -3
- package/src/index.jsx +3 -9
- package/src/scss/editor-panel.scss +3 -99
- package/src/scss/main.scss +1 -19
- package/src/scss/map.scss +15 -220
- package/src/store/map.actions.ts +46 -0
- package/src/store/map.reducer.ts +96 -0
- package/src/types/Annotations.ts +24 -0
- package/src/types/MapConfig.ts +23 -3
- package/src/types/MapContext.ts +36 -35
- package/src/types/Modal.ts +1 -0
- package/src/types/RuntimeData.ts +3 -0
- package/examples/private/DEV-9644.json +0 -184
- package/examples/private/DEV-9989.json +0 -229
- package/examples/private/ardi.json +0 -180
- package/examples/private/colors 2.json +0 -416
- package/examples/private/colors.json +0 -416
- package/examples/private/colors.json.zip +0 -0
- package/examples/private/customColors.json +0 -45348
- package/examples/test.json +0 -183
- package/src/helpers/closeModal.ts +0 -9
- package/src/scss/btn.scss +0 -69
- package/src/scss/filters.scss +0 -27
- package/src/scss/variables.scss +0 -1
- /package/src/hooks/{useActiveElement.js → useActiveElement.ts} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { useContext, useEffect
|
|
2
|
-
import ConfigContext from '../context'
|
|
3
|
-
import { geoAlbersUsaTerritories
|
|
1
|
+
import { useContext, useEffect } from 'react'
|
|
2
|
+
import ConfigContext, { MapDispatchContext } from '../context'
|
|
3
|
+
import { geoAlbersUsaTerritories } from 'd3-composite-projections'
|
|
4
4
|
import { MapContext } from '../types/MapContext'
|
|
5
5
|
import { geoPath, GeoPath } from 'd3-geo'
|
|
6
|
-
import _ from 'lodash'
|
|
7
6
|
import { getFilterControllingStatePicked } from '../components/UsaMap/helpers/map'
|
|
8
7
|
import { supportedStatesFipsCodes } from '../data/supported-geos'
|
|
8
|
+
import { SVG_HEIGHT, SVG_WIDTH, SVG_PADDING } from '../helpers'
|
|
9
|
+
import _ from 'lodash'
|
|
9
10
|
|
|
10
11
|
interface StateData {
|
|
11
12
|
geometry: { type: 'MultiPolygon'; coordinates: number[][][][] }
|
|
@@ -16,113 +17,89 @@ interface StateData {
|
|
|
16
17
|
type: 'Feature'
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
interface Position {
|
|
20
|
-
zoom: number
|
|
21
|
-
coordinates: [number, number]
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
const useSetScaleAndTranslate = (topoData: { states: StateData[] }) => {
|
|
25
|
-
const {
|
|
26
|
-
const statePicked = getFilterControllingStatePicked(
|
|
27
|
-
const
|
|
21
|
+
const { config, runtimeData, position } = useContext<MapContext>(ConfigContext)
|
|
22
|
+
const statePicked = getFilterControllingStatePicked(config, runtimeData)
|
|
23
|
+
const dispatch = useContext(MapDispatchContext)
|
|
24
|
+
|
|
28
25
|
useEffect(() => {
|
|
29
26
|
const fipsCode = Object.keys(supportedStatesFipsCodes).find(key => supportedStatesFipsCodes[key] === statePicked)
|
|
30
27
|
const stateName = statePicked
|
|
31
28
|
const stateData = { fipsCode, stateName }
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
setStateToShow(topoData?.states?.find(s => s.properties.name === statePicked))
|
|
29
|
+
const newConfig = _.cloneDeep(config)
|
|
30
|
+
newConfig.general.statePicked = stateData
|
|
31
|
+
const stateToShow = topoData?.states?.find(s => s.properties.name === statePicked)
|
|
32
|
+
|
|
33
|
+
dispatch({ type: 'SET_SCALE', payload: 1 })
|
|
34
|
+
dispatch({ type: 'SET_TRANSLATE', payload: [0, 0] })
|
|
35
|
+
dispatch({ type: 'SET_CONFIG', payload: newConfig })
|
|
36
|
+
dispatch({ type: 'SET_STATE_TO_SHOW', payload: stateToShow })
|
|
42
37
|
}, [topoData])
|
|
43
38
|
|
|
44
39
|
useEffect(() => {
|
|
45
40
|
const fipsCode = Object.keys(supportedStatesFipsCodes).find(key => supportedStatesFipsCodes[key] === statePicked)
|
|
46
41
|
const stateName = statePicked
|
|
47
42
|
const stateData = { fipsCode, stateName }
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
general: {
|
|
52
|
-
...state.general,
|
|
53
|
-
statePicked: stateData
|
|
54
|
-
}
|
|
55
|
-
})
|
|
43
|
+
const newConfig = _.cloneDeep(config)
|
|
44
|
+
newConfig.general.statePicked = stateData
|
|
45
|
+
dispatch({ type: 'SET_CONFIG', payload: newConfig })
|
|
56
46
|
setScaleAndTranslate('reset')
|
|
57
47
|
}, [statePicked])
|
|
58
48
|
|
|
59
|
-
// SVG ITEMS
|
|
60
|
-
const WIDTH = 880
|
|
61
|
-
const HEIGHT = 500
|
|
62
|
-
const PADDING = 50
|
|
63
|
-
|
|
64
49
|
// TODO: same as city list projection?
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
.scale(1)
|
|
69
|
-
)
|
|
50
|
+
const projection = geoAlbersUsaTerritories()
|
|
51
|
+
.translate([SVG_WIDTH / 2, SVG_HEIGHT / 2])
|
|
52
|
+
.scale(1)
|
|
70
53
|
|
|
71
|
-
/*
|
|
72
|
-
NORMALIZATION_FACTOR NOTES:
|
|
73
|
-
This is used during state switching,
|
|
74
|
-
I'm not sure why the value is 1070 but it does appear to work during the switching.
|
|
75
|
-
During zoom it does not work.
|
|
76
|
-
*/
|
|
77
|
-
const NORMALIZATION_FACTOR = 1070
|
|
78
54
|
const _statePickedData = topoData?.states?.find(s => s.properties.name === statePicked)
|
|
79
55
|
const newProjection = projection.fitExtent(
|
|
80
56
|
[
|
|
81
|
-
[
|
|
82
|
-
[
|
|
57
|
+
[SVG_PADDING, SVG_PADDING],
|
|
58
|
+
[SVG_WIDTH - SVG_PADDING, SVG_HEIGHT - SVG_PADDING]
|
|
83
59
|
],
|
|
84
60
|
_statePickedData
|
|
85
61
|
)
|
|
86
62
|
|
|
87
63
|
// Work for centering the state.
|
|
88
|
-
const newScale = newProjection.scale()
|
|
89
|
-
const normalizedScale = newScale / NORMALIZATION_FACTOR
|
|
90
64
|
let [x, y] = newProjection.translate()
|
|
91
|
-
x = x -
|
|
92
|
-
y = y -
|
|
65
|
+
x = x - SVG_WIDTH / 2
|
|
66
|
+
y = y - SVG_HEIGHT / 2
|
|
93
67
|
|
|
94
68
|
const path: GeoPath = geoPath().projection(projection)
|
|
95
69
|
const featureCenter = path.centroid(_statePickedData)
|
|
96
70
|
const stateCenter = newProjection.invert(featureCenter)
|
|
97
71
|
|
|
98
72
|
const switchState = () => {
|
|
99
|
-
|
|
73
|
+
dispatch({ type: 'SET_STATE_TO_SHOW', payload: _statePickedData })
|
|
100
74
|
setScaleAndTranslate('reset')
|
|
101
75
|
}
|
|
102
76
|
|
|
103
77
|
const setScaleAndTranslate = (zoomFunction: string = '') => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
78
|
+
const _prevPosition = position
|
|
79
|
+
let newZoom = _prevPosition.zoom
|
|
80
|
+
let newCoordinates = _prevPosition.coordinates
|
|
81
|
+
if (zoomFunction === 'zoomIn' && _prevPosition.zoom < 4) {
|
|
82
|
+
newZoom = _prevPosition.zoom * 1.5
|
|
83
|
+
newCoordinates =
|
|
84
|
+
_prevPosition.coordinates[0] !== 0 && _prevPosition.coordinates[1] !== 0
|
|
85
|
+
? _prevPosition.coordinates
|
|
86
|
+
: stateCenter
|
|
87
|
+
} else if (zoomFunction === 'zoomOut' && _prevPosition.zoom > 1) {
|
|
88
|
+
newZoom = _prevPosition.zoom / 1.5
|
|
89
|
+
newCoordinates =
|
|
90
|
+
_prevPosition.coordinates[0] !== 0 && _prevPosition.coordinates[1] !== 0
|
|
91
|
+
? _prevPosition.coordinates
|
|
92
|
+
: stateCenter
|
|
93
|
+
} else if (zoomFunction === 'reset') {
|
|
94
|
+
newZoom = 1
|
|
95
|
+
newCoordinates = stateCenter
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
dispatch({ type: 'SET_POSITION', payload: { coordinates: newCoordinates, zoom: newZoom } })
|
|
122
99
|
|
|
123
100
|
if (zoomFunction === 'reset') {
|
|
124
|
-
|
|
125
|
-
|
|
101
|
+
dispatch({ type: 'SET_TRANSLATE', payload: [0, 0] }) // needed for state switcher
|
|
102
|
+
dispatch({ type: 'SET_SCALE', payload: 1 }) // needed for state switcher
|
|
126
103
|
}
|
|
127
104
|
}
|
|
128
105
|
|
|
@@ -135,7 +112,7 @@ const useSetScaleAndTranslate = (topoData: { states: StateData[] }) => {
|
|
|
135
112
|
}
|
|
136
113
|
|
|
137
114
|
const handleMoveEnd = position => {
|
|
138
|
-
|
|
115
|
+
dispatch({ type: 'SET_POSITION', payload: position })
|
|
139
116
|
}
|
|
140
117
|
|
|
141
118
|
const handleReset = () => {
|
package/src/hooks/useTooltip.ts
CHANGED
|
@@ -2,9 +2,8 @@ import { displayDataAsText } from '../../../core/helpers/displayDataAsText'
|
|
|
2
2
|
import { displayGeoName } from '../helpers/displayGeoName'
|
|
3
3
|
|
|
4
4
|
const useTooltip = props => {
|
|
5
|
-
const {
|
|
5
|
+
const { config, supportedStatesFipsCodes } = props
|
|
6
6
|
|
|
7
|
-
const config = state
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* On county maps there's a need to append the state name
|
|
@@ -108,7 +107,7 @@ const useTooltip = props => {
|
|
|
108
107
|
let tooltipValue = handleTooltipSpecialClassText(specialClasses, column, row, '', columnKey)
|
|
109
108
|
|
|
110
109
|
if (!tooltipValue) {
|
|
111
|
-
tooltipValue = row ? displayDataAsText(row[column.name], columnKey,
|
|
110
|
+
tooltipValue = row ? displayDataAsText(row[column.name], columnKey, config) : 'No Data'
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
toolTipText += handleTooltipPrimaryColumn(tooltipValue, column)
|
package/src/index.jsx
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import ReactDOM from 'react-dom/client'
|
|
3
3
|
|
|
4
|
-
import CdcMap from './CdcMap'
|
|
5
|
-
|
|
6
4
|
import '@cdc/core/styles/cove-main.scss'
|
|
7
5
|
import 'react-tooltip/dist/react-tooltip.css'
|
|
8
6
|
import './coreStyles_map.scss'
|
|
9
7
|
|
|
8
|
+
import CdcMap from './CdcMap'
|
|
9
|
+
|
|
10
10
|
let isEditor = window.location.href.includes('editor=true')
|
|
11
|
-
let isDebug = window.location.href.includes('debug=true')
|
|
12
11
|
let domContainer = document.getElementsByClassName('react-container')[0]
|
|
13
12
|
|
|
14
13
|
ReactDOM.createRoot(domContainer).render(
|
|
15
14
|
<React.StrictMode>
|
|
16
|
-
<CdcMap
|
|
17
|
-
isEditor={isEditor}
|
|
18
|
-
isDebug={isDebug}
|
|
19
|
-
configUrl={domContainer.attributes['data-config'].value}
|
|
20
|
-
containerEl={domContainer}
|
|
21
|
-
/>
|
|
15
|
+
<CdcMap isEditor={isEditor} configUrl={domContainer.attributes['data-config'].value} containerEl={domContainer} />
|
|
22
16
|
</React.StrictMode>
|
|
23
17
|
)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
cursor: default !important;
|
|
8
8
|
appearance: auto !important;
|
|
9
9
|
box-sizing: border-box !important;
|
|
10
|
-
margin: 3px 3px
|
|
10
|
+
margin: 3px 3px 0 5px !important;
|
|
11
11
|
padding: initial !important;
|
|
12
12
|
border: initial !important;
|
|
13
13
|
}
|
|
@@ -15,100 +15,6 @@
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
.cdc-open-viz-module {
|
|
18
|
-
.geo-buttons {
|
|
19
|
-
list-style: none;
|
|
20
|
-
color: var(--mediumGray);
|
|
21
|
-
display: grid;
|
|
22
|
-
button { width: 100% !important; }
|
|
23
|
-
svg {
|
|
24
|
-
display: block;
|
|
25
|
-
max-width: 80px;
|
|
26
|
-
max-height: 40px;
|
|
27
|
-
margin: 0.5em auto;
|
|
28
|
-
box-sizing: border-box;
|
|
29
|
-
path {
|
|
30
|
-
fill: currentColor;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
button {
|
|
34
|
-
background: transparent;
|
|
35
|
-
padding: 0.3em 0.75em;
|
|
36
|
-
display: flex;
|
|
37
|
-
border: var(--lightGray) 1px solid;
|
|
38
|
-
width: 40%;
|
|
39
|
-
align-items: center;
|
|
40
|
-
margin-right: 1em;
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
transition: 0.2s all;
|
|
45
|
-
svg {
|
|
46
|
-
display: block;
|
|
47
|
-
height: 25px;
|
|
48
|
-
margin: 0.5em auto;
|
|
49
|
-
max-width: 100%;
|
|
50
|
-
}
|
|
51
|
-
span {
|
|
52
|
-
text-transform: none;
|
|
53
|
-
font-size: 1em;
|
|
54
|
-
}
|
|
55
|
-
&:hover {
|
|
56
|
-
background: #f2f2f2;
|
|
57
|
-
transition: 0.2s all;
|
|
58
|
-
}
|
|
59
|
-
&.active {
|
|
60
|
-
background: #fff;
|
|
61
|
-
border-color: #005eaa;
|
|
62
|
-
color: #005eaa;
|
|
63
|
-
position: relative;
|
|
64
|
-
path {
|
|
65
|
-
fill: #005eaa;
|
|
66
|
-
}
|
|
67
|
-
&:before {
|
|
68
|
-
content: ' ';
|
|
69
|
-
width: 5px;
|
|
70
|
-
background: #005eaa;
|
|
71
|
-
left: 0;
|
|
72
|
-
top: 0;
|
|
73
|
-
bottom: 0;
|
|
74
|
-
position: absolute;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.editor-toggle {
|
|
81
|
-
background: #f2f2f2;
|
|
82
|
-
border-radius: 60px;
|
|
83
|
-
color: #000;
|
|
84
|
-
font-size: 1em;
|
|
85
|
-
border: 0;
|
|
86
|
-
position: fixed;
|
|
87
|
-
z-index: 100;
|
|
88
|
-
transition: 0.1s background;
|
|
89
|
-
cursor: pointer;
|
|
90
|
-
width: 25px;
|
|
91
|
-
height: 25px;
|
|
92
|
-
left: 307px;
|
|
93
|
-
box-shadow: rgba(0, 0, 0, 0.5) 0 1px 2px;
|
|
94
|
-
&:before {
|
|
95
|
-
top: 43%;
|
|
96
|
-
left: 50%;
|
|
97
|
-
transform: translate(-50%, -50%);
|
|
98
|
-
position: absolute;
|
|
99
|
-
content: '\00ab';
|
|
100
|
-
}
|
|
101
|
-
&.collapsed {
|
|
102
|
-
left: 1em;
|
|
103
|
-
margin-left: 0;
|
|
104
|
-
&:before {
|
|
105
|
-
content: '\00bb';
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
&:hover {
|
|
109
|
-
background: rgba(255, 255, 255, 1);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
18
|
|
|
113
19
|
.editor-panel {
|
|
114
20
|
.cove-input-group,
|
|
@@ -186,13 +92,12 @@
|
|
|
186
92
|
margin-left: 0.3rem;
|
|
187
93
|
}
|
|
188
94
|
|
|
189
|
-
|
|
190
|
-
background: var(--lightestGray);
|
|
191
|
-
}
|
|
95
|
+
|
|
192
96
|
.form-container {
|
|
193
97
|
border-right: var(--lightGray) 1px solid;
|
|
194
98
|
flex-grow: 1;
|
|
195
99
|
}
|
|
100
|
+
|
|
196
101
|
.guidance-link {
|
|
197
102
|
margin: 2em 1em 0;
|
|
198
103
|
padding: 0.75em 1em;
|
|
@@ -242,7 +147,6 @@
|
|
|
242
147
|
margin-right: 1em;
|
|
243
148
|
border-bottom: 2px solid currentColor;
|
|
244
149
|
border-right: 2px solid currentColor;
|
|
245
|
-
transform: rotate(-45deg);
|
|
246
150
|
right: 0;
|
|
247
151
|
position: absolute;
|
|
248
152
|
top: 50%;
|
package/src/scss/main.scss
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
@import 'mixins';
|
|
2
|
-
|
|
3
|
-
@import 'variables';
|
|
4
2
|
@import 'editor-panel';
|
|
5
|
-
@import 'filters';
|
|
6
3
|
|
|
7
4
|
.type-map--has-error {
|
|
8
|
-
overflow: hidden !important;
|
|
9
|
-
height: 100vh;
|
|
10
5
|
|
|
11
6
|
.waiting {
|
|
12
7
|
display: flex;
|
|
13
|
-
|
|
14
|
-
flex-wrap: wrap;
|
|
15
|
-
display: flex;
|
|
8
|
+
overflow: hidden !important;
|
|
16
9
|
align-content: center;
|
|
17
10
|
flex-wrap: wrap;
|
|
18
11
|
height: 100vh;
|
|
@@ -26,16 +19,6 @@
|
|
|
26
19
|
margin-top: 20%;
|
|
27
20
|
}
|
|
28
21
|
|
|
29
|
-
.visually-hidden {
|
|
30
|
-
clip: rect(0 0 0 0);
|
|
31
|
-
clip-path: inset(50%);
|
|
32
|
-
height: 1px;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
position: absolute;
|
|
35
|
-
white-space: nowrap;
|
|
36
|
-
width: 1px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
22
|
@include breakpointClass(md) {
|
|
40
23
|
.map-container.modal-background::before {
|
|
41
24
|
border-bottom: var(--lightGray) 1px solid;
|
|
@@ -48,7 +31,6 @@
|
|
|
48
31
|
.cdc-map-inner-container {
|
|
49
32
|
@import './map';
|
|
50
33
|
flex-grow: 1;
|
|
51
|
-
color: #202020;
|
|
52
34
|
border: 0;
|
|
53
35
|
text-align: left;
|
|
54
36
|
max-width: 100%;
|
package/src/scss/map.scss
CHANGED
|
@@ -1,48 +1,4 @@
|
|
|
1
|
-
// Map Download UI
|
|
2
|
-
.map-downloads {
|
|
3
|
-
position: relative;
|
|
4
|
-
z-index: 3;
|
|
5
|
-
|
|
6
|
-
.map-downloads__ui.btn-group {
|
|
7
|
-
transform: scale(0.8);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.map-downloads__ui {
|
|
11
|
-
position: absolute;
|
|
12
|
-
top: 0.5em;
|
|
13
|
-
left: 0.5em;
|
|
14
|
-
transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
|
|
15
|
-
box-shadow: 0 5px 12px -8px rgba(0, 0, 0, 0.5);
|
|
16
|
-
user-select: none;
|
|
17
|
-
height: 42px;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.map-container {
|
|
22
|
-
&.full-border {
|
|
23
|
-
border: #c2c2c2 1px solid;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
header + .map-container.full-border {
|
|
28
|
-
border-top: 0; // When they have a header, don't add a border top
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// World Specific Styles
|
|
32
|
-
.map-container.world {
|
|
33
|
-
&.data .geography-container {
|
|
34
|
-
border-bottom: var(--lightGray) 1px solid;
|
|
35
|
-
}
|
|
36
|
-
.geography-container {
|
|
37
|
-
cursor: move;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
1
|
@include breakpointClass(md) {
|
|
42
|
-
// US Specific
|
|
43
|
-
.map-container.us {
|
|
44
|
-
margin: 0 1em;
|
|
45
|
-
}
|
|
46
2
|
// Data Specific
|
|
47
3
|
.map-container.data {
|
|
48
4
|
&.side {
|
|
@@ -71,27 +27,6 @@ header + .map-container.full-border {
|
|
|
71
27
|
$small: 500px;
|
|
72
28
|
$medium: 768px;
|
|
73
29
|
|
|
74
|
-
.geography-container {
|
|
75
|
-
position: relative;
|
|
76
|
-
flex-grow: 1;
|
|
77
|
-
width: 100%;
|
|
78
|
-
.geo-point {
|
|
79
|
-
transition: 0.3s all;
|
|
80
|
-
circle {
|
|
81
|
-
fill: inherit;
|
|
82
|
-
transition: 0.1s transform;
|
|
83
|
-
}
|
|
84
|
-
&:hover {
|
|
85
|
-
transition: 0.2s all;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
.map-logo {
|
|
89
|
-
display: block;
|
|
90
|
-
margin: 0 0 0 auto;
|
|
91
|
-
max-height: 35px;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
30
|
.single-geo {
|
|
96
31
|
transition: 0.2s fill;
|
|
97
32
|
cursor: pointer;
|
|
@@ -101,77 +36,34 @@ $medium: 768px;
|
|
|
101
36
|
}
|
|
102
37
|
|
|
103
38
|
.territories-label {
|
|
104
|
-
font-size:
|
|
39
|
+
font-size: 0.8rem;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include breakpointClass(sm) {
|
|
44
|
+
.territories-label {
|
|
45
|
+
font-size: 1rem;
|
|
46
|
+
}
|
|
105
47
|
}
|
|
106
48
|
|
|
107
49
|
// Cities and Territories
|
|
108
50
|
.territories {
|
|
109
51
|
gap: 0.5em;
|
|
110
52
|
svg {
|
|
111
|
-
max-width:
|
|
112
|
-
min-width:
|
|
53
|
+
max-width: 30px;
|
|
54
|
+
min-width: 30px;
|
|
113
55
|
transition: 0.3s all;
|
|
114
56
|
|
|
115
57
|
text {
|
|
116
|
-
font-size:
|
|
58
|
+
font-size: var(--territory-label-font-size);
|
|
59
|
+
font-weight: 900;
|
|
60
|
+
@include breakpointClass(sm) {
|
|
61
|
+
font-size: var(--territory-label-font-size-mobile);
|
|
62
|
+
}
|
|
117
63
|
}
|
|
118
64
|
}
|
|
119
65
|
}
|
|
120
66
|
|
|
121
|
-
.zoom-controls {
|
|
122
|
-
display: flex;
|
|
123
|
-
position: absolute;
|
|
124
|
-
bottom: 2em;
|
|
125
|
-
left: 1em;
|
|
126
|
-
z-index: 4;
|
|
127
|
-
> button.reset {
|
|
128
|
-
margin-left: 5px;
|
|
129
|
-
background: rgba(0, 0, 0, 0.65);
|
|
130
|
-
transition: 0.2s all;
|
|
131
|
-
color: #fff;
|
|
132
|
-
&:hover {
|
|
133
|
-
background: rgba(0, 0, 0, 0.8);
|
|
134
|
-
transition: 0.2s all;
|
|
135
|
-
}
|
|
136
|
-
&:active {
|
|
137
|
-
transform: scale(0.9);
|
|
138
|
-
}
|
|
139
|
-
&:focus {
|
|
140
|
-
background: #005eaa;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
> button:not(.reset) {
|
|
144
|
-
display: flex;
|
|
145
|
-
align-items: center;
|
|
146
|
-
justify-content: center;
|
|
147
|
-
padding: 0.2em;
|
|
148
|
-
height: 1.75em;
|
|
149
|
-
width: 1.75em;
|
|
150
|
-
background: rgba(0, 0, 0, 0.65);
|
|
151
|
-
transition: 0.2s all;
|
|
152
|
-
color: #fff;
|
|
153
|
-
border-radius: 100%;
|
|
154
|
-
border: 0;
|
|
155
|
-
&:hover {
|
|
156
|
-
background: rgba(0, 0, 0, 0.8);
|
|
157
|
-
transition: 0.2s all;
|
|
158
|
-
}
|
|
159
|
-
&:active {
|
|
160
|
-
transform: scale(0.9);
|
|
161
|
-
}
|
|
162
|
-
svg {
|
|
163
|
-
height: 1.75em;
|
|
164
|
-
width: 1.75em;
|
|
165
|
-
}
|
|
166
|
-
&:focus {
|
|
167
|
-
background: #005eaa;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
> button:first-child {
|
|
171
|
-
margin-right: 0.25em;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
67
|
@include breakpointClass(sm) {
|
|
176
68
|
.zoom-controls > button:not(.reset) {
|
|
177
69
|
height: 2.5em;
|
|
@@ -181,35 +73,13 @@ $medium: 768px;
|
|
|
181
73
|
width: 2.5em;
|
|
182
74
|
}
|
|
183
75
|
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
@include breakpointClass(md) {
|
|
187
|
-
.map-downloads .map-downloads__ui.btn-group {
|
|
188
|
-
top: 1em;
|
|
189
|
-
left: 1em;
|
|
190
|
-
transform: none;
|
|
191
|
-
}
|
|
192
76
|
.territories {
|
|
193
|
-
> span {
|
|
194
|
-
margin-left: 0;
|
|
195
|
-
}
|
|
196
77
|
svg {
|
|
197
78
|
max-width: 45px;
|
|
198
79
|
}
|
|
199
80
|
}
|
|
200
81
|
}
|
|
201
82
|
|
|
202
|
-
.countyMapGroup {
|
|
203
|
-
transition: transform 1s;
|
|
204
|
-
will-change: transform;
|
|
205
|
-
transform-origin: center;
|
|
206
|
-
stroke: none !important;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.countyMapGroup--no-transition {
|
|
210
|
-
transition: none !important;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
83
|
.state {
|
|
214
84
|
&--inactive:hover path {
|
|
215
85
|
cursor: pointer;
|
|
@@ -228,81 +98,6 @@ $medium: 768px;
|
|
|
228
98
|
display: none;
|
|
229
99
|
}
|
|
230
100
|
|
|
231
|
-
//Region Maps
|
|
232
|
-
#region-1-label,
|
|
233
|
-
#region-2-label,
|
|
234
|
-
#region-3-label,
|
|
235
|
-
#region-4-label,
|
|
236
|
-
#region-5-label,
|
|
237
|
-
#region-6-label,
|
|
238
|
-
#region-7-label,
|
|
239
|
-
#region-8-label,
|
|
240
|
-
#region-9-label,
|
|
241
|
-
#region-10-label {
|
|
242
|
-
background: #fff;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
#region-1-label {
|
|
246
|
-
transform: translate(90%, 22%);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
#region-2-label {
|
|
250
|
-
//transform: translate(83%, 31%); SIDE CHART EXPERIMENT
|
|
251
|
-
transform: translate(83%, 33%);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
#region-3-label {
|
|
255
|
-
//transform: translate(78%, 48%); SIDE CHART EXPERIMENT
|
|
256
|
-
transform: translate(75%, 45%);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
#region-4-label {
|
|
260
|
-
transform: translate(68%, 70%);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
#region-5-label {
|
|
264
|
-
transform: translate(65%, 44%);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
#region-6-label {
|
|
268
|
-
transform: translate(45%, 75%);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
#region-7-label {
|
|
272
|
-
transform: translate(53%, 47%);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
#region-8-label {
|
|
276
|
-
transform: translate(35%, 30%);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
#region-9-label {
|
|
280
|
-
transform: translate(18%, 58%);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
#region-10-label {
|
|
284
|
-
transform: translate(15%, 28%);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
#region-2-territories,
|
|
288
|
-
#region-9-territories {
|
|
289
|
-
text {
|
|
290
|
-
font-weight: bold;
|
|
291
|
-
font-size: 14px;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
#region-2-territories {
|
|
296
|
-
transform: translate(86%, 40%);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
#region-9-territories {
|
|
300
|
-
transform: translate(4%, 72%);
|
|
301
|
-
|
|
302
|
-
.region-9-row2 {
|
|
303
|
-
transform: translateY(34px);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
101
|
|
|
307
102
|
.county-borders {
|
|
308
103
|
fill: none;
|