@cdc/map 4.24.7 → 4.24.9
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 +40720 -38422
- package/examples/county-year.csv +10 -0
- package/examples/default-geocode.json +44 -10
- package/examples/default-patterns.json +0 -2
- package/examples/default-single-state.json +279 -108
- package/examples/map-issue-3.json +646 -0
- package/examples/single-state-filter.json +153 -0
- package/index.html +9 -6
- package/package.json +3 -3
- package/src/CdcMap.tsx +322 -126
- package/src/_stories/CdcMap.stories.tsx +7 -0
- package/src/_stories/_mock/DEV-8942.json +270 -0
- package/src/components/Annotation/AnnotationDropdown.tsx +1 -0
- package/src/components/{BubbleList.jsx → BubbleList.tsx} +1 -1
- package/src/components/{CityList.jsx → CityList.tsx} +28 -2
- package/src/components/{DataTable.jsx → DataTable.tsx} +2 -2
- package/src/components/EditorPanel/components/EditorPanel.tsx +647 -127
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +0 -22
- package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +61 -11
- package/src/components/Legend/components/Legend.tsx +125 -36
- package/src/components/Legend/components/index.scss +42 -42
- package/src/components/Modal.tsx +25 -0
- package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +74 -0
- package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +29 -0
- package/src/components/UsaMap/components/SingleState/index.tsx +9 -0
- package/src/components/UsaMap/components/UsaMap.County.tsx +84 -33
- package/src/components/UsaMap/components/UsaMap.SingleState.tsx +173 -206
- package/src/components/UsaMap/components/UsaMap.State.tsx +161 -26
- package/src/components/UsaMap/data/us-extended-geography.json +1 -0
- package/src/components/UsaMap/helpers/map.ts +111 -0
- package/src/components/WorldMap/WorldMap.tsx +17 -32
- package/src/components/ZoomControls.tsx +41 -0
- package/src/data/initial-state.js +7 -1
- package/src/data/supported-geos.js +15 -4
- package/src/helpers/generateRuntimeLegendHash.ts +2 -2
- package/src/hooks/useStateZoom.tsx +157 -0
- package/src/hooks/{useZoomPan.js → useZoomPan.ts} +6 -5
- package/src/scss/editor-panel.scss +0 -4
- package/src/scss/main.scss +23 -1
- package/src/scss/map.scss +8 -0
- package/src/types/MapConfig.ts +9 -1
- package/src/types/MapContext.ts +14 -2
- package/src/components/Modal.jsx +0 -22
- /package/src/components/{Geo.jsx → Geo.tsx} +0 -0
- /package/src/components/{NavigationMenu.jsx → NavigationMenu.tsx} +0 -0
- /package/src/components/{ZoomableGroup.jsx → ZoomableGroup.tsx} +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"general": {
|
|
3
|
+
"geoType": "single-state",
|
|
4
|
+
"type": "data",
|
|
5
|
+
"geoBorderColor": "darkGray",
|
|
6
|
+
"headerColor": "theme-blue",
|
|
7
|
+
"title": "Example County Set By Year Filter State Data Map",
|
|
8
|
+
"showTitle": true,
|
|
9
|
+
"showSidebar": true,
|
|
10
|
+
"showDownloadButton": true,
|
|
11
|
+
"showDownloadMediaButton": false,
|
|
12
|
+
"displayAsHex": false,
|
|
13
|
+
"displayStateLabels": false,
|
|
14
|
+
"territoriesLabel": "Territories",
|
|
15
|
+
"territoriesAlwaysShow": false,
|
|
16
|
+
"language": "en",
|
|
17
|
+
"geoLabelOverride": "",
|
|
18
|
+
"hasRegions": false,
|
|
19
|
+
"fullBorder": false,
|
|
20
|
+
"convertFipsCodes": true,
|
|
21
|
+
"palette": {
|
|
22
|
+
"isReversed": false
|
|
23
|
+
},
|
|
24
|
+
"allowMapZoom": true,
|
|
25
|
+
"hideGeoColumnInTooltip": false,
|
|
26
|
+
"hidePrimaryColumnInTooltip": false,
|
|
27
|
+
"statePicked": {
|
|
28
|
+
"fipsCode": "02",
|
|
29
|
+
"stateName": "Alaska"
|
|
30
|
+
},
|
|
31
|
+
"expandDataTable": false,
|
|
32
|
+
"filterControlsCountyYear": "YEAR"
|
|
33
|
+
},
|
|
34
|
+
"type": "map",
|
|
35
|
+
"color": "pinkpurple",
|
|
36
|
+
"columns": {
|
|
37
|
+
"geo": {
|
|
38
|
+
"name": "FIPS",
|
|
39
|
+
"label": "Location",
|
|
40
|
+
"tooltip": false,
|
|
41
|
+
"dataTable": true
|
|
42
|
+
},
|
|
43
|
+
"primary": {
|
|
44
|
+
"dataTable": true,
|
|
45
|
+
"tooltip": true,
|
|
46
|
+
"prefix": "",
|
|
47
|
+
"suffix": "",
|
|
48
|
+
"name": "VALUE",
|
|
49
|
+
"label": ""
|
|
50
|
+
},
|
|
51
|
+
"navigate": {
|
|
52
|
+
"name": ""
|
|
53
|
+
},
|
|
54
|
+
"latitude": {
|
|
55
|
+
"name": ""
|
|
56
|
+
},
|
|
57
|
+
"longitude": {
|
|
58
|
+
"name": ""
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"legend": {
|
|
62
|
+
"descriptions": {},
|
|
63
|
+
"specialClasses": [],
|
|
64
|
+
"unified": true,
|
|
65
|
+
"singleColumn": false,
|
|
66
|
+
"singleRow": false,
|
|
67
|
+
"verticalSorted": false,
|
|
68
|
+
"showSpecialClassesLast": false,
|
|
69
|
+
"dynamicDescription": false,
|
|
70
|
+
"type": "equalnumber",
|
|
71
|
+
"numberOfItems": 6,
|
|
72
|
+
"position": "side",
|
|
73
|
+
"title": "Legend"
|
|
74
|
+
},
|
|
75
|
+
"filters": [
|
|
76
|
+
{
|
|
77
|
+
"order": "asc",
|
|
78
|
+
"label": "Year",
|
|
79
|
+
"columnName": "YEAR",
|
|
80
|
+
"values": [
|
|
81
|
+
"2019",
|
|
82
|
+
"2020"
|
|
83
|
+
],
|
|
84
|
+
"active": "2019",
|
|
85
|
+
"filterStyle": "dropdown"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"table": {
|
|
89
|
+
"wrapColumns": false,
|
|
90
|
+
"label": "Data Table",
|
|
91
|
+
"expanded": false,
|
|
92
|
+
"limitHeight": false,
|
|
93
|
+
"height": "",
|
|
94
|
+
"caption": "",
|
|
95
|
+
"showDownloadUrl": false,
|
|
96
|
+
"showDataTableLink": true,
|
|
97
|
+
"showFullGeoNameInCSV": false,
|
|
98
|
+
"forceDisplay": true,
|
|
99
|
+
"download": true,
|
|
100
|
+
"indexLabel": ""
|
|
101
|
+
},
|
|
102
|
+
"tooltips": {
|
|
103
|
+
"appearanceType": "hover",
|
|
104
|
+
"linkLabel": "Learn More",
|
|
105
|
+
"capitalizeLabels": true,
|
|
106
|
+
"opacity": 90
|
|
107
|
+
},
|
|
108
|
+
"visual": {
|
|
109
|
+
"minBubbleSize": 1,
|
|
110
|
+
"maxBubbleSize": 20,
|
|
111
|
+
"extraBubbleBorder": false,
|
|
112
|
+
"cityStyle": "circle",
|
|
113
|
+
"cityStyleLabel": "",
|
|
114
|
+
"showBubbleZeros": false,
|
|
115
|
+
"additionalCityStyles": [],
|
|
116
|
+
"geoCodeCircleSize": 8
|
|
117
|
+
},
|
|
118
|
+
"mapPosition": {
|
|
119
|
+
"coordinates": [
|
|
120
|
+
0,
|
|
121
|
+
30
|
|
122
|
+
],
|
|
123
|
+
"zoom": 1
|
|
124
|
+
},
|
|
125
|
+
"map": {
|
|
126
|
+
"layers": [],
|
|
127
|
+
"patterns": []
|
|
128
|
+
},
|
|
129
|
+
"hexMap": {
|
|
130
|
+
"type": "",
|
|
131
|
+
"shapeGroups": [
|
|
132
|
+
{
|
|
133
|
+
"legendTitle": "",
|
|
134
|
+
"legendDescription": "",
|
|
135
|
+
"items": [
|
|
136
|
+
{
|
|
137
|
+
"key": "",
|
|
138
|
+
"shape": "Arrow Up",
|
|
139
|
+
"column": "",
|
|
140
|
+
"operator": "=",
|
|
141
|
+
"value": ""
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"filterBehavior": "Filter Change",
|
|
148
|
+
"datasets": {},
|
|
149
|
+
"dataFileName": "https://wcms-wp.cdc.gov/wcms/4.0/cdc-wp/data-presentation/data/county-year.csv",
|
|
150
|
+
"dataFileSourceType": "url",
|
|
151
|
+
"dataUrl": "http://localhost:8080/examples/county-year.csv",
|
|
152
|
+
"version": "4.24.4"
|
|
153
|
+
}
|
package/index.html
CHANGED
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
min-height: 100vh;
|
|
14
14
|
}
|
|
15
15
|
</style>
|
|
16
|
-
<link
|
|
16
|
+
<link
|
|
17
|
+
rel="stylesheet prefetch"
|
|
18
|
+
href="https://www.cdc.gov/TemplatePackage/contrib/libs/bootstrap/latest/css/bootstrap.min.css?_=39423"
|
|
19
|
+
/>
|
|
17
20
|
<link rel="stylesheet prefetch" href="https://www.cdc.gov/TemplatePackage/4.0/assets/css/app.min.css?_=39423" />
|
|
18
21
|
</head>
|
|
19
22
|
|
|
20
23
|
<body>
|
|
21
24
|
<!-- DEFAULT EXAMPLES -->
|
|
22
|
-
<div class="react-container" data-config="/examples/
|
|
25
|
+
<!-- <div class="react-container" data-config="/examples/annotation/usa-map.json"></div> -->
|
|
23
26
|
<!-- <div class="react-container" data-config="/examples/hex-colors.json"></div> -->
|
|
24
27
|
<!-- <div class="react-container" data-config="/examples/private/map.json"></div> -->
|
|
25
28
|
<!-- <div class="react-container" data-config="/examples/private/zika-issue.json"></div> -->
|
|
@@ -34,10 +37,10 @@
|
|
|
34
37
|
<!-- <div class="react-container react-container--maps" data-config="/examples/test.json"></div> -->
|
|
35
38
|
<!-- <div class="react-container react-container--maps" data-config="/examples/default-usa-regions.json"></div> -->
|
|
36
39
|
<!-- <div class="react-container react-container--maps" data-config="/examples/default-usa.json"></div> -->
|
|
37
|
-
<div class="react-container react-container--maps" data-config="https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/US-County-Level-Map.json"></div>
|
|
38
|
-
|
|
40
|
+
<!-- <div class="react-container react-container--maps" data-config="https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/examples/US-County-Level-Map.json"></div> -->
|
|
41
|
+
<div class="react-container react-container--maps" data-config="/examples/default-geocode.json"></div>
|
|
39
42
|
<div class="react-container react-container--maps" data-config="/examples/default-single-state.json"></div>
|
|
40
|
-
<div class="react-container react-container--maps" data-config="/examples/bubble-us.json"></div>
|
|
43
|
+
<!-- <div class="react-container react-container--maps" data-config="/examples/bubble-us.json"></div> -->
|
|
41
44
|
<!-- <div class="react-container react-container--maps" data-config="/examples/bubble-world.json"></div> -->
|
|
42
45
|
|
|
43
46
|
<!-- TESTS DATA TABLE SORT-->
|
|
@@ -55,7 +58,7 @@
|
|
|
55
58
|
<!-- TP4 EXAMPLES -->
|
|
56
59
|
<div class="react-container react-container--maps" data-config="/examples/example-city-state.json"></div>
|
|
57
60
|
<!-- <div class="react-container react-container--maps" data-config="/examples/example-city-state-no-territories.json"></div> -->
|
|
58
|
-
<div class="react-container react-container--maps" data-config="/examples/example-world-map.json"></div>
|
|
61
|
+
<!-- <div class="react-container react-container--maps" data-config="/examples/example-world-map.json"></div> -->
|
|
59
62
|
<!-- <div class="react-container react-container--maps" data-config="/examples/default-hex.json"></div> -->
|
|
60
63
|
|
|
61
64
|
<!-- <div class="react-container" data-config="/examples/example-hex-map-with-filter.json"></div> -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/map",
|
|
3
|
-
"version": "4.24.
|
|
3
|
+
"version": "4.24.9",
|
|
4
4
|
"description": "React component for visualizing tabular data on a map of the United States or the world.",
|
|
5
5
|
"moduleName": "CdcMap",
|
|
6
6
|
"main": "dist/cdcmap",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@cdc/core": "^4.24.
|
|
28
|
+
"@cdc/core": "^4.24.9",
|
|
29
29
|
"@emotion/core": "^10.0.28",
|
|
30
30
|
"@emotion/react": "^11.1.5",
|
|
31
31
|
"@hello-pangea/dnd": "^16.2.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-dom": "^18.2.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "c4b0402afe6ed209a85b7078711549b9fd7dae7d"
|
|
56
56
|
}
|