@cdc/map 4.24.5 → 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.
Files changed (67) hide show
  1. package/dist/cdcmap.js +71853 -64936
  2. package/examples/annotation/index.json +552 -0
  3. package/examples/annotation/usa-map.json +900 -0
  4. package/examples/county-year.csv +10 -0
  5. package/examples/default-geocode.json +44 -10
  6. package/examples/default-patterns.json +0 -2
  7. package/examples/default-single-state.json +279 -108
  8. package/examples/map-issue-3.json +646 -0
  9. package/examples/single-state-filter.json +153 -0
  10. package/index.html +10 -6
  11. package/package.json +6 -5
  12. package/src/CdcMap.tsx +367 -199
  13. package/src/_stories/CdcMap.stories.tsx +14 -0
  14. package/src/_stories/_mock/DEV-7286.json +165 -0
  15. package/src/_stories/_mock/DEV-8942.json +270 -0
  16. package/src/components/Annotation/Annotation.Draggable.styles.css +18 -0
  17. package/src/components/Annotation/Annotation.Draggable.tsx +152 -0
  18. package/src/components/Annotation/AnnotationDropdown.styles.css +14 -0
  19. package/src/components/Annotation/AnnotationDropdown.tsx +70 -0
  20. package/src/components/Annotation/AnnotationList.styles.css +45 -0
  21. package/src/components/Annotation/AnnotationList.tsx +42 -0
  22. package/src/components/Annotation/index.tsx +11 -0
  23. package/src/components/{BubbleList.jsx → BubbleList.tsx} +1 -1
  24. package/src/components/{CityList.jsx → CityList.tsx} +28 -2
  25. package/src/components/{DataTable.jsx → DataTable.tsx} +2 -2
  26. package/src/components/EditorPanel/components/EditorPanel.tsx +650 -129
  27. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +336 -0
  28. package/src/components/EditorPanel/components/{Panel.PatternSettings.tsx → Panels/Panel.PatternSettings.tsx} +63 -13
  29. package/src/components/EditorPanel/components/{Panels.tsx → Panels/index.tsx} +3 -0
  30. package/src/components/Legend/components/Legend.tsx +125 -42
  31. package/src/components/Legend/components/index.scss +42 -42
  32. package/src/components/Modal.tsx +25 -0
  33. package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +74 -0
  34. package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +29 -0
  35. package/src/components/UsaMap/components/SingleState/index.tsx +9 -0
  36. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +4 -3
  37. package/src/components/UsaMap/components/UsaMap.County.tsx +114 -36
  38. package/src/components/UsaMap/components/UsaMap.Region.tsx +2 -0
  39. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +175 -206
  40. package/src/components/UsaMap/components/UsaMap.State.tsx +188 -44
  41. package/src/components/UsaMap/data/us-extended-geography.json +1 -0
  42. package/src/components/UsaMap/helpers/map.ts +111 -0
  43. package/src/components/WorldMap/WorldMap.tsx +17 -32
  44. package/src/components/ZoomControls.tsx +41 -0
  45. package/src/data/initial-state.js +11 -2
  46. package/src/data/supported-geos.js +15 -4
  47. package/src/helpers/generateColorsArray.ts +13 -0
  48. package/src/helpers/generateRuntimeLegendHash.ts +23 -0
  49. package/src/helpers/getUniqueValues.ts +19 -0
  50. package/src/helpers/hashObj.ts +25 -0
  51. package/src/helpers/tests/generateColorsArray.test.ts +18 -0
  52. package/src/helpers/tests/generateRuntimeLegendHash.test.ts +11 -0
  53. package/src/helpers/tests/hashObj.test.ts +10 -0
  54. package/src/hooks/useStateZoom.tsx +157 -0
  55. package/src/hooks/{useZoomPan.js → useZoomPan.ts} +6 -5
  56. package/src/scss/editor-panel.scss +0 -4
  57. package/src/scss/main.scss +23 -1
  58. package/src/scss/map.scss +14 -3
  59. package/src/types/MapConfig.ts +9 -1
  60. package/src/types/MapContext.ts +16 -2
  61. package/LICENSE +0 -201
  62. package/src/components/Modal.jsx +0 -22
  63. package/src/test/CdcMap.test.jsx +0 -19
  64. /package/src/components/EditorPanel/components/{Panel.PatternSettings-style.css → Panels/Panel.PatternSettings-style.css} +0 -0
  65. /package/src/components/{Geo.jsx → Geo.tsx} +0 -0
  66. /package/src/components/{NavigationMenu.jsx → NavigationMenu.tsx} +0 -0
  67. /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,16 +13,20 @@
