@jbrowse/plugin-linear-genome-view 2.1.4 → 2.1.6

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 (104) hide show
  1. package/dist/BaseLinearDisplay/components/BlockMsg.d.ts +9 -0
  2. package/dist/BaseLinearDisplay/components/BlockMsg.js +22 -0
  3. package/dist/BaseLinearDisplay/components/BlockMsg.js.map +1 -0
  4. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +5 -42
  5. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  6. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +3 -6
  7. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -20
  8. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  9. package/dist/BaseLinearDisplay/models/TooLargeMessage.d.ts +11 -0
  10. package/dist/BaseLinearDisplay/models/TooLargeMessage.js +22 -0
  11. package/dist/BaseLinearDisplay/models/TooLargeMessage.js.map +1 -0
  12. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
  13. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  14. package/dist/LinearBareDisplay/model.d.ts +2 -2
  15. package/dist/LinearBasicDisplay/model.d.ts +12 -4
  16. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +4 -2
  17. package/dist/LinearGenomeView/components/Header.d.ts +1 -1
  18. package/dist/LinearGenomeView/components/Header.js +2 -2
  19. package/dist/LinearGenomeView/components/Header.js.map +1 -1
  20. package/dist/LinearGenomeView/components/LinearGenomeView.js +9 -10
  21. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  22. package/dist/LinearGenomeView/components/MiniControls.d.ts +1 -1
  23. package/dist/LinearGenomeView/components/MiniControls.js +13 -12
  24. package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
  25. package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +11 -26
  26. package/dist/LinearGenomeView/components/OverviewScaleBar.js +2 -2
  27. package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
  28. package/dist/LinearGenomeView/components/SearchResultsDialog.js +4 -6
  29. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  30. package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -2
  31. package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
  32. package/dist/LinearGenomeView/components/TrackLabel.js +12 -23
  33. package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
  34. package/dist/LinearGenomeView/components/TracksContainer.d.ts +2 -3
  35. package/dist/LinearGenomeView/components/TracksContainer.js +1 -0
  36. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
  37. package/dist/LinearGenomeView/index.d.ts +8 -3
  38. package/dist/LinearGenomeView/index.js +47 -28
  39. package/dist/LinearGenomeView/index.js.map +1 -1
  40. package/dist/index.d.ts +1249 -6
  41. package/dist/index.js +3 -0
  42. package/dist/index.js.map +1 -1
  43. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +9 -0
  44. package/esm/BaseLinearDisplay/components/BlockMsg.js +16 -0
  45. package/esm/BaseLinearDisplay/components/BlockMsg.js.map +1 -0
  46. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +6 -43
  47. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  48. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +3 -6
  49. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -20
  50. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  51. package/esm/BaseLinearDisplay/models/TooLargeMessage.d.ts +11 -0
  52. package/esm/BaseLinearDisplay/models/TooLargeMessage.js +17 -0
  53. package/esm/BaseLinearDisplay/models/TooLargeMessage.js.map +1 -0
  54. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
  55. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  56. package/esm/LinearBareDisplay/model.d.ts +2 -2
  57. package/esm/LinearBasicDisplay/model.d.ts +12 -4
  58. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +4 -2
  59. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  60. package/esm/LinearGenomeView/components/Header.js +2 -2
  61. package/esm/LinearGenomeView/components/Header.js.map +1 -1
  62. package/esm/LinearGenomeView/components/LinearGenomeView.js +9 -10
  63. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  64. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  65. package/esm/LinearGenomeView/components/MiniControls.js +13 -12
  66. package/esm/LinearGenomeView/components/MiniControls.js.map +1 -1
  67. package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +11 -26
  68. package/esm/LinearGenomeView/components/OverviewScaleBar.js +2 -2
  69. package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
  70. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  71. package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  72. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -2
  73. package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
  74. package/esm/LinearGenomeView/components/TrackLabel.js +13 -24
  75. package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
  76. package/esm/LinearGenomeView/components/TracksContainer.d.ts +2 -3
  77. package/esm/LinearGenomeView/components/TracksContainer.js +1 -0
  78. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
  79. package/esm/LinearGenomeView/index.d.ts +8 -3
  80. package/esm/LinearGenomeView/index.js +44 -27
  81. package/esm/LinearGenomeView/index.js.map +1 -1
  82. package/esm/index.d.ts +1249 -6
  83. package/esm/index.js +4 -1
  84. package/esm/index.js.map +1 -1
  85. package/package.json +3 -2
  86. package/src/BaseLinearDisplay/components/BlockMsg.tsx +42 -0
  87. package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +16 -91
  88. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +3 -31
  89. package/src/BaseLinearDisplay/models/TooLargeMessage.tsx +34 -0
  90. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +2 -2
  91. package/src/LinearGenomeView/components/ExportSvgDialog.tsx +2 -2
  92. package/src/LinearGenomeView/components/Header.tsx +8 -6
  93. package/src/LinearGenomeView/components/{LinearGenomeView.test.js → LinearGenomeView.test.tsx} +16 -7
  94. package/src/LinearGenomeView/components/LinearGenomeView.tsx +14 -17
  95. package/src/LinearGenomeView/components/MiniControls.tsx +39 -37
  96. package/src/LinearGenomeView/components/OverviewScaleBar.tsx +3 -4
  97. package/src/LinearGenomeView/components/SearchResultsDialog.tsx +5 -11
  98. package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +1 -4
  99. package/src/LinearGenomeView/components/TrackLabel.tsx +15 -39
  100. package/src/LinearGenomeView/components/TracksContainer.tsx +3 -3
  101. package/src/LinearGenomeView/components/__snapshots__/{LinearGenomeView.test.js.snap → LinearGenomeView.test.tsx.snap} +32 -102
  102. package/src/LinearGenomeView/index.test.ts +2 -2
  103. package/src/LinearGenomeView/index.tsx +53 -28
  104. package/src/index.ts +5 -0
