react-msaview 3.2.0 → 3.2.2

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 (175) hide show
  1. package/bundle/index.js +13 -13
  2. package/dist/colorSchemes.js +2 -2
  3. package/dist/colorSchemes.js.map +1 -1
  4. package/dist/components/Loading.js +3 -1
  5. package/dist/components/Loading.js.map +1 -1
  6. package/dist/components/ResizeHandles.js +6 -2
  7. package/dist/components/ResizeHandles.js.map +1 -1
  8. package/dist/components/SequenceTextArea.js +9 -3
  9. package/dist/components/SequenceTextArea.js.map +1 -1
  10. package/dist/components/TextTrack.js +1 -1
  11. package/dist/components/TextTrack.js.map +1 -1
  12. package/dist/components/Track.js +6 -2
  13. package/dist/components/Track.js.map +1 -1
  14. package/dist/components/VerticalScrollbar.js +5 -1
  15. package/dist/components/VerticalScrollbar.js.map +1 -1
  16. package/dist/components/dialogs/AboutDialog.js +3 -1
  17. package/dist/components/dialogs/AboutDialog.js.map +1 -1
  18. package/dist/components/dialogs/AddTrackDialog.d.ts +2 -2
  19. package/dist/components/dialogs/AddTrackDialog.js +8 -3
  20. package/dist/components/dialogs/AddTrackDialog.js.map +1 -1
  21. package/dist/components/dialogs/DomainDialog.js +6 -2
  22. package/dist/components/dialogs/DomainDialog.js.map +1 -1
  23. package/dist/components/dialogs/ExportSVGDialog.js +29 -17
  24. package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
  25. package/dist/components/dialogs/FeatureDialog.js +8 -4
  26. package/dist/components/dialogs/FeatureDialog.js.map +1 -1
  27. package/dist/components/dialogs/InterProScanDialog.js +23 -9
  28. package/dist/components/dialogs/InterProScanDialog.js.map +1 -1
  29. package/dist/components/dialogs/MetadataDialog.js +3 -1
  30. package/dist/components/dialogs/MetadataDialog.js.map +1 -1
  31. package/dist/components/dialogs/SettingsDialog.js +61 -23
  32. package/dist/components/dialogs/SettingsDialog.js.map +1 -1
  33. package/dist/components/dialogs/TracklistDialog.d.ts +2 -2
  34. package/dist/components/dialogs/TracklistDialog.js +8 -3
  35. package/dist/components/dialogs/TracklistDialog.js.map +1 -1
  36. package/dist/components/dialogs/UserProvidedDomainsDialog.js +10 -4
  37. package/dist/components/dialogs/UserProvidedDomainsDialog.js.map +1 -1
  38. package/dist/components/header/Header.js +3 -1
  39. package/dist/components/header/Header.js.map +1 -1
  40. package/dist/components/header/HeaderInfoArea.js +5 -2
  41. package/dist/components/header/HeaderInfoArea.js.map +1 -1
  42. package/dist/components/header/HeaderMenu.js +12 -4
  43. package/dist/components/header/HeaderMenu.js.map +1 -1
  44. package/dist/components/header/HeaderMenuExtra.js +34 -16
  45. package/dist/components/header/HeaderMenuExtra.js.map +1 -1
  46. package/dist/components/header/ZoomControls.js +18 -6
  47. package/dist/components/header/ZoomControls.js.map +1 -1
  48. package/dist/components/import/ImportForm.d.ts +2 -2
  49. package/dist/components/import/ImportForm.js +15 -2
  50. package/dist/components/import/ImportForm.js.map +1 -1
  51. package/dist/components/import/ImportFormExamples.js +44 -31
  52. package/dist/components/import/ImportFormExamples.js.map +1 -1
  53. package/dist/components/minimap/Minimap.js +12 -4
  54. package/dist/components/minimap/Minimap.js.map +1 -1
  55. package/dist/components/msa/MSACanvasBlock.js +5 -3
  56. package/dist/components/msa/MSACanvasBlock.js.map +1 -1
  57. package/dist/components/msa/MSAMouseoverCanvas.d.ts +1 -1
  58. package/dist/components/msa/MSAMouseoverCanvas.js +1 -1
  59. package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
  60. package/dist/components/msa/renderBoxFeatureCanvasBlock.js +2 -2
  61. package/dist/components/msa/renderBoxFeatureCanvasBlock.js.map +1 -1
  62. package/dist/components/msa/renderMSABlock.js +28 -24
  63. package/dist/components/msa/renderMSABlock.js.map +1 -1
  64. package/dist/components/msa/renderMSAMouseover.js +3 -3
  65. package/dist/components/msa/renderMSAMouseover.js.map +1 -1
  66. package/dist/components/tree/TreeBranchMenu.js +6 -3
  67. package/dist/components/tree/TreeBranchMenu.js.map +1 -1
  68. package/dist/components/tree/TreeCanvasBlock.js +11 -4
  69. package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
  70. package/dist/components/tree/TreeNodeMenu.js +1 -1
  71. package/dist/components/tree/TreeNodeMenu.js.map +1 -1
  72. package/dist/components/tree/dialogs/TreeNodeInfoDialog.d.ts +2 -2
  73. package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +7 -5
  74. package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
  75. package/dist/components/tree/renderTreeCanvas.js +5 -5
  76. package/dist/components/tree/renderTreeCanvas.js.map +1 -1
  77. package/dist/components/util.js +0 -3
  78. package/dist/components/util.js.map +1 -1
  79. package/dist/ggplotPalettes.js.map +1 -1
  80. package/dist/launchInterProScan.js +4 -4
  81. package/dist/launchInterProScan.js.map +1 -1
  82. package/dist/model/DialogQueue.d.ts +1 -1
  83. package/dist/model/DialogQueue.js +0 -1
  84. package/dist/model/DialogQueue.js.map +1 -1
  85. package/dist/model.d.ts +59 -25
  86. package/dist/model.js +123 -62
  87. package/dist/model.js.map +1 -1
  88. package/dist/parseGFF.js +8 -6
  89. package/dist/parseGFF.js.map +1 -1
  90. package/dist/parseNewick.d.ts +4 -4
  91. package/dist/parseNewick.js +7 -8
  92. package/dist/parseNewick.js.map +1 -1
  93. package/dist/parsers/ClustalMSA.d.ts +5 -5
  94. package/dist/parsers/ClustalMSA.js +2 -2
  95. package/dist/parsers/ClustalMSA.js.map +1 -1
  96. package/dist/parsers/EmfMSA.d.ts +27 -0
  97. package/dist/parsers/EmfMSA.js +53 -0
  98. package/dist/parsers/EmfMSA.js.map +1 -0
  99. package/dist/parsers/EmfTree.d.ts +5 -0
  100. package/dist/parsers/EmfTree.js +8 -0
  101. package/dist/parsers/EmfTree.js.map +1 -0
  102. package/dist/parsers/FastaMSA.js +5 -5
  103. package/dist/parsers/FastaMSA.js.map +1 -1
  104. package/dist/parsers/StockholmMSA.d.ts +6 -6
  105. package/dist/parsers/StockholmMSA.js +6 -6
  106. package/dist/parsers/StockholmMSA.js.map +1 -1
  107. package/dist/renderToSvg.js +3 -6
  108. package/dist/renderToSvg.js.map +1 -1
  109. package/dist/reparseTree.js +2 -2
  110. package/dist/reparseTree.js.map +1 -1
  111. package/dist/rowCoordinateCalculations.d.ts +2 -0
  112. package/dist/rowCoordinateCalculations.js +26 -0
  113. package/dist/rowCoordinateCalculations.js.map +1 -0
  114. package/dist/rowCoordinateCalculations.test.d.ts +1 -0
  115. package/dist/rowCoordinateCalculations.test.js +18 -0
  116. package/dist/rowCoordinateCalculations.test.js.map +1 -0
  117. package/dist/util.d.ts +3 -3
  118. package/dist/util.js +1 -1
  119. package/dist/util.js.map +1 -1
  120. package/dist/version.d.ts +1 -1
  121. package/dist/version.js +1 -1
  122. package/package.json +8 -3
  123. package/src/colorSchemes.ts +4 -4
  124. package/src/components/Loading.tsx +7 -1
  125. package/src/components/ResizeHandles.tsx +6 -2
  126. package/src/components/SequenceTextArea.tsx +10 -4
  127. package/src/components/TextTrack.tsx +2 -2
  128. package/src/components/Track.tsx +8 -4
  129. package/src/components/VerticalScrollbar.tsx +6 -2
  130. package/src/components/dialogs/AboutDialog.tsx +7 -1
  131. package/src/components/dialogs/AddTrackDialog.tsx +13 -3
  132. package/src/components/dialogs/DomainDialog.tsx +9 -2
  133. package/src/components/dialogs/ExportSVGDialog.tsx +36 -17
  134. package/src/components/dialogs/FeatureDialog.tsx +7 -5
  135. package/src/components/dialogs/InterProScanDialog.tsx +20 -10
  136. package/src/components/dialogs/MetadataDialog.tsx +8 -1
  137. package/src/components/dialogs/SettingsDialog.tsx +76 -32
  138. package/src/components/dialogs/TracklistDialog.tsx +17 -3
  139. package/src/components/dialogs/UserProvidedDomainsDialog.tsx +11 -5
  140. package/src/components/header/Header.tsx +3 -1
  141. package/src/components/header/HeaderInfoArea.tsx +3 -2
  142. package/src/components/header/HeaderMenu.tsx +12 -7
  143. package/src/components/header/HeaderMenuExtra.tsx +28 -16
  144. package/src/components/header/ZoomControls.tsx +22 -6
  145. package/src/components/import/ImportForm.tsx +14 -2
  146. package/src/components/import/ImportFormExamples.tsx +59 -48
  147. package/src/components/minimap/Minimap.tsx +21 -9
  148. package/src/components/msa/MSACanvasBlock.tsx +5 -3
  149. package/src/components/msa/MSAMouseoverCanvas.tsx +5 -1
  150. package/src/components/msa/renderBoxFeatureCanvasBlock.ts +4 -4
  151. package/src/components/msa/renderMSABlock.ts +42 -38
  152. package/src/components/msa/renderMSAMouseover.ts +3 -3
  153. package/src/components/tree/TreeBranchMenu.tsx +5 -3
  154. package/src/components/tree/TreeCanvasBlock.tsx +11 -4
  155. package/src/components/tree/TreeNodeMenu.tsx +1 -1
  156. package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +17 -4
  157. package/src/components/tree/renderTreeCanvas.ts +2 -2
  158. package/src/components/util.ts +1 -4
  159. package/src/ggplotPalettes.ts +1 -1
  160. package/src/launchInterProScan.ts +5 -5
  161. package/src/model/DialogQueue.ts +0 -1
  162. package/src/model.ts +136 -74
  163. package/src/parseGFF.ts +13 -11
  164. package/src/parseNewick.ts +10 -10
  165. package/src/parsers/ClustalMSA.ts +4 -4
  166. package/src/parsers/EmfMSA.ts +66 -0
  167. package/src/parsers/EmfTree.ts +9 -0
  168. package/src/parsers/FastaMSA.ts +6 -6
  169. package/src/parsers/StockholmMSA.ts +12 -12
  170. package/src/renderToSvg.tsx +1 -2
  171. package/src/reparseTree.ts +3 -3
  172. package/src/rowCoordinateCalculations.test.ts +19 -0
  173. package/src/rowCoordinateCalculations.ts +26 -0
  174. package/src/util.ts +5 -5
  175. package/src/version.ts +1 -1
@@ -70,8 +70,12 @@ const VerticalScrollbar = observer(({ model }: { model: MsaViewModel }) => {
70
70
  height: Math.max(b - t, 20),
71
71
  zIndex: 100,
72
72
  }}
73
- onMouseOver={() => setHovered(true)}
74
- onMouseOut={() => setHovered(false)}
73
+ onMouseOver={() => {
74
+ setHovered(true)
75
+ }}
76
+ onMouseOut={() => {
77
+ setHovered(false)
78
+ }}
75
79
  onMouseDown={event => {
76
80
  setMouseDown({
77
81
  clientY: event.clientY,
@@ -5,7 +5,13 @@ import { version } from '../../version'
5
5
 
6
6
  export default function AboutDialog({ onClose }: { onClose: () => void }) {
7
7
  return (
8
- <Dialog onClose={() => onClose()} open title="About this plugin">
8
+ <Dialog
9
+ onClose={() => {
10
+ onClose()
11
+ }}
12
+ open
13
+ title="About this plugin"
14
+ >
9
15
  <DialogContent>
10
16
  <Typography>
11
17
  MSAView {version} (
@@ -12,7 +12,7 @@ import type { FileLocation } from '@jbrowse/core/util/types'
12
12
  import { observer } from 'mobx-react'
13
13
  import type { MsaViewModel } from '../../model'
14
14
 
15
- export default observer(function ({
15
+ const AddTrackDialog = observer(function ({
16
16
  model,
17
17
  onClose,
18
18
  open,
@@ -26,7 +26,13 @@ export default observer(function ({
26
26
  const [currentOption, setCurrentOption] = useState('')
27
27
 
28
28
  return (
29
- <Dialog onClose={() => onClose()} open={open} title="Add track">
29
+ <Dialog
30
+ onClose={() => {
31
+ onClose()
32
+ }}
33
+ open={open}
34
+ title="Add track"
35
+ >
30
36
  <DialogContent>
31
37
  <Typography>
32
38
  Open relevant per-alignment tracks e.g. protein domains
@@ -62,7 +68,9 @@ export default observer(function ({
62
68
  <Button
63
69
  color="secondary"
64
70
  variant="contained"
65
- onClick={() => onClose()}
71
+ onClick={() => {
72
+ onClose()
73
+ }}
66
74
  >
67
75
  Cancel
68
76
  </Button>
@@ -71,3 +79,5 @@ export default observer(function ({
71
79
  </Dialog>
72
80
  )
73
81
  })
82
+
83
+ export default AddTrackDialog
@@ -20,10 +20,17 @@ export default function LaunchDomainViewDialog({
20
20
  <Dialog
21
21
  maxWidth="xl"
22
22
  title="Launch protein view"
23
- onClose={() => handleClose()}
23
+ onClose={() => {
24
+ handleClose()
25
+ }}
24
26
  open
25
27
  >
26
- <Tabs value={choice} onChange={(_, val) => setChoice(val)}>
28
+ <Tabs
29
+ value={choice}
30
+ onChange={(_, val) => {
31
+ setChoice(val)
32
+ }}
33
+ >
27
34
  <Tab value={0} label="Automatic lookup" />
28
35
  <Tab value={1} label="Manual" />
29
36
  </Tabs>
@@ -28,7 +28,13 @@ export default function ExportSVGDialog({
28
28
  const [error, setError] = useState<unknown>()
29
29
  const theme = useTheme()
30
30
  return (
31
- <Dialog onClose={() => onClose()} open title="Export SVG">
31
+ <Dialog
32
+ onClose={() => {
33
+ onClose()
34
+ }}
35
+ open
36
+ title="Export SVG"
37
+ >
32
38
  <DialogContent>
33
39
  {error ? <ErrorMessage error={error} /> : null}
34
40
  <Typography>Settings:</Typography>
@@ -36,14 +42,18 @@ export default function ExportSVGDialog({
36
42
  label="Include minimap?"
37
43
  disabled={exportType === 'entire'}
38
44
  checked={includeMinimap}
39
- onChange={() => setIncludeMinimap(!includeMinimap)}
45
+ onChange={() => {
46
+ setIncludeMinimap(!includeMinimap)
47
+ }}
40
48
  />
41
49
  <div>
42
50
  <FormControl>
43
51
  <FormLabel>Export type</FormLabel>
44
52
  <RadioGroup
45
53
  value={exportType}
46
- onChange={event => setExportType(event.target.value)}
54
+ onChange={event => {
55
+ setExportType(event.target.value)
56
+ }}
47
57
  >
48
58
  <FormControlLabel
49
59
  value="entire"
@@ -63,24 +73,33 @@ export default function ExportSVGDialog({
63
73
  <Button
64
74
  variant="contained"
65
75
  color="primary"
66
- onClick={async () => {
67
- try {
68
- await model.exportSVG({
69
- theme,
70
- includeMinimap:
71
- exportType === 'entire' ? false : includeMinimap,
72
- exportType,
73
- })
74
- } catch (e) {
75
- console.error(e)
76
- setError(e)
77
- }
78
- onClose()
76
+ onClick={() => {
77
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
78
+ ;(async () => {
79
+ try {
80
+ await model.exportSVG({
81
+ theme,
82
+ includeMinimap:
83
+ exportType === 'entire' ? false : includeMinimap,
84
+ exportType,
85
+ })
86
+ } catch (e) {
87
+ console.error(e)
88
+ setError(e)
89
+ }
90
+ onClose()
91
+ })()
79
92
  }}
80
93
  >
81
94
  Submit
82
95
  </Button>
83
- <Button variant="contained" color="secondary" onClick={() => onClose()}>
96
+ <Button
97
+ variant="contained"
98
+ color="secondary"
99
+ onClick={() => {
100
+ onClose()
101
+ }}
102
+ >
84
103
  Cancel
85
104
  </Button>
86
105
  </DialogActions>
@@ -35,8 +35,8 @@ const Toggles = observer(function ({ model }: { model: MsaViewModel }) {
35
35
  })
36
36
 
37
37
  const Table = observer(function ({ model }: { model: MsaViewModel }) {
38
- const { tidyTypes, featureFilters } = model
39
- const values = [...tidyTypes.values()]
38
+ const { tidyInterProAnnotationTypes, featureFilters } = model
39
+ const values = [...tidyInterProAnnotationTypes.values()]
40
40
  const palette = getPalette(values.length - 1)
41
41
  return (
42
42
  <>
@@ -57,12 +57,12 @@ const Table = observer(function ({ model }: { model: MsaViewModel }) {
57
57
  <input
58
58
  type="checkbox"
59
59
  checked={featureFilters.get(accession) ?? false}
60
- onChange={() =>
60
+ onChange={() => {
61
61
  model.setFilter(
62
62
  accession,
63
63
  !model.featureFilters.get(accession),
64
64
  )
65
- }
65
+ }}
66
66
  />
67
67
  </td>
68
68
  <td>{accession}</td>
@@ -94,7 +94,9 @@ const FeatureTypeDialog = observer(function ({
94
94
  }) {
95
95
  return (
96
96
  <Dialog
97
- onClose={() => onClose()}
97
+ onClose={() => {
98
+ onClose()
99
+ }}
98
100
  open
99
101
  title="Feature filters"
100
102
  maxWidth="xl"
@@ -151,7 +151,9 @@ const InterProScanDialog = observer(function ({
151
151
  <Dialog
152
152
  maxWidth="xl"
153
153
  title="Query InterProScan API for domains"
154
- onClose={() => handleClose()}
154
+ onClose={() => {
155
+ handleClose()
156
+ }}
155
157
  open
156
158
  >
157
159
  <DialogContent>
@@ -159,7 +161,11 @@ const InterProScanDialog = observer(function ({
159
161
  This will run InterProScan via the InterProScan API on all rows of the
160
162
  current MSA
161
163
  </Typography>
162
- <Button onClick={() => setShow(!show)}>
164
+ <Button
165
+ onClick={() => {
166
+ setShow(!show)
167
+ }}
168
+ >
163
169
  {show ? 'Hide' : 'Show'} advanced options
164
170
  </Button>
165
171
  {show ? (
@@ -169,18 +175,18 @@ const InterProScanDialog = observer(function ({
169
175
  <Button
170
176
  variant="contained"
171
177
  color="secondary"
172
- onClick={() =>
178
+ onClick={() => {
173
179
  setVals(vals.map(v => ({ ...v, checked: false })))
174
- }
180
+ }}
175
181
  >
176
182
  Select none
177
183
  </Button>
178
184
  <Button
179
185
  variant="contained"
180
186
  color="primary"
181
- onClick={() =>
187
+ onClick={() => {
182
188
  setVals(vals.map(v => ({ ...v, checked: true })))
183
- }
189
+ }}
184
190
  >
185
191
  Select all
186
192
  </Button>
@@ -196,7 +202,7 @@ const InterProScanDialog = observer(function ({
196
202
  type="checkbox"
197
203
  key={name}
198
204
  checked={checked}
199
- onChange={() =>
205
+ onChange={() => {
200
206
  setVals(
201
207
  vals.map(e =>
202
208
  e.name === name
@@ -204,7 +210,7 @@ const InterProScanDialog = observer(function ({
204
210
  : e,
205
211
  ),
206
212
  )
207
- }
213
+ }}
208
214
  />
209
215
  </td>
210
216
  <td>{name}</td>
@@ -220,7 +226,9 @@ const InterProScanDialog = observer(function ({
220
226
  <Button
221
227
  variant="contained"
222
228
  color="secondary"
223
- onClick={() => handleClose()}
229
+ onClick={() => {
230
+ handleClose()
231
+ }}
224
232
  >
225
233
  Cancel
226
234
  </Button>
@@ -245,7 +253,9 @@ const InterProScanDialog = observer(function ({
245
253
  .filter(f => !!f[1])
246
254
  .map(row => `>${row[0]}\n${row[1]}`)
247
255
  .join('\n'),
248
- onProgress: arg => model.setStatus(arg),
256
+ onProgress: arg => {
257
+ model.setStatus(arg)
258
+ },
249
259
  model,
250
260
  })
251
261
  } catch (e) {
@@ -21,7 +21,14 @@ const MetadataDialog = observer(function ({
21
21
  const { header } = model
22
22
 
23
23
  return (
24
- <Dialog onClose={() => onClose()} open title="Metadata" maxWidth="xl">
24
+ <Dialog
25
+ onClose={() => {
26
+ onClose()
27
+ }}
28
+ open
29
+ title="Metadata"
30
+ maxWidth="xl"
31
+ >
25
32
  <DialogContent>
26
33
  <Attributes attributes={header} />
27
34
  <BaseCard title="sequence">
@@ -23,6 +23,9 @@ const useStyles = makeStyles()(theme => ({
23
23
  flex: {
24
24
  display: 'flex',
25
25
  },
26
+ minw: {
27
+ width: '80em',
28
+ },
26
29
  }))
27
30
 
28
31
  const SettingsContent = observer(function ({ model }: { model: MsaViewModel }) {
@@ -56,39 +59,49 @@ const TreeSettings = observer(function TreeSettings({
56
59
  <h1>Tree options</h1>
57
60
  <Checkbox2
58
61
  checked={showBranchLen}
59
- onChange={() => model.setShowBranchLen(!showBranchLen)}
62
+ onChange={() => {
63
+ model.setShowBranchLen(!showBranchLen)
64
+ }}
60
65
  label="Show branch length?"
61
66
  />
62
67
 
63
68
  <Checkbox2
64
69
  checked={drawNodeBubbles}
65
- onChange={() => model.setDrawNodeBubbles(!drawNodeBubbles)}
70
+ onChange={() => {
71
+ model.setDrawNodeBubbles(!drawNodeBubbles)
72
+ }}
66
73
  label="Draw clickable bubbles on tree branches?"
67
74
  />
68
75
  <Checkbox2
69
76
  checked={drawTree}
70
- onChange={() => model.setDrawTree(!drawTree)}
77
+ onChange={() => {
78
+ model.setDrawTree(!drawTree)
79
+ }}
71
80
  label="Show tree?"
72
81
  />
73
82
 
74
83
  <Checkbox2
75
84
  checked={labelsAlignRight}
76
- onChange={() => model.setLabelsAlignRight(!labelsAlignRight)}
85
+ onChange={() => {
86
+ model.setLabelsAlignRight(!labelsAlignRight)
87
+ }}
77
88
  label="Tree labels align right?"
78
89
  />
79
90
 
80
91
  <Checkbox2
81
92
  checked={drawLabels}
82
- onChange={() => model.setDrawLabels(!drawLabels)}
93
+ onChange={() => {
94
+ model.setDrawLabels(!drawLabels)
95
+ }}
83
96
  label="Draw labels"
84
97
  />
85
98
  {noTree ? null : (
86
99
  <div>
87
100
  <Checkbox2
88
101
  checked={treeWidthMatchesArea}
89
- onChange={() =>
102
+ onChange={() => {
90
103
  model.setTreeWidthMatchesArea(!treeWidthMatchesArea)
91
- }
104
+ }}
92
105
  label="Make tree width fit to tree area?"
93
106
  />
94
107
  {treeWidthMatchesArea ? null : (
@@ -99,7 +112,9 @@ const TreeSettings = observer(function TreeSettings({
99
112
  min={50}
100
113
  max={600}
101
114
  value={treeWidth}
102
- onChange={(_, val) => model.setTreeWidth(val as number)}
115
+ onChange={(_, val) => {
116
+ model.setTreeWidth(val as number)
117
+ }}
103
118
  />
104
119
  </div>
105
120
  )}
@@ -131,25 +146,46 @@ const MSASettings = observer(function MSASettings({
131
146
  <h1>MSA options</h1>
132
147
  <Checkbox2
133
148
  checked={drawMsaLetters}
134
- onChange={() => model.setDrawMsaLetters(!drawMsaLetters)}
149
+ onChange={() => {
150
+ model.setDrawMsaLetters(!drawMsaLetters)
151
+ }}
135
152
  label="Draw letters"
136
153
  />
137
154
  <Checkbox2
138
155
  checked={bgColor}
139
- onChange={() => model.setBgColor(!bgColor)}
156
+ onChange={() => {
157
+ model.setBgColor(!bgColor)
158
+ }}
140
159
  label="Color background tiles of MSA?"
141
160
  />
142
161
  <Checkbox2
143
162
  checked={contrastLettering}
144
- onChange={() => model.setContrastLettering(!contrastLettering)}
163
+ onChange={() => {
164
+ model.setContrastLettering(!contrastLettering)
165
+ }}
145
166
  label="Use contrast lettering"
146
167
  />
147
168
  <Checkbox2
148
169
  checked={hideGaps}
149
- onChange={() => model.setHideGaps(!hideGaps)}
150
- label={`Hide columns that are ${100 - allowedGappyness}% gaps`}
170
+ onChange={() => {
171
+ model.setHideGaps(!hideGaps)
172
+ }}
173
+ label={`Hide columns that are ${allowedGappyness}% gaps`}
151
174
  />
152
-
175
+ {hideGaps ? (
176
+ <div className={classes.flex}>
177
+ <Typography>Allowed gappyness ({100 - allowedGappyness}%)</Typography>
178
+ <Slider
179
+ className={classes.field}
180
+ min={1}
181
+ max={100}
182
+ value={allowedGappyness}
183
+ onChange={(_, val) => {
184
+ model.setAllowedGappyness(val as number)
185
+ }}
186
+ />
187
+ </div>
188
+ ) : null}
153
189
  <div className={classes.flex}>
154
190
  <Typography>Column width ({colWidth}px)</Typography>
155
191
  <Slider
@@ -157,7 +193,9 @@ const MSASettings = observer(function MSASettings({
157
193
  min={1}
158
194
  max={50}
159
195
  value={colWidth}
160
- onChange={(_, val) => model.setColWidth(val as number)}
196
+ onChange={(_, val) => {
197
+ model.setColWidth(val as number)
198
+ }}
161
199
  />
162
200
  </div>
163
201
  <div className={classes.flex}>
@@ -167,27 +205,19 @@ const MSASettings = observer(function MSASettings({
167
205
  min={1}
168
206
  max={50}
169
207
  value={rowHeight}
170
- onChange={(_, val) => model.setRowHeight(val as number)}
208
+ onChange={(_, val) => {
209
+ model.setRowHeight(val as number)
210
+ }}
171
211
  />
172
212
  </div>
173
- {hideGaps ? (
174
- <div className={classes.flex}>
175
- <Typography>Allowed gappyness ({100 - allowedGappyness}%)</Typography>
176
- <Slider
177
- className={classes.field}
178
- min={1}
179
- max={100}
180
- value={allowedGappyness}
181
- onChange={(_, val) => model.setAllowedGappyness(val as number)}
182
- />
183
- </div>
184
- ) : null}
185
213
 
186
214
  <TextField
187
215
  select
188
216
  label="Color scheme"
189
217
  value={colorSchemeName}
190
- onChange={event => model.setColorSchemeName(event.target.value)}
218
+ onChange={event => {
219
+ model.setColorSchemeName(event.target.value)
220
+ }}
191
221
  >
192
222
  {Object.keys(colorSchemes).map(option => (
193
223
  <MenuItem key={option} value={option}>
@@ -206,12 +236,26 @@ const SettingsDialog = observer(function ({
206
236
  model: MsaViewModel
207
237
  onClose: () => void
208
238
  }) {
239
+ const { classes } = useStyles()
209
240
  return (
210
- <Dialog open onClose={() => onClose()} title="Settings" maxWidth="xl">
211
- <DialogContent style={{ width: '80em' }}>
241
+ <Dialog
242
+ open
243
+ onClose={() => {
244
+ onClose()
245
+ }}
246
+ title="Settings"
247
+ maxWidth="xl"
248
+ >
249
+ <DialogContent className={classes.minw}>
212
250
  <SettingsContent model={model} />
213
251
  <DialogActions>
214
- <Button onClick={() => onClose()} variant="contained" color="primary">
252
+ <Button
253
+ onClick={() => {
254
+ onClose()
255
+ }}
256
+ variant="contained"
257
+ color="primary"
258
+ >
215
259
  Submit
216
260
  </Button>
217
261
  </DialogActions>
@@ -14,7 +14,7 @@ import { observer } from 'mobx-react'
14
14
  // locals
15
15
  import type { MsaViewModel } from '../../model'
16
16
 
17
- export default observer(function ({
17
+ const TracklistDialog = observer(function ({
18
18
  model,
19
19
  onClose,
20
20
  }: {
@@ -24,7 +24,13 @@ export default observer(function ({
24
24
  const { tracks } = model
25
25
 
26
26
  return (
27
- <Dialog onClose={() => onClose()} open title="Add track">
27
+ <Dialog
28
+ onClose={() => {
29
+ onClose()
30
+ }}
31
+ open
32
+ title="Add track"
33
+ >
28
34
  <DialogContent>
29
35
  <Typography>
30
36
  Open relevant per-alignment tracks e.g. protein domains
@@ -49,7 +55,13 @@ export default observer(function ({
49
55
  })}
50
56
  </FormGroup>
51
57
  <DialogActions>
52
- <Button onClick={() => onClose()} variant="contained" color="primary">
58
+ <Button
59
+ onClick={() => {
60
+ onClose()
61
+ }}
62
+ variant="contained"
63
+ color="primary"
64
+ >
53
65
  Close
54
66
  </Button>
55
67
  </DialogActions>
@@ -57,3 +69,5 @@ export default observer(function ({
57
69
  </Dialog>
58
70
  )
59
71
  })
72
+
73
+ export default TracklistDialog
@@ -34,7 +34,9 @@ const UserProvidedDomainsDialog = observer(function ({
34
34
  <Dialog
35
35
  maxWidth="xl"
36
36
  title="Open protein domains from file"
37
- onClose={() => handleClose()}
37
+ onClose={() => {
38
+ handleClose()
39
+ }}
38
40
  open
39
41
  >
40
42
  <DialogContent>
@@ -48,7 +50,9 @@ const UserProvidedDomainsDialog = observer(function ({
48
50
  <FormControl component="fieldset">
49
51
  <RadioGroup
50
52
  value={choice}
51
- onChange={event => setChoice(event.target.value)}
53
+ onChange={event => {
54
+ setChoice(event.target.value)
55
+ }}
52
56
  >
53
57
  <FormControlLabel value="url" control={<Radio />} label="URL" />
54
58
  <FormControlLabel
@@ -66,7 +70,9 @@ const UserProvidedDomainsDialog = observer(function ({
66
70
  <TextField
67
71
  label="URL"
68
72
  value={interProURL}
69
- onChange={event => setInterProURL(event.target.value)}
73
+ onChange={event => {
74
+ setInterProURL(event.target.value)
75
+ }}
70
76
  />
71
77
  </div>
72
78
  ) : null}
@@ -81,7 +87,7 @@ const UserProvidedDomainsDialog = observer(function ({
81
87
  type="file"
82
88
  hidden
83
89
  onChange={({ target }) => {
84
- const file = target?.files?.[0]
90
+ const file = target.files?.[0]
85
91
  if (file) {
86
92
  setFile(file)
87
93
  }
@@ -106,7 +112,7 @@ const UserProvidedDomainsDialog = observer(function ({
106
112
  : await jsonfetch(interProURL)
107
113
 
108
114
  model.setInterProAnnotations(
109
- Object.fromEntries(ret.results.map(r => [r.xref[0].id, r])),
115
+ Object.fromEntries(ret.results.map(r => [r.xref[0]!.id, r])),
110
116
  )
111
117
  model.setShowDomains(true)
112
118
  getSession(model).notify(
@@ -32,7 +32,9 @@ const Header = observer(function ({ model }: { model: MsaViewModel }) {
32
32
  <Spacer />
33
33
  <HeaderStatusArea model={model} />
34
34
  <IconButton
35
- onClick={() => model.queueDialog(onClose => [AboutDialog, { onClose }])}
35
+ onClick={() => {
36
+ model.queueDialog(onClose => [AboutDialog, { onClose }])
37
+ }}
36
38
  >
37
39
  <Help />
38
40
  </IconButton>
@@ -13,13 +13,14 @@ const useStyles = makeStyles()({
13
13
  },
14
14
  })
15
15
 
16
- const HeaderInfoArea = observer(({ model }: { model: MsaViewModel }) => {
16
+ const HeaderInfoArea = observer(function ({ model }: { model: MsaViewModel }) {
17
17
  const { mouseOverRowName, mouseCol } = model
18
18
  const { classes } = useStyles()
19
19
  return mouseOverRowName && mouseCol !== undefined ? (
20
20
  <Typography className={classes.margin}>
21
21
  {mouseOverRowName}:
22
- {model.globalCoordToRowSpecificSeqCoord(mouseOverRowName, mouseCol)}
22
+ {model.mouseOverCoordToGapRemovedRowCoord(mouseOverRowName, mouseCol)} (
23
+ {model.mouseOverCoordToRowLetter(mouseOverRowName, mouseCol)})
23
24
  </Typography>
24
25
  ) : null
25
26
  })
@@ -24,24 +24,29 @@ const HeaderMenu = observer(function ({ model }: { model: MsaViewModel }) {
24
24
  {
25
25
  label: 'Return to import form',
26
26
  icon: FolderOpen,
27
- onClick: () => model.reset(),
27
+ onClick: () => {
28
+ model.reset()
29
+ },
28
30
  },
29
31
  {
30
32
  label: 'Settings',
31
- onClick: () =>
32
- model.queueDialog(onClose => [SettingsDialog, { model, onClose }]),
33
+ onClick: () => {
34
+ model.queueDialog(onClose => [SettingsDialog, { model, onClose }])
35
+ },
33
36
  icon: Settings,
34
37
  },
35
38
  {
36
39
  label: 'Metadata',
37
- onClick: () =>
38
- model.queueDialog(onClose => [MetadataDialog, { model, onClose }]),
40
+ onClick: () => {
41
+ model.queueDialog(onClose => [MetadataDialog, { model, onClose }])
42
+ },
39
43
  icon: Assignment,
40
44
  },
41
45
  {
42
46
  label: 'Extra tracks',
43
- onClick: () =>
44
- model.queueDialog(onClose => [TracklistDialog, { model, onClose }]),
47
+ onClick: () => {
48
+ model.queueDialog(onClose => [TracklistDialog, { model, onClose }])
49
+ },
45
50
  icon: List,
46
51
  },
47
52
  ]}