@cdc/map 4.26.2 → 4.26.3

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 (65) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cdcmap-vr9HZwRt.es.js +6 -0
  3. package/dist/cdcmap.js +26781 -24615
  4. package/examples/private/annotation-bug.json +642 -0
  5. package/package.json +3 -3
  6. package/src/CdcMap.tsx +3 -14
  7. package/src/CdcMapComponent.tsx +214 -159
  8. package/src/_stories/CdcMap.Defaults.stories.tsx +76 -0
  9. package/src/_stories/CdcMap.Editor.stories.tsx +187 -14
  10. package/src/_stories/CdcMap.stories.tsx +11 -1
  11. package/src/_stories/Map.HTMLInDataTable.stories.tsx +385 -0
  12. package/src/_stories/_mock/multi-state-show-unselected.json +82 -0
  13. package/src/cdcMapComponent.styles.css +2 -2
  14. package/src/components/Annotation/Annotation.Draggable.styles.css +4 -4
  15. package/src/components/Annotation/AnnotationDropdown.styles.css +1 -1
  16. package/src/components/Annotation/AnnotationList.styles.css +13 -13
  17. package/src/components/EditorPanel/components/EditorPanel.tsx +426 -58
  18. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings-style.css +1 -1
  19. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +5 -2
  20. package/src/components/EditorPanel/components/editorPanel.styles.css +34 -24
  21. package/src/components/Legend/components/Legend.tsx +9 -4
  22. package/src/components/Legend/components/LegendGroup/legend.group.css +5 -5
  23. package/src/components/Legend/components/index.scss +2 -3
  24. package/src/components/NavigationMenu.tsx +2 -1
  25. package/src/components/SmallMultiples/SmallMultiples.css +5 -5
  26. package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +32 -17
  27. package/src/components/UsaMap/components/TerritoriesSection.tsx +3 -2
  28. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +13 -8
  29. package/src/components/UsaMap/components/UsaMap.County.tsx +410 -183
  30. package/src/components/UsaMap/components/UsaMap.Region.styles.css +1 -1
  31. package/src/components/UsaMap/components/UsaMap.SingleState.styles.css +2 -2
  32. package/src/components/UsaMap/components/UsaMap.State.tsx +13 -8
  33. package/src/components/WorldMap/WorldMap.tsx +10 -13
  34. package/src/components/WorldMap/data/world-topo-updated.json +1 -0
  35. package/src/components/WorldMap/data/world-topo.json +1 -1
  36. package/src/components/WorldMap/worldMap.styles.css +1 -1
  37. package/src/components/ZoomControls.tsx +49 -18
  38. package/src/components/zoomControls.styles.css +27 -11
  39. package/src/data/initial-state.js +14 -5
  40. package/src/data/legacy-defaults.ts +8 -0
  41. package/src/data/supported-geos.js +19 -0
  42. package/src/helpers/colors.ts +2 -1
  43. package/src/helpers/dataTableHelpers.ts +56 -0
  44. package/src/helpers/displayGeoName.ts +19 -11
  45. package/src/helpers/getMapContainerClasses.ts +8 -2
  46. package/src/helpers/getMatchingPatternForRow.ts +67 -0
  47. package/src/helpers/getPatternForRow.ts +11 -18
  48. package/src/helpers/tests/dataTableHelpers.test.ts +78 -0
  49. package/src/helpers/tests/displayGeoName.test.ts +17 -0
  50. package/src/helpers/tests/getMatchingPatternForRow.test.ts +150 -0
  51. package/src/helpers/tests/getPatternForRow.test.ts +140 -2
  52. package/src/helpers/urlDataHelpers.ts +7 -1
  53. package/src/hooks/useResizeObserver.ts +36 -22
  54. package/src/hooks/useTooltip.test.tsx +64 -0
  55. package/src/hooks/useTooltip.ts +28 -8
  56. package/src/scss/editor-panel.scss +1 -1
  57. package/src/scss/main.scss +140 -6
  58. package/src/scss/map.scss +9 -4
  59. package/src/store/map.actions.ts +2 -0
  60. package/src/store/map.reducer.ts +4 -0
  61. package/src/test/CdcMap.test.jsx +2 -2
  62. package/src/types/MapConfig.ts +22 -4
  63. package/src/types/MapContext.ts +3 -1
  64. package/dist/cdcmap-Cf9_fbQf.es.js +0 -6
  65. package/src/helpers/componentHelpers.ts +0 -8
