@cdc/map 4.25.8 → 4.25.10

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 (84) hide show
  1. package/.claude/settings.local.json +30 -0
  2. package/dist/cdcmap.js +54263 -52600
  3. package/examples/private/c.json +290 -0
  4. package/examples/private/canvas-city-hover.json +787 -0
  5. package/examples/private/d.json +345 -0
  6. package/examples/private/g.json +1 -0
  7. package/examples/private/h.json +105911 -0
  8. package/examples/private/measles-data.json +378 -0
  9. package/examples/private/measles.json +211 -0
  10. package/examples/private/north-dakota.json +1132 -0
  11. package/examples/private/state-with-pattern.json +883 -0
  12. package/index.html +35 -34
  13. package/package.json +26 -5
  14. package/src/CdcMap.tsx +23 -8
  15. package/src/CdcMapComponent.tsx +215 -309
  16. package/src/_stories/CdcMap.Filters.stories.tsx +2 -2
  17. package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +3 -3
  18. package/src/_stories/CdcMap.Legend.stories.tsx +7 -4
  19. package/src/_stories/CdcMap.Patterns.stories.tsx +2 -2
  20. package/src/_stories/CdcMap.Table.stories.tsx +2 -2
  21. package/src/_stories/CdcMap.stories.tsx +15 -5
  22. package/src/_stories/GoogleMap.stories.tsx +2 -2
  23. package/src/_stories/UsaMap.NoData.stories.tsx +2 -2
  24. package/src/_stories/_mock/equal-number.json +1109 -0
  25. package/src/_stories/_mock/us-bubble-cities.json +306 -0
  26. package/src/components/BubbleList.tsx +16 -12
  27. package/src/components/CityList.tsx +85 -107
  28. package/src/components/DataTable.tsx +37 -9
  29. package/src/components/EditorPanel/components/EditorPanel.tsx +177 -165
  30. package/src/components/EditorPanel/components/HexShapeSettings.tsx +3 -2
  31. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +7 -5
  32. package/src/components/Geo.tsx +2 -0
  33. package/src/components/Legend/components/Legend.tsx +109 -73
  34. package/src/components/Legend/components/LegendGroup/Legend.Group.tsx +10 -7
  35. package/src/components/MapContainer.tsx +52 -0
  36. package/src/components/MapControls.tsx +44 -0
  37. package/src/components/NavigationMenu.tsx +11 -2
  38. package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +24 -7
  39. package/src/components/UsaMap/components/UsaMap.County.tsx +111 -37
  40. package/src/components/UsaMap/components/UsaMap.Region.tsx +23 -5
  41. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +6 -6
  42. package/src/components/UsaMap/components/UsaMap.State.tsx +28 -10
  43. package/src/components/UsaMap/helpers/map.ts +2 -2
  44. package/src/components/WorldMap/WorldMap.tsx +113 -25
  45. package/src/components/ZoomControls.tsx +6 -9
  46. package/src/context/LegendMemoContext.tsx +30 -0
  47. package/src/context.ts +1 -40
  48. package/src/data/initial-state.js +143 -130
  49. package/src/data/supported-geos.js +17 -2
  50. package/src/helpers/applyColorToLegend.ts +116 -20
  51. package/src/helpers/applyLegendToRow.ts +10 -6
  52. package/src/helpers/componentHelpers.ts +8 -0
  53. package/src/helpers/constants.ts +12 -0
  54. package/src/helpers/dataTableHelpers.ts +6 -0
  55. package/src/helpers/displayGeoName.ts +1 -1
  56. package/src/helpers/generateRuntimeLegend.ts +44 -8
  57. package/src/helpers/generateRuntimeLegendHash.ts +4 -2
  58. package/src/helpers/getColumnNames.ts +1 -1
  59. package/src/helpers/getPatternForRow.ts +36 -0
  60. package/src/helpers/getStatesPicked.ts +8 -5
  61. package/src/helpers/index.ts +11 -3
  62. package/src/helpers/isLegendItemDisabled.ts +16 -0
  63. package/src/helpers/mapObserverHelpers.ts +40 -0
  64. package/src/helpers/resetLegendToggles.ts +3 -2
  65. package/src/helpers/toggleLegendActive.ts +6 -11
  66. package/src/helpers/urlDataHelpers.ts +70 -0
  67. package/src/hooks/useGeoClickHandler.ts +35 -1
  68. package/src/hooks/useLegendMemo.ts +17 -0
  69. package/src/hooks/useMapLayers.tsx +5 -4
  70. package/src/hooks/useStateZoom.tsx +25 -6
  71. package/src/hooks/useTooltip.ts +1 -2
  72. package/src/index.jsx +0 -2
  73. package/src/store/map.reducer.ts +17 -6
  74. package/src/test/CdcMap.test.jsx +11 -0
  75. package/src/types/MapConfig.ts +23 -14
  76. package/src/types/MapContext.ts +0 -7
  77. package/src/types/runtimeLegend.ts +17 -1
  78. package/vite.config.js +2 -7
  79. package/vitest.config.ts +16 -0
  80. package/src/coreStyles_map.scss +0 -3
  81. package/src/helpers/colorDistributions.ts +0 -12
  82. package/src/helpers/generateColorsArray.ts +0 -14
  83. package/src/helpers/tests/generateColorsArray.test.ts +0 -18
  84. package/src/helpers/tests/generateRuntimeLegendHash.test.ts +0 -11