13
13
  min-height: 100vh;
14
14
  }
15
15
  </style>
16
- <link rel="stylesheet prefetch" href="https://www.cdc.gov/TemplatePackage/contrib/libs/bootstrap/latest/css/bootstrap.min.css?_=39423" />
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 -->
25
+ <!-- <div class="react-container" data-config="/examples/annotation/usa-map.json"></div> -->
22
26
  <!-- <div class="react-container" data-config="/examples/hex-colors.json"></div> -->
23
27
  <!-- <div class="react-container" data-config="/examples/private/map.json"></div> -->
24
28
  <!-- <div class="react-container" data-config="/examples/private/zika-issue.json"></div> -->
25
- <div class="react-container react-container--maps" data-config="/examples/usa-special-class-legend.json">/</div>
29
+ <!-- <div class="react-container react-container--maps" data-config="/examples/annotation/index.json">/</div> -->
26
30
 
27
31
  <!-- <div class="react-container react-container--maps" data-config="/examples/private/tooltip-issue.json"></div> -->
28
32
  <!-- <div class="react-container react-container--maps" data-config="/examples/test.json"></div> -->
@@ -34,9 +38,9 @@
34
38
  <!-- <div class="react-container react-container--maps" data-config="/examples/default-usa-regions.json"></div> -->
35
39
  <!-- <div class="react-container react-container--maps" data-config="/examples/default-usa.json"></div> -->
36
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> -->
37
- <!-- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/default-geocode.json"></div> -->
38
- <!-- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/default-single-state.json"></div> -->
39
- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/bubble-us.json"></div>
41
+ <div class="react-container react-container&#45;&#45;maps" data-config="/examples/default-geocode.json"></div>
42
+ <div class="react-container react-container&#45;&#45;maps" data-config="/examples/default-single-state.json"></div>
43
+ <!-- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/bubble-us.json"></div> -->
40
44
  <!-- <div class="react-container react-container&#45;&#45;maps" data-config="/examples/bubble-world.json"></div> -->
41
45
 
42
46
  <!-- TESTS DATA TABLE SORT-->
@@ -54,7 +58,7 @@
54
58
  <!-- TP4 EXAMPLES -->
55
59
  <div class="react-container react-container--maps" data-config="/examples/example-city-state.json"></div>
56
60
  <!-- <div class="react-container react-container--maps" data-config="/examples/example-city-state-no-territories.json"></div> -->
57
- <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> -->
58
62
  <!-- <div class="react-container react-container--maps" data-config="/examples/default-hex.json"></div> -->
59
63
 
60
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.5",
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",
@@ -8,8 +8,9 @@
8
8
  "scripts": {
9
9
  "start": "vite --open",
10
10
  "build": "vite build",
11
- "test": "vitest watch --reporter verbose",
12
- "test:ui": "vitest --ui",
11
+ "test": "vitest run --reporter verbose",
12
+ "test-watch": "vitest watch --reporter verbose",
13
+ "test-watch:ui": "vitest --ui",
13
14
  "preview": "vite preview",
14
15
  "graph": "nx graph",
15
16
  "prepublishOnly": "lerna run --scope @cdc/map build"
@@ -24,7 +25,7 @@
24
25
  },
25
26
  "license": "Apache-2.0",
26
27
  "dependencies": {
27
- "@cdc/core": "^4.24.5",
28
+ "@cdc/core": "^4.24.9",
28
29
  "@emotion/core": "^10.0.28",
29
30
  "@emotion/react": "^11.1.5",
30
31
  "@hello-pangea/dnd": "^16.2.0",
@@ -51,5 +52,5 @@
51
52
  "react": "^18.2.0",
52
53
  "react-dom": "^18.2.0"
53
54
  },
54
- "gitHead": "def85aaf4cd9dc1983e80f2900199f35de82af95"
55
+ "gitHead": "c4b0402afe6ed209a85b7078711549b9fd7dae7d"
55
56
  }