@cdc/map 4.25.3 → 4.25.5-1

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 (111) hide show
  1. package/dist/cdcmap.js +38945 -41511
  2. package/examples/hex-colors.json +3 -3
  3. package/examples/private/test.json +470 -1457
  4. package/examples/private/{mmr.json → wastewatermap.json} +86 -115
  5. package/index.html +13 -41
  6. package/package.json +4 -10
  7. package/src/CdcMap.tsx +51 -1555
  8. package/src/CdcMapComponent.tsx +594 -0
  9. package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +10 -0
  10. package/src/_stories/CdcMap.Legend.stories.tsx +67 -0
  11. package/src/_stories/CdcMap.stories.tsx +4 -1
  12. package/src/_stories/UsaMap.NoData.stories.tsx +4 -4
  13. package/{examples/private/default-patterns.json → src/_stories/_mock/legends/legend-tests.json} +36 -131
  14. package/src/cdcMapComponent.styles.css +9 -0
  15. package/src/components/Annotation/Annotation.Draggable.tsx +27 -26
  16. package/src/components/Annotation/AnnotationDropdown.tsx +5 -6
  17. package/src/components/BubbleList.tsx +135 -49
  18. package/src/components/CityList.tsx +89 -87
  19. package/src/components/DataTable.tsx +8 -8
  20. package/src/components/EditorPanel/components/EditorPanel.tsx +714 -820
  21. package/src/components/EditorPanel/components/Error.tsx +9 -2
  22. package/src/components/EditorPanel/components/HexShapeSettings.tsx +127 -141
  23. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +55 -86
  24. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +89 -75
  25. package/src/components/EditorPanel/components/editorPanel.styles.css +95 -0
  26. package/src/components/Geo.tsx +9 -1
  27. package/src/components/GoogleMap/components/GoogleMap.tsx +1 -1
  28. package/src/components/Legend/components/Legend.tsx +92 -87
  29. package/src/components/Legend/components/LegendGroup/Legend.Group.tsx +128 -0
  30. package/src/components/Legend/components/LegendGroup/legend.group.css +27 -0
  31. package/src/components/Legend/components/LegendItem.Hex.tsx +4 -1
  32. package/src/components/Legend/components/index.scss +18 -6
  33. package/src/components/Modal.tsx +17 -7
  34. package/src/components/NavigationMenu.tsx +11 -9
  35. package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +12 -8
  36. package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +4 -4
  37. package/src/components/UsaMap/components/TerritoriesSection.tsx +33 -10
  38. package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +12 -10
  39. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +12 -14
  40. package/src/components/UsaMap/components/Territory/TerritoryShape.ts +2 -1
  41. package/src/components/UsaMap/components/UsaMap.County.tsx +138 -96
  42. package/src/components/UsaMap/components/UsaMap.Region.styles.css +72 -0
  43. package/src/components/UsaMap/components/UsaMap.Region.tsx +56 -103
  44. package/src/components/UsaMap/components/UsaMap.SingleState.styles.css +10 -0
  45. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +59 -66
  46. package/src/components/UsaMap/components/UsaMap.State.tsx +112 -91
  47. package/src/components/UsaMap/helpers/map.ts +1 -1
  48. package/src/components/UsaMap/helpers/shapes.ts +20 -7
  49. package/src/components/WorldMap/WorldMap.tsx +64 -118
  50. package/src/components/WorldMap/worldMap.styles.css +28 -0
  51. package/src/components/ZoomControls.tsx +15 -13
  52. package/src/components/zoomControls.styles.css +53 -0
  53. package/src/context.ts +17 -9
  54. package/src/data/initial-state.js +5 -2
  55. package/src/helpers/addUIDs.ts +151 -0
  56. package/src/helpers/applyColorToLegend.ts +39 -64
  57. package/src/helpers/applyLegendToRow.ts +51 -0
  58. package/src/helpers/colorDistributions.ts +12 -0
  59. package/src/helpers/constants.ts +44 -0
  60. package/src/helpers/displayGeoName.ts +9 -2
  61. package/src/helpers/generateColorsArray.ts +2 -1
  62. package/src/helpers/generateRuntimeData.ts +74 -0
  63. package/src/helpers/generateRuntimeFilters.ts +63 -0
  64. package/src/helpers/generateRuntimeLegend.ts +537 -0
  65. package/src/helpers/generateRuntimeLegendHash.ts +16 -15
  66. package/src/helpers/getColumnNames.ts +19 -0
  67. package/src/helpers/getMapContainerClasses.ts +23 -0
  68. package/src/helpers/handleMapTabbing.ts +31 -0
  69. package/src/helpers/hashObj.ts +1 -1
  70. package/src/helpers/index.ts +22 -0
  71. package/src/helpers/navigationHandler.ts +3 -3
  72. package/src/helpers/resetLegendToggles.ts +13 -0
  73. package/src/helpers/setBinNumbers.ts +5 -0
  74. package/src/helpers/sortSpecialClassesLast.ts +7 -0
  75. package/src/helpers/tests/getColumnNames.test.ts +52 -0
  76. package/src/helpers/titleCase.ts +1 -1
  77. package/src/helpers/toggleLegendActive.ts +25 -0
  78. package/src/hooks/useApplyTooltipsToGeo.tsx +51 -0
  79. package/src/hooks/useColumnsRequiredChecker.ts +51 -0
  80. package/src/hooks/useGeoClickHandler.ts +45 -0
  81. package/src/hooks/useLegendSeparators.ts +26 -0
  82. package/src/hooks/useMapLayers.tsx +34 -60
  83. package/src/hooks/useModal.ts +22 -0
  84. package/src/hooks/useResizeObserver.ts +4 -5
  85. package/src/hooks/useStateZoom.tsx +52 -75
  86. package/src/hooks/useTooltip.ts +2 -3
  87. package/src/index.jsx +3 -9
  88. package/src/scss/editor-panel.scss +3 -99
  89. package/src/scss/main.scss +1 -19
  90. package/src/scss/map.scss +15 -220
  91. package/src/store/map.actions.ts +46 -0
  92. package/src/store/map.reducer.ts +96 -0
  93. package/src/types/Annotations.ts +24 -0
  94. package/src/types/MapConfig.ts +23 -3
  95. package/src/types/MapContext.ts +36 -35
  96. package/src/types/Modal.ts +1 -0
  97. package/src/types/RuntimeData.ts +3 -0
  98. package/LICENSE +0 -201
  99. package/examples/private/DEV-9644.json +0 -184
  100. package/examples/private/DEV-9989.json +0 -229
  101. package/examples/private/ardi.json +0 -180
  102. package/examples/private/colors 2.json +0 -416
  103. package/examples/private/colors.json +0 -416
  104. package/examples/private/colors.json.zip +0 -0
  105. package/examples/private/customColors.json +0 -45348
  106. package/examples/test.json +0 -183
  107. package/src/helpers/closeModal.ts +0 -9
  108. package/src/scss/btn.scss +0 -69
  109. package/src/scss/filters.scss +0 -27
  110. package/src/scss/variables.scss +0 -1
  111. /package/src/hooks/{useActiveElement.js → useActiveElement.ts} +0 -0