@@ -3,6 +3,7 @@ import { geoMercator } from 'd3-geo'
3
3
  import { Mercator } from '@visx/geo'
4
4
  import { feature } from 'topojson-client'
5
5
  import ConfigContext, { MapDispatchContext } from '../../context'
6
+ import { useLegendMemoContext } from '../../context/LegendMemoContext'
6
7
  import ErrorBoundary from '@cdc/core/components/ErrorBoundary'
7
8
  import ZoomableGroup from '../ZoomableGroup'
8
9
  import Geo from '../Geo'
@@ -28,23 +29,23 @@ import { applyLegendToRow } from '../../helpers/applyLegendToRow'
28
29
 
29
30
  import './worldMap.styles.css'
30
31
  import { publishAnalyticsEvent } from '@cdc/core/helpers/metrics/helpers'
32
+ import { getVizTitle, getVizSubType } from '@cdc/core/helpers/metrics/utils'
31
33
 
32
34
  let projection = geoMercator()
33
35
 
34
36
  const WorldMap = () => {
35
37
  // prettier-ignore
36
38
  const {
37
- data,
39
+ runtimeData,
38
40
  position,
39
- setRuntimeData,
40
41
  config,
41
42
  tooltipId,
42
43
  runtimeLegend,
43
- legendMemo,
44
- legendSpecialClassLastMemo,
45
44
  interactionLabel
46
45
  } = useContext(ConfigContext)
47
46
 
47
+ const { legendMemo, legendSpecialClassLastMemo } = useLegendMemoContext()
48
+
48
49
  const { type, allowMapZoom } = config.general
49
50
 
50
51
  const [world, setWorld] = useState(null)
@@ -65,38 +66,97 @@ const WorldMap = () => {
65
66
  return <></>
66
67
  }
67
68
 
68
- const handleReset = () => {
69
+ const handleFiltersReset = () => {
69
70
  const newRuntimeData = generateRuntimeData(config)
70
- publishAnalyticsEvent('map_reset_zoom_level', 'click', interactionLabel, 'map')
71
- dispatch({ type: 'SET_POSITION', payload: { coordinates: [0, 30], zoom: 1 } })
71
+ publishAnalyticsEvent({
72
+ vizType: config.type,
73
+ vizSubType: getVizSubType(config),
74
+ eventType: 'map_filter_reset',
75
+ eventAction: 'click',
76
+ eventLabel: interactionLabel,
77
+ vizTitle: getVizTitle(config)
78
+ })
72
79
  dispatch({ type: 'SET_FILTERED_COUNTRY_CODE', payload: '' })
73
- setRuntimeData(newRuntimeData)
80
+ dispatch({ type: 'SET_RUNTIME_DATA', payload: newRuntimeData })
81
+ }
82
+
83
+ const handleZoomReset = _setRuntimeData => {
84
+ publishAnalyticsEvent({
85
+ vizType: config.type,
86
+ vizSubType: getVizSubType(config),
87
+ eventType: 'map_reset_zoom_level',
88
+ eventAction: 'click',
89
+ eventLabel: interactionLabel,
90
+ vizTitle: getVizTitle(config)
91
+ })
92
+ dispatch({ type: 'SET_POSITION', payload: { coordinates: [0, 30], zoom: 1 } })
74
93
  }
75
94
 
76
95
  const handleZoomIn = position => {
77
96
  if (position.zoom >= 4) return
78
- publishAnalyticsEvent(
79
- 'map_zoomed_in',
80
- 'click',
81
- `${interactionLabel}|zoom_level_${Math.floor(position.zoom * 1.5)}|${position.coordinates}`,
82
- 'map'
83
- )
97
+ publishAnalyticsEvent({
98
+ vizType: config.type,
99
+ vizSubType: getVizSubType(config),
100
+ eventType: `zoom_in`,
101
+ eventAction: 'click',
102
+ eventLabel: interactionLabel,
103
+ vizTitle: getVizTitle(config),
104
+ specifics: `zoom_level: ${Math.floor(position.zoom * 1.5)}`
105
+ })
106
+ publishAnalyticsEvent({
107
+ vizType: config.type,
108
+ vizSubType: getVizSubType(config),
109
+ eventType: `zoom_in`,
110
+ eventAction: 'click',
111
+ eventLabel: interactionLabel,
112
+ vizTitle: getVizTitle(config),
113
+ specifics: `location: ${position.coordinates}`
114
+ })
84
115
  dispatch({ type: 'SET_POSITION', payload: { coordinates: position.coordinates, zoom: position.zoom * 1.5 } })
85
116
  }
86
117
 
87
118
  const handleZoomOut = position => {
88
119
  if (position.zoom <= 1) return
89
- publishAnalyticsEvent(
90
- 'map_zoomed_out',
91
- 'click',
92
- `${interactionLabel}|zoom_level_${Math.floor(position.zoom / 1.5)}|${position.coordinates}`,
93
- 'map'
94
- )
120
+ publishAnalyticsEvent({
121
+ vizType: config.type,
122
+ vizSubType: getVizSubType(config),
123
+ eventType: `zoom_out`,
124
+ eventAction: 'click',
125
+ eventLabel: interactionLabel,
126
+ vizTitle: getVizTitle(config),
127
+ specifics: `zoom_level: ${Math.floor(position.zoom / 1.5)}`
128
+ })
129
+ publishAnalyticsEvent({
130
+ vizType: config.type,
131
+ vizSubType: getVizSubType(config),
132
+ eventType: `zoom_out`,
133
+ eventAction: 'click',
134
+ eventLabel: interactionLabel,
135
+ vizTitle: getVizTitle(config),
136
+ specifics: `location: ${position.coordinates}`
137
+ })
95
138
  dispatch({ type: 'SET_POSITION', payload: { coordinates: position.coordinates, zoom: position.zoom / 1.5 } })
96
139
  }
97
140
 
98
141
  const handleMoveEnd = position => {
99
- publishAnalyticsEvent('map_panned', 'drag', interactionLabel, 'map')
142
+ publishAnalyticsEvent({
143
+ vizType: config.type,
144
+ vizSubType: getVizSubType(config),
145
+ eventType: 'map_panned',
146
+ eventAction: 'drag',
147
+ eventLabel: interactionLabel,
148
+ vizTitle: getVizTitle(config),
149
+ specifics: `zoom: ${position.zoom}`
150
+ })
151
+ publishAnalyticsEvent({
152
+ vizType: config.type,
153
+ vizSubType: getVizSubType(config),
154
+ eventType: 'map_panned',
155
+ eventAction: 'drag',
156
+ eventLabel: interactionLabel,
157
+ vizTitle: getVizTitle(config),
158
+ specifics: `coordinates: ${position.coordinates}`
159
+ })
100
160
  dispatch({ type: 'SET_POSITION', payload: position })
101
161
  }
102
162
 
@@ -105,7 +165,7 @@ const WorldMap = () => {
105
165
  // If the geo.properties.config value is found in the data use that, otherwise fall back to geo.properties.iso
106
166
  const dataHasStateName = config.data.some(d => d[config.columns.geo.name] === geo.properties.state)
107
167
  const geoKey =
108
- geo.properties.state && data[geo.properties.state]
168
+ geo.properties.state && runtimeData[geo.properties.state]
109
169
  ? geo.properties.state
110
170
  : geo.properties.name
111
171
  ? geo.properties.name
@@ -116,7 +176,7 @@ const WorldMap = () => {
116
176
  }
117
177
  if (!geoKey) return null
118
178
 
119
- let geoData = data[geoKey]
179
+ let geoData = runtimeData[geoKey]
120
180
 
121
181
  const geoDisplayName = displayGeoName(supportedCountries[geoKey]?.[0])
122
182
  let legendColors
@@ -169,6 +229,20 @@ const WorldMap = () => {
169
229
  stroke={geoStrokeColor}
170
230
  strokeWidth={strokeWidth}
171
231
  onClick={() => geoClickHandler(geoDisplayName, geoData)}
232
+ onMouseEnter={() => {
233
+ // Track hover analytics event if this is a new location
234
+ const locationName = geoDisplayName.replace(/[^a-zA-Z0-9]/g, '_')
235
+ publishAnalyticsEvent({
236
+ vizType: config.type,
237
+ vizSubType: getVizSubType(config),
238
+ eventType: `map_hover`,
239
+ eventAction: 'hover',
240
+ eventLabel: interactionLabel,
241
+ vizTitle: getVizTitle(config),
242
+ location: geoDisplayName,
243
+ specifics: `location: ${locationName?.toLowerCase()}`
244
+ })
245
+ }}
172
246
  data-tooltip-id={`tooltip__${tooltipId}`}
173
247
  data-tooltip-html={toolTip}
174
248
  tabIndex={-1}
@@ -186,6 +260,20 @@ const WorldMap = () => {
186
260
  strokeWidth={strokeWidth}
187
261
  styles={styles}
188
262
  path={path}
263
+ onMouseEnter={() => {
264
+ // Track hover analytics event if this is a new location
265
+ const locationName = geoDisplayName.replace(/[^a-zA-Z0-9]/g, '_')
266
+ publishAnalyticsEvent({
267
+ vizType: config.type,
268
+ vizSubType: getVizSubType(config),
269
+ eventType: `map_hover`,
270
+ eventAction: 'hover',
271
+ eventLabel: interactionLabel,
272
+ vizTitle: getVizTitle(config),
273
+ location: geoDisplayName,
274
+ specifics: `location: ${locationName?.toLowerCase()}`
275
+ })
276
+ }}
189
277
  data-tooltip-id={`tooltip__${tooltipId}`}
190
278
  data-tooltip-html={toolTip}
191
279
  />
@@ -207,7 +295,7 @@ const WorldMap = () => {
207
295
  <ErrorBoundary component='WorldMap'>
208
296
  {allowMapZoom ? (
209
297
  <svg viewBox={SVG_VIEWBOX} role='img' aria-label={handleMapAriaLabels(config)}>
210
- <rect height={SVG_HEIGHT} width={SVG_WIDTH} onClick={handleReset} fill='white' />
298
+ <rect height={SVG_HEIGHT} width={SVG_WIDTH} onClick={handleFiltersReset} fill='white' />
211
299
  <ZoomableGroup
212
300
  zoom={position.zoom}
213
301
  center={position.coordinates}
@@ -236,7 +324,7 @@ const WorldMap = () => {
236
324
  </svg>
237
325
  )}
238
326
  {(type === 'data' || (type === 'world-geocode' && allowMapZoom) || (type === 'bubble' && allowMapZoom)) && (
239
- <ZoomControls handleZoomIn={handleZoomIn} handleZoomOut={handleZoomOut} handleReset={handleReset} />
327
+ <ZoomControls handleZoomIn={handleZoomIn} handleZoomOut={handleZoomOut} handleZoomReset={handleZoomReset} />
240
328
  )}
241
329
  </ErrorBoundary>
242
330
  )
@@ -7,10 +7,10 @@ import './zoomControls.styles.css'
7
7
  type ZoomControlsProps = {
8
8
  handleZoomIn: (coordinates: [Number, Number]) => void
9
9
  handleZoomOut: (coordinates: [Number, Number]) => void
10
- handleReset: (setRuntimeData: Function) => void
10
+ handleZoomReset: (setRuntimeData: Function) => void
11
11
  }
12
12
 
13
- const ZoomControls: React.FC<ZoomControlsProps> = ({ handleZoomIn, handleZoomOut, handleReset }) => {
13
+ const ZoomControls: React.FC<ZoomControlsProps> = ({ handleZoomIn, handleZoomOut, handleZoomReset }) => {
14
14
  const { config, setRuntimeData, position } = useContext<MapContext>(ConfigContext)
15
15
  if (!config.general.allowMapZoom) return
16
16
  return (
@@ -26,13 +26,10 @@ const ZoomControls: React.FC<ZoomControlsProps> = ({ handleZoomIn, handleZoomOut
26
26
  <line x1='5' y1='12' x2='19' y2='12' />
27
27
  </svg>
28
28
  </button>
29
- {config.general.type === 'bubble' && (
30
- <button onClick={() => handleReset(setRuntimeData)} className='reset' aria-label='Reset Zoom and Map Filters'>
31
- Reset Filters
32
- </button>
33
- )}
34
- {(config.general.type === 'world-geocode' || config.general.geoType === 'single-state') && (
35
- <button onClick={() => handleReset(setRuntimeData)} className='reset' aria-label='Reset Zoom'>
29
+ {(config.general.type === 'world-geocode' ||
30
+ config.general.geoType === 'single-state' ||
31
+ config.general.type === 'bubble') && (
32
+ <button onClick={() => handleZoomReset(setRuntimeData)} className='reset' aria-label='Reset Zoom'>
36
33
  Reset Zoom
37
34
  </button>
38
35
  )}
@@ -0,0 +1,30 @@
1
+ import React, { createContext, useContext } from 'react'
2
+
3
+ interface LegendMemoContextType {
4
+ legendMemo: React.RefObject<Map<any, any>>
5
+ legendSpecialClassLastMemo: React.RefObject<Map<any, any>>
6
+ }
7
+
8
+ const LegendMemoContext = createContext<LegendMemoContextType | null>(null)
9
+
10
+ export const LegendMemoProvider: React.FC<{
11
+ children: React.ReactNode
12
+ legendMemo: React.RefObject<Map<any, any>>
13
+ legendSpecialClassLastMemo: React.RefObject<Map<any, any>>
14
+ }> = ({ children, legendMemo, legendSpecialClassLastMemo }) => {
15
+ return (
16
+ <LegendMemoContext.Provider value={{ legendMemo, legendSpecialClassLastMemo }}>
17
+ {children}
18
+ </LegendMemoContext.Provider>
19
+ )
20
+ }
21
+
22
+ export const useLegendMemoContext = () => {
23
+ const context = useContext(LegendMemoContext)
24
+ if (!context) {
25
+ throw new Error('useLegendMemoContext must be used within a LegendMemoProvider')
26
+ }
27
+ return context
28
+ }
29
+
30
+ export default LegendMemoContext
package/src/context.ts CHANGED
@@ -1,46 +1,7 @@
1
1
  import { createContext, Dispatch } from 'react'
2
- import { MapConfig } from './types/MapConfig'
2
+ import { MapContext } from './types/MapContext'
3
3
  import MapActions from './store/map.actions'
4
4
 
5
- type MapContext = {
6
- container
7
- setSharedFilter
8
- customNavigationHandler
9
- tooltipRef
10
- containerEl
11
- applyLegendToRow
12
- data
13
- displayGeoName
14
- filteredCountryCode
15
- generateColorsArray
16
- generateRuntimeData
17
- geoClickHandler
18
- handleCircleClick: Function
19
- innerContainerRef
20
- isDashboard
21
- isEditor
22
- mapId: string
23
- loadConfig
24
- position
25
- resetLegendToggles
26
- runtimeFilters
27
- runtimeLegend
28
- setParentConfig
29
- setRuntimeData
30
- setRuntimeFilters
31
- setRuntimeLegend
32
- setSharedFilterValue
33
- setConfig: Function
34
- config: MapConfig
35
- tooltipId: string
36
- legendMemo
37
- legendSpecialClassLastMemo
38
- translate
39
- scale
40
- annotations
41
- interactionLabel?: string
42
- }
43
-
44
5
  export const MapDispatchContext = createContext<Dispatch<MapActions>>(() => {})
45
6
 
46
7
  const ConfigContext = createContext({} as MapContext)
@@ -1,135 +1,148 @@
1
- export default {
2
- annotations: [],
3
- general: {
4
- navigationTarget: '_self',
5
- noStateFoundMessage: 'Map Unavailable',
6
- annotationDropdownText: 'Annotations',
7
- geoBorderColor: 'darkGray',
8
- headerColor: 'theme-blue',
9
- title: '',
10
- showTitle: true,
11
- showSidebar: true,
12
- showDownloadMediaButton: false,
13
- displayAsHex: false,
14
- displayStateLabels: true,
15
- territoriesAlwaysShow: false,
16
- language: 'en',
17
- geoType: 'single-state',
18
- geoLabelOverride: '',
19
- hasRegions: false,
20
- fullBorder: false,
21
- type: 'data',
22
- convertFipsCodes: true,
23
- palette: {
24
- isReversed: false
25
- },
26
- allowMapZoom: true,
27
- hideGeoColumnInTooltip: false,
28
- hidePrimaryColumnInTooltip: false,
29
- statesPicked: [
30
- {
31
- fipsCode: '01',
32
- stateName: 'Alabama'
1
+ import { USE_V2_MIGRATION } from '@cdc/core/helpers/constants'
2
+
3
+ // Dynamic initial state based on migration flag
4
+ const createInitialState = () => {
5
+ const paletteDefaults = USE_V2_MIGRATION
6
+ ? {
7
+ isReversed: true,
8
+ name: 'sequential_bluereverse',
9
+ version: '2.0'
10
+ }
11
+ : {
12
+ isReversed: true,
13
+ name: 'bluegreen',
14
+ version: '1.0'
33
15
  }
34
- ]
35
- },
36
- type: 'map',
37
- color: 'pinkpurple',
38
- columns: {
39
- geo: {
40
- name: 'FIPS Codes',
41
- label: 'Location',
42
- tooltip: false,
43
- dataTable: true
16
+
17
+ return {
18
+ annotations: [],
19
+ general: {
20
+ navigationTarget: '_self',
21
+ noDataMessage: 'No State Selected',
22
+ annotationDropdownText: 'Annotations',
23
+ geoBorderColor: 'darkGray',
24
+ headerColor: 'theme-blue',
25
+ title: '',
26
+ showTitle: true,
27
+ showSidebar: true,
28
+ showDownloadMediaButton: false,
29
+ displayAsHex: false,
30
+ displayStateLabels: true,
31
+ territoriesAlwaysShow: false,
32
+ language: 'en',
33
+ geoType: 'single-state',
34
+ geoLabelOverride: '',
35
+ hasRegions: false,
36
+ fullBorder: false,
37
+ type: 'data',
38
+ convertFipsCodes: true,
39
+ palette: paletteDefaults,
40
+ allowMapZoom: true,
41
+ hideGeoColumnInTooltip: false,
42
+ hidePrimaryColumnInTooltip: false,
43
+ statesPicked: []
44
44
  },
45
- primary: {
46
- dataTable: true,
47
- tooltip: true,
48
- prefix: '',
49
- suffix: '',
50
- name: '',
51
- label: '',
52
- roundToPlace: 0
45
+ type: 'map',
46
+ columns: {
47
+ geo: {
48
+ name: 'FIPS Codes',
49
+ label: 'Location',
50
+ tooltip: false,
51
+ dataTable: true
52
+ },
53
+ primary: {
54
+ dataTable: true,
55
+ tooltip: true,
56
+ prefix: '',
57
+ suffix: '',
58
+ name: '',
59
+ label: '',
60
+ roundToPlace: 0
61
+ },
62
+ navigate: {
63
+ name: ''
64
+ },
65
+ latitude: { name: '' },
66
+ longitude: { name: '' }
53
67
  },
54
- navigate: {
55
- name: ''
68
+ legend: {
69
+ descriptions: {},
70
+ specialClasses: [],
71
+ unified: false,
72
+ singleColumn: false,
73
+ singleRow: false,
74
+ verticalSorted: false,
75
+ showSpecialClassesLast: false,
76
+ dynamicDescription: false,
77
+ type: 'equalnumber',
78
+ numberOfItems: 3,
79
+ position: 'side',
80
+ title: '',
81
+ style: 'circles',
82
+ subStyle: 'linear blocks',
83
+ tickRotation: '',
84
+ singleColumnLegend: false,
85
+ hideBorder: false,
86
+ groupBy: ''
56
87
  },
57
- latitude: { name: '' },
58
- longitude: { name: '' }
59
- },
60
- legend: {
61
- descriptions: {},
62
- specialClasses: [],
63
- unified: false,
64
- singleColumn: false,
65
- singleRow: false,
66
- verticalSorted: false,
67
- showSpecialClassesLast: false,
68
- dynamicDescription: false,
69
- type: 'equalnumber',
70
- numberOfItems: 3,
71
- position: 'side',
72
- title: '',
73
- style: 'circles',
74
- subStyle: 'linear blocks',
75
- tickRotation: '',
76
- singleColumnLegend: false,
77
- hideBorder: false,
78
- groupBy: ''
79
- },
80
- filters: [],
81
- data: [],
82
- table: {
83
- wrapColumns: false,
84
- label: 'Data Table',
85
- expanded: false,
86
- limitHeight: false,
87
- height: '',
88
- caption: '',
89
- showDownloadUrl: false,
90
- showDataTableLink: true,
91
- showDownloadLinkBelow: true,
92
- showFullGeoNameInCSV: false,
93
- forceDisplay: true,
94
- download: false,
95
- indexLabel: '',
96
- cellMinWidth: '0',
97
- collapsible: true
98
- },
99
- tooltips: {
100
- appearanceType: 'hover',
101
- linkLabel: 'Learn More',
102
- opacity: 90
103
- },
104
- runtime: {
105
- editorErrorMessage: []
106
- },
107
- visual: {
108
- minBubbleSize: 1,
109
- maxBubbleSize: 20,
110
- extraBubbleBorder: false,
111
- cityStyle: 'circle',
112
- cityStyleLabel: '',
113
- showBubbleZeros: false,
114
- additionalCityStyles: [],
115
- geoCodeCircleSize: 8,
116
- showBubbleZeros: false
117
- },
118
- mapPosition: { coordinates: [0, 30], zoom: 1 },
119
- map: {
120
- layers: [],
121
- patterns: []
122
- },
123
- hexMap: {
124
- type: '',
125
- shapeGroups: [
126
- {
127
- legendTitle: '',
128
- legendDescription: '',
129
- items: [{ key: '', shape: 'Arrow Up', column: '', operator: '=', value: '' }]
130
- }
131
- ]
132
- },
133
- filterBehavior: 'Filter Change',
134
- filterIntro: ''
88
+ filters: [],
89
+ data: [],
90
+ table: {
91
+ wrapColumns: false,
92
+ label: 'Data Table',
93
+ expanded: false,
94
+ limitHeight: false,
95
+ height: '',
96
+ caption: '',
97
+ showDownloadUrl: false,
98
+ showDataTableLink: true,
99
+ showDownloadLinkBelow: true,
100
+ showFullGeoNameInCSV: false,
101
+ forceDisplay: true,
102
+ download: false,
103
+ indexLabel: '',
104
+ cellMinWidth: '0',
105
+ collapsible: true
106
+ },
107
+ tooltips: {
108
+ appearanceType: 'hover',
109
+ linkLabel: 'Learn More',
110
+ opacity: 90
111
+ },
112
+ runtime: {
113
+ editorErrorMessage: []
114
+ },
115
+ visual: {
116
+ minBubbleSize: 1,
117
+ maxBubbleSize: 20,
118
+ extraBubbleBorder: false,
119
+ cityStyle: 'circle',
120
+ cityStyleLabel: '',
121
+ showBubbleZeros: false,
122
+ additionalCityStyles: [],
123
+ geoCodeCircleSize: 8,
124
+ showBubbleZeros: false
125
+ },
126
+ mapPosition: { coordinates: [0, 30], zoom: 1 },
127
+ map: {
128
+ layers: [],
129
+ patterns: []
130
+ },
131
+ hexMap: {
132
+ type: '',
133
+ shapeGroups: [
134
+ {
135
+ legendTitle: '',
136
+ legendDescription: '',
137
+ items: [{ key: '', shape: 'Arrow Up', column: '', operator: '=', value: '' }]
138
+ }
139
+ ]
140
+ },
141
+ filterBehavior: 'Filter Change',
142
+ filterIntro: '',
143
+ markupVariables: [],
144
+ enableMarkupVariables: false
145
+ }
135
146
  }
147
+
148
+ export default createInitialState()
@@ -512,7 +512,14 @@ export const supportedCountries = {
512
512
  NIU: ['Niue', 'Niue (New Zealand)'],
513
513
  NFK: ['Norfolk Island', 'Norfolk Island (Australia)'],
514
514
  MKD: ['North Macedonia', 'Republic of North Macedonia', 'Macedonia'],
515
- MNP: ['Northern Mariana Islands', 'N. Mariana Is.', 'Northern Mariana Islands (U.S.)'],
515
+ MNP: [
516
+ 'Northern Mariana Islands',
517
+ 'N. Mariana Is.',
518
+ 'Northern Mariana Islands (U.S.)',
519
+ 'Commonwealth of Northern Mariana Islands',
520
+ 'Commonwealth of the Northern Mariana Islands',
521
+ 'Commonwealth of the Northern Mariana Islands (CNMI)'
522
+ ],
516
523
  NOR: ['Norway'],
517
524
  OMN: ['Oman'],
518
525
  PAK: ['Pakistan'],
@@ -643,7 +650,15 @@ export const supportedTerritories = {
643
650
  'US-GU': ['GUAM', 'GU'],
644
651
  'US-PR': ['PUERTO RICO', 'PR'],
645
652
  'US-VI': ['U.S. VIRGIN ISLANDS', 'VI', 'US VIRGIN ISLANDS', 'VIRGIN ISLANDS'],
646
- 'US-MP': ['NORTHERN MARIANAS', 'MP', 'CNMI'],
653
+ 'US-MP': [
654
+ 'NORTHERN MARIANA ISLANDS',
655
+ 'MP',
656
+ 'CNMI',
657
+ 'NORTHERN MARIANAS',
658
+ 'COMMONWEALTH OF NORTHERN MARIANA ISLANDS',
659
+ 'COMMONWEALTH OF THE NORTHERN MARIANA ISLANDS',
660
+ 'COMMONWEALTH OF THE NORTHERN MARIANA ISLANDS (CNMI)'
661
+ ],
647
662
  'US-FM': ['MICRONESIA', 'FM', 'Federated States of Micronesia'], // Note: Key is not an official ISO code
648
663
  'US-PW': ['PALAU', 'PW'], // Note: Key is not an official ISO code
649
664
  'US-MH': ['MARSHALL ISLANDS', 'MH', 'RMI'] // Note: Key is not an official ISO code