package/esm/index.js CHANGED
@@ -10,7 +10,7 @@ import { isAbstractMenuManager } from '@jbrowse/core/util';
10
10
  import LineStyleIcon from '@mui/icons-material/LineStyle';
11
11
  import { BaseLinearDisplay, BaseLinearDisplayComponent, baseLinearDisplayConfigSchema, } from './BaseLinearDisplay';
12
12
  import { configSchemaFactory as linearBareDisplayConfigSchemaFactory, stateModelFactory as LinearBareDisplayStateModelFactory, } from './LinearBareDisplay';
13
- import { stateModelFactory as linearGenomeViewStateModelFactory, renderToSvg, RefNameAutocomplete, SearchBox, } from './LinearGenomeView';
13
+ import { stateModelFactory as linearGenomeViewStateModelFactory, renderToSvg, RefNameAutocomplete, SearchBox, ZoomControls, LinearGenomeView, } from './LinearGenomeView';
14
14
  import { configSchema as linearBasicDisplayConfigSchemaFactory, modelFactory as linearBasicDisplayModelFactory, } from './LinearBasicDisplay';
15
15
  export default class LinearGenomeViewPlugin extends Plugin {
16
16
  constructor() {
@@ -20,6 +20,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
20
20
  BaseLinearDisplayComponent,
21
21
  BaseLinearDisplay,
22
22
  baseLinearDisplayConfigSchema,
23
+ SearchBox,
24
+ ZoomControls,
25
+ LinearGenomeView,
23
26
  };
24
27
  }
