@cdc/map 4.23.2 → 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.
Files changed (36) hide show
  1. package/dist/cdcmap.js +24661 -24191
  2. package/examples/custom-map-layers.json +764 -0
  3. package/examples/default-county.json +169 -155
  4. package/examples/default-geocode.json +744 -744
  5. package/examples/default-hex.json +3 -5
  6. package/examples/example-city-state-no-territories.json +703 -0
  7. package/examples/example-city-state.json +26 -7
  8. package/examples/example-city-stateBAD.json +744 -0
  9. package/examples/gallery/city-state.json +478 -478
  10. package/examples/testing-layer-2.json +1 -0
  11. package/examples/testing-layer.json +96 -0
  12. package/examples/world-geocode-data.json +18 -0
  13. package/examples/world-geocode.json +108 -0
  14. package/index.html +35 -29
  15. package/package.json +6 -3
  16. package/src/CdcMap.jsx +179 -111
  17. package/src/components/CityList.jsx +35 -35
  18. package/src/components/CountyMap.jsx +309 -446
  19. package/src/components/DataTable.jsx +7 -31
  20. package/src/components/EditorPanel.jsx +468 -217
  21. package/src/components/Sidebar.jsx +2 -0
  22. package/src/components/UsaMap.jsx +34 -23
  23. package/src/components/WorldMap.jsx +40 -8
  24. package/src/data/feature-test.json +73 -0
  25. package/src/data/initial-state.js +10 -3
  26. package/src/data/supported-geos.js +7 -7
  27. package/src/hooks/useMapLayers.jsx +243 -0
  28. package/src/index.jsx +4 -8
  29. package/src/scss/editor-panel.scss +97 -97
  30. package/src/scss/filters.scss +0 -2
  31. package/src/scss/main.scss +25 -26
  32. package/src/scss/map.scss +12 -0
  33. package/src/test/CdcMap.test.jsx +19 -0
  34. package/vite.config.js +3 -3
  35. package/src/components/Filters.jsx +0 -113
  36. package/src/hooks/useColorPalette.ts +0 -88
@@ -1,157 +1,171 @@
1
1
  {
2
- "general": {
3
- "title": "Default County Map",
4
- "subtext": "",
5
- "territoriesLabel": "Territories",
6
- "type": "map",
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
- "type": "map",
33
- "color": "pinkpurple",
34
- "columns": {
35
- "geo": {
36
- "name": "FIPS Codes",
37
- "label": "Location",
38
- "tooltip": false,
39
- "dataTable": true
40
- },
41
- "primary": {
42
- "name": "Insured Rate",
43
- "label": "Data Label",
44
- "prefix": "",
45
- "suffix": "%",
46
- "dataTable": true,
47
- "tooltip": true
48
- },
49
- "navigate": {
50
- "name": "",
51
- "tooltip": false,
52
- "dataTable": false
53
- }
54
- },
55
- "legend": {
56
- "numberOfItems": 3,
57
- "position": "side",
58
- "title": "Legend Title",
59
- "description": "Legend Text",
60
- "type": "equalnumber",
61
- "specialClasses": [
62
- {
63
- "key": "Insured Rate",
64
- "value": "18",
65
- "label": "18"
66
- }
67
- ],
68
- "descriptions": {},
69
- "unified": false,
70
- "singleColumn": false,
71
- "dynamicDescription": false
72
- },
73
- "filters": [],
74
- "dataTable": {
75
- "title": "Data Table",
76
- "forceDisplay": true
77
- },
78
- "tooltips": {
79
- "appearanceType": "hover",
80
- "linkLabel": "Learn More",
81
- "capitalizeLabels": true
82
- },
83
- "runtime": {
84
- "editorErrorMessage": []
85
- },
86
- "visual": {
87
- "minBubbleSize": 1,
88
- "maxBubbleSize": 20,
89
- "extraBubbleBorder": false,
90
- "cityStyle": "circle"
91
- },
92
- "mapPosition": {
93
- "coordinates": [
94
- 0,
95
- 30
96
- ],
97
- "zoom": 1
98
- },
99
- "data": [
100
- {
101
- "Insured Rate": 8,
102
- "Coverage Status": "Insured",
103
- "FIPS Codes": "06071",
104
- "Year (Good filter option)": "2010",
105
- "link": ""
106
- },
107
- {
108
- "Insured Rate": 0,
109
- "Coverage Status": "Insured",
110
- "FIPS Codes": "55005",
111
- "Year (Good filter option)": "2010",
112
- "link": "https://cdc.gov"
113
- },
114
- {
115
- "Insured Rate": 25,
116
- "Coverage Status": "Insured",
117
- "FIPS Codes": "12103",
118
- "Year (Good filter option)": "2010",
119
- "link": ""
120
- },
121
- {
122
- "Insured Rate": 25,
123
- "Coverage Status": "Insured",
124
- "FIPS Codes": "32005",
125
- "Year (Good filter option)": "2010",
126
- "link": ""
127
- },
128
- {
129
- "Insured Rate": 18,
130
- "Coverage Status": "Insured",
131
- "FIPS Codes": "06075",
132
- "Year (Good filter option)": "2010",
133
- "link": ""
134
- },
135
- {
136
- "Insured Rate": 3,
137
- "Coverage Status": "Insured",
138
- "FIPS Codes": "06027",
139
- "Year (Good filter option)": "2010",
140
- "link": ""
141
- },
142
- {
143
- "Insured Rate": 25,
144
- "Coverage Status": "Insured",
145
- "FIPS Codes": "06029",
146
- "Year (Good filter option)": "2010",
147
- "link": ""
148
- },
149
- {
150
- "Insured Rate": 60,
151
- "Coverage Status": "Insured",
152
- "FIPS Codes": "06065",
153
- "Year (Good filter option)": "2010",
154
- "link": ""
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
  }