@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
@@ -10,39 +10,14 @@ import CoveMediaControls from '@cdc/core/components/CoveMediaControls'
10
10
 
11
11
  import Loading from '@cdc/core/components/Loading'
12
12
 
13
+ /* eslint-disable jsx-a11y/no-noninteractive-tabindex, jsx-a11y/no-static-element-interactions */
13
14
  const DataTable = props => {
14
- const {
15
- state,
16
- tableTitle,
17
- indexTitle,
18
- mapTitle,
19
- rawData,
20
- showDownloadImgButton,
21
- showDownloadPdfButton,
22
- showDownloadButton,
23
- runtimeData,
24
- runtimeLegend,
25
- headerColor,
26
- expandDataTable,
27
- columns,
28
- displayDataAsText,
29
- applyLegendToRow,
30
- displayGeoName,
31
- navigationHandler,
32
- viewport,
33
- formatLegendLocation,
34
- tabbingId,
35
- setFilteredCountryCode,
36
- innerContainerRef,
37
- imageRef
38
- } = props
15
+ const { state, tableTitle, indexTitle, mapTitle, rawData, runtimeData, headerColor, expandDataTable, columns, displayDataAsText, applyLegendToRow, displayGeoName, navigationHandler, viewport, formatLegendLocation, tabbingId, setFilteredCountryCode } = props
39
16
 
40
17
  const [expanded, setExpanded] = useState(expandDataTable)
41
18
 
42
19
  const [accessibilityLabel, setAccessibilityLabel] = useState('')
43
20
 
44
- const [ready, setReady] = useState(false)
45
-
46
21
  const fileName = `${mapTitle || 'data-table'}.csv`
47
22
 
48
23
  // Catch all sorting method used on load by default but also on user click
@@ -202,10 +177,11 @@ const DataTable = props => {
202
177
 
203
178
  const legendColor = applyLegendToRow(rowObj)
204
179
 
180
+ var labelValue
205
181
  if (state.general.geoType !== 'us-county' || state.general.type === 'us-geocode') {
206
- var labelValue = displayGeoName(row.original)
182
+ labelValue = displayGeoName(row.original)
207
183
  } else {
208
- var labelValue = formatLegendLocation(row.original)
184
+ labelValue = formatLegendLocation(row.original)
209
185
  }
210
186
 
211
187
  labelValue = getCellAnchor(labelValue, rowObj)
@@ -232,7 +208,7 @@ const DataTable = props => {
232
208
  })
233
209
 
234
210
  return newTableColumns
235
- }, [indexTitle, columns, runtimeData, getCellAnchor, displayDataAsText, applyLegendToRow, customSort, displayGeoName, state.legend.specialClasses])
211
+ }, [indexTitle, columns, runtimeData, getCellAnchor, displayDataAsText, applyLegendToRow, customSort, displayGeoName, state.legend.specialClasses]) // eslint-disable-line
236
212
 
237
213
  const tableData = useMemo(
238
214
  () =>
@@ -301,7 +277,7 @@ const DataTable = props => {
301
277
  }
302
278
  }}
303
279
  >
304
- <Icon display={expanded ? 'minus' : 'plus'} base/>
280
+ <Icon display={expanded ? 'minus' : 'plus'} base />
305
281
  {tableTitle}
306
282
  </div>
307
283
  <div className='table-container' style={{ maxHeight: state.dataTable.limitHeight && `${state.dataTable.height}px`, overflowY: 'scroll' }}>