@cdc/map 4.23.3 → 4.23.4
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 +22422 -22053
- package/examples/custom-map-layers.json +764 -0
- package/examples/default-county.json +169 -155
- package/examples/example-city-state.json +31 -9
- package/examples/testing-layer-2.json +1 -0
- package/examples/testing-layer.json +96 -0
- package/index.html +6 -5
- package/package.json +3 -3
- package/src/CdcMap.jsx +55 -50
- package/src/components/CountyMap.jsx +30 -5
- package/src/components/EditorPanel.jsx +255 -129
- package/src/components/UsaMap.jsx +17 -11
- package/src/data/initial-state.js +7 -3
- package/src/hooks/useMapLayers.jsx +243 -0
- package/src/index.jsx +4 -8
- package/src/scss/editor-panel.scss +97 -97
- package/src/scss/filters.scss +0 -2
- package/src/scss/main.scss +25 -26
- package/src/components/Filters.jsx +0 -113
|
@@ -1,157 +1,171 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
2
|
+
"general": {
|
|
3
|
+
"title": "Default County Map",
|
|
4
|
+
"subtext": "",
|
|
5
|
+
"territoriesLabel": "Territories",
|
|
6
|
+
"type": "data",
|
|
7
|
+
"geoType": "us-county",
|
|
8
|
+
"headerColor": "theme-blue",
|
|
9
|
+
"showSidebar": true,
|
|
10
|
+
"showTitle": true,
|
|
11
|
+
"geoBorderColor": "darkGray",
|
|
12
|
+
"showDownloadButton": true,
|
|
13
|
+
"expandDataTable": false,
|
|
14
|
+
"showDownloadMediaButton": false,
|
|
15
|
+
"displayAsHex": false,
|
|
16
|
+
"displayStateLabels": false,
|
|
17
|
+
"language": "en",
|
|
18
|
+
"hasRegions": false,
|
|
19
|
+
"fullBorder": false,
|
|
20
|
+
"palette": {
|
|
21
|
+
"isReversed": false
|
|
22
|
+
},
|
|
23
|
+
"allowMapZoom": true,
|
|
24
|
+
"hideGeoColumnInTooltip": false,
|
|
25
|
+
"hidePrimaryColumnInTooltip": false,
|
|
26
|
+
"statePicked": {
|
|
27
|
+
"fipsCode": "01",
|
|
28
|
+
"stateName": "Alabama"
|
|
29
|
+
},
|
|
30
|
+
"equalNumberOptIn": true
|
|
31
|
+
},
|
|
32
|
+
"map": {
|
|
33
|
+
"layers": [
|
|
34
|
+
{
|
|
35
|
+
"name": "Layer One",
|
|
36
|
+
"url": "./examples/testing-layer.json",
|
|
37
|
+
"namespace": "cove"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "Layer Two",
|
|
41
|
+
"url": "./examples/testing-layer.json",
|
|
42
|
+
"namespace": "cove"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"type": "map",
|
|
47
|
+
"color": "pinkpurple",
|
|
48
|
+
"columns": {
|
|
49
|
+
"geo": {
|
|
50
|
+
"name": "FIPS Codes",
|
|
51
|
+
"label": "Location",
|
|
52
|
+
"tooltip": false,
|
|
53
|
+
"dataTable": true
|
|
54
|
+
},
|
|
55
|
+
"primary": {
|
|
56
|
+
"name": "Insured Rate",
|
|
57
|
+
"label": "Data Label",
|
|
58
|
+
"prefix": "",
|
|
59
|
+
"suffix": "%",
|
|
60
|
+
"dataTable": true,
|
|
61
|
+
"tooltip": true
|
|
62
|
+
},
|
|
63
|
+
"navigate": {
|
|
64
|
+
"name": "",
|
|
65
|
+
"tooltip": false,
|
|
66
|
+
"dataTable": false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"legend": {
|
|
70
|
+
"numberOfItems": 3,
|
|
71
|
+
"position": "side",
|
|
72
|
+
"title": "Legend Title",
|
|
73
|
+
"description": "Legend Text",
|
|
74
|
+
"type": "equalnumber",
|
|
75
|
+
"specialClasses": [
|
|
76
|
+
{
|
|
77
|
+
"key": "Insured Rate",
|
|
78
|
+
"value": "18",
|
|
79
|
+
"label": "18"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"descriptions": {},
|
|
83
|
+
"unified": false,
|
|
84
|
+
"singleColumn": false,
|
|
85
|
+
"dynamicDescription": false
|
|
86
|
+
},
|
|
87
|
+
"filters": [],
|
|
88
|
+
"dataTable": {
|
|
89
|
+
"title": "Data Table",
|
|
90
|
+
"forceDisplay": true
|
|
91
|
+
},
|
|
92
|
+
"tooltips": {
|
|
93
|
+
"appearanceType": "hover",
|
|
94
|
+
"linkLabel": "Learn More",
|
|
95
|
+
"capitalizeLabels": true
|
|
96
|
+
},
|
|
97
|
+
"runtime": {
|
|
98
|
+
"editorErrorMessage": []
|
|
99
|
+
},
|
|
100
|
+
"visual": {
|
|
101
|
+
"minBubbleSize": 1,
|
|
102
|
+
"maxBubbleSize": 20,
|
|
103
|
+
"extraBubbleBorder": false,
|
|
104
|
+
"cityStyle": "circle"
|
|
105
|
+
},
|
|
106
|
+
"mapPosition": {
|
|
107
|
+
"coordinates": [
|
|
108
|
+
0,
|
|
109
|
+
30
|
|
110
|
+
],
|
|
111
|
+
"zoom": 1
|
|
112
|
+
},
|
|
113
|
+
"data": [
|
|
114
|
+
{
|
|
115
|
+
"Insured Rate": 8,
|
|
116
|
+
"Coverage Status": "Insured",
|
|
117
|
+
"FIPS Codes": "06071",
|
|
118
|
+
"Year (Good filter option)": "2010",
|
|
119
|
+
"link": ""
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"Insured Rate": 0,
|
|
123
|
+
"Coverage Status": "Insured",
|
|
124
|
+
"FIPS Codes": "55005",
|
|
125
|
+
"Year (Good filter option)": "2010",
|
|
126
|
+
"link": "https://cdc.gov"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"Insured Rate": 25,
|
|
130
|
+
"Coverage Status": "Insured",
|
|
131
|
+
"FIPS Codes": "12103",
|
|
132
|
+
"Year (Good filter option)": "2010",
|
|
133
|
+
"link": ""
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"Insured Rate": 25,
|
|
137
|
+
"Coverage Status": "Insured",
|
|
138
|
+
"FIPS Codes": "32005",
|
|
139
|
+
"Year (Good filter option)": "2010",
|
|
140
|
+
"link": ""
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"Insured Rate": 18,
|
|
144
|
+
"Coverage Status": "Insured",
|
|
145
|
+
"FIPS Codes": "06075",
|
|
146
|
+
"Year (Good filter option)": "2010",
|
|
147
|
+
"link": ""
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"Insured Rate": 3,
|
|
151
|
+
"Coverage Status": "Insured",
|
|
152
|
+
"FIPS Codes": "06027",
|
|
153
|
+
"Year (Good filter option)": "2010",
|
|
154
|
+
"link": ""
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"Insured Rate": 25,
|
|
158
|
+
"Coverage Status": "Insured",
|
|
159
|
+
"FIPS Codes": "06029",
|
|
160
|
+
"Year (Good filter option)": "2010",
|
|
161
|
+
"link": ""
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"Insured Rate": 60,
|
|
165
|
+
"Coverage Status": "Insured",
|
|
166
|
+
"FIPS Codes": "06065",
|
|
167
|
+
"Year (Good filter option)": "2010",
|
|
168
|
+
"link": ""
|
|
169
|
+
}
|
|
170
|
+
]
|
|
157
171
|
}
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
"stateName": "Alabama"
|
|
30
30
|
},
|
|
31
31
|
"showDownloadImgButton": false,
|
|
32
|
-
"showDownloadPdfButton": false
|
|
32
|
+
"showDownloadPdfButton": false,
|
|
33
|
+
"territoriesAlwaysShow": false,
|
|
34
|
+
"geoLabelOverride": ""
|
|
33
35
|
},
|
|
34
36
|
"type": "map",
|
|
35
37
|
"color": "yelloworangered",
|
|
@@ -79,20 +81,32 @@
|
|
|
79
81
|
"description": "Legend Text",
|
|
80
82
|
"type": "equalnumber",
|
|
81
83
|
"specialClasses": [
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
+
{
|
|
85
|
+
"key": "Rate",
|
|
86
|
+
"value": "*",
|
|
87
|
+
"label": "*"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"key": "Rate",
|
|
91
|
+
"value": "NA",
|
|
92
|
+
"label": "N/A"
|
|
93
|
+
}
|
|
84
94
|
],
|
|
85
95
|
"unified": false,
|
|
86
96
|
"singleColumn": false,
|
|
87
97
|
"dynamicDescription": false,
|
|
88
98
|
"descriptions": {},
|
|
89
|
-
"singleRow": false
|
|
99
|
+
"singleRow": false,
|
|
100
|
+
"showSpecialClassesLast": false
|
|
90
101
|
},
|
|
91
|
-
"filters": [],
|
|
92
102
|
"dataTable": {
|
|
93
103
|
"title": "Data Table",
|
|
94
104
|
"forceDisplay": true
|
|
95
105
|
},
|
|
106
|
+
"table": {
|
|
107
|
+
"showDownloadUrl": false,
|
|
108
|
+
"showDataTableLink": true
|
|
109
|
+
},
|
|
96
110
|
"tooltips": {
|
|
97
111
|
"appearanceType": "hover",
|
|
98
112
|
"linkLabel": "Learn More",
|
|
@@ -106,12 +120,19 @@
|
|
|
106
120
|
"minBubbleSize": 1,
|
|
107
121
|
"maxBubbleSize": 20,
|
|
108
122
|
"extraBubbleBorder": false,
|
|
109
|
-
"showBubbleZeros": false
|
|
123
|
+
"showBubbleZeros": false,
|
|
124
|
+
"geoCodeCircleSize": 2
|
|
110
125
|
},
|
|
111
126
|
"mapPosition": {
|
|
112
|
-
"coordinates": [
|
|
127
|
+
"coordinates": [
|
|
128
|
+
0,
|
|
129
|
+
30
|
|
130
|
+
],
|
|
113
131
|
"zoom": 1
|
|
114
132
|
},
|
|
133
|
+
"map": {
|
|
134
|
+
"layers": []
|
|
135
|
+
},
|
|
115
136
|
"sharing": {
|
|
116
137
|
"enabled": false,
|
|
117
138
|
"dataHost": "wcms-wp.cdc.gov",
|
|
@@ -737,5 +758,6 @@
|
|
|
737
758
|
"Location": "Vehicle",
|
|
738
759
|
"URL": "https://www.cdc.gov/"
|
|
739
760
|
}
|
|
740
|
-
]
|
|
741
|
-
|
|
761
|
+
],
|
|
762
|
+
"filterStyle": "Filter Changes"
|
|
763
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"Topology","arcs":[[[0,96],[101,-7],[-1,-89],[-87,12],[-13,84]]],"transform":{"scale":[0.13053063168316828,0.06265089895833335],"translate":[-105.5395304,42.6239805]},"objects":{"Untitled layer (2)":{"type":"GeometryCollection","geometries":[{"arcs":[[0]],"type":"Polygon","properties":{"name":"Polygon 3","styleUrl":"#poly-000000-1200-77-nodesc","fill-opacity":0.30196078431372547,"fill":"#000000","stroke-opacity":1,"stroke":"#000000","stroke-width":1.2}}]}}}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "Topology",
|
|
3
|
+
"arcs": [
|
|
4
|
+
[
|
|
5
|
+
[
|
|
6
|
+
129,
|
|
7
|
+
163
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
14,
|
|
11
|
+
-127
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
-143,
|
|
15
|
+
114
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
129,
|
|
19
|
+
13
|
|
20
|
+
]
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
[
|
|
24
|
+
245,
|
|
25
|
+
0
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
-14,
|
|
29
|
+
49
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
23,
|
|
33
|
+
-2
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
9,
|
|
37
|
+
-42
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
-18,
|
|
41
|
+
-5
|
|
42
|
+
]
|
|
43
|
+
]
|
|
44
|
+
],
|
|
45
|
+
"transform": {
|
|
46
|
+
"scale": [
|
|
47
|
+
0.13050833117870725,
|
|
48
|
+
0.06478136993865032
|
|
49
|
+
],
|
|
50
|
+
"translate": [
|
|
51
|
+
-116.2166096,
|
|
52
|
+
31.6689211
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"objects": {
|
|
56
|
+
"cove": {
|
|
57
|
+
"type": "GeometryCollection",
|
|
58
|
+
"geometries": [
|
|
59
|
+
{
|
|
60
|
+
"arcs": [
|
|
61
|
+
[
|
|
62
|
+
0
|
|
63
|
+
]
|
|
64
|
+
],
|
|
65
|
+
"type": "Polygon",
|
|
66
|
+
"properties": {
|
|
67
|
+
"name": "Polygon 2",
|
|
68
|
+
"styleUrl": "#poly-000000-1200-77-nodesc",
|
|
69
|
+
"fill-opacity": 0.30196078431372547,
|
|
70
|
+
"fill": "blue",
|
|
71
|
+
"stroke-opacity": 1,
|
|
72
|
+
"stroke": "red",
|
|
73
|
+
"stroke-width": 5
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"arcs": [
|
|
78
|
+
[
|
|
79
|
+
1
|
|
80
|
+
]
|
|
81
|
+
],
|
|
82
|
+
"type": "Polygon",
|
|
83
|
+
"properties": {
|
|
84
|
+
"name": "Polygon 5",
|
|
85
|
+
"styleUrl": "#poly-000000-1200-77-nodesc",
|
|
86
|
+
"fill-opacity": 0.30196078431372547,
|
|
87
|
+
"fill": "green",
|
|
88
|
+
"stroke-opacity": 0,
|
|
89
|
+
"stroke": "#000000",
|
|
90
|
+
"stroke-width": 1.2
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
package/index.html
CHANGED
|
@@ -19,24 +19,25 @@
|
|
|
19
19
|
<!-- <div class="react-container react-container--maps" data-config="/examples/default-county.json"></div> -->
|
|
20
20
|
<!-- <div class="react-container react-container--maps" data-config="/examples/default-geocode.json"></div> -->
|
|
21
21
|
<!-- <div class="react-container react-container--maps" data-config="/examples/default-usa-regions.json"></div> -->
|
|
22
|
-
<!--
|
|
23
|
-
<!--
|
|
22
|
+
<!-- <div class="react-container react-container--maps" data-config="/examples/default-single-state.json"></div> -->
|
|
23
|
+
<!-- <div class="react-container react-container--maps" data-config="/examples/default-world.json"></div> -->
|
|
24
24
|
<!-- <div class="react-container react-container--maps" data-config="/examples/bubble-us.json"></div>-->
|
|
25
25
|
<!-- <div class="react-container react-container--maps" data-config="/examples/bubble-world.json"></div> -->
|
|
26
26
|
|
|
27
27
|
<!-- TP4 EXAMPLES -->
|
|
28
|
-
<div class="react-container react-container--maps" data-config="/examples/example-city-state.json"></div>
|
|
28
|
+
<!-- <div class="react-container react-container--maps" data-config="/examples/example-city-state.json"></div> -->
|
|
29
|
+
<!-- <div class="react-container react-container--maps" data-config="/examples/custom-map-layers.json"></div> -->
|
|
29
30
|
<!-- <div class="react-container react-container--maps" data-config="/examples/example-city-stateBAD.json"></div> -->
|
|
30
31
|
<!-- <div class="react-container react-container--maps" data-config="/examples/example-world-map.json"></div> -->
|
|
31
32
|
<!-- <div class="react-container react-container--maps" data-config="/examples/default-hex.json"></div> -->
|
|
32
33
|
|
|
33
34
|
<!-- TP4 EXAMPLES -->
|
|
34
|
-
|
|
35
|
+
<div class="react-container react-container--maps" data-config="/examples/example-city-state.json"></div>
|
|
35
36
|
<!-- <div class="react-container react-container--maps" data-config="/examples/example-city-state-no-territories.json"></div> -->
|
|
36
37
|
<!-- <div class="react-container react-container--maps" data-config="/examples/example-world-map.json"></div> -->
|
|
37
38
|
<!-- <div class="react-container react-container--maps" data-config="/examples/default-hex.json"></div> -->
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
<div class="react-container" data-config="/examples/example-hex-map-with-filter.json"></div>
|
|
40
41
|
|
|
41
42
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
42
43
|
<script type="module" src="./src/index.jsx"></script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/map",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.4",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@cdc/core": "^4.23.
|
|
27
|
+
"@cdc/core": "^4.23.4",
|
|
28
28
|
"@emotion/core": "^10.0.28",
|
|
29
29
|
"@emotion/react": "^11.1.5",
|
|
30
30
|
"@hello-pangea/dnd": "^16.2.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react": "^18.2.0",
|
|
52
52
|
"react-dom": "^18.2.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "dcd395d76f70b2d113f2b4c6fe50a52522655cd1"
|
|
55
55
|
}
|