@@ -14,6 +14,7 @@ type Story = StoryObj<typeof CdcMap>
14
14
 
15
15
  export const Equal_Interval_Map: Story = {
16
16
  args: {
17
+ isEditor: true,
17
18
  configUrl: 'https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/page-elements/equal-interval-map.json'
18
19
  }
19
20
  }
@@ -26,6 +27,7 @@ export const Equal_Number_Opt_In: Story = {
26
27
 
27
28
  export const Equal_Number_Map: Story = {
28
29
  args: {
30
+ isEditor: true,
29
31
  configUrl: 'https://www.cdc.gov/wcms/4.0/cdc-wp/data-presentation/page-elements/equal-number-map.json'
30
32
  }
31
33
  }
@@ -137,7 +139,8 @@ export const Custom_Color_Distributions_Without_Special_Classes: Story = {
137
139
 
138
140
  export const Standard_Color_Distributions_With_Special_Classes: Story = {
139
141
  args: {
140
- config: exampleCityStateStandardColors
142
+ config: exampleCityStateStandardColors,
143
+ isEditor: true
141
144
  }
142
145
  }
143
146
 
@@ -1,14 +1,14 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react'
2
- import CdcMap from '../CdcMap'
2
+ import CdcMapComponent from '../CdcMapComponent'
3
3
  import cityStateConfig from './_mock/example-city-state.json'
4
4
  import { editConfigKeys } from '@cdc/chart/src/helpers/configHelpers'
5
5
 
6
- const meta: Meta<typeof CdcMap> = {
6
+ const meta: Meta<typeof CdcMapComponent> = {
7
7
  title: 'Components/Templates/Map',
8
- component: CdcMap
8
+ component: CdcMapComponent
9
9
  }
10
10
 
11
- type Story = StoryObj<typeof CdcMap>
11
+ type Story = StoryObj<typeof CdcMapComponent>
12
12
 
13
13
  export const USA_Map_No_Data: Story = {
14
14
  args: {
@@ -1,5 +1,4 @@
1
1
  {
2
- "annotations": [],
3
2
  "general": {
4
3
  "title": "Example Data Map with Cities",
5
4
  "subtext": "*: Lorem ipsum; NA: Lorem ipsum.",
@@ -20,7 +19,7 @@
20
19
  "displayStateLabels": false,
21
20
  "fullBorder": false,
22
21
  "palette": {
23
- "isReversed": true
22
+ "isReversed": false
24
23
  },
25
24
  "allowMapZoom": true,
26
25
  "hideGeoColumnInTooltip": false,
@@ -30,15 +29,10 @@
30
29
  "stateName": "Alabama"
31
30
  },
32
31
  "showDownloadImgButton": false,
33
- "showDownloadPdfButton": false,
34
- "territoriesAlwaysShow": false,
35
- "geoLabelOverride": "",
36
- "convertFipsCodes": true,
37
- "noStateFoundMessage": "Map Unavailable",
38
- "annotationDropdownText": "Annotations"
32
+ "showDownloadPdfButton": false
39
33
  },
40
34
  "type": "map",
41
- "color": "yellowpurplereverse",
35
+ "color": "yelloworangered",
42
36
  "columns": {
43
37
  "geo": {
44
38
  "dataTable": true,
@@ -52,8 +46,7 @@
52
46
  "name": "Rate",
53
47
  "prefix": "",
54
48
  "suffix": "",
55
- "tooltip": false,
56
- "roundToPlace": 0
49
+ "tooltip": false
57
50
  },
58
51
  "navigate": {
59
52
  "dataTable": false,
@@ -101,49 +94,47 @@
101
94
  "singleColumn": false,
102
95
  "dynamicDescription": false,
103
96
  "descriptions": {},
104
- "singleRow": false,
105
- "showSpecialClassesLast": false,
106
- "verticalSorted": false,
107
- "style": "circles",
108
- "subStyle": "linear blocks",
109
- "tickRotation": "",
110
- "singleColumnLegend": false,
111
- "hideBorder": false
97
+ "singleRow": false
98
+ },
99
+ "map": {
100
+ "layers": [
101
+ {
102
+ "name": "Layer One",
103
+ "url": "./examples/testing-layer.json",
104
+ "namespace": "cove",
105
+ "fill": "blue",
106
+ "stroke": "orange",
107
+ "strokeWidth": "5"
108
+ },
109
+ {
110
+ "name": "Layer Two",
111
+ "url": "./examples/testing-layer-2.json",
112
+ "namespace": "cove",
113
+ "fill": "blue",
114
+ "stroke": "orange",
115
+ "strokeWidth": "5"
116
+ }
117
+ ]
112
118
  },
113
119
  "filters": [],
114
- "table": {
115
- "showDownloadUrl": false,
116
- "showDataTableLink": true,
117
- "wrapColumns": false,
118
- "label": "Data Table",
119
- "expanded": true,
120
- "limitHeight": false,
121
- "height": "",
122
- "caption": "",
123
- "showFullGeoNameInCSV": false,
124
- "forceDisplay": true,
125
- "download": true,
126
- "indexLabel": "",
127
- "showDownloadLinkBelow": true
120
+ "dataTable": {
121
+ "title": "Data Table",
122
+ "forceDisplay": true
128
123
  },
129
124
  "tooltips": {
130
125
  "appearanceType": "hover",
131
126
  "linkLabel": "Learn More",
132
- "capitalizeLabels": true,
133
- "opacity": 90
127
+ "capitalizeLabels": true
134
128
  },
135
129
  "runtime": {
136
- "editorErrorMessage": ""
130
+ "editorErrorMessage": []
137
131
  },
138
132
  "visual": {
139
133
  "cityStyle": "pin",
140
134
  "minBubbleSize": 1,
141
135
  "maxBubbleSize": 20,
142
136
  "extraBubbleBorder": false,
143
- "showBubbleZeros": false,
144
- "geoCodeCircleSize": 2,
145
- "cityStyleLabel": "",
146
- "additionalCityStyles": []
137
+ "showBubbleZeros": false
147
138
  },
148
139
  "mapPosition": {
149
140
  "coordinates": [
@@ -152,42 +143,6 @@
152
143
  ],
153
144
  "zoom": 1
154
145
  },
155
- "map": {
156
- "layers": [],
157
- "patterns": [
158
- {
159
- "dataKey": "Location",
160
- "pattern": "circles",
161
- "contrastCheck": true,
162
- "dataValue": "School",
163
- "color": "red"
164
- }
165
- ]
166
- },
167
- "hexMap": {
168
- "type": "",
169
- "shapeGroups": [
170
- {
171
- "legendTitle": "",
172
- "legendDescription": "",
173
- "items": [
174
- {
175
- "key": "",
176
- "shape": "Arrow Up",
177
- "column": "",
178
- "operator": "=",
179
- "value": ""
180
- }
181
- ]
182
- }
183
- ]
184
- },
185
- "filterBehavior": "Filter Change",
186
- "filterIntro": "",
187
- "dataTable": {
188
- "title": "Data Table",
189
- "forceDisplay": true
190
- },
191
146
  "sharing": {
192
147
  "enabled": false,
193
148
  "dataHost": "wcms-wp.cdc.gov",
@@ -197,25 +152,13 @@
197
152
  "data": [
198
153
  {
199
154
  "STATE": "AL",
200
- "Rate": 1000,
201
- "Location": "Home",
202
- "URL": "https://www.cdc.gov/"
203
- },
204
- {
205
- "STATE": "Great Plains Tribal Leaders Health Board",
206
- "Rate": 1000,
207
- "Location": "Home",
208
- "URL": "https://www.cdc.gov/"
209
- },
210
- {
211
- "STATE": "Montana American Indian Women’s Health Coalition",
212
- "Rate": 1000,
155
+ "Rate": 10,
213
156
  "Location": "Home",
214
157
  "URL": "https://www.cdc.gov/"
215
158
  },
216
159
  {
217
160
  "STATE": "AK",
218
- "Rate": 1200,
161
+ "Rate": 12,
219
162
  "Location": "Vehicle",
220
163
  "URL": "https://www.cdc.gov/"
221
164
  },
@@ -573,42 +516,6 @@
573
516
  "Location": "Vehicle",
574
517
  "URL": "https://www.cdc.gov/"
575
518
  },
576
- {
577
- "STATE": "Grand Rapids, MICHIGAN",
578
- "Rate": 14,
579
- "Location": "Vehicle",
580
- "URL": "https://www.cdc.gov/"
581
- },
582
- {
583
- "STATE": "Salem, OReGON",
584
- "Rate": 14,
585
- "Location": "Vehicle",
586
- "URL": "https://www.cdc.gov/"
587
- },
588
- {
589
- "STATE": "Round Rock, TEXAS",
590
- "Rate": 14,
591
- "Location": "Vehicle",
592
- "URL": "https://www.cdc.gov/"
593
- },
594
- {
595
- "STATE": "PROVO, UT",
596
- "Rate": 14,
597
- "Location": "Vehicle",
598
- "URL": "https://www.cdc.gov/"
599
- },
600
- {
601
- "STATE": "SALUDA, VIRGINIA",
602
- "Rate": 14,
603
- "Location": "Vehicle",
604
- "URL": "https://www.cdc.gov/"
605
- },
606
- {
607
- "STATE": "ELLENSBURG, WA",
608
- "Rate": 14,
609
- "Location": "Vehicle",
610
- "URL": "https://www.cdc.gov/"
611
- },
612
519
  {
613
520
  "STATE": "Atlanta",
614
521
  "Rate": 12,
@@ -724,7 +631,7 @@
724
631
  "URL": "https://www.cdc.gov/"
725
632
  },
726
633
  {
727
- "STATE": "Great Plains Tribal Leaders Health Board",
634
+ "STATE": "Great Plains Tribal Chairmen's Health Board",
728
635
  "Rate": 18,
729
636
  "Location": "Vehicle",
730
637
  "URL": "https://www.cdc.gov/"
@@ -861,7 +768,5 @@
861
768
  "Location": "Vehicle",
862
769
  "URL": "https://www.cdc.gov/"
863
770
  }
864
- ],
865
- "filterStyle": "Filter Changes",
866
- "version": "4.24.11"
867
- }
771
+ ]
772
+ }
@@ -0,0 +1,9 @@
1
+ .map-container {
2
+ &.full-border {
3
+ border: #c2c2c2 1px solid;
4
+ }
5
+ }
6
+
7
+ header + .map-container.full-border {
8
+ border-top: 0; /* When they have a header, don't add a border top */
9
+ }
@@ -1,4 +1,4 @@
1
- import { useContext, useState, useRef } from 'react'
1
+ import React, { useContext, useState } from 'react'
2
2
 
3
3
  // visx
4
4
  import { HtmlLabel, CircleSubject, EditableAnnotation, Connector, Annotation as VisxAnnotation } from '@visx/annotation'
@@ -10,53 +10,56 @@ import './Annotation.Draggable.styles.css'
10
10
  import ConfigContext from '../../context'
11
11
  import { MapContext } from '../../types/MapContext'
12
12
 
13
- const Annotations = ({ xScale, yScale, xMax, svgRef, onDragStateChange }) => {
13
+ type AnnotationsProps = {
14
+ onDragStateChange: (state: boolean) => void
15
+ }
16
+
17
+ const Annotations: React.FC<AnnotationsProps> = ({ onDragStateChange }) => {
14
18
  const [draggingItems, setDraggingItems] = useState([])
15
19
  const {
16
- state: config,
17
- setState: updateConfig,
20
+ config,
21
+ setConfig,
18
22
  isDraggingAnnotation,
19
23
  isEditor,
20
24
  dimensions
21
25
  } = useContext<MapContext>(ConfigContext)
22
26
  const [width, height] = dimensions
23
27
  const { annotations } = config
24
- const prevDimensions = useRef(dimensions)
25
28
  const AnnotationComponent = isEditor ? EditableAnnotation : VisxAnnotation
26
29
 
27
30
  return (
28
31
  annotations &&
29
32
  annotations.map((annotation, index) => {
33
+ const { marker, x, y, dx, dy, edit, connectionType } = annotation
34
+
30
35
  return (
31
36
  <>
32
37
  <Drag
33
38
  key={`annotation--${index}`}
34
39
  width={width}
35
40
  height={height}
36
- x={annotation.x} // subject x
37
- y={annotation.y} // subject y
41
+ x={x}
42
+ y={y} // subject y
38
43
  onDragStart={() => {
39
44
  setDraggingItems(raise(annotations, index))
40
45
  }}
41
46
  >
42
- {({ dragStart, dragEnd, dragMove, isDragging, x, y, dx, dy }) => {
47
+ {({ dragStart, dragEnd, dragMove }) => {
43
48
  return (
44
49
  <>
45
50
  <AnnotationComponent
46
- dx={annotation.dx} // label position
47
- dy={annotation.dy} // label postion
48
- x={annotation.x}
49
- y={annotation.y}
50
- canEditLabel={annotation.edit.label || false}
51
- canEditSubject={annotation.edit.subject || false}
51
+ dx={dx} // label position
52
+ dy={dy} // label position
53
+ x={x}
54
+ y={y}
55
+ canEditLabel={edit.label || false}
56
+ canEditSubject={edit.subject || false}
52
57
  labelDragHandleProps={{ r: 15, stroke: isDraggingAnnotation ? 'red' : 'var(--primary)' }}
53
58
  subjectDragHandleProps={{ r: 15, stroke: isDraggingAnnotation ? 'red' : 'var(--primary)' }}
54
59
  onDragEnd={props => {
55
60
  onDragStateChange(false)
56
61
  const updatedAnnotations = annotations.map((annotation, idx) => {
57
62
  if (idx === index) {
58
- const nearestDatum = annotation
59
-
60
63
  return {
61
64
  ...annotation,
62
65
  x: props.x,
@@ -68,7 +71,7 @@ const Annotations = ({ xScale, yScale, xMax, svgRef, onDragStateChange }) => {
68
71
  return annotation
69
72
  })
70
73
 
71
- updateConfig({
74
+ setConfig({
72
75
  ...config,
73
76
  annotations: updatedAnnotations
74
77
  })
@@ -95,7 +98,7 @@ const Annotations = ({ xScale, yScale, xMax, svgRef, onDragStateChange }) => {
95
98
  }}
96
99
  role='presentation'
97
100
  // ! IMPORTANT: Workaround for 508
98
- // - HTML needs to be set from the editor and we need a wrapper with the tabIndex
101
+ // - HTML needs to be set from the editor, and we need a wrapper with the tabIndex
99
102
  // - TabIndex is only supposed to be used on interactive elements. This is a workaround.
100
103
  // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
101
104
  tabIndex={0}
@@ -104,24 +107,22 @@ const Annotations = ({ xScale, yScale, xMax, svgRef, onDragStateChange }) => {
104
107
  />
105
108
  </HtmlLabel>
106
109
 
107
- {annotation.connectionType === 'line' && (
110
+ {connectionType === 'line' && (
108
111
  <Connector type='line' pathProps={{ markerStart: 'url(#marker-start)' }} />
109
112
  )}
110
113
 
111
- {annotation.connectionType === 'elbow' && (
114
+ {connectionType === 'elbow' && (
112
115
  <Connector type='elbow' pathProps={{ markerStart: 'url(#marker-start)' }} />
113
116
  )}
114
117
 
115
118
  {/* MARKERS */}
116
- {annotation.marker === 'circle' && (
117
- <CircleSubject className='circle-subject' stroke={'black'} radius={8} />
118
- )}
119
- {annotation.marker === 'arrow' && (
119
+ {marker === 'circle' && <CircleSubject className='circle-subject' stroke={'black'} radius={8} />}
120
+ {marker === 'arrow' && (
120
121
  <MarkerArrow
121
122
  fill='black'
122
123
  id='marker-start'
123
- x={annotation.x}
124
- y={annotation.dy}
124
+ x={x}
125
+ y={dy}
125
126
  stroke='#333'
126
127
  markerWidth={10}
127
128
  size={10}
@@ -2,16 +2,15 @@ import React, { useContext, useState } from 'react'
2
2
  import ConfigContext from '../../context'
3
3
  import './AnnotationDropdown.styles.css'
4
4
  import Icon from '@cdc/core/components/ui/Icon'
5
- import { appFontSize } from '@cdc/core/helpers/cove/fontSettings'
5
+ import { APP_FONT_SIZE } from '@cdc/core/helpers/constants'
6
6
  import AnnotationList from './AnnotationList'
7
+ import { MapContext } from '../../types/MapContext'
7
8
 
8
9
  const AnnotationDropdown = () => {
9
- const { state: config, isEditor, currentViewport: viewport } = useContext(ConfigContext)
10
+ const { config, currentViewport: viewport } = useContext<MapContext>(ConfigContext)
10
11
  const [expanded, setExpanded] = useState(false)
11
12
 
12
- const titleFontSize = ['sm', 'xs', 'xxs'].includes(viewport) ? '13px' : `${appFontSize}px`
13
-
14
- const annotations = config?.annotations || []
13
+ const titleFontSize = ['sm', 'xs', 'xxs'].includes(viewport) ? '13px' : `${APP_FONT_SIZE}px`
15
14
 
16
15
  const limitHeight = {
17
16
  maxHeight: config.table.limitHeight && `${config.table.height}px`,
@@ -49,7 +48,7 @@ const AnnotationDropdown = () => {
49
48
  }}
50
49
  tabIndex={0}
51
50
  onKeyDown={e => {
52
- if (e.keyCode === 13) {
51
+ if (e.key === 'Enter') {
53
52
  setExpanded(!expanded)
54
53
  }
55
54
  }}