@jbrowse/plugin-linear-genome-view 2.2.0 → 2.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.
- package/dist/BaseLinearDisplay/components/Tooltip.d.ts +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +3 -3
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +2 -2
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/dist/BasicTrack/index.d.ts +1 -1
- package/dist/BasicTrack/index.js +4 -4
- package/dist/BasicTrack/index.js.map +1 -1
- package/dist/LaunchLinearGenomeView/index.d.ts +3 -0
- package/dist/LaunchLinearGenomeView/index.js +44 -0
- package/dist/LaunchLinearGenomeView/index.js.map +1 -0
- package/dist/LinearBareDisplay/index.d.ts +6 -2
- package/dist/LinearBareDisplay/index.js +17 -2
- package/dist/LinearBareDisplay/index.js.map +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +2 -15
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
- package/dist/LinearBasicDisplay/index.d.ts +6 -2
- package/dist/LinearBasicDisplay/index.js +20 -4
- package/dist/LinearBasicDisplay/index.js.map +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +21 -14
- package/dist/LinearBasicDisplay/model.js +2 -1
- package/dist/LinearBasicDisplay/model.js.map +1 -1
- package/dist/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +1 -19
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +1 -1
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +7 -18
- package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/dist/LinearGenomeView/components/Header.d.ts +1 -1
- package/dist/LinearGenomeView/components/Header.js +2 -2
- package/dist/LinearGenomeView/components/HelpDialog.js +2 -17
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/ImportForm.d.ts +1 -1
- package/dist/LinearGenomeView/components/ImportForm.js +18 -16
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +1 -3
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +5 -5
- package/dist/LinearGenomeView/components/{OverviewRubberBand.d.ts → OverviewRubberband.d.ts} +3 -3
- package/dist/LinearGenomeView/components/{OverviewRubberBand.js → OverviewRubberband.js} +27 -79
- package/dist/LinearGenomeView/components/OverviewRubberband.js.map +1 -0
- package/{esm/LinearGenomeView/components/OverviewScaleBar.d.ts → dist/LinearGenomeView/components/OverviewScalebar.d.ts} +3 -3
- package/dist/LinearGenomeView/components/{OverviewScaleBar.js → OverviewScalebar.js} +25 -24
- package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/dist/LinearGenomeView/components/{RubberBand.d.ts → Rubberband.d.ts} +3 -3
- package/dist/LinearGenomeView/components/Rubberband.js +57 -0
- package/dist/LinearGenomeView/components/Rubberband.js.map +1 -0
- package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +14 -0
- package/dist/LinearGenomeView/components/RubberbandSpan.js +90 -0
- package/dist/LinearGenomeView/components/RubberbandSpan.js.map +1 -0
- package/dist/LinearGenomeView/components/{ScaleBar.d.ts → Scalebar.d.ts} +3 -3
- package/dist/LinearGenomeView/components/{ScaleBar.js → Scalebar.js} +11 -11
- package/dist/LinearGenomeView/components/{ScaleBar.js.map → Scalebar.js.map} +1 -1
- package/dist/LinearGenomeView/components/SearchBox.js +6 -6
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +17 -31
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js +4 -19
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/dist/LinearGenomeView/components/TrackContainer.js +13 -10
- 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/components/TracksContainer.js +21 -118
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/VerticalGuide.d.ts +9 -0
- package/dist/LinearGenomeView/components/VerticalGuide.js +29 -0
- package/dist/LinearGenomeView/components/VerticalGuide.js.map +1 -0
- package/dist/LinearGenomeView/components/hooks.d.ts +65 -0
- package/dist/LinearGenomeView/components/hooks.js +264 -0
- package/dist/LinearGenomeView/components/hooks.js.map +1 -0
- package/dist/LinearGenomeView/components/util.d.ts +5 -2
- package/dist/LinearGenomeView/components/util.js +7 -6
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/index.d.ts +3 -453
- package/dist/LinearGenomeView/index.js +11 -1247
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/LinearGenomeView/model.d.ts +535 -0
- package/dist/LinearGenomeView/model.js +1357 -0
- package/dist/LinearGenomeView/model.js.map +1 -0
- package/dist/index.d.ts +20 -8
- package/dist/index.js +9 -72
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +1 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +3 -3
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +2 -2
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -1
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/esm/BasicTrack/index.d.ts +1 -1
- package/esm/BasicTrack/index.js +4 -4
- package/esm/BasicTrack/index.js.map +1 -1
- package/esm/LaunchLinearGenomeView/index.d.ts +3 -0
- package/esm/LaunchLinearGenomeView/index.js +42 -0
- package/esm/LaunchLinearGenomeView/index.js.map +1 -0
- package/esm/LinearBareDisplay/index.d.ts +6 -2
- package/esm/LinearBareDisplay/index.js +18 -2
- package/esm/LinearBareDisplay/index.js.map +1 -1
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +3 -13
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
- package/esm/LinearBasicDisplay/index.d.ts +6 -2
- package/esm/LinearBasicDisplay/index.js +19 -2
- package/esm/LinearBasicDisplay/index.js.map +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +21 -14
- package/esm/LinearBasicDisplay/model.js +2 -1
- package/esm/LinearBasicDisplay/model.js.map +1 -1
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +3 -18
- package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +1 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +8 -19
- package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.js +2 -2
- package/esm/LinearGenomeView/components/HelpDialog.js +3 -18
- package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/ImportForm.d.ts +1 -1
- package/esm/LinearGenomeView/components/ImportForm.js +18 -16
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +2 -4
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +3 -3
- package/esm/LinearGenomeView/components/{OverviewRubberBand.d.ts → OverviewRubberband.d.ts} +3 -3
- package/esm/LinearGenomeView/components/{OverviewRubberBand.js → OverviewRubberband.js} +25 -80
- package/esm/LinearGenomeView/components/OverviewRubberband.js.map +1 -0
- package/{dist/LinearGenomeView/components/OverviewScaleBar.d.ts → esm/LinearGenomeView/components/OverviewScalebar.d.ts} +3 -3
- package/esm/LinearGenomeView/components/{OverviewScaleBar.js → OverviewScalebar.js} +25 -24
- package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/esm/LinearGenomeView/components/{RubberBand.d.ts → Rubberband.d.ts} +3 -3
- package/esm/LinearGenomeView/components/Rubberband.js +29 -0
- package/esm/LinearGenomeView/components/Rubberband.js.map +1 -0
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +14 -0
- package/esm/LinearGenomeView/components/RubberbandSpan.js +65 -0
- package/esm/LinearGenomeView/components/RubberbandSpan.js.map +1 -0
- package/esm/LinearGenomeView/components/{ScaleBar.d.ts → Scalebar.d.ts} +3 -3
- package/esm/LinearGenomeView/components/{ScaleBar.js → Scalebar.js} +11 -11
- package/esm/LinearGenomeView/components/{ScaleBar.js.map → Scalebar.js.map} +1 -1
- package/esm/LinearGenomeView/components/SearchBox.js +6 -6
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +18 -32
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +5 -17
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +14 -11
- 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/components/TracksContainer.js +22 -119
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +9 -0
- package/esm/LinearGenomeView/components/VerticalGuide.js +24 -0
- package/esm/LinearGenomeView/components/VerticalGuide.js.map +1 -0
- package/esm/LinearGenomeView/components/hooks.d.ts +65 -0
- package/esm/LinearGenomeView/components/hooks.js +255 -0
- package/esm/LinearGenomeView/components/hooks.js.map +1 -0
- package/esm/LinearGenomeView/components/util.d.ts +5 -2
- package/esm/LinearGenomeView/components/util.js +4 -3
- package/esm/LinearGenomeView/components/util.js.map +1 -1
- package/esm/LinearGenomeView/index.d.ts +3 -453
- package/esm/LinearGenomeView/index.js +9 -1238
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/esm/LinearGenomeView/model.d.ts +535 -0
- package/esm/LinearGenomeView/model.js +1322 -0
- package/esm/LinearGenomeView/model.js.map +1 -0
- package/esm/index.d.ts +20 -8
- package/esm/index.js +9 -72
- package/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
- package/src/BasicTrack/index.ts +4 -8
- package/src/LaunchLinearGenomeView/index.ts +66 -0
- package/src/LinearBareDisplay/index.ts +21 -2
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +3 -28
- package/src/LinearBasicDisplay/index.ts +23 -2
- package/src/LinearBasicDisplay/model.ts +2 -1
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +2 -23
- package/src/LinearGenomeView/components/GetSequenceDialog.tsx +13 -31
- package/src/LinearGenomeView/components/Header.tsx +3 -3
- package/src/LinearGenomeView/components/HelpDialog.tsx +8 -34
- package/src/LinearGenomeView/components/ImportForm.tsx +19 -16
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +2 -8
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +3 -3
- package/src/LinearGenomeView/components/{OverviewRubberBand.tsx → OverviewRubberband.tsx} +32 -114
- package/src/LinearGenomeView/components/{OverviewScaleBar.tsx → OverviewScalebar.tsx} +26 -25
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +2 -1
- package/src/LinearGenomeView/components/Rubberband.tsx +89 -0
- package/src/LinearGenomeView/components/RubberbandSpan.tsx +116 -0
- package/src/LinearGenomeView/components/{ScaleBar.test.tsx → Scalebar.test.tsx} +5 -5
- package/src/LinearGenomeView/components/{ScaleBar.tsx → Scalebar.tsx} +11 -11
- package/src/LinearGenomeView/components/SearchBox.tsx +6 -6
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +17 -44
- package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +4 -30
- package/src/LinearGenomeView/components/TrackContainer.tsx +41 -28
- package/src/LinearGenomeView/components/TrackLabel.tsx +10 -1
- package/src/LinearGenomeView/components/TracksContainer.tsx +59 -136
- package/src/LinearGenomeView/components/VerticalGuide.tsx +37 -0
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +37 -39
- package/src/LinearGenomeView/components/hooks.ts +300 -0
- package/src/LinearGenomeView/components/util.ts +8 -11
- package/src/LinearGenomeView/index.test.ts +6 -7
- package/src/LinearGenomeView/index.ts +17 -0
- package/src/LinearGenomeView/{index.tsx → model.ts} +159 -75
- package/src/index.ts +13 -108
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +0 -1
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +0 -1
- package/dist/LinearGenomeView/components/RubberBand.js +0 -221
- package/dist/LinearGenomeView/components/RubberBand.js.map +0 -1
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +0 -1
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +0 -1
- package/esm/LinearGenomeView/components/RubberBand.js +0 -196
- package/esm/LinearGenomeView/components/RubberBand.js.map +0 -1
- package/src/LinearGenomeView/components/RubberBand.tsx +0 -308
|
@@ -4,12 +4,8 @@ import {
|
|
|
4
4
|
Button,
|
|
5
5
|
CircularProgress,
|
|
6
6
|
Container,
|
|
7
|
-
Dialog,
|
|
8
7
|
DialogActions,
|
|
9
8
|
DialogContent,
|
|
10
|
-
DialogTitle,
|
|
11
|
-
Divider,
|
|
12
|
-
IconButton,
|
|
13
9
|
TextField,
|
|
14
10
|
Typography,
|
|
15
11
|
} from '@mui/material'
|
|
@@ -17,31 +13,25 @@ import { observer } from 'mobx-react'
|
|
|
17
13
|
import { saveAs } from 'file-saver'
|
|
18
14
|
import { getConf } from '@jbrowse/core/configuration'
|
|
19
15
|
import copy from 'copy-to-clipboard'
|
|
16
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
20
17
|
import { getSession, Feature, Region } from '@jbrowse/core/util'
|
|
21
18
|
import { formatSeqFasta } from '@jbrowse/core/util/formatFastaStrings'
|
|
22
19
|
|
|
23
20
|
// icons
|
|
24
21
|
import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons'
|
|
25
|
-
import CloseIcon from '@mui/icons-material/Close'
|
|
26
22
|
import GetAppIcon from '@mui/icons-material/GetApp'
|
|
27
23
|
|
|
28
24
|
// locals
|
|
29
25
|
import { LinearGenomeViewModel } from '..'
|
|
30
26
|
|
|
31
|
-
const useStyles = makeStyles()(
|
|
32
|
-
closeButton: {
|
|
33
|
-
position: 'absolute',
|
|
34
|
-
right: theme.spacing(1),
|
|
35
|
-
top: theme.spacing(1),
|
|
36
|
-
color: theme.palette.grey[500],
|
|
37
|
-
},
|
|
27
|
+
const useStyles = makeStyles()({
|
|
38
28
|
dialogContent: {
|
|
39
29
|
width: '80em',
|
|
40
30
|
},
|
|
41
31
|
textAreaFont: {
|
|
42
32
|
fontFamily: 'Courier New',
|
|
43
33
|
},
|
|
44
|
-
})
|
|
34
|
+
})
|
|
45
35
|
|
|
46
36
|
type LGV = LinearGenomeViewModel
|
|
47
37
|
|
|
@@ -106,6 +96,7 @@ function SequenceDialog({
|
|
|
106
96
|
let active = true
|
|
107
97
|
const controller = new AbortController()
|
|
108
98
|
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
109
100
|
;(async () => {
|
|
110
101
|
try {
|
|
111
102
|
if (regionsSelected.length > 0) {
|
|
@@ -157,24 +148,15 @@ function SequenceDialog({
|
|
|
157
148
|
const sequenceTooLarge = sequence ? sequence.length > 1_000_000 : false
|
|
158
149
|
|
|
159
150
|
return (
|
|
160
|
-
<Dialog
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}}
|
|
170
|
-
size="large"
|
|
171
|
-
>
|
|
172
|
-
<CloseIcon />
|
|
173
|
-
</IconButton>
|
|
174
|
-
) : null}
|
|
175
|
-
</DialogTitle>
|
|
176
|
-
<Divider />
|
|
177
|
-
|
|
151
|
+
<Dialog
|
|
152
|
+
maxWidth="xl"
|
|
153
|
+
open
|
|
154
|
+
onClose={() => {
|
|
155
|
+
handleClose()
|
|
156
|
+
model.setOffsets(undefined, undefined)
|
|
157
|
+
}}
|
|
158
|
+
title="Reference sequence"
|
|
159
|
+
>
|
|
178
160
|
<DialogContent>
|
|
179
161
|
{error ? <Typography color="error">{`${error}`}</Typography> : null}
|
|
180
162
|
{loading && !error ? (
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
SPACING,
|
|
17
17
|
HEADER_BAR_HEIGHT,
|
|
18
18
|
} from '..'
|
|
19
|
-
import
|
|
19
|
+
import OverviewScalebar from './OverviewScalebar'
|
|
20
20
|
import ZoomControls from './ZoomControls'
|
|
21
21
|
import SearchBox from './SearchBox'
|
|
22
22
|
|
|
@@ -123,9 +123,9 @@ const LinearGenomeViewHeader = observer(({ model }: { model: LGV }) => {
|
|
|
123
123
|
model.hideHeaderOverview ? (
|
|
124
124
|
<Controls model={model} />
|
|
125
125
|
) : (
|
|
126
|
-
<
|
|
126
|
+
<OverviewScalebar model={model}>
|
|
127
127
|
<Controls model={model} />
|
|
128
|
-
</
|
|
128
|
+
</OverviewScalebar>
|
|
129
129
|
)
|
|
130
130
|
) : null
|
|
131
131
|
})
|
|
@@ -1,45 +1,19 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Dialog,
|
|
5
|
-
DialogActions,
|
|
6
|
-
DialogContent,
|
|
7
|
-
DialogTitle,
|
|
8
|
-
Divider,
|
|
9
|
-
IconButton,
|
|
10
|
-
} from '@mui/material'
|
|
11
|
-
import { makeStyles } from 'tss-react/mui'
|
|
12
|
-
import CloseIcon from '@mui/icons-material/Close'
|
|
13
|
-
|
|
14
|
-
const useStyles = makeStyles()(theme => ({
|
|
15
|
-
closeButton: {
|
|
16
|
-
position: 'absolute',
|
|
17
|
-
right: theme.spacing(1),
|
|
18
|
-
top: theme.spacing(1),
|
|
19
|
-
color: theme.palette.grey[500],
|
|
20
|
-
},
|
|
21
|
-
}))
|
|
2
|
+
import { Button, DialogActions, DialogContent, Divider } from '@mui/material'
|
|
3
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
22
4
|
|
|
23
5
|
export default function HelpDialog({
|
|
24
6
|
handleClose,
|
|
25
7
|
}: {
|
|
26
8
|
handleClose: () => void
|
|
27
9
|
}) {
|
|
28
|
-
const { classes } = useStyles()
|
|
29
10
|
return (
|
|
30
|
-
<Dialog
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
onClick={() => handleClose()}
|
|
37
|
-
>
|
|
38
|
-
<CloseIcon />
|
|
39
|
-
</IconButton>
|
|
40
|
-
) : null}
|
|
41
|
-
</DialogTitle>
|
|
42
|
-
<Divider />
|
|
11
|
+
<Dialog
|
|
12
|
+
open
|
|
13
|
+
maxWidth="xl"
|
|
14
|
+
onClose={handleClose}
|
|
15
|
+
title="Using the search box"
|
|
16
|
+
>
|
|
43
17
|
<DialogContent>
|
|
44
18
|
<h3>Searching</h3>
|
|
45
19
|
<ul>
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
} from '@mui/material'
|
|
12
12
|
import { ErrorMessage, AssemblySelector } from '@jbrowse/core/ui'
|
|
13
13
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
|
|
14
|
+
|
|
15
|
+
// icons
|
|
14
16
|
import CloseIcon from '@mui/icons-material/Close'
|
|
15
17
|
|
|
16
18
|
// locals
|
|
@@ -39,7 +41,6 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
39
41
|
const { assemblyNames, assemblyManager, textSearchManager } = session
|
|
40
42
|
const { rankSearchResults, isSearchDialogDisplayed, error } = model
|
|
41
43
|
const [selectedAsm, setSelectedAsm] = useState(assemblyNames[0])
|
|
42
|
-
const [importError, setImportError] = useState(error)
|
|
43
44
|
const [option, setOption] = useState<BaseResult>()
|
|
44
45
|
|
|
45
46
|
const searchScope = model.searchScope(selectedAsm)
|
|
@@ -49,21 +50,23 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
49
50
|
? assembly?.error
|
|
50
51
|
: 'No configured assemblies'
|
|
51
52
|
const regions = assembly?.regions || []
|
|
52
|
-
const
|
|
53
|
+
const displayError = assemblyError || error
|
|
53
54
|
const [value, setValue] = useState('')
|
|
54
55
|
const r0 = regions[0]?.refName
|
|
55
56
|
|
|
56
57
|
// useEffect resets to an "initial state" of displaying first region from assembly
|
|
57
|
-
// after assembly change
|
|
58
|
+
// after assembly change. needs to react to selectedAsm as well as r0 because changing
|
|
59
|
+
// assembly will run setValue('') and then r0 may not change if assembly names are the
|
|
60
|
+
// same across assemblies, but it still needs to be reset
|
|
58
61
|
useEffect(() => {
|
|
59
62
|
setValue(r0)
|
|
60
|
-
}, [r0])
|
|
63
|
+
}, [r0, selectedAsm])
|
|
61
64
|
|
|
62
|
-
function navToOption(option: BaseResult) {
|
|
65
|
+
async function navToOption(option: BaseResult) {
|
|
63
66
|
const location = option.getLocation()
|
|
64
67
|
const trackId = option.getTrackId()
|
|
65
68
|
if (location) {
|
|
66
|
-
model.navToLocString(location, selectedAsm)
|
|
69
|
+
await model.navToLocString(location, selectedAsm)
|
|
67
70
|
if (trackId) {
|
|
68
71
|
model.showTrack(trackId)
|
|
69
72
|
}
|
|
@@ -78,7 +81,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
78
81
|
async function handleSelectedRegion(input: string) {
|
|
79
82
|
try {
|
|
80
83
|
if (option?.getDisplayString() === input && option.hasLocation()) {
|
|
81
|
-
navToOption(option)
|
|
84
|
+
await navToOption(option)
|
|
82
85
|
} else {
|
|
83
86
|
const [ref, rest] = splitLast(input, ':')
|
|
84
87
|
const allRefs = assembly?.allRefNamesWithLowerCase || []
|
|
@@ -86,7 +89,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
86
89
|
allRefs.includes(input) ||
|
|
87
90
|
(allRefs.includes(ref) && !Number.isNaN(parseInt(rest, 10)))
|
|
88
91
|
) {
|
|
89
|
-
model.navToLocString(input, selectedAsm)
|
|
92
|
+
await model.navToLocString(input, selectedAsm)
|
|
90
93
|
} else {
|
|
91
94
|
const results = await fetchResults({
|
|
92
95
|
queryString: input,
|
|
@@ -100,9 +103,9 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
100
103
|
if (results.length > 1) {
|
|
101
104
|
model.setSearchResults(results, input.toLowerCase())
|
|
102
105
|
} else if (results.length === 1) {
|
|
103
|
-
navToOption(results[0])
|
|
106
|
+
await navToOption(results[0])
|
|
104
107
|
} else {
|
|
105
|
-
model.navToLocString(input, selectedAsm)
|
|
108
|
+
await model.navToLocString(input, selectedAsm)
|
|
106
109
|
}
|
|
107
110
|
}
|
|
108
111
|
}
|
|
@@ -116,14 +119,15 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
116
119
|
// having this wrapped in a form allows intuitive use of enter key to submit
|
|
117
120
|
return (
|
|
118
121
|
<div className={classes.container}>
|
|
119
|
-
{
|
|
122
|
+
{displayError ? <ErrorMessage error={displayError} /> : null}
|
|
120
123
|
<Container className={classes.importFormContainer}>
|
|
121
124
|
<form
|
|
122
|
-
onSubmit={event => {
|
|
125
|
+
onSubmit={async event => {
|
|
123
126
|
event.preventDefault()
|
|
124
127
|
model.setError(undefined)
|
|
125
128
|
if (value) {
|
|
126
|
-
|
|
129
|
+
// has it's own error handling
|
|
130
|
+
await handleSelectedRegion(value)
|
|
127
131
|
}
|
|
128
132
|
}}
|
|
129
133
|
>
|
|
@@ -137,7 +141,6 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
137
141
|
<FormControl>
|
|
138
142
|
<AssemblySelector
|
|
139
143
|
onChange={val => {
|
|
140
|
-
setImportError('')
|
|
141
144
|
setSelectedAsm(val)
|
|
142
145
|
setValue('')
|
|
143
146
|
}}
|
|
@@ -148,7 +151,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
148
151
|
</Grid>
|
|
149
152
|
<Grid item>
|
|
150
153
|
{selectedAsm ? (
|
|
151
|
-
|
|
154
|
+
assemblyError ? (
|
|
152
155
|
<CloseIcon style={{ color: 'red' }} />
|
|
153
156
|
) : value ? (
|
|
154
157
|
<FormControl>
|
|
@@ -165,7 +168,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
165
168
|
model={model}
|
|
166
169
|
assemblyName={assemblyError ? undefined : selectedAsm}
|
|
167
170
|
value={value}
|
|
168
|
-
// note: minWidth 270
|
|
171
|
+
// note: minWidth 270 accommodates full width of helperText
|
|
169
172
|
minWidth={270}
|
|
170
173
|
onChange={str => setValue(str)}
|
|
171
174
|
onSelect={val => setOption(val)}
|
|
@@ -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 { LoadingEllipses
|
|
5
|
+
import { LoadingEllipses } from '@jbrowse/core/ui'
|
|
7
6
|
import { observer } from 'mobx-react'
|
|
8
7
|
|
|
9
8
|
// locals
|
|
@@ -76,12 +75,7 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => {
|
|
|
76
75
|
</Paper>
|
|
77
76
|
) : (
|
|
78
77
|
tracks.map(track => (
|
|
79
|
-
<
|
|
80
|
-
key={track.id}
|
|
81
|
-
FallbackComponent={({ error }) => <ErrorMessage error={error} />}
|
|
82
|
-
>
|
|
83
|
-
<TrackContainer model={model} track={track} />
|
|
84
|
-
</ErrorBoundary>
|
|
78
|
+
<TrackContainer key={track.id} model={model} track={track} />
|
|
85
79
|
))
|
|
86
80
|
)}
|
|
87
81
|
</TracksContainer>
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
ExportSvgOptions,
|
|
15
15
|
HEADER_OVERVIEW_HEIGHT,
|
|
16
16
|
} from '..'
|
|
17
|
-
import { Polygon, Cytobands } from './
|
|
17
|
+
import { Polygon, Cytobands } from './OverviewScalebar'
|
|
18
18
|
|
|
19
19
|
type LGV = LinearGenomeViewModel
|
|
20
20
|
|
|
21
|
-
function
|
|
21
|
+
function Scalebar({ model, fontSize }: { model: LGV; fontSize: number }) {
|
|
22
22
|
const {
|
|
23
23
|
offsetPx,
|
|
24
24
|
dynamicBlocks: { totalWidthPxWithoutBorders: totalWidthPx, totalBp },
|
|
@@ -178,7 +178,7 @@ const SVGHeader = ({ model }: { model: LGV }) => {
|
|
|
178
178
|
) : null}
|
|
179
179
|
|
|
180
180
|
<g transform={`translate(0 ${fontSize + cytobandHeight})`}>
|
|
181
|
-
<
|
|
181
|
+
<Scalebar model={model} fontSize={fontSize} />
|
|
182
182
|
</g>
|
|
183
183
|
<g transform={`translate(0 ${rulerHeight + cytobandHeight})`}>
|
|
184
184
|
<SVGRuler model={model} fontSize={fontSize} width={width} />
|
|
@@ -1,51 +1,28 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { Tooltip } from '@mui/material'
|
|
3
3
|
import { makeStyles } from 'tss-react/mui'
|
|
4
4
|
import { getSession, stringify } from '@jbrowse/core/util'
|
|
5
5
|
import { observer } from 'mobx-react'
|
|
6
6
|
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel'
|
|
7
|
-
import { LinearGenomeViewModel
|
|
7
|
+
import { LinearGenomeViewModel } from '..'
|
|
8
|
+
import RubberbandSpan from './RubberbandSpan'
|
|
9
|
+
import { getRelativeX } from './util'
|
|
8
10
|
|
|
9
11
|
type LGV = LinearGenomeViewModel
|
|
10
12
|
|
|
11
|
-
const useStyles = makeStyles()(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
rubberBandControl: {
|
|
26
|
-
cursor: 'crosshair',
|
|
27
|
-
width: '100%',
|
|
28
|
-
minHeight: 8,
|
|
29
|
-
},
|
|
30
|
-
rubberBandText: {
|
|
31
|
-
color: tertiary ? tertiary.contrastText : primary.contrastText,
|
|
32
|
-
},
|
|
33
|
-
popover: {
|
|
34
|
-
mouseEvents: 'none',
|
|
35
|
-
cursor: 'crosshair',
|
|
36
|
-
},
|
|
37
|
-
paper: {
|
|
38
|
-
paddingLeft: theme.spacing(1),
|
|
39
|
-
paddingRight: theme.spacing(1),
|
|
40
|
-
},
|
|
41
|
-
guide: {
|
|
42
|
-
pointerEvents: 'none',
|
|
43
|
-
height: '100%',
|
|
44
|
-
width: 1,
|
|
45
|
-
position: 'absolute',
|
|
46
|
-
zIndex: 10,
|
|
47
|
-
},
|
|
48
|
-
}
|
|
13
|
+
const useStyles = makeStyles()({
|
|
14
|
+
rubberbandControl: {
|
|
15
|
+
cursor: 'crosshair',
|
|
16
|
+
width: '100%',
|
|
17
|
+
minHeight: 8,
|
|
18
|
+
},
|
|
19
|
+
guide: {
|
|
20
|
+
pointerEvents: 'none',
|
|
21
|
+
height: '100%',
|
|
22
|
+
width: 1,
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
zIndex: 10,
|
|
25
|
+
},
|
|
49
26
|
})
|
|
50
27
|
|
|
51
28
|
const HoverTooltip = observer(
|
|
@@ -91,7 +68,7 @@ const HoverTooltip = observer(
|
|
|
91
68
|
},
|
|
92
69
|
)
|
|
93
70
|
|
|
94
|
-
function
|
|
71
|
+
function OverviewRubberband({
|
|
95
72
|
model,
|
|
96
73
|
overview,
|
|
97
74
|
ControlComponent = <div />,
|
|
@@ -105,7 +82,6 @@ function OverviewRubberBand({
|
|
|
105
82
|
const [currentX, setCurrentX] = useState<number>()
|
|
106
83
|
const [guideX, setGuideX] = useState<number>()
|
|
107
84
|
const controlsRef = useRef<HTMLDivElement>(null)
|
|
108
|
-
const rubberBandRef = useRef<HTMLDivElement>(null)
|
|
109
85
|
const { classes } = useStyles()
|
|
110
86
|
const mouseDragging = startX !== undefined
|
|
111
87
|
|
|
@@ -113,8 +89,7 @@ function OverviewRubberBand({
|
|
|
113
89
|
function globalMouseMove(event: MouseEvent) {
|
|
114
90
|
const ref = controlsRef.current
|
|
115
91
|
if (ref && mouseDragging) {
|
|
116
|
-
|
|
117
|
-
setCurrentX(relativeX)
|
|
92
|
+
setCurrentX(getRelativeX(event, ref))
|
|
118
93
|
}
|
|
119
94
|
}
|
|
120
95
|
|
|
@@ -172,19 +147,11 @@ function OverviewRubberBand({
|
|
|
172
147
|
function mouseDown(event: React.MouseEvent<HTMLDivElement>) {
|
|
173
148
|
event.preventDefault()
|
|
174
149
|
event.stopPropagation()
|
|
175
|
-
|
|
176
|
-
setStartX(
|
|
177
|
-
event.clientX - controlsRef.current.getBoundingClientRect().left,
|
|
178
|
-
)
|
|
179
|
-
}
|
|
150
|
+
setStartX(getRelativeX(event, controlsRef.current))
|
|
180
151
|
}
|
|
181
152
|
|
|
182
153
|
function mouseMove(event: React.MouseEvent<HTMLDivElement>) {
|
|
183
|
-
|
|
184
|
-
setGuideX(
|
|
185
|
-
event.clientX - controlsRef.current.getBoundingClientRect().left,
|
|
186
|
-
)
|
|
187
|
-
}
|
|
154
|
+
setGuideX(getRelativeX(event, controlsRef.current))
|
|
188
155
|
}
|
|
189
156
|
|
|
190
157
|
function mouseOut() {
|
|
@@ -203,7 +170,7 @@ function OverviewRubberBand({
|
|
|
203
170
|
/>
|
|
204
171
|
) : null}
|
|
205
172
|
<div
|
|
206
|
-
className={classes.
|
|
173
|
+
className={classes.rubberbandControl}
|
|
207
174
|
role="presentation"
|
|
208
175
|
ref={controlsRef}
|
|
209
176
|
onMouseDown={mouseDown}
|
|
@@ -235,66 +202,17 @@ function OverviewRubberBand({
|
|
|
235
202
|
|
|
236
203
|
return (
|
|
237
204
|
<div style={{ position: 'relative' }}>
|
|
238
|
-
{
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
open
|
|
246
|
-
anchorEl={rubberBandRef.current}
|
|
247
|
-
anchorOrigin={{
|
|
248
|
-
vertical: 'top',
|
|
249
|
-
horizontal: 'left',
|
|
250
|
-
}}
|
|
251
|
-
transformOrigin={{
|
|
252
|
-
vertical: 'bottom',
|
|
253
|
-
horizontal: 'right',
|
|
254
|
-
}}
|
|
255
|
-
keepMounted
|
|
256
|
-
disableRestoreFocus
|
|
257
|
-
>
|
|
258
|
-
<Typography>
|
|
259
|
-
{leftBpOffset ? stringify(leftBpOffset) : ''}
|
|
260
|
-
</Typography>
|
|
261
|
-
</Popover>
|
|
262
|
-
<Popover
|
|
263
|
-
className={classes.popover}
|
|
264
|
-
classes={{
|
|
265
|
-
paper: classes.paper,
|
|
266
|
-
}}
|
|
267
|
-
open
|
|
268
|
-
anchorEl={rubberBandRef.current}
|
|
269
|
-
anchorOrigin={{
|
|
270
|
-
vertical: 'top',
|
|
271
|
-
horizontal: 'right',
|
|
272
|
-
}}
|
|
273
|
-
transformOrigin={{
|
|
274
|
-
vertical: 'bottom',
|
|
275
|
-
horizontal: 'left',
|
|
276
|
-
}}
|
|
277
|
-
keepMounted
|
|
278
|
-
disableRestoreFocus
|
|
279
|
-
>
|
|
280
|
-
<Typography>
|
|
281
|
-
{rightBpOffset ? stringify(rightBpOffset) : ''}
|
|
282
|
-
</Typography>
|
|
283
|
-
</Popover>
|
|
284
|
-
</>
|
|
205
|
+
{leftBpOffset && rightBpOffset ? (
|
|
206
|
+
<RubberbandSpan
|
|
207
|
+
leftBpOffset={leftBpOffset}
|
|
208
|
+
rightBpOffset={rightBpOffset}
|
|
209
|
+
width={width}
|
|
210
|
+
left={left}
|
|
211
|
+
/>
|
|
285
212
|
) : null}
|
|
286
213
|
<div
|
|
287
|
-
|
|
288
|
-
className={classes.
|
|
289
|
-
style={{
|
|
290
|
-
left,
|
|
291
|
-
width: Math.abs(width),
|
|
292
|
-
height: HEADER_OVERVIEW_HEIGHT,
|
|
293
|
-
}}
|
|
294
|
-
/>
|
|
295
|
-
<div
|
|
296
|
-
data-testid="rubberBand_controls"
|
|
297
|
-
className={classes.rubberBandControl}
|
|
214
|
+
data-testid="rubberband_controls"
|
|
215
|
+
className={classes.rubberbandControl}
|
|
298
216
|
role="presentation"
|
|
299
217
|
ref={controlsRef}
|
|
300
218
|
onMouseDown={mouseDown}
|
|
@@ -307,4 +225,4 @@ function OverviewRubberBand({
|
|
|
307
225
|
)
|
|
308
226
|
}
|
|
309
227
|
|
|
310
|
-
export default observer(
|
|
228
|
+
export default observer(OverviewRubberband)
|