@@ -0,0 +1,82 @@
1
+ {
2
+ "general": {
3
+ "geoType": "single-state",
4
+ "geoBorderColor": "darkGray",
5
+ "headerColor": "theme-blue",
6
+ "showTitle": true,
7
+ "showSidebar": true,
8
+ "showDownloadButton": true,
9
+ "showDownloadMediaButton": false,
10
+ "displayAsHex": false,
11
+ "displayStateLabels": false,
12
+ "territoriesLabel": "Territories",
13
+ "language": "en",
14
+ "hasRegions": false,
15
+ "expandDataTable": false,
16
+ "fullBorder": false,
17
+ "type": "data",
18
+ "statesPicked": [
19
+ { "fipsCode": "01", "stateName": "Alabama" },
20
+ { "stateName": "Florida", "fipsCode": "12" },
21
+ { "stateName": "Georgia", "fipsCode": "13" },
22
+ { "stateName": "South Carolina", "fipsCode": "45" }
23
+ ],
24
+ "hideUnselectedStates": false,
25
+ "title": "Multi-State Map - Show Unselected States",
26
+ "subtext": "Unselected states are shown as light outlines for geographic context."
27
+ },
28
+ "type": "map",
29
+ "color": "orangered",
30
+ "columns": {
31
+ "geo": { "name": "FIPS Codes", "label": "Location", "tooltip": false, "dataTable": true },
32
+ "primary": {
33
+ "dataTable": true,
34
+ "tooltip": true,
35
+ "prefix": "",
36
+ "suffix": "%",
37
+ "name": "Percent Vaccinated",
38
+ "label": "Percent Vaccinated"
39
+ },
40
+ "navigate": { "name": "" }
41
+ },
42
+ "legend": {
43
+ "descriptions": {},
44
+ "specialClasses": [],
45
+ "unified": false,
46
+ "singleColumn": true,
47
+ "dynamicDescription": false,
48
+ "type": "equalinterval",
49
+ "numberOfItems": 4,
50
+ "position": "side",
51
+ "title": "Percent Vaccinated",
52
+ "description": ""
53
+ },
54
+ "filters": [],
55
+ "dataTable": { "title": "Data Table", "forceDisplay": true, "indexTitle": "Percent Vaccinated" },
56
+ "tooltips": { "appearanceType": "hover", "linkLabel": "Learn More", "capitalizeLabels": true },
57
+ "data": [
58
+ { "FIPS Codes": "01001", "County": "Autauga County", "Percent Vaccinated": 34.13 },
59
+ { "FIPS Codes": "01003", "County": "Baldwin County", "Percent Vaccinated": 37.55 },
60
+ { "FIPS Codes": "01005", "County": "Barbour County", "Percent Vaccinated": 32.78 },
61
+ { "FIPS Codes": "01073", "County": "Jefferson County", "Percent Vaccinated": 55.79 },
62
+ { "FIPS Codes": "01089", "County": "Madison County", "Percent Vaccinated": 57.67 },
63
+ { "FIPS Codes": "01097", "County": "Mobile County", "Percent Vaccinated": 39.18 },
64
+ { "FIPS Codes": "01101", "County": "Montgomery County", "Percent Vaccinated": 50.54 },
65
+ { "FIPS Codes": "12011", "County": "Broward County", "Percent Vaccinated": 73.98 },
66
+ { "FIPS Codes": "12031", "County": "Duval County", "Percent Vaccinated": 53.48 },
67
+ { "FIPS Codes": "12057", "County": "Hillsborough County", "Percent Vaccinated": 58.66 },
68
+ { "FIPS Codes": "12086", "County": "Miami-Dade County", "Percent Vaccinated": 91.5 },
69
+ { "FIPS Codes": "12095", "County": "Orange County", "Percent Vaccinated": 77.97 },
70
+ { "FIPS Codes": "12099", "County": "Palm Beach County", "Percent Vaccinated": 60.75 },
71
+ { "FIPS Codes": "13089", "County": "DeKalb County", "Percent Vaccinated": 50.4 },
72
+ { "FIPS Codes": "13121", "County": "Fulton County", "Percent Vaccinated": 44.58 },
73
+ { "FIPS Codes": "13067", "County": "Cobb County", "Percent Vaccinated": 51.43 },
74
+ { "FIPS Codes": "13135", "County": "Gwinnett County", "Percent Vaccinated": 42.55 },
75
+ { "FIPS Codes": "13051", "County": "Chatham County", "Percent Vaccinated": 50.47 },
76
+ { "FIPS Codes": "45019", "County": "Charleston County", "Percent Vaccinated": 63.1 },
77
+ { "FIPS Codes": "45045", "County": "Greenville County", "Percent Vaccinated": 45.84 },
78
+ { "FIPS Codes": "45079", "County": "Richland County", "Percent Vaccinated": 64.96 },
79
+ { "FIPS Codes": "45013", "County": "Beaufort County", "Percent Vaccinated": 60.82 },
80
+ { "FIPS Codes": "45051", "County": "Horry County", "Percent Vaccinated": 40.86 }
81
+ ]
82
+ }
@@ -1,9 +1,9 @@
1
- .map-container {
1
+ .visualization-container {
2
2
  &.full-border {
3
3
  border: #c2c2c2 1px solid;
4
4
  }
5
5
  }
6
6
 
7
- header + .map-container.full-border {
7
+ header + .visualization-container.full-border {
8
8
  border-top: 0; /* When they have a header, don't add a border top */
9
9
  }
@@ -1,18 +1,18 @@
1
- .cdc-open-viz-module.type-map .annotation__desktop-label {
1
+ .cove-visualization.type-map .annotation__desktop-label {
2
2
  display: none;
3
3
  }
4
4
 
5
- .cdc-open-viz-module.type-map {
5
+ .cove-visualization.type-map {
6
6
  .annotation__mobile-label-circle {
7
7
  stroke-width: 2;
8
8
  }
9
9
  }
10
10
 
11
11
  @container content (min-width: 700px) {
12
- .cdc-open-viz-module.type-map .annotation__mobile-label {
12
+ .cove-visualization.type-map .annotation__mobile-label {
13
13
  display: none;
14
14
  }
15
- .cdc-open-viz-module.type-map .annotation__desktop-label {
15
+ .cove-visualization.type-map .annotation__desktop-label {
16
16
  display: block;
17
17
  }
18
18
  }
@@ -1,4 +1,4 @@
1
- .cdc-open-viz-module.type-map {
1
+ .cove-visualization.type-map {
2
2
  .annotation__dropdown-list {
3
3
  list-style: none;
4
4
  }
@@ -1,29 +1,29 @@
1
- .cdc-open-viz-module.type-map {
1
+ .cove-visualization.type-map {
2
2
  .annotation__title-circle {
3
- display: flex;
4
- justify-content: center;
5
3
  align-items: center;
4
+
5
+ border: 2px solid #666;
6
6
  border-radius: 50%;
7
- padding: 8px;
8
- width: 16px;
7
+ display: flex;
8
+ font-size: 14px;
9
9
  height: 16px;
10
- margin-right: 5px;
10
+ justify-content: center;
11
11
  line-height: 1.5rem;
12
-
13
- border: 2px solid #666;
12
+ margin-right: 5px;
13
+ padding: 8px;
14
14
  text-align: center;
15
- font-size: 14px;
15
+ width: 16px;
16
16
  }
17
17
 
18
18
  .annotation__title-wrapper {
19
+ align-items: center;
19
20
  display: flex;
20
21
  flex-wrap: nowrap;
21
- align-items: center;
22
22
  }
23
23
 
24
24
  .annotation__title-wrapper .annotation__title-text {
25
- margin-left: 5px;
26
25
  font-size: 16px;
26
+ margin-left: 5px;
27
27
  }
28
28
 
29
29
  .annotation__subtext {
@@ -38,8 +38,8 @@
38
38
  margin-top: 5px;
39
39
  }
40
40
 
41
- .cove-component__content {
42
- container-type: inline-size;
41
+ .cove-visualization__body {
43
42
  container-name: content;
43
+ container-type: inline-size;
44
44
  }
45
45
  }