@jbrowse/plugin-linear-genome-view 2.1.3 → 2.1.5
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.
- package/dist/BaseLinearDisplay/components/BlockMsg.d.ts +9 -0
- package/dist/BaseLinearDisplay/components/BlockMsg.js +22 -0
- package/dist/BaseLinearDisplay/components/BlockMsg.js.map +1 -0
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +5 -42
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +2 -5
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -20
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/TooLargeMessage.d.ts +11 -0
- package/dist/BaseLinearDisplay/models/TooLargeMessage.js +22 -0
- package/dist/BaseLinearDisplay/models/TooLargeMessage.js.map +1 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/dist/LinearBareDisplay/model.d.ts +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +1 -1
- package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +4 -2
- package/dist/LinearGenomeView/components/Header.d.ts +1 -1
- package/dist/LinearGenomeView/components/Header.js +2 -2
- package/dist/LinearGenomeView/components/Header.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +9 -10
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/dist/LinearGenomeView/components/MiniControls.js +13 -12
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
- package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -2
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackLabel.js +4 -5
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +2 -3
- package/dist/LinearGenomeView/components/TracksContainer.js +1 -0
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/dist/LinearGenomeView/index.d.ts +8 -3
- package/dist/LinearGenomeView/index.js +47 -28
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/index.d.ts +1246 -3
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +9 -0
- package/esm/BaseLinearDisplay/components/BlockMsg.js +16 -0
- package/esm/BaseLinearDisplay/components/BlockMsg.js.map +1 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +6 -43
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +2 -5
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -20
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/esm/BaseLinearDisplay/models/TooLargeMessage.d.ts +11 -0
- package/esm/BaseLinearDisplay/models/TooLargeMessage.js +17 -0
- package/esm/BaseLinearDisplay/models/TooLargeMessage.js.map +1 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/esm/LinearBareDisplay/model.d.ts +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +1 -1
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +4 -2
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.js +2 -2
- package/esm/LinearGenomeView/components/Header.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +9 -10
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +13 -12
- package/esm/LinearGenomeView/components/MiniControls.js.map +1 -1
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -2
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/TrackLabel.js +4 -5
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +2 -3
- package/esm/LinearGenomeView/components/TracksContainer.js +1 -0
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/esm/LinearGenomeView/index.d.ts +8 -3
- package/esm/LinearGenomeView/index.js +44 -27
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/esm/index.d.ts +1246 -3
- package/esm/index.js +4 -1
- package/esm/index.js.map +1 -1
- package/package.json +3 -2
- package/src/BaseLinearDisplay/components/BlockMsg.tsx +42 -0
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +16 -91
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +3 -31
- package/src/BaseLinearDisplay/models/TooLargeMessage.tsx +34 -0
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +2 -2
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +2 -2
- package/src/LinearGenomeView/components/Header.tsx +8 -6
- package/src/LinearGenomeView/components/{LinearGenomeView.test.js → LinearGenomeView.test.tsx} +16 -7
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +14 -17
- package/src/LinearGenomeView/components/MiniControls.tsx +39 -37
- package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +1 -4
- package/src/LinearGenomeView/components/TrackLabel.tsx +6 -9
- package/src/LinearGenomeView/components/TracksContainer.tsx +3 -3
- package/src/LinearGenomeView/components/__snapshots__/{LinearGenomeView.test.js.snap → LinearGenomeView.test.tsx.snap} +32 -102
- package/src/LinearGenomeView/index.test.ts +2 -2
- package/src/LinearGenomeView/index.tsx +53 -28
- 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,CA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CAAC,CAAC,KAAK,CAAC,EAAE;gBAC/C,KAAK,EAAE,oBAAoB;gBAC3B,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,CAAC,OAA6B,EAAE,EAAE;oBACzC,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;gBACzC,CAAC;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF;AAED,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,EACpC,qCAAqC,EACrC,8BAA8B,EAC9B,WAAW,EACX,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,GACV,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-genome-view",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
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": "
|
|
68
|
+
"gitHead": "bc5253ecdddeceeb999fffebf6dc6cf5f444e1c9"
|
|
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
|
|
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
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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 {
|
|
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:
|
|
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.
|
|
123
|
-
|
|
124
|
-
) : (
|
|
125
|
-
<OverviewScaleBar model={model}>
|
|
122
|
+
return !model.hideHeader ? (
|
|
123
|
+
model.hideHeaderOverview ? (
|
|
126
124
|
<Controls model={model} />
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
) : (
|
|
126
|
+
<OverviewScaleBar model={model}>
|
|
127
|
+
<Controls model={model} />
|
|
128
|
+
</OverviewScaleBar>
|
|
129
|
+
)
|
|
130
|
+
) : null
|
|
129
131
|
})
|
|
130
132
|
|
|
131
133
|
export default LinearGenomeViewHeader
|
package/src/LinearGenomeView/components/{LinearGenomeView.test.js → LinearGenomeView.test.tsx}
RENAMED
|
@@ -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),
|
|
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(
|
|
89
|
-
'
|
|
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,
|
|
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
|
-
{
|
|
77
|
-
|
|
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
|
-
<
|
|
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
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
@@ -21,9 +21,6 @@ import { getSession } from '@jbrowse/core/util'
|
|
|
21
21
|
// icons
|
|
22
22
|
import CloseIcon from '@mui/icons-material/Close'
|
|
23
23
|
|
|
24
|
-
// locals
|
|
25
|
-
import { LinearGenomeViewModel } from '..'
|
|
26
|
-
|
|
27
24
|
const useStyles = makeStyles()(theme => ({
|
|
28
25
|
closeButton: {
|
|
29
26
|
position: 'absolute',
|
|
@@ -40,7 +37,7 @@ function SequenceDialog({
|
|
|
40
37
|
model,
|
|
41
38
|
handleClose,
|
|
42
39
|
}: {
|
|
43
|
-
model:
|
|
40
|
+
model: { assemblyNames: string[]; toggleTrack(trackId: string): void }
|
|
44
41
|
handleClose: () => void
|
|
45
42
|
}) {
|
|
46
43
|
const { classes } = useStyles()
|
|
@@ -67,16 +67,13 @@ function getTrackName(
|
|
|
67
67
|
session: { assemblies: AnyConfigurationModel[] },
|
|
68
68
|
) {
|
|
69
69
|
const trackName = getConf(track, 'name')
|
|
70
|
-
if (getConf(track, 'type') === 'ReferenceSequenceTrack') {
|
|
70
|
+
if (!trackName && getConf(track, 'type') === 'ReferenceSequenceTrack') {
|
|
71
71
|
const asm = session.assemblies.find(a => a.sequence === track.configuration)
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})`
|
|
78
|
-
: 'Reference Sequence')
|
|
79
|
-
)
|
|
72
|
+
return asm
|
|
73
|
+
? `Reference Sequence (${
|
|
74
|
+
readConfObject(asm, 'displayName') || readConfObject(asm, 'name')
|
|
75
|
+
})`
|
|
76
|
+
: 'Reference Sequence'
|
|
80
77
|
}
|
|
81
78
|
return trackName
|
|
82
79
|
}
|