25
28
  install(pluginManager) {
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,4CAA4C,CAAA;AACnD,OAAO,SAAS,MAAM,+CAA+C,CAAA;AACrE,OAAO,WAAW,MAAM,iDAAiD,CAAA;AACzE,OAAO,QAAQ,MAAM,8CAA8C,CAAA;AACnE,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAEzC,OAAO,EAAwB,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,aAAa,MAAM,+BAA+B,CAAA;AACzD,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,6BAA6B,GAE9B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,mBAAmB,IAAI,oCAAoC,EAC3D,iBAAiB,IAAI,kCAAkC,GACxD,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAGL,iBAAiB,IAAI,iCAAiC,EACtD,WAAW,EACX,mBAAmB,EACnB,SAAS,GACV,MAAM,oBAAoB,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1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "JBrowse 2 linear genome view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -58,11 +58,12 @@
58
58
  "prop-types": "^15.0.0",
59
59
  "react": ">=16.8.0",
60
60
  "react-dom": ">=16.8.0",
61
+ "react-error-boundary": "^3.0.0",
61
62
  "tss-react": "^3.0.0"
62
63
  },
63
64
  "publishConfig": {
64
65
  "access": "public"
65
66
  },
66
67
  "module": "esm/index.js",
67
- "gitHead": "8f53e016dd83b01a1beea0fc61c33964f5b6c809"
68
+ "gitHead": "df810d2a4f057adcd8f5345d54972508fba007a7"
68
69
  }
@@ -0,0 +1,42 @@
1
+ import React from 'react'
2
+ import { Tooltip, Button, Alert, AlertColor } from '@mui/material'
3
+ import { makeStyles } from 'tss-react/mui'
4
+
5
+ const useStyles = makeStyles()({
6
+ ellipses: {
7
+ textOverflow: 'ellipsis',
8
+ overflow: 'hidden',
9
+ },
10
+ })
11
+
12
+ export default function BlockMsg({
13
+ message,
14
+ severity,
15
+ buttonText,
16
+ icon,
17
+ action,
18
+ }: {
19
+ message: string
20
+ severity?: AlertColor
21
+ buttonText?: string
22
+ icon?: React.ReactNode
23
+ action?: () => void
24
+ }) {
25
+ const { classes } = useStyles()
26
+ const button = action ? (
27
+ <Button data-testid="reload_button" onClick={action} startIcon={icon}>
28
+ {buttonText}
29
+ </Button>
30
+ ) : null
31
+ return (
32
+ <Tooltip title={message}>
33
+ <Alert
34
+ severity={severity}
35
+ action={button}
36
+ classes={{ message: classes.ellipses }}
37
+ >
38
+ {message}
39
+ </Alert>
40
+ </Tooltip>
41
+ )
42
+ }
@@ -1,11 +1,12 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { Typography, Button } from '@mui/material'
2
+ import { Typography } from '@mui/material'
3
3
  import { makeStyles } from 'tss-react/mui'
4
4
  import { observer } from 'mobx-react'
5
5
  import { getParent } from 'mobx-state-tree'
6
- import { getParentRenderProps } from '@jbrowse/core/util/tracks'
7
6
  import RefreshIcon from '@mui/icons-material/Refresh'
8
7
 
