@jbrowse/plugin-linear-genome-view 1.7.10 → 2.0.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/BaseLinearDisplay.js +119 -139
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Block.js +53 -74
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -0
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +11 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +64 -103
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +145 -175
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Tooltip.js +109 -116
- package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/dist/BaseLinearDisplay/index.js +13 -40
- package/dist/BaseLinearDisplay/index.js.map +1 -0
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +20 -15
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +605 -684
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +15 -22
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +7 -8
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +266 -312
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/dist/LinearBareDisplay/configSchema.js +11 -17
- package/dist/LinearBareDisplay/configSchema.js.map +1 -0
- package/dist/LinearBareDisplay/index.js +7 -20
- package/dist/LinearBareDisplay/index.js.map +1 -0
- package/dist/LinearBareDisplay/model.d.ts +16 -14
- package/dist/LinearBareDisplay/model.js +36 -42
- package/dist/LinearBareDisplay/model.js.map +1 -0
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +76 -85
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/dist/LinearBasicDisplay/configSchema.js +15 -23
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -0
- package/dist/LinearBasicDisplay/index.js +10 -22
- package/dist/LinearBasicDisplay/index.js.map +1 -0
- package/dist/LinearBasicDisplay/model.d.ts +20 -15
- package/dist/LinearBasicDisplay/model.js +180 -159
- package/dist/LinearBasicDisplay/model.js.map +1 -0
- package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -8
- package/dist/LinearGenomeView/components/CenterLine.js +60 -74
- package/dist/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +141 -141
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/Gridlines.d.ts +8 -0
- package/dist/LinearGenomeView/components/Gridlines.js +78 -0
- package/dist/LinearGenomeView/components/Gridlines.js.map +1 -0
- package/dist/LinearGenomeView/components/Header.js +70 -126
- package/dist/LinearGenomeView/components/Header.js.map +1 -0
- package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/HelpDialog.js +62 -44
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/ImportForm.js +223 -320
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.js +64 -124
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +198 -337
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/dist/LinearGenomeView/components/MiniControls.js +64 -78
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +229 -293
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +24 -8
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +277 -365
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +237 -324
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/dist/LinearGenomeView/components/RubberBand.js +228 -296
- package/dist/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/Ruler.js +45 -90
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -0
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +8 -403
- package/dist/LinearGenomeView/components/ScaleBar.js +121 -172
- package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchBox.js +158 -205
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +105 -150
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/SequenceDialog.js +219 -272
- package/dist/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackContainer.js +116 -156
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
- package/dist/LinearGenomeView/components/TrackLabel.js +115 -134
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +172 -199
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/ZoomControls.js +72 -87
- package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/dist/LinearGenomeView/components/util.d.ts +12 -0
- package/dist/LinearGenomeView/components/util.js +95 -13
- package/dist/LinearGenomeView/components/util.js.map +1 -0
- package/dist/LinearGenomeView/index.d.ts +64 -77
- package/dist/LinearGenomeView/index.js +1035 -1412
- package/dist/LinearGenomeView/index.js.map +1 -0
- package/dist/LinearGenomeView/util.js +76 -83
- package/dist/LinearGenomeView/util.js.map +1 -0
- package/dist/index.d.ts +101 -51
- package/dist/index.js +225 -295
- package/dist/index.js.map +1 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +9 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +68 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Block.d.ts +15 -0
- package/esm/BaseLinearDisplay/components/Block.js +46 -0
- package/esm/BaseLinearDisplay/components/Block.js.map +1 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +22 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +62 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +113 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js +64 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/esm/BaseLinearDisplay/index.d.ts +5 -0
- package/esm/BaseLinearDisplay/index.js +4 -0
- package/esm/BaseLinearDisplay/index.js.map +1 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +232 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +541 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +14 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +225 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/esm/LinearBareDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBareDisplay/configSchema.js +9 -0
- package/esm/LinearBareDisplay/configSchema.js.map +1 -0
- package/esm/LinearBareDisplay/index.d.ts +2 -0
- package/esm/LinearBareDisplay/index.js +3 -0
- package/esm/LinearBareDisplay/index.js.map +1 -0
- package/esm/LinearBareDisplay/model.d.ts +194 -0
- package/esm/LinearBareDisplay/model.js +28 -0
- package/esm/LinearBareDisplay/model.js.map +1 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +40 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/esm/LinearBasicDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBasicDisplay/configSchema.js +14 -0
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -0
- package/esm/LinearBasicDisplay/index.d.ts +2 -0
- package/esm/LinearBasicDisplay/index.js +3 -0
- package/esm/LinearBasicDisplay/index.js.map +1 -0
- package/esm/LinearBasicDisplay/model.d.ts +218 -0
- package/esm/LinearBasicDisplay/model.js +127 -0
- package/esm/LinearBasicDisplay/model.js.map +1 -0
- package/esm/LinearGenomeView/components/CenterLine.d.ts +8 -0
- package/esm/LinearGenomeView/components/CenterLine.js +40 -0
- package/esm/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +52 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/Gridlines.d.ts +8 -0
- package/esm/LinearGenomeView/components/Gridlines.js +71 -0
- package/esm/LinearGenomeView/components/Gridlines.js.map +1 -0
- package/esm/LinearGenomeView/components/Header.d.ts +7 -0
- package/esm/LinearGenomeView/components/Header.js +81 -0
- package/esm/LinearGenomeView/components/Header.js.map +1 -0
- package/esm/LinearGenomeView/components/HelpDialog.d.ts +4 -0
- package/esm/LinearGenomeView/components/HelpDialog.js +58 -0
- package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +7 -0
- package/esm/LinearGenomeView/components/ImportForm.js +141 -0
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +7 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js +67 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +132 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/esm/LinearGenomeView/components/MiniControls.d.ts +6 -0
- package/esm/LinearGenomeView/components/MiniControls.js +25 -0
- package/esm/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js +197 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +148 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js +287 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +22 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +136 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/esm/LinearGenomeView/components/RubberBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/RubberBand.js +197 -0
- package/esm/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/Ruler.d.ts +27 -0
- package/esm/LinearGenomeView/components/Ruler.js +50 -0
- package/esm/LinearGenomeView/components/Ruler.js.map +1 -0
- package/esm/LinearGenomeView/components/ScaleBar.d.ts +10 -0
- package/esm/LinearGenomeView/components/ScaleBar.js +112 -0
- package/esm/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchBox.d.ts +8 -0
- package/esm/LinearGenomeView/components/SearchBox.js +94 -0
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +107 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/SequenceDialog.d.ts +8 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js +147 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +9 -0
- package/esm/LinearGenomeView/components/TrackContainer.js +109 -0
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +8 -0
- package/esm/LinearGenomeView/components/TrackLabel.js +89 -0
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/{dist/LinearGenomeView/components/VerticalGuides.d.ts → esm/LinearGenomeView/components/TracksContainer.d.ts} +4 -3
- package/esm/LinearGenomeView/components/TracksContainer.js +142 -0
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomControls.js +32 -0
- package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/esm/LinearGenomeView/components/util.d.ts +14 -0
- package/esm/LinearGenomeView/components/util.js +17 -0
- package/esm/LinearGenomeView/components/util.js.map +1 -0
- package/esm/LinearGenomeView/index.d.ts +275 -0
- package/esm/LinearGenomeView/index.js +978 -0
- package/esm/LinearGenomeView/index.js.map +1 -0
- package/esm/LinearGenomeView/util.d.ts +14 -0
- package/esm/LinearGenomeView/util.js +62 -0
- package/esm/LinearGenomeView/util.js.map +1 -0
- package/esm/index.d.ts +615 -0
- package/esm/index.js +127 -0
- package/esm/index.js.map +1 -0
- package/package.json +22 -15
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +4 -3
- package/src/BaseLinearDisplay/components/Block.tsx +5 -5
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +7 -8
- package/src/BaseLinearDisplay/components/Tooltip.tsx +14 -4
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +6 -4
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +10 -7
- package/src/LinearBasicDisplay/model.ts +21 -15
- package/src/LinearGenomeView/components/CenterLine.tsx +6 -11
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +5 -5
- package/src/LinearGenomeView/components/{VerticalGuides.tsx → Gridlines.tsx} +9 -11
- package/src/LinearGenomeView/components/Header.tsx +13 -18
- package/src/LinearGenomeView/components/HelpDialog.tsx +5 -5
- package/src/LinearGenomeView/components/ImportForm.tsx +24 -37
- package/src/LinearGenomeView/components/LinearGenomeView.test.js +16 -6
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +4 -3
- package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +20 -29
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +100 -89
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +13 -44
- package/src/LinearGenomeView/components/RubberBand.tsx +12 -18
- package/src/LinearGenomeView/components/Ruler.tsx +5 -11
- package/src/LinearGenomeView/components/ScaleBar.tsx +23 -27
- package/src/LinearGenomeView/components/SearchBox.tsx +22 -32
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -7
- package/src/LinearGenomeView/components/SequenceDialog.tsx +10 -10
- package/src/LinearGenomeView/components/TrackContainer.tsx +12 -12
- package/src/LinearGenomeView/components/TrackLabel.tsx +21 -31
- package/src/LinearGenomeView/components/TracksContainer.tsx +10 -15
- package/src/LinearGenomeView/components/ZoomControls.tsx +12 -13
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +500 -547
- package/src/LinearGenomeView/components/util.ts +43 -0
- package/src/LinearGenomeView/index.test.ts +14 -36
- package/src/LinearGenomeView/index.tsx +390 -564
- package/src/index.ts +1 -1
- package/dist/LinearBareDisplay/index.test.js +0 -33
- package/dist/LinearGenomeView/components/LinearGenomeView.test.js +0 -234
- package/dist/LinearGenomeView/components/ScaleBar.test.js +0 -180
- package/dist/LinearGenomeView/components/VerticalGuides.js +0 -116
- package/dist/LinearGenomeView/index.test.js +0 -1187
- package/dist/LinearGenomeView/util.test.js +0 -78
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import {
|
|
2
3
|
ContentBlock,
|
|
3
4
|
ElidedBlock,
|
|
4
5
|
InterRegionPaddingBlock,
|
|
5
6
|
} from '@jbrowse/core/util/blockTypes'
|
|
6
|
-
import { makeStyles } from '
|
|
7
|
-
import clsx from 'clsx'
|
|
7
|
+
import { makeStyles } from 'tss-react/mui'
|
|
8
8
|
import { observer } from 'mobx-react'
|
|
9
|
-
import {
|
|
10
|
-
import React from 'react'
|
|
11
|
-
import { LinearGenomeViewStateModel } from '..'
|
|
9
|
+
import { LinearGenomeViewModel } from '..'
|
|
12
10
|
import {
|
|
13
11
|
ContentBlock as ContentBlockComponent,
|
|
14
12
|
ElidedBlock as ElidedBlockComponent,
|
|
@@ -17,9 +15,9 @@ import {
|
|
|
17
15
|
|
|
18
16
|
import { makeTicks } from '../util'
|
|
19
17
|
|
|
20
|
-
type LGV =
|
|
18
|
+
type LGV = LinearGenomeViewModel
|
|
21
19
|
|
|
22
|
-
const useStyles = makeStyles(theme => ({
|
|
20
|
+
const useStyles = makeStyles()(theme => ({
|
|
23
21
|
verticalGuidesZoomContainer: {
|
|
24
22
|
position: 'absolute',
|
|
25
23
|
height: '100%',
|
|
@@ -40,14 +38,14 @@ const useStyles = makeStyles(theme => ({
|
|
|
40
38
|
width: 1,
|
|
41
39
|
},
|
|
42
40
|
majorTick: {
|
|
43
|
-
background: theme.palette.text.
|
|
41
|
+
background: theme.palette.text.secondary,
|
|
44
42
|
},
|
|
45
43
|
minorTick: {
|
|
46
44
|
background: theme.palette.divider,
|
|
47
45
|
},
|
|
48
46
|
}))
|
|
49
47
|
const RenderedVerticalGuides = observer(({ model }: { model: LGV }) => {
|
|
50
|
-
const classes = useStyles()
|
|
48
|
+
const { classes, cx } = useStyles()
|
|
51
49
|
return (
|
|
52
50
|
<>
|
|
53
51
|
{model.staticBlocks.map((block, index) => {
|
|
@@ -63,7 +61,7 @@ const RenderedVerticalGuides = observer(({ model }: { model: LGV }) => {
|
|
|
63
61
|
return (
|
|
64
62
|
<div
|
|
65
63
|
key={tick.base}
|
|
66
|
-
className={
|
|
64
|
+
className={cx(
|
|
67
65
|
classes.tick,
|
|
68
66
|
tick.type === 'major' || tick.type === 'labeledMajor'
|
|
69
67
|
? classes.majorTick
|
|
@@ -94,7 +92,7 @@ const RenderedVerticalGuides = observer(({ model }: { model: LGV }) => {
|
|
|
94
92
|
)
|
|
95
93
|
})
|
|
96
94
|
function VerticalGuides({ model }: { model: LGV }) {
|
|
97
|
-
const classes = useStyles()
|
|
95
|
+
const { classes } = useStyles()
|
|
98
96
|
// find the block that needs pinning to the left side for context
|
|
99
97
|
const offsetLeft = model.staticBlocks.offsetPx - model.offsetPx
|
|
100
98
|
return (
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { observer } from 'mobx-react'
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Typography,
|
|
7
|
-
makeStyles,
|
|
8
|
-
alpha,
|
|
9
|
-
} from '@material-ui/core'
|
|
10
|
-
import { getTickDisplayStr2 } from '@jbrowse/core/util'
|
|
11
|
-
import SearchBox from './SearchBox'
|
|
3
|
+
import { Button, FormGroup, Typography, alpha } from '@mui/material'
|
|
4
|
+
import { makeStyles } from 'tss-react/mui'
|
|
5
|
+
import { getBpDisplayStr } from '@jbrowse/core/util'
|
|
12
6
|
|
|
13
7
|
// icons
|
|
14
8
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons'
|
|
15
|
-
import ArrowForwardIcon from '@
|
|
16
|
-
import ArrowBackIcon from '@
|
|
9
|
+
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
|
|
10
|
+
import ArrowBackIcon from '@mui/icons-material/ArrowBack'
|
|
17
11
|
|
|
18
12
|
// locals
|
|
19
13
|
import {
|
|
@@ -24,9 +18,10 @@ import {
|
|
|
24
18
|
} from '..'
|
|
25
19
|
import OverviewScaleBar from './OverviewScaleBar'
|
|
26
20
|
import ZoomControls from './ZoomControls'
|
|
21
|
+
import SearchBox from './SearchBox'
|
|
27
22
|
|
|
28
23
|
type LGV = LinearGenomeViewModel
|
|
29
|
-
const useStyles = makeStyles(theme => ({
|
|
24
|
+
const useStyles = makeStyles()(theme => ({
|
|
30
25
|
headerBar: {
|
|
31
26
|
height: HEADER_BAR_HEIGHT,
|
|
32
27
|
display: 'flex',
|
|
@@ -60,7 +55,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
60
55
|
}))
|
|
61
56
|
|
|
62
57
|
const HeaderButtons = observer(({ model }: { model: LGV }) => {
|
|
63
|
-
const classes = useStyles()
|
|
58
|
+
const { classes } = useStyles()
|
|
64
59
|
return (
|
|
65
60
|
<Button
|
|
66
61
|
onClick={model.activateTrackSelector}
|
|
@@ -75,7 +70,7 @@ const HeaderButtons = observer(({ model }: { model: LGV }) => {
|
|
|
75
70
|
})
|
|
76
71
|
|
|
77
72
|
function PanControls({ model }: { model: LGV }) {
|
|
78
|
-
const classes = useStyles()
|
|
73
|
+
const { classes } = useStyles()
|
|
79
74
|
return (
|
|
80
75
|
<>
|
|
81
76
|
<Button
|
|
@@ -97,17 +92,17 @@ function PanControls({ model }: { model: LGV }) {
|
|
|
97
92
|
}
|
|
98
93
|
|
|
99
94
|
const RegionWidth = observer(({ model }: { model: LGV }) => {
|
|
100
|
-
const classes = useStyles()
|
|
101
|
-
const { coarseTotalBp
|
|
95
|
+
const { classes } = useStyles()
|
|
96
|
+
const { coarseTotalBp } = model
|
|
102
97
|
return (
|
|
103
98
|
<Typography variant="body2" color="textSecondary" className={classes.bp}>
|
|
104
|
-
{
|
|
99
|
+
{getBpDisplayStr(coarseTotalBp)}
|
|
105
100
|
</Typography>
|
|
106
101
|
)
|
|
107
102
|
})
|
|
108
103
|
|
|
109
104
|
const Controls = ({ model }: { model: LGV }) => {
|
|
110
|
-
const classes = useStyles()
|
|
105
|
+
const { classes } = useStyles()
|
|
111
106
|
return (
|
|
112
107
|
<div className={classes.headerBar}>
|
|
113
108
|
<HeaderButtons model={model} />
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
DialogTitle,
|
|
8
8
|
Divider,
|
|
9
9
|
IconButton,
|
|
10
|
-
|
|
11
|
-
} from '
|
|
12
|
-
import CloseIcon from '@
|
|
10
|
+
} from '@mui/material'
|
|
11
|
+
import { makeStyles } from 'tss-react/mui'
|
|
12
|
+
import CloseIcon from '@mui/icons-material/Close'
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const useStyles = makeStyles()(theme => ({
|
|
15
15
|
closeButton: {
|
|
16
16
|
position: 'absolute',
|
|
17
17
|
right: theme.spacing(1),
|
|
@@ -25,7 +25,7 @@ export default function HelpDialog({
|
|
|
25
25
|
}: {
|
|
26
26
|
handleClose: () => void
|
|
27
27
|
}) {
|
|
28
|
-
const classes = useStyles()
|
|
28
|
+
const { classes } = useStyles()
|
|
29
29
|
return (
|
|
30
30
|
<Dialog open maxWidth="xl" onClose={handleClose}>
|
|
31
31
|
<DialogTitle>
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import React, { useState, lazy } from 'react'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
2
3
|
import { observer } from 'mobx-react'
|
|
3
4
|
import { getSession } from '@jbrowse/core/util'
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
CircularProgress,
|
|
7
|
-
Container,
|
|
8
|
-
Grid,
|
|
9
|
-
makeStyles,
|
|
10
|
-
} from '@material-ui/core'
|
|
11
|
-
import { SearchType } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
12
|
-
import ErrorMessage from '@jbrowse/core/ui/ErrorMessage'
|
|
5
|
+
import { Button, CircularProgress, Container, Grid } from '@mui/material'
|
|
6
|
+
import { ErrorMessage, AssemblySelector } from '@jbrowse/core/ui'
|
|
13
7
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
|
|
14
|
-
import
|
|
15
|
-
import CloseIcon from '@material-ui/icons/Close'
|
|
8
|
+
import CloseIcon from '@mui/icons-material/Close'
|
|
16
9
|
|
|
17
10
|
// locals
|
|
18
11
|
import RefNameAutocomplete from './RefNameAutocomplete'
|
|
12
|
+
import { fetchResults } from './util'
|
|
19
13
|
import { LinearGenomeViewModel, WIDGET_HEIGHT } from '..'
|
|
20
14
|
const SearchResultsDialog = lazy(() => import('./SearchResultsDialog'))
|
|
21
15
|
|
|
22
|
-
const useStyles = makeStyles(theme => ({
|
|
16
|
+
const useStyles = makeStyles()(theme => ({
|
|
23
17
|
importFormContainer: {
|
|
24
18
|
padding: theme.spacing(2),
|
|
25
19
|
},
|
|
@@ -34,7 +28,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
34
28
|
type LGV = LinearGenomeViewModel
|
|
35
29
|
|
|
36
30
|
const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
37
|
-
const classes = useStyles()
|
|
31
|
+
const { classes } = useStyles()
|
|
38
32
|
const session = getSession(model)
|
|
39
33
|
const { assemblyNames, assemblyManager, textSearchManager } = session
|
|
40
34
|
const { rankSearchResults, isSearchDialogDisplayed, error } = model
|
|
@@ -57,28 +51,6 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
57
51
|
label: value,
|
|
58
52
|
})
|
|
59
53
|
|
|
60
|
-
async function fetchResults(query: string, searchType?: SearchType) {
|
|
61
|
-
if (!textSearchManager) {
|
|
62
|
-
console.warn('No text search manager')
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const textSearchResults = await textSearchManager?.search(
|
|
66
|
-
{
|
|
67
|
-
queryString: query,
|
|
68
|
-
searchType,
|
|
69
|
-
},
|
|
70
|
-
searchScope,
|
|
71
|
-
rankSearchResults,
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
const refNameResults = assembly?.allRefNames
|
|
75
|
-
?.filter(refName => refName.startsWith(query))
|
|
76
|
-
.map(r => new BaseResult({ label: r }))
|
|
77
|
-
.slice(0, 10)
|
|
78
|
-
|
|
79
|
-
return [...(refNameResults || []), ...(textSearchResults || [])]
|
|
80
|
-
}
|
|
81
|
-
|
|
82
54
|
// gets a string as input, or use stored option results from previous query,
|
|
83
55
|
// then re-query and
|
|
84
56
|
// 1) if it has multiple results: pop a dialog
|
|
@@ -105,7 +77,14 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
105
77
|
) {
|
|
106
78
|
model.navToLocString(location, selectedAsm)
|
|
107
79
|
} else {
|
|
108
|
-
const results = await fetchResults(
|
|
80
|
+
const results = await fetchResults({
|
|
81
|
+
queryString: input,
|
|
82
|
+
searchType: 'exact',
|
|
83
|
+
searchScope,
|
|
84
|
+
rankSearchResults,
|
|
85
|
+
textSearchManager,
|
|
86
|
+
assembly,
|
|
87
|
+
})
|
|
109
88
|
if (results.length > 1) {
|
|
110
89
|
model.setSearchResults(results, input.toLowerCase())
|
|
111
90
|
return
|
|
@@ -165,7 +144,15 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
|
|
|
165
144
|
<CloseIcon style={{ color: 'red' }} />
|
|
166
145
|
) : value ? (
|
|
167
146
|
<RefNameAutocomplete
|
|
168
|
-
fetchResults={
|
|
147
|
+
fetchResults={queryString =>
|
|
148
|
+
fetchResults({
|
|
149
|
+
queryString,
|
|
150
|
+
assembly,
|
|
151
|
+
textSearchManager,
|
|
152
|
+
rankSearchResults,
|
|
153
|
+
searchScope,
|
|
154
|
+
})
|
|
155
|
+
}
|
|
169
156
|
model={model}
|
|
170
157
|
assemblyName={assemblyError ? undefined : selectedAsm}
|
|
171
158
|
value={value}
|
|
@@ -35,11 +35,12 @@ describe('<LinearGenomeView />', () => {
|
|
|
35
35
|
model.setWidth(800)
|
|
36
36
|
const { findByText } = render(<LinearGenomeView model={model} />)
|
|
37
37
|
expect(model.displayedRegions.length).toEqual(0)
|
|
38
|
-
|
|
39
|
-
await waitFor(() =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
38
|
+
const elt = await findByText('Open')
|
|
39
|
+
await waitFor(() => expect(elt.getAttribute('disabled')).toBe(null))
|
|
40
|
+
fireEvent.click(elt)
|
|
41
|
+
await waitFor(() => expect(model.displayedRegions.length).toEqual(1), 15000)
|
|
42
|
+
}, 15000)
|
|
43
|
+
|
|
43
44
|
it('renders one track, one region', async () => {
|
|
44
45
|
const session = createTestSession()
|
|
45
46
|
session.addAssemblyConf(assemblyConf)
|
|
@@ -75,13 +76,22 @@ describe('<LinearGenomeView />', () => {
|
|
|
75
76
|
})
|
|
76
77
|
const model = session.views[0]
|
|
77
78
|
model.setWidth(800)
|
|
78
|
-
const { container, findByText } = render(
|
|
79
|
+
const { container, getByPlaceholderText, findByText } = render(
|
|
80
|
+
<LinearGenomeView model={model} />,
|
|
81
|
+
)
|
|
79
82
|
await findByText('Foo Track')
|
|
80
83
|
// test needs to wait until it's updated to display 100 bp in the header to
|
|
81
84
|
// make snapshot pass
|
|
82
85
|
await findByText('100bp')
|
|
86
|
+
|
|
87
|
+
await waitFor(() => {
|
|
88
|
+
expect(getByPlaceholderText('Search for location').value).toEqual(
|
|
89
|
+
'ctgA:1..100',
|
|
90
|
+
)
|
|
91
|
+
})
|
|
83
92
|
expect(container.firstChild).toMatchSnapshot()
|
|
84
93
|
})
|
|
94
|
+
|
|
85
95
|
it('renders two tracks, two regions', async () => {
|
|
86
96
|
const session = createTestSession()
|
|
87
97
|
session.addAssemblyConf(assemblyConf)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Button, Paper, Typography
|
|
2
|
+
import { Button, Paper, Typography } from '@mui/material'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
4
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons'
|
|
4
5
|
import { observer } from 'mobx-react'
|
|
5
6
|
|
|
@@ -15,7 +16,7 @@ import SearchResultsDialog from './SearchResultsDialog'
|
|
|
15
16
|
|
|
16
17
|
type LGV = LinearGenomeViewModel
|
|
17
18
|
|
|
18
|
-
const useStyles = makeStyles(theme => ({
|
|
19
|
+
const useStyles = makeStyles()(theme => ({
|
|
19
20
|
note: {
|
|
20
21
|
textAlign: 'center',
|
|
21
22
|
paddingTop: theme.spacing(1),
|
|
@@ -45,7 +46,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
45
46
|
|
|
46
47
|
const LinearGenomeView = observer(({ model }: { model: LGV }) => {
|
|
47
48
|
const { tracks, error, hideHeader, initialized, hasDisplayedRegions } = model
|
|
48
|
-
const classes = useStyles()
|
|
49
|
+
const { classes } = useStyles()
|
|
49
50
|
|
|
50
51
|
if (!initialized && !error) {
|
|
51
52
|
return (
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import { observer } from 'mobx-react'
|
|
3
|
-
import IconButton from '@material
|
|
4
|
-
import ZoomIn from '@
|
|
5
|
-
import ZoomOut from '@
|
|
6
|
-
import ArrowDown from '@
|
|
7
|
-
import Paper from '@material-ui/core/Paper'
|
|
3
|
+
import { IconButton, Paper } from '@mui/material'
|
|
4
|
+
import ZoomIn from '@mui/icons-material/ZoomIn'
|
|
5
|
+
import ZoomOut from '@mui/icons-material/ZoomOut'
|
|
6
|
+
import ArrowDown from '@mui/icons-material/KeyboardArrowDown'
|
|
8
7
|
import Menu from '@jbrowse/core/ui/Menu'
|
|
9
8
|
import { LinearGenomeViewModel } from '..'
|
|
10
9
|
|
|
@@ -14,38 +13,30 @@ const MiniControls = observer((props: { model: LinearGenomeViewModel }) => {
|
|
|
14
13
|
const [anchorEl, setAnchorEl] = useState<HTMLElement>()
|
|
15
14
|
|
|
16
15
|
return (
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
>
|
|
25
|
-
<ArrowDown />
|
|
26
|
-
</IconButton>
|
|
16
|
+
<Paper style={{ background: '#aaa7' }}>
|
|
17
|
+
<IconButton
|
|
18
|
+
color="secondary"
|
|
19
|
+
onClick={event => setAnchorEl(event.currentTarget)}
|
|
20
|
+
>
|
|
21
|
+
<ArrowDown fontSize="small" />
|
|
22
|
+
</IconButton>
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
color="secondary"
|
|
45
|
-
>
|
|
46
|
-
<ZoomIn />
|
|
47
|
-
</IconButton>
|
|
48
|
-
</Paper>
|
|
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>
|
|
49
40
|
<Menu
|
|
50
41
|
anchorEl={anchorEl}
|
|
51
42
|
open={Boolean(anchorEl)}
|
|
@@ -53,12 +44,10 @@ const MiniControls = observer((props: { model: LinearGenomeViewModel }) => {
|
|
|
53
44
|
callback()
|
|
54
45
|
setAnchorEl(undefined)
|
|
55
46
|
}}
|
|
56
|
-
onClose={() =>
|
|
57
|
-
setAnchorEl(undefined)
|
|
58
|
-
}}
|
|
47
|
+
onClose={() => setAnchorEl(undefined)}
|
|
59
48
|
menuItems={model.menuItems()}
|
|
60
49
|
/>
|
|
61
|
-
|
|
50
|
+
</Paper>
|
|
62
51
|
)
|
|
63
52
|
})
|
|
64
53
|
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Tooltip,
|
|
5
|
-
Typography,
|
|
6
|
-
makeStyles,
|
|
7
|
-
alpha,
|
|
8
|
-
} from '@material-ui/core'
|
|
2
|
+
import { Popover, Tooltip, Typography, alpha } from '@mui/material'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
9
4
|
import { getSession, stringify } from '@jbrowse/core/util'
|
|
10
5
|
import { observer, PropTypes as MobxPropTypes } from 'mobx-react'
|
|
11
6
|
import ReactPropTypes from 'prop-types'
|
|
@@ -14,7 +9,8 @@ import { LinearGenomeViewModel, HEADER_OVERVIEW_HEIGHT } from '..'
|
|
|
14
9
|
|
|
15
10
|
type LGV = LinearGenomeViewModel
|
|
16
11
|
|
|
17
|
-
const useStyles = makeStyles(theme => {
|
|
12
|
+
const useStyles = makeStyles()(theme => {
|
|
13
|
+
// @ts-ignore
|
|
18
14
|
const { tertiary, primary } = theme.palette
|
|
19
15
|
const background = tertiary
|
|
20
16
|
? alpha(tertiary.main, 0.7)
|
|
@@ -66,7 +62,7 @@ const HoverTooltip = observer(
|
|
|
66
62
|
guideX: number
|
|
67
63
|
overview: Base1DViewModel
|
|
68
64
|
}) => {
|
|
69
|
-
const classes = useStyles()
|
|
65
|
+
const { classes } = useStyles()
|
|
70
66
|
const { cytobandOffset } = model
|
|
71
67
|
const { assemblyManager } = getSession(model)
|
|
72
68
|
|
|
@@ -111,8 +107,8 @@ function OverviewRubberBand({
|
|
|
111
107
|
const [currentX, setCurrentX] = useState<number>()
|
|
112
108
|
const [guideX, setGuideX] = useState<number>()
|
|
113
109
|
const controlsRef = useRef<HTMLDivElement>(null)
|
|
114
|
-
const rubberBandRef = useRef(null)
|
|
115
|
-
const classes = useStyles()
|
|
110
|
+
const rubberBandRef = useRef<HTMLDivElement>(null)
|
|
111
|
+
const { classes } = useStyles()
|
|
116
112
|
const mouseDragging = startX !== undefined
|
|
117
113
|
|
|
118
114
|
useEffect(() => {
|
|
@@ -125,30 +121,25 @@ function OverviewRubberBand({
|
|
|
125
121
|
}
|
|
126
122
|
|
|
127
123
|
function globalMouseUp() {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
startX !== undefined &&
|
|
131
|
-
currentX !== undefined
|
|
132
|
-
) {
|
|
124
|
+
// click and drag
|
|
125
|
+
if (startX !== undefined && currentX !== undefined) {
|
|
133
126
|
if (Math.abs(currentX - startX) > 3) {
|
|
134
|
-
model.
|
|
127
|
+
model.moveTo(
|
|
135
128
|
overview.pxToBp(startX - cytobandOffset),
|
|
136
129
|
overview.pxToBp(currentX - cytobandOffset),
|
|
137
130
|
)
|
|
138
131
|
}
|
|
139
132
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
startX
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
Math.round(
|
|
149
|
-
|
|
150
|
-
clickedAt.index,
|
|
151
|
-
)
|
|
133
|
+
|
|
134
|
+
// just a click
|
|
135
|
+
if (startX !== undefined && currentX === undefined) {
|
|
136
|
+
const click = overview.pxToBp(startX - cytobandOffset)
|
|
137
|
+
if (!click.refName) {
|
|
138
|
+
getSession(model).notify('unknown position clicked')
|
|
139
|
+
console.error('unknown position clicked', click)
|
|
140
|
+
} else {
|
|
141
|
+
model.centerAt(Math.round(click.coord), click.refName, click.index)
|
|
142
|
+
}
|
|
152
143
|
}
|
|
153
144
|
setStartX(undefined)
|
|
154
145
|
setCurrentX(undefined)
|