@jbrowse/plugin-linear-genome-view 2.1.7 → 2.2.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.
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +2 -2
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +2 -22
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Tooltip.d.ts +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +149 -4
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +600 -464
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +19 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +2 -2
- package/dist/BasicTrack/configSchema.d.ts +3 -0
- package/dist/BasicTrack/configSchema.js +18 -0
- package/dist/BasicTrack/configSchema.js.map +1 -0
- package/dist/BasicTrack/index.d.ts +3 -0
- package/dist/BasicTrack/index.js +18 -0
- package/dist/BasicTrack/index.js.map +1 -0
- package/dist/FeatureTrack/configSchema.d.ts +3 -0
- package/dist/FeatureTrack/configSchema.js +21 -0
- package/dist/FeatureTrack/configSchema.js.map +1 -0
- package/dist/FeatureTrack/index.d.ts +3 -0
- package/dist/FeatureTrack/index.js +18 -0
- package/dist/FeatureTrack/index.js.map +1 -0
- package/dist/LinearBareDisplay/configSchema.d.ts +5 -1
- package/dist/LinearBareDisplay/configSchema.js +12 -1
- package/dist/LinearBareDisplay/configSchema.js.map +1 -1
- package/dist/LinearBareDisplay/model.d.ts +16 -0
- package/dist/LinearBareDisplay/model.js +16 -0
- package/dist/LinearBareDisplay/model.js.map +1 -1
- package/dist/LinearBasicDisplay/configSchema.d.ts +5 -1
- package/dist/LinearBasicDisplay/configSchema.js +16 -1
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +79 -8
- package/dist/LinearBasicDisplay/model.js +167 -111
- package/dist/LinearBasicDisplay/model.js.map +1 -1
- package/dist/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +1 -1
- package/dist/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/dist/LinearGenomeView/components/Header.d.ts +1 -1
- package/dist/LinearGenomeView/components/ImportForm.d.ts +1 -1
- package/dist/LinearGenomeView/components/ImportForm.js +38 -31
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +2 -24
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +7 -5
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewRubberBand.d.ts +1 -1
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +27 -35
- package/dist/LinearGenomeView/components/RubberBand.d.ts +1 -1
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +1 -1
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/dist/LinearGenomeView/components/TrackContainer.js +12 -9
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackLabel.js +9 -1
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/dist/LinearGenomeView/index.d.ts +273 -18
- package/dist/LinearGenomeView/index.js +409 -90
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/index.d.ts +30 -90
- package/dist/index.js +4 -25
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +2 -2
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +2 -22
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +1 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +149 -4
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +600 -464
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +19 -1
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -1
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +2 -2
- package/esm/BasicTrack/configSchema.d.ts +3 -0
- package/esm/BasicTrack/configSchema.js +16 -0
- package/esm/BasicTrack/configSchema.js.map +1 -0
- package/esm/BasicTrack/index.d.ts +3 -0
- package/esm/BasicTrack/index.js +13 -0
- package/esm/BasicTrack/index.js.map +1 -0
- package/esm/FeatureTrack/configSchema.d.ts +3 -0
- package/esm/FeatureTrack/configSchema.js +19 -0
- package/esm/FeatureTrack/configSchema.js.map +1 -0
- package/esm/FeatureTrack/index.d.ts +3 -0
- package/esm/FeatureTrack/index.js +13 -0
- package/esm/FeatureTrack/index.js.map +1 -0
- package/esm/LinearBareDisplay/configSchema.d.ts +5 -1
- package/esm/LinearBareDisplay/configSchema.js +14 -2
- package/esm/LinearBareDisplay/configSchema.js.map +1 -1
- package/esm/LinearBareDisplay/model.d.ts +16 -0
- package/esm/LinearBareDisplay/model.js +16 -0
- package/esm/LinearBareDisplay/model.js.map +1 -1
- package/esm/LinearBasicDisplay/configSchema.d.ts +5 -1
- package/esm/LinearBasicDisplay/configSchema.js +18 -2
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +79 -8
- package/esm/LinearBasicDisplay/model.js +167 -111
- package/esm/LinearBasicDisplay/model.js.map +1 -1
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +1 -1
- package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/ImportForm.d.ts +1 -1
- package/esm/LinearGenomeView/components/ImportForm.js +40 -33
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +3 -25
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +7 -5
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +1 -1
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +27 -35
- package/esm/LinearGenomeView/components/RubberBand.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScaleBar.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +13 -10
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/TrackLabel.js +9 -1
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/index.d.ts +273 -18
- package/esm/LinearGenomeView/index.js +409 -90
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/esm/index.d.ts +30 -90
- package/esm/index.js +4 -25
- package/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +2 -24
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +695 -555
- package/src/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.ts +20 -1
- package/src/BasicTrack/configSchema.ts +23 -0
- package/src/BasicTrack/index.ts +18 -0
- package/src/FeatureTrack/configSchema.ts +27 -0
- package/src/FeatureTrack/index.ts +21 -0
- package/src/LinearBareDisplay/configSchema.ts +15 -2
- package/src/LinearBareDisplay/model.ts +16 -0
- package/src/LinearBasicDisplay/configSchema.ts +19 -2
- package/src/LinearBasicDisplay/model.ts +63 -11
- package/src/LinearGenomeView/components/ImportForm.tsx +85 -67
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +3 -33
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +21 -18
- package/src/LinearGenomeView/components/TrackContainer.tsx +38 -27
- package/src/LinearGenomeView/components/TrackLabel.tsx +10 -1
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +204 -204
- package/src/LinearGenomeView/index.test.ts +33 -26
- package/src/LinearGenomeView/index.tsx +471 -133
- package/src/index.ts +6 -46
|
@@ -1,9 +1,8 @@
|
|
|
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'
|
|
5
4
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons'
|
|
6
|
-
import {
|
|
5
|
+
import { LoadingEllipses } from '@jbrowse/core/ui'
|
|
7
6
|
import { observer } from 'mobx-react'
|
|
8
7
|
|
|
9
8
|
// locals
|
|
@@ -22,26 +21,6 @@ const useStyles = makeStyles()(theme => ({
|
|
|
22
21
|
paddingTop: theme.spacing(1),
|
|
23
22
|
paddingBottom: theme.spacing(1),
|
|
24
23
|
},
|
|
25
|
-
dots: {
|
|
26
|
-
'&::after': {
|
|
27
|
-
display: 'inline-block',
|
|
28
|
-
animation: '$ellipsis 1.5s infinite',
|
|
29
|
-
content: '"."',
|
|
30
|
-
width: '1em',
|
|
31
|
-
textAlign: 'left',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
'@keyframes ellipsis': {
|
|
35
|
-
'0%': {
|
|
36
|
-
content: '"."',
|
|
37
|
-
},
|
|
38
|
-
'33%': {
|
|
39
|
-
content: '".."',
|
|
40
|
-
},
|
|
41
|
-
'66%': {
|
|
42
|
-
content: '"..."',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
24
|
}))
|
|
46
25
|
|
|
47
26
|
const LinearGenomeView = observer(({ model }: { model: LGV }) => {
|
|
@@ -49,11 +28,7 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => {
|
|
|
49
28
|
const { classes } = useStyles()
|
|
50
29
|
|
|
51
30
|
if (!initialized && !error) {
|
|
52
|
-
return
|
|
53
|
-
<Typography className={classes.dots} variant="h5">
|
|
54
|
-
Loading
|
|
55
|
-
</Typography>
|
|
56
|
-
)
|
|
31
|
+
return <LoadingEllipses variant="h5" />
|
|
57
32
|
}
|
|
58
33
|
if (!hasDisplayedRegions || error) {
|
|
59
34
|
return <ImportForm model={model} />
|
|
@@ -100,12 +75,7 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => {
|
|
|
100
75
|
</Paper>
|
|
101
76
|
) : (
|
|
102
77
|
tracks.map(track => (
|
|
103
|
-
<
|
|
104
|
-
key={track.id}
|
|
105
|
-
FallbackComponent={({ error }) => <ErrorMessage error={error} />}
|
|
106
|
-
>
|
|
107
|
-
<TrackContainer model={model} track={track} />
|
|
108
|
-
</ErrorBoundary>
|
|
78
|
+
<TrackContainer key={track.id} model={model} track={track} />
|
|
109
79
|
))
|
|
110
80
|
)}
|
|
111
81
|
</TracksContainer>
|
|
@@ -263,6 +263,7 @@ function SVGTracks({
|
|
|
263
263
|
// render LGV to SVG
|
|
264
264
|
export async function renderToSvg(model: LGV, opts: ExportSvgOptions) {
|
|
265
265
|
await when(() => model.initialized)
|
|
266
|
+
const { Wrapper = ({ children }) => <>{children}</> } = opts
|
|
266
267
|
const { width, tracks, showCytobands } = model
|
|
267
268
|
const shift = 50
|
|
268
269
|
const offset =
|
|
@@ -282,24 +283,26 @@ export async function renderToSvg(model: LGV, opts: ExportSvgOptions) {
|
|
|
282
283
|
|
|
283
284
|
// the xlink namespace is used for rendering <image> tag
|
|
284
285
|
return renderToStaticMarkup(
|
|
285
|
-
<
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
286
|
+
<Wrapper>
|
|
287
|
+
<svg
|
|
288
|
+
width={width}
|
|
289
|
+
height={height}
|
|
290
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
291
|
+
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
292
|
+
viewBox={[0, 0, width + shift * 2, height].toString()}
|
|
293
|
+
>
|
|
294
|
+
{/* background white */}
|
|
295
|
+
<rect width={width + shift * 2} height={height} fill="white" />
|
|
294
296
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
297
|
+
<g stroke="none" transform={`translate(${shift} ${fontSize})`}>
|
|
298
|
+
<SVGHeader model={model} />
|
|
299
|
+
<SVGTracks
|
|
300
|
+
model={model}
|
|
301
|
+
displayResults={displayResults}
|
|
302
|
+
offset={offset}
|
|
303
|
+
/>
|
|
304
|
+
</g>
|
|
305
|
+
</svg>
|
|
306
|
+
</Wrapper>,
|
|
304
307
|
)
|
|
305
308
|
}
|
|
@@ -5,7 +5,8 @@ import { observer } from 'mobx-react'
|
|
|
5
5
|
import { isAlive } from 'mobx-state-tree'
|
|
6
6
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
7
7
|
import { getConf } from '@jbrowse/core/configuration'
|
|
8
|
-
import { ResizeHandle } from '@jbrowse/core/ui'
|
|
8
|
+
import { ResizeHandle, ErrorMessage } from '@jbrowse/core/ui'
|
|
9
|
+
import { ErrorBoundary } from 'react-error-boundary'
|
|
9
10
|
import { useDebouncedCallback } from '@jbrowse/core/util'
|
|
10
11
|
|
|
11
12
|
// locals
|
|
@@ -92,6 +93,7 @@ function TrackContainer({
|
|
|
92
93
|
const trackId = getConf(track, 'trackId')
|
|
93
94
|
const ref = useRef(null)
|
|
94
95
|
const dimmed = draggingTrackId !== undefined && draggingTrackId !== display.id
|
|
96
|
+
const minimized = track.minimized
|
|
95
97
|
const debouncedOnDragEnter = useDebouncedCallback(() => {
|
|
96
98
|
if (isAlive(display) && dimmed) {
|
|
97
99
|
moveTrack(draggingTrackId, track.id)
|
|
@@ -109,36 +111,45 @@ function TrackContainer({
|
|
|
109
111
|
return (
|
|
110
112
|
<Paper className={classes.root} variant="outlined">
|
|
111
113
|
<TrackContainerLabel model={track} view={model} />
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
onScroll={event => display.setScrollTop(event.currentTarget.scrollTop)}
|
|
116
|
-
onDragEnter={debouncedOnDragEnter}
|
|
117
|
-
data-testid={`trackRenderingContainer-${model.id}-${trackId}`}
|
|
114
|
+
<ErrorBoundary
|
|
115
|
+
key={track.id}
|
|
116
|
+
FallbackComponent={({ error }) => <ErrorMessage error={error} />}
|
|
118
117
|
>
|
|
119
118
|
<div
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
className={classes.trackRenderingContainer}
|
|
120
|
+
style={{ height: minimized ? 20 : height }}
|
|
121
|
+
onScroll={evt => display.setScrollTop(evt.currentTarget.scrollTop)}
|
|
122
|
+
onDragEnter={debouncedOnDragEnter}
|
|
123
|
+
data-testid={`trackRenderingContainer-${model.id}-${trackId}`}
|
|
123
124
|
>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
{!minimized ? (
|
|
126
|
+
<>
|
|
127
|
+
<div
|
|
128
|
+
ref={ref}
|
|
129
|
+
className={classes.renderingComponentContainer}
|
|
130
|
+
style={{ transform: `scaleX(${model.scaleFactor})` }}
|
|
131
|
+
>
|
|
132
|
+
<RenderingComponent
|
|
133
|
+
model={display}
|
|
134
|
+
onHorizontalScroll={horizontalScroll}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
129
137
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
{DisplayBlurb ? (
|
|
139
|
+
<div
|
|
140
|
+
style={{
|
|
141
|
+
position: 'absolute',
|
|
142
|
+
left: 0,
|
|
143
|
+
top: display.height - 20,
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
<DisplayBlurb model={display} />
|
|
147
|
+
</div>
|
|
148
|
+
) : null}
|
|
149
|
+
</>
|
|
150
|
+
) : null}
|
|
151
|
+
</div>
|
|
152
|
+
</ErrorBoundary>
|
|
142
153
|
<div
|
|
143
154
|
className={classes.overlay}
|
|
144
155
|
style={{
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
import MoreVertIcon from '@mui/icons-material/MoreVert'
|
|
19
19
|
import DragIcon from '@mui/icons-material/DragIndicator'
|
|
20
20
|
import CloseIcon from '@mui/icons-material/Close'
|
|
21
|
+
import MinimizeIcon from '@mui/icons-material/Minimize'
|
|
22
|
+
import AddIcon from '@mui/icons-material/Add'
|
|
21
23
|
|
|
22
24
|
import { LinearGenomeViewModel } from '..'
|
|
23
25
|
|
|
@@ -64,6 +66,7 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(
|
|
|
64
66
|
const view = getContainingView(track) as LGV
|
|
65
67
|
const session = getSession(track)
|
|
66
68
|
const trackConf = track.configuration
|
|
69
|
+
const minimized = track.minimized
|
|
67
70
|
const trackId = getConf(track, 'trackId')
|
|
68
71
|
const trackName = getTrackName(trackConf, session)
|
|
69
72
|
|
|
@@ -73,6 +76,11 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(
|
|
|
73
76
|
})
|
|
74
77
|
|
|
75
78
|
const items = [
|
|
79
|
+
{
|
|
80
|
+
label: minimized ? 'Restore track' : 'Minimize track',
|
|
81
|
+
icon: minimized ? AddIcon : MinimizeIcon,
|
|
82
|
+
onClick: () => track.setMinimized(!minimized),
|
|
83
|
+
},
|
|
76
84
|
...(session.getTrackActionMenuItems?.(trackConf) || []),
|
|
77
85
|
...track.trackMenuItems(),
|
|
78
86
|
].sort((a, b) => (b.priority || 0) - (a.priority || 0))
|
|
@@ -103,12 +111,13 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(
|
|
|
103
111
|
>
|
|
104
112
|
<CloseIcon fontSize="small" />
|
|
105
113
|
</IconButton>
|
|
114
|
+
|
|
106
115
|
<Typography
|
|
107
116
|
variant="body1"
|
|
108
117
|
component="span"
|
|
109
118
|
className={classes.trackName}
|
|
110
119
|
>
|
|
111
|
-
{trackName}
|
|
120
|
+
{trackName + (minimized ? ' (minimized)' : '')}
|
|
112
121
|
</Typography>
|
|
113
122
|
<IconButton
|
|
114
123
|
{...bindTrigger(popupState)}
|