8
+ import BlockMsg from './BlockMsg'
9
+
9
10
  const useStyles = makeStyles()(theme => ({
10
11
  loading: {
11
12
  paddingLeft: '0.6em',
@@ -17,26 +18,6 @@ const useStyles = makeStyles()(theme => ({
17
18
  pointerEvents: 'none',
18
19
  textAlign: 'center',
19
20
  },
20
- blockMessage: {
21
- width: '100%',
22
- background: theme.palette.action.disabledBackground,
23
- padding: theme.spacing(2),
24
- pointerEvents: 'none',
25
- textAlign: 'center',
26
- },
27
- blockError: {
28
- padding: theme.spacing(2),
29
- width: '100%',
30
- whiteSpace: 'normal',
31
- color: theme.palette.error.main,
32
- overflowY: 'auto',
33
- },
34
- blockReactNodeMessage: {
35
- width: '100%',
36
- background: theme.palette.action.disabledBackground,
37
- padding: theme.spacing(2),
38
- textAlign: 'center',
39
- },
40
21
  dots: {
41
22
  '&::after': {
42
23
  display: 'inline-block',
@@ -59,15 +40,6 @@ const useStyles = makeStyles()(theme => ({
59
40
  },
60
41
  }))
61
42
 
62
- function Repeater({ children }: { children: React.ReactNode }) {
63
- return (
64
- <div style={{ display: 'flex' }}>
65
- {children}
66
- {children}
67
- </div>
68
- )
69
- }
70
-
71
43
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
44
  const LoadingMessage = observer(({ model }: { model: any }) => {
73
45
  // only show the loading message after 300ms to prevent excessive flickering
@@ -103,50 +75,6 @@ const LoadingMessage = observer(({ model }: { model: any }) => {
103
75
  )
104
76
  })
105
77
 
106
- function BlockMessage({
107
- messageContent,
108
- }: {
109
- messageContent: string | React.ReactNode
110
- }) {
111
- const { classes } = useStyles()
112
-
113
- return React.isValidElement(messageContent) ? (
114
- <div className={classes.blockReactNodeMessage}>{messageContent}</div>
115
- ) : (
116
- <Typography variant="body2" className={classes.blockMessage}>
117
- {messageContent}
118
- </Typography>
119
- )
120
- }
121
-
122
- function BlockError({
123
- error,
124
- reload,
125
- displayHeight,
126
- }: {
127
- error: Error
128
- reload: () => void
129
- displayHeight: number
130
- }) {
131
- const { classes } = useStyles()
132
- return (
133
- <div className={classes.blockError} style={{ height: displayHeight }}>
134
- {reload ? (
135
- <Button
136
- data-testid="reload_button"
137
- onClick={reload}
138
- startIcon={<RefreshIcon />}
139
- >
140
- Reload
141
- </Button>
142
- ) : null}
143
- <Typography color="error" variant="body2" display="inline">
144
- {`${error}`}
145
- </Typography>
146
- </div>
147
- )
148
- }
149
-
150
78
  const ServerSideRenderedBlockContent = observer(
151
79
  ({
152
80
  model,
@@ -156,28 +84,25 @@ const ServerSideRenderedBlockContent = observer(
156
84
  }) => {
157
85
  if (model.error) {
158
86
  return (
159
- <Repeater>
160
- <BlockError
161
- error={model.error}
162
- reload={model.reload}
163
- displayHeight={getParentRenderProps(model).displayModel.height}
164
- />
165
- </Repeater>
87
+ <BlockMsg
88
+ message={`${model.error}`}
89
+ severity="error"
90
+ buttonText="reload"
91
+ icon={<RefreshIcon />}
92
+ action={model.reload}
93
+ />
166
94
  )
167
95
  }
168
96
  if (model.message) {
169
- return (
170
- <Repeater>
171
- <BlockMessage messageContent={model.message} />
172
- </Repeater>
97
+ // the message can be a fully rendered react component, e.g. the region too large message
98
+ return React.isValidElement(model.message) ? (
99
+ model.message
100
+ ) : (
101
+ <BlockMsg message={`${model.message}`} severity="info" />
173
102
  )
174
103
  }
175
104
  if (!model.filled) {
176
- return (
177
- <Repeater>
178
- <LoadingMessage model={model} />
179
- </Repeater>
180
- )
105
+ return <LoadingMessage model={model} />
181
106
  }
182
107
  return model.reactElement
183
108
  },
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import React from 'react'
3
- import { Button, Typography } from '@mui/material'
3
+ import TooLargeMessage from './TooLargeMessage'
4
4
  import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models'
5
5
  import { getConf } from '@jbrowse/core/configuration'
6
6
  import { MenuItem } from '@jbrowse/core/ui'
@@ -498,36 +498,8 @@ export const BaseLinearDisplay = types
498
498
  * react node allows user to force load at current setting
499
499
  */
500
500
  regionCannotBeRendered(_region: Region) {
501
- const { regionTooLarge, regionTooLargeReason } = self
502
-
503
- if (regionTooLarge) {
504
- return (
505
- <>
506
- <Typography component="span" variant="body2">
507
- {regionTooLargeReason ? regionTooLargeReason + '. ' : ''}
508
- Zoom in to see features or{' '}
509
- </Typography>
510
- <Button
511
- data-testid="force_reload_button"
512
- onClick={() => {
513
- if (!self.estimatedRegionStats) {
514
- console.error('No global stats?')
515
- } else {
516
- self.updateStatsLimit(self.estimatedRegionStats)
517
- self.reload()
518
- }
519
- }}
520
- variant="outlined"
521
- >
522
- Force Load
523
- </Button>
524
- <Typography component="span" variant="body2">
525
- (force load may be slow)
526
- </Typography>
527
- </>
528
- )
529
- }
530
- return undefined
501
+ const { regionTooLarge } = self
502
+ return regionTooLarge ? <TooLargeMessage model={self} /> : null
531
503
  },
532
504
 
533
505
  trackMenuItems(): MenuItem[] {
@@ -0,0 +1,34 @@
1
+ import React from 'react'
2
+ import BlockMsg from '../components/BlockMsg'
3
+ import { Stats } from '@jbrowse/core/data_adapters/BaseAdapter'
4
+
5
+ function TooLargeMessage({
6
+ model,
7
+ }: {
8
+ model: {
9
+ regionTooLargeReason: string
10
+ estimatedRegionStats?: Stats
11
+ updateStatsLimit: (s: Stats) => void
12
+ reload: () => void
13
+ }
14
+ }) {
15
+ const { regionTooLargeReason } = model
16
+ return (
17
+ <BlockMsg
18
+ severity="warning"
19
+ action={() => {
20
+ if (!model.estimatedRegionStats) {
21
+ console.error('No global stats?')
22
+ } else {
23
+ model.updateStatsLimit(model.estimatedRegionStats)
24
+ model.reload()
25
+ }
26
+ }}
27
+ buttonText="Force load"
28
+ message={`${regionTooLargeReason ? regionTooLargeReason + '. ' : ''}
29
+ Zoom in to see features or force load (may be slow).`}
30
+ />
31
+ )
32
+ }
33
+
34
+ export default TooLargeMessage
@@ -196,7 +196,7 @@ export type BlockModel = Instance<BlockStateModel>
196
196
  // calls the render worker to render the block content not using a flow for
197
197
  // this, because the flow doesn't work with autorun
198
198
  export function renderBlockData(
199
- self: Instance<BlockStateModel>,
199
+ self: BlockModel,
200
200
  optDisplay?: AbstractDisplayModel,
201
201
  ) {
202
202
  try {
@@ -269,7 +269,7 @@ interface ErrorProps {
269
269
  async function renderBlockEffect(
270
270
  props: RenderProps | ErrorProps,
271
271
  signal: AbortSignal,
272
- self: Instance<BlockStateModel>,
272
+ self: BlockModel,
273
273
  ) {
274
274
  const {
275
275
  rendererType,
@@ -15,7 +15,7 @@ import {
15
15
  } from '@mui/material'
16
16
  import { ErrorMessage } from '@jbrowse/core/ui'
17
17
  import CloseIcon from '@mui/icons-material/Close'
18
- import { LinearGenomeViewModel as LGV } from '..'
18
+ import { ExportSvgOptions } from '..'
19
19
 
20
20
  const useStyles = makeStyles()(theme => ({
21
21
  closeButton: {
@@ -39,7 +39,7 @@ export default function ExportSvgDlg({
39
39
  model,
40
40
  handleClose,
41
41
  }: {
42
- model: LGV
42
+ model: { exportSvg(opts: ExportSvgOptions): void }
43
43
  handleClose: () => void
44
44
  }) {
45
45
  // @ts-ignore
@@ -119,13 +119,15 @@ const Controls = ({ model }: { model: LGV }) => {
119
119
  }
120
120
 
121
121
  const LinearGenomeViewHeader = observer(({ model }: { model: LGV }) => {
122
- return model.hideHeaderOverview ? (
123
- <Controls model={model} />
124
- ) : (
125
- <OverviewScaleBar model={model}>
122
+ return !model.hideHeader ? (
123
+ model.hideHeaderOverview ? (
126
124
  <Controls model={model} />
127
- </OverviewScaleBar>
128
- )
125
+ ) : (
126
+ <OverviewScaleBar model={model}>
127
+ <Controls model={model} />
128
+ </OverviewScaleBar>
129
+ )
130
+ ) : null
129
131
  })
130
132
 
131
133
  export default LinearGenomeViewHeader
@@ -1,9 +1,13 @@
1
1
  import React from 'react'
2
2
  import { fireEvent, render, waitFor } from '@testing-library/react'
3
- import '@testing-library/jest-dom/extend-expect'
4
3
  import { createTestSession } from '@jbrowse/web/src/rootModel'
4
+ import '@testing-library/jest-dom/extend-expect'
5
5
  import 'requestidlecallback-polyfill'
6
+
7
+ // locals
6
8
  import LinearGenomeView from './LinearGenomeView'
9
+
10
+ // mock
7
11
  jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
8
12
 
9
13
  const assemblyConf = {
@@ -38,7 +42,9 @@ describe('<LinearGenomeView />', () => {
38
42
  const elt = await findByText('Open')
39
43
  await waitFor(() => expect(elt.getAttribute('disabled')).toBe(null))
40
44
  fireEvent.click(elt)
41
- await waitFor(() => expect(model.displayedRegions.length).toEqual(1), 15000)
45
+ await waitFor(() => expect(model.displayedRegions.length).toEqual(1), {
46
+ timeout: 15000,
47
+ })
42
48
  }, 15000)
43
49
 
44
50
  it('renders one track, one region', async () => {
@@ -76,7 +82,7 @@ describe('<LinearGenomeView />', () => {
76
82
  })
77
83
  const model = session.views[0]
78
84
  model.setWidth(800)
79
- const { container, getByPlaceholderText, findByText } = render(
85
+ const { container, queryByText, getByPlaceholderText, findByText } = render(
80
86
  <LinearGenomeView model={model} />,
81
87
  )
82
88
  await findByText('Foo Track')
@@ -85,10 +91,11 @@ describe('<LinearGenomeView />', () => {
85
91
  await findByText('100bp')
86
92
 
87
93
  await waitFor(() => {
88
- expect(getByPlaceholderText('Search for location').value).toEqual(
89
- 'ctgA:1..100',
90
- )
94
+ expect(
95
+ (getByPlaceholderText('Search for location') as HTMLInputElement).value,
96
+ ).toEqual('ctgA:1..100')
91
97
  })
98
+ await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
92
99
  expect(container.firstChild).toMatchSnapshot()
93
100
  })
94
101
 
@@ -102,6 +109,7 @@ describe('<LinearGenomeView />', () => {
102
109
  type: 'BasicTrack',
103
110
  adapter: { type: 'FromConfigAdapter', features: [] },
104
111
  })
112
+
105
113
  session.addTrackConf({
106
114
  trackId: 'testConfig2',
107
115
  name: 'Bar Track',
@@ -151,12 +159,13 @@ describe('<LinearGenomeView />', () => {
151
159
  })
152
160
  const model = session.views[0]
153
161
  model.setWidth(800)
154
- const { container, findByText, findAllByTestId } = render(
162
+ const { container, findByText, queryByText, findAllByTestId } = render(
155
163
  <LinearGenomeView model={model} />,
156
164
  )
157
165
  await findByText('Foo Track')
158
166
  await findByText('798bp')
159
167
  await findAllByTestId('svgfeatures')
168
+ await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
160
169
 
161
170
  expect(container.firstChild).toMatchSnapshot()
162
171
  })
@@ -1,16 +1,16 @@
1
1
  import React from 'react'
2
2
  import { Button, Paper, Typography } from '@mui/material'
3
3
  import { makeStyles } from 'tss-react/mui'
4
+ import { ErrorBoundary } from 'react-error-boundary'
4
5
  import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons'
6
+ import { ErrorMessage } from '@jbrowse/core/ui'
5
7
  import { observer } from 'mobx-react'
6
8
 
7
9
  // locals
8
10
  import { LinearGenomeViewModel } from '..'
9
- import Header from './Header'
10
11
  import TrackContainer from './TrackContainer'
11
12
  import TracksContainer from './TracksContainer'
12
13
  import ImportForm from './ImportForm'
13
- import MiniControls from './MiniControls'
14
14
  import GetSequenceDialog from './GetSequenceDialog'
15
15
  import SearchResultsDialog from './SearchResultsDialog'
16
16
 
@@ -45,7 +45,7 @@ const useStyles = makeStyles()(theme => ({
45
45
  }))
46
46
 
47
47
  const LinearGenomeView = observer(({ model }: { model: LGV }) => {
48
- const { tracks, error, hideHeader, initialized, hasDisplayedRegions } = model
48
+ const { tracks, error, initialized, hasDisplayedRegions } = model
49
49
  const { classes } = useStyles()
50
50
 
51
51
  if (!initialized && !error) {
@@ -59,6 +59,9 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => {
59
59
  return <ImportForm model={model} />
60
60
  }
61
61
 
62
+ const MiniControlsComponent = model.MiniControlsComponent()
63
+ const HeaderComponent = model.HeaderComponent()
64
+
62
65
  return (
63
66
  <div style={{ position: 'relative' }}>
64
67
  {model.seqDialogDisplayed ? (
@@ -73,19 +76,8 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => {
73
76
  handleClose={() => model.setSearchResults(undefined, undefined)}
74
77
  />
75
78
  ) : null}
76
- {!hideHeader ? (
77
- <Header model={model} />
78
- ) : (
79
- <div
80
- style={{
81
- position: 'absolute',
82
- right: 0,
83
- zIndex: 1001,
84
- }}
85
- >
86
- <MiniControls model={model} />
87
- </div>
88
- )}
79
+ <HeaderComponent model={model} />
80
+ <MiniControlsComponent model={model} />
89
81
  <TracksContainer model={model}>
90
82
  {!tracks.length ? (
91
83
  <Paper variant="outlined" className={classes.note}>
@@ -108,7 +100,12 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => {
108
100
  </Paper>
109
101
  ) : (
110
102
  tracks.map(track => (
111
- <TrackContainer key={track.id} model={model} track={track} />
103
+ <ErrorBoundary
104
+ key={track.id}
105
+ FallbackComponent={({ error }) => <ErrorMessage error={error} />}
106
+ >
107
+ <TrackContainer model={model} track={track} />
108
+ </ErrorBoundary>
112
109
  ))
113
110
  )}
114
111
  </TracksContainer>
@@ -9,46 +9,48 @@ import { LinearGenomeViewModel } from '..'
9
9
 
10
10
  const MiniControls = observer((props: { model: LinearGenomeViewModel }) => {
11
11
  const { model } = props
12
- const { bpPerPx, maxBpPerPx, minBpPerPx, scaleFactor } = model
12
+ const { bpPerPx, maxBpPerPx, minBpPerPx, scaleFactor, hideHeader } = model
13
13
  const [anchorEl, setAnchorEl] = useState<HTMLElement>()
14
14
 
15
- return (
16
- <Paper style={{ background: '#aaa7' }}>
17
- <IconButton
18
- color="secondary"
19
- onClick={event => setAnchorEl(event.currentTarget)}
20
- >
21
- <ArrowDown fontSize="small" />
22
- </IconButton>
15
+ return hideHeader ? (
16
+ <div style={{ position: 'absolute', right: '0px', zIndex: '1001' }}>
17
+ <Paper style={{ background: '#aaa7' }}>
18
+ <IconButton
19
+ color="secondary"
20
+ onClick={event => setAnchorEl(event.currentTarget)}
21
+ >
22
+ <ArrowDown fontSize="small" />
23
+ </IconButton>
23
24
 
24
- <IconButton
25
- data-testid="zoom_out"
26
- onClick={() => model.zoom(bpPerPx * 2)}
27
- disabled={bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1}
28
- color="secondary"
29
- >
30
- <ZoomOut fontSize="small" />
31
- </IconButton>
32
- <IconButton
33
- data-testid="zoom_in"
34
- onClick={() => model.zoom(model.bpPerPx / 2)}
35
- disabled={bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1}
36
- color="secondary"
37
- >
38
- <ZoomIn fontSize="small" />
39
- </IconButton>
40
- <Menu
41
- anchorEl={anchorEl}
42
- open={Boolean(anchorEl)}
43
- onMenuItemClick={(_, callback) => {
44
- callback()
45
- setAnchorEl(undefined)
46
- }}
47
- onClose={() => setAnchorEl(undefined)}
48
- menuItems={model.menuItems()}
49
- />
50
- </Paper>
51
- )
25
+ <IconButton
26
+ data-testid="zoom_out"
27
+ onClick={() => model.zoom(bpPerPx * 2)}
28
+ disabled={bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1}
29
+ color="secondary"
30
+ >
31
+ <ZoomOut fontSize="small" />
32
+ </IconButton>
33
+ <IconButton
34
+ data-testid="zoom_in"
35
+ onClick={() => model.zoom(model.bpPerPx / 2)}
36
+ disabled={bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1}
37
+ color="secondary"
38
+ >
39
+ <ZoomIn fontSize="small" />
40
+ </IconButton>
41
+ <Menu
42
+ anchorEl={anchorEl}
43
+ open={Boolean(anchorEl)}
44
+ onMenuItemClick={(_, callback) => {
45
+ callback()
46
+ setAnchorEl(undefined)
47
+ }}
48
+ onClose={() => setAnchorEl(undefined)}
49
+ menuItems={model.menuItems()}
50
+ />
51
+ </Paper>
52
+ </div>
53
+ ) : null
52
54
  })
53
55
 
54
56
  export default MiniControls
@@ -2,7 +2,6 @@ import React from 'react'
2
2
  import { Typography, useTheme, alpha } from '@mui/material'
3
3
  import { makeStyles } from 'tss-react/mui'
4
4
  import { observer } from 'mobx-react'
5
- import { Instance } from 'mobx-state-tree'
6
5
 
7
6
  import Base1DView, { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel'
8
7
  import { getSession, getTickDisplayStr } from '@jbrowse/core/util'
@@ -79,7 +78,7 @@ const Polygon = observer(
79
78
  useOffset = true,
80
79
  }: {
81
80
  model: LGV
82
- overview: Instance<Base1DViewModel>
81
+ overview: Base1DViewModel
83
82
  useOffset?: boolean
84
83
  }) => {
85
84
  const theme = useTheme()
@@ -305,7 +304,7 @@ const OverviewBox = observer(
305
304
  overview: Base1DViewModel
306
305
  }) => {
307
306
  const { classes, cx } = useStyles()
308
- const { cytobandOffset, bpPerPx, showCytobands } = model
307
+ const { cytobandOffset, showCytobands } = model
309
308
  const { start, end, reversed, refName, assemblyName } = block
310
309
  const { majorPitch } = chooseGridPitch(scale, 120, 15)
311
310
  const { assemblyManager } = getSession(model)
@@ -361,7 +360,7 @@ const OverviewBox = observer(
361
360
  color: refNameColor,
362
361
  }}
363
362
  >
364
- {getTickDisplayStr(tickLabel, bpPerPx)}
363
+ {getTickDisplayStr(tickLabel, overview.bpPerPx)}
365
364
  </Typography>
366
365
  ))
367
366
  : null}