@jbrowse/plugin-linear-genome-view 2.0.0 → 2.1.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/BaseLinearDisplay.js +28 -55
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Block.js +17 -28
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +19 -21
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +28 -48
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Tooltip.js +29 -58
- package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +242 -363
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +1 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +77 -129
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/dist/LinearBareDisplay/configSchema.js +2 -2
- package/dist/LinearBareDisplay/configSchema.js.map +1 -1
- package/dist/LinearBareDisplay/model.js +13 -19
- package/dist/LinearBareDisplay/model.js.map +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +14 -31
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
- package/dist/LinearBasicDisplay/configSchema.js +3 -3
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
- package/dist/LinearBasicDisplay/model.js +119 -147
- package/dist/LinearBasicDisplay/model.js.map +1 -1
- package/dist/LinearGenomeView/components/CenterLine.js +11 -12
- package/dist/LinearGenomeView/components/CenterLine.js.map +1 -1
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +30 -96
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +9 -0
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +172 -0
- package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/{VerticalGuides.d.ts → Gridlines.d.ts} +0 -0
- package/dist/LinearGenomeView/components/{VerticalGuides.js → Gridlines.js} +19 -21
- package/dist/LinearGenomeView/components/Gridlines.js.map +1 -0
- package/dist/LinearGenomeView/components/Header.js +26 -31
- package/dist/LinearGenomeView/components/Header.js.map +1 -1
- package/dist/LinearGenomeView/components/HelpDialog.js +10 -11
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/ImportForm.js +91 -154
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +20 -25
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +86 -157
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/dist/LinearGenomeView/components/MiniControls.js +16 -32
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewRubberBand.d.ts +0 -11
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +55 -84
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +94 -117
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +90 -172
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/dist/LinearGenomeView/components/RubberBand.js +51 -72
- package/dist/LinearGenomeView/components/RubberBand.js.map +1 -1
- package/dist/LinearGenomeView/components/Ruler.js +17 -18
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -1
- package/dist/LinearGenomeView/components/ScaleBar.js +37 -58
- package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchBox.js +69 -133
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +32 -33
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/{SequenceDialog.d.ts → SequenceSearchDialog.d.ts} +0 -0
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js +104 -0
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +2 -1
- package/dist/LinearGenomeView/components/TrackContainer.js +36 -43
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackLabel.js +50 -85
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +33 -50
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/ZoomControls.js +15 -32
- package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -1
- package/dist/LinearGenomeView/components/util.js +14 -87
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/index.d.ts +66 -79
- package/dist/LinearGenomeView/index.js +534 -710
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/LinearGenomeView/util.js +17 -36
- package/dist/LinearGenomeView/util.js.map +1 -1
- package/dist/index.js +75 -146
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +1 -1
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +1 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +9 -0
- package/esm/LinearGenomeView/components/{SequenceDialog.js → GetSequenceDialog.js} +5 -8
- package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/{VerticalGuides.d.ts → Gridlines.d.ts} +0 -0
- package/esm/LinearGenomeView/components/{VerticalGuides.js → Gridlines.js} +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js.map +1 -0
- package/esm/LinearGenomeView/components/ImportForm.js +1 -0
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +3 -7
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +0 -11
- package/esm/LinearGenomeView/components/OverviewRubberBand.js +16 -21
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewScaleBar.js +0 -2
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
- package/esm/LinearGenomeView/components/RubberBand.js +0 -2
- package/esm/LinearGenomeView/components/RubberBand.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/esm/LinearGenomeView/components/{SequenceDialog.d.ts → SequenceSearchDialog.d.ts} +0 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +76 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +2 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +15 -20
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/TrackLabel.js +22 -23
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +2 -2
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/esm/LinearGenomeView/index.d.ts +66 -79
- package/esm/LinearGenomeView/index.js +268 -407
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/package.json +3 -4
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +0 -1
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +2 -1
- package/src/LinearGenomeView/components/{SequenceDialog.tsx → GetSequenceDialog.tsx} +5 -18
- package/src/LinearGenomeView/components/{VerticalGuides.tsx → Gridlines.tsx} +0 -0
- package/src/LinearGenomeView/components/ImportForm.tsx +1 -0
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +4 -8
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +19 -34
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +0 -2
- package/src/LinearGenomeView/components/RubberBand.tsx +0 -2
- package/src/LinearGenomeView/components/SearchBox.tsx +1 -1
- package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +165 -0
- package/src/LinearGenomeView/components/TrackContainer.tsx +18 -28
- package/src/LinearGenomeView/components/TrackLabel.tsx +60 -53
- package/src/LinearGenomeView/components/TracksContainer.tsx +2 -2
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +14 -17
- package/src/LinearGenomeView/index.test.ts +14 -36
- package/src/LinearGenomeView/index.tsx +389 -541
- package/dist/LinearGenomeView/components/SequenceDialog.js +0 -242
- package/dist/LinearGenomeView/components/SequenceDialog.js.map +0 -1
- package/dist/LinearGenomeView/components/VerticalGuides.js.map +0 -1
- package/esm/LinearGenomeView/components/SequenceDialog.js.map +0 -1
- package/esm/LinearGenomeView/components/VerticalGuides.js.map +0 -1
|
@@ -8,6 +8,7 @@ import { getConf } from '@jbrowse/core/configuration'
|
|
|
8
8
|
import { ResizeHandle } from '@jbrowse/core/ui'
|
|
9
9
|
import { useDebouncedCallback } from '@jbrowse/core/util'
|
|
10
10
|
|
|
11
|
+
// locals
|
|
11
12
|
import { LinearGenomeViewModel } from '..'
|
|
12
13
|
import TrackLabel from './TrackLabel'
|
|
13
14
|
|
|
@@ -42,7 +43,7 @@ const useStyles = makeStyles()({
|
|
|
42
43
|
height: '100%',
|
|
43
44
|
width: '100%',
|
|
44
45
|
},
|
|
45
|
-
|
|
46
|
+
trackLabelOffset: {
|
|
46
47
|
position: 'relative',
|
|
47
48
|
display: 'inline-block',
|
|
48
49
|
},
|
|
@@ -64,15 +65,15 @@ type LGV = LinearGenomeViewModel
|
|
|
64
65
|
const TrackContainerLabel = observer(
|
|
65
66
|
({ model, view }: { model: BaseTrackModel; view: LGV }) => {
|
|
66
67
|
const { classes, cx } = useStyles()
|
|
68
|
+
const display = model.displays[0]
|
|
69
|
+
const { trackLabel, trackLabelOverlap, trackLabelOffset } = classes
|
|
67
70
|
const labelStyle =
|
|
68
|
-
view.trackLabels
|
|
69
|
-
?
|
|
70
|
-
:
|
|
71
|
+
view.trackLabels !== 'overlapping' || display.prefersOffset
|
|
72
|
+
? trackLabelOffset
|
|
73
|
+
: trackLabelOverlap
|
|
74
|
+
|
|
71
75
|
return view.trackLabels !== 'hidden' ? (
|
|
72
|
-
<TrackLabel
|
|
73
|
-
track={model}
|
|
74
|
-
className={cx(classes.trackLabel, labelStyle)}
|
|
75
|
-
/>
|
|
76
|
+
<TrackLabel track={model} className={cx(trackLabel, labelStyle)} />
|
|
76
77
|
) : null
|
|
77
78
|
},
|
|
78
79
|
)
|
|
@@ -81,16 +82,21 @@ function TrackContainer({
|
|
|
81
82
|
model,
|
|
82
83
|
track,
|
|
83
84
|
}: {
|
|
84
|
-
model:
|
|
85
|
+
model: LGV
|
|
85
86
|
track: BaseTrackModel
|
|
86
87
|
}) {
|
|
87
88
|
const { classes } = useStyles()
|
|
88
89
|
const display = track.displays[0]
|
|
89
90
|
const { horizontalScroll, draggingTrackId, moveTrack } = model
|
|
90
|
-
const { height } = display
|
|
91
|
+
const { height, RenderingComponent, DisplayBlurb } = display
|
|
91
92
|
const trackId = getConf(track, 'trackId')
|
|
92
93
|
const ref = useRef(null)
|
|
93
|
-
|
|
94
|
+
const dimmed = draggingTrackId !== undefined && draggingTrackId !== display.id
|
|
95
|
+
const debouncedOnDragEnter = useDebouncedCallback(() => {
|
|
96
|
+
if (isAlive(display) && dimmed) {
|
|
97
|
+
moveTrack(draggingTrackId, track.id)
|
|
98
|
+
}
|
|
99
|
+
}, 100)
|
|
94
100
|
useEffect(() => {
|
|
95
101
|
if (ref.current) {
|
|
96
102
|
model.trackRefs[trackId] = ref.current
|
|
@@ -99,18 +105,6 @@ function TrackContainer({
|
|
|
99
105
|
delete model.trackRefs[trackId]
|
|
100
106
|
}
|
|
101
107
|
}, [model.trackRefs, trackId])
|
|
102
|
-
function onDragEnter() {
|
|
103
|
-
if (
|
|
104
|
-
draggingTrackId !== undefined &&
|
|
105
|
-
isAlive(display) &&
|
|
106
|
-
draggingTrackId !== display.id
|
|
107
|
-
) {
|
|
108
|
-
moveTrack(draggingTrackId, track.id)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const debouncedOnDragEnter = useDebouncedCallback(onDragEnter, 100)
|
|
112
|
-
const { RenderingComponent, DisplayBlurb } = display
|
|
113
|
-
const dimmed = draggingTrackId !== undefined && draggingTrackId !== display.id
|
|
114
108
|
|
|
115
109
|
return (
|
|
116
110
|
<Paper className={classes.root} variant="outlined">
|
|
@@ -118,13 +112,9 @@ function TrackContainer({
|
|
|
118
112
|
<div
|
|
119
113
|
className={classes.trackRenderingContainer}
|
|
120
114
|
style={{ height }}
|
|
121
|
-
onScroll={event =>
|
|
122
|
-
const target = event.target as HTMLDivElement
|
|
123
|
-
display.setScrollTop(target.scrollTop)
|
|
124
|
-
}}
|
|
115
|
+
onScroll={event => display.setScrollTop(event.currentTarget.scrollTop)}
|
|
125
116
|
onDragEnter={debouncedOnDragEnter}
|
|
126
117
|
data-testid={`trackRenderingContainer-${model.id}-${trackId}`}
|
|
127
|
-
role="presentation"
|
|
128
118
|
>
|
|
129
119
|
<div
|
|
130
120
|
ref={ref}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { observer } from 'mobx-react'
|
|
3
3
|
import { Instance } from 'mobx-state-tree'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
AnyConfigurationModel,
|
|
6
|
+
getConf,
|
|
7
|
+
readConfObject,
|
|
8
|
+
} from '@jbrowse/core/configuration'
|
|
5
9
|
import CascadingMenu from '@jbrowse/core/ui/CascadingMenu'
|
|
6
10
|
import { getSession, getContainingView } from '@jbrowse/core/util'
|
|
7
11
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
@@ -52,10 +56,28 @@ const useStyles = makeStyles()(theme => ({
|
|
|
52
56
|
}))
|
|
53
57
|
|
|
54
58
|
type LGV = Instance<LinearGenomeViewStateModel>
|
|
59
|
+
|
|
55
60
|
interface Props {
|
|
56
61
|
track: BaseTrackModel
|
|
57
62
|
className?: string
|
|
58
63
|
}
|
|
64
|
+
|
|
65
|
+
function getTrackName(
|
|
66
|
+
track: BaseTrackModel,
|
|
67
|
+
session: { assemblies: AnyConfigurationModel[] },
|
|
68
|
+
) {
|
|
69
|
+
const trackName = getConf(track, 'name')
|
|
70
|
+
if (getConf(track, 'type') === 'ReferenceSequenceTrack') {
|
|
71
|
+
const asm = session.assemblies.find(a => a.sequence === track.configuration)
|
|
72
|
+
return (
|
|
73
|
+
trackName ||
|
|
74
|
+
(asm
|
|
75
|
+
? `Reference Sequence (${readConfObject(asm, 'name')})`
|
|
76
|
+
: 'Reference Sequence')
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
return trackName
|
|
80
|
+
}
|
|
59
81
|
const TrackLabel = React.forwardRef<HTMLDivElement, Props>(
|
|
60
82
|
({ track, className }, ref) => {
|
|
61
83
|
const { classes, cx } = useStyles()
|
|
@@ -63,6 +85,7 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(
|
|
|
63
85
|
const session = getSession(track)
|
|
64
86
|
const trackConf = track.configuration
|
|
65
87
|
const trackId = getConf(track, 'trackId')
|
|
88
|
+
const trackName = getTrackName(track, session)
|
|
66
89
|
|
|
67
90
|
const popupState = usePopupState({
|
|
68
91
|
popupId: 'trackLabelMenu',
|
|
@@ -70,7 +93,7 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(
|
|
|
70
93
|
})
|
|
71
94
|
|
|
72
95
|
const onDragStart = (event: React.DragEvent<HTMLSpanElement>) => {
|
|
73
|
-
const target = event.
|
|
96
|
+
const target = event.currentTarget
|
|
74
97
|
if (target.parentNode) {
|
|
75
98
|
const parent = target.parentNode as HTMLElement
|
|
76
99
|
event.dataTransfer.setDragImage(parent, 20, 20)
|
|
@@ -78,69 +101,53 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(
|
|
|
78
101
|
}
|
|
79
102
|
}
|
|
80
103
|
|
|
81
|
-
const onDragEnd = () => {
|
|
82
|
-
view.setDraggingTrackId(undefined)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
let trackName = getConf(track, 'name')
|
|
86
|
-
if (getConf(track, 'type') === 'ReferenceSequenceTrack') {
|
|
87
|
-
const r = session.assemblies.find(a => a.sequence === trackConf)
|
|
88
|
-
trackName =
|
|
89
|
-
trackName ||
|
|
90
|
-
(r
|
|
91
|
-
? `Reference Sequence (${readConfObject(r, 'name')})`
|
|
92
|
-
: 'Reference Sequence')
|
|
93
|
-
}
|
|
94
|
-
|
|
95
104
|
const items = [
|
|
96
105
|
...(session.getTrackActionMenuItems?.(trackConf) || []),
|
|
97
106
|
...track.trackMenuItems(),
|
|
98
107
|
].sort((a, b) => (b.priority || 0) - (a.priority || 0))
|
|
99
108
|
|
|
100
109
|
return (
|
|
101
|
-
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
</IconButton>
|
|
136
|
-
</Paper>
|
|
110
|
+
<Paper ref={ref} className={cx(className, classes.root)}>
|
|
111
|
+
<span
|
|
112
|
+
draggable
|
|
113
|
+
className={classes.dragHandle}
|
|
114
|
+
onDragStart={onDragStart}
|
|
115
|
+
onDragEnd={() => view.setDraggingTrackId(undefined)}
|
|
116
|
+
data-testid={`dragHandle-${view.id}-${trackId}`}
|
|
117
|
+
>
|
|
118
|
+
<DragIcon className={classes.dragHandleIcon} fontSize="small" />
|
|
119
|
+
</span>
|
|
120
|
+
<IconButton
|
|
121
|
+
onClick={() => view.hideTrack(trackId)}
|
|
122
|
+
className={classes.iconButton}
|
|
123
|
+
title="close this track"
|
|
124
|
+
color="secondary"
|
|
125
|
+
>
|
|
126
|
+
<CloseIcon fontSize="small" />
|
|
127
|
+
</IconButton>
|
|
128
|
+
<Typography
|
|
129
|
+
variant="body1"
|
|
130
|
+
component="span"
|
|
131
|
+
className={classes.trackName}
|
|
132
|
+
>
|
|
133
|
+
{trackName}
|
|
134
|
+
</Typography>
|
|
135
|
+
<IconButton
|
|
136
|
+
{...bindTrigger(popupState)}
|
|
137
|
+
className={classes.iconButton}
|
|
138
|
+
color="secondary"
|
|
139
|
+
data-testid="track_menu_icon"
|
|
140
|
+
disabled={!items.length}
|
|
141
|
+
>
|
|
142
|
+
<MoreVertIcon fontSize="small" />
|
|
143
|
+
</IconButton>
|
|
137
144
|
<CascadingMenu
|
|
138
145
|
{...bindPopover(popupState)}
|
|
139
146
|
onMenuItemClick={(_: unknown, callback: Function) => callback()}
|
|
140
147
|
menuItems={items}
|
|
141
148
|
popupState={popupState}
|
|
142
149
|
/>
|
|
143
|
-
|
|
150
|
+
</Paper>
|
|
144
151
|
)
|
|
145
152
|
},
|
|
146
153
|
)
|
|
@@ -7,7 +7,7 @@ import normalizeWheel from 'normalize-wheel'
|
|
|
7
7
|
import { LinearGenomeViewStateModel, SCALE_BAR_HEIGHT } from '..'
|
|
8
8
|
import RubberBand from './RubberBand'
|
|
9
9
|
import ScaleBar from './ScaleBar'
|
|
10
|
-
import
|
|
10
|
+
import Gridlines from './Gridlines'
|
|
11
11
|
import CenterLine from './CenterLine'
|
|
12
12
|
|
|
13
13
|
const useStyles = makeStyles()({
|
|
@@ -168,7 +168,7 @@ function TracksContainer({
|
|
|
168
168
|
onMouseUp={mouseUp}
|
|
169
169
|
onMouseLeave={mouseLeave}
|
|
170
170
|
>
|
|
171
|
-
<
|
|
171
|
+
{model.showGridlines ? <Gridlines model={model} /> : null}
|
|
172
172
|
{model.showCenterLine ? <CenterLine model={model} /> : null}
|
|
173
173
|
|
|
174
174
|
<RubberBand
|
|
@@ -90,7 +90,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
90
90
|
class="tss-ig8oez-headerBar"
|
|
91
91
|
>
|
|
92
92
|
<button
|
|
93
|
-
class="MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium
|
|
93
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium tss-19jxj46-toggleButton css-1d3f8j8-MuiButtonBase-root-MuiButton-root"
|
|
94
94
|
tabindex="0"
|
|
95
95
|
title="Open track selector"
|
|
96
96
|
type="button"
|
|
@@ -117,7 +117,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
117
117
|
class="MuiFormGroup-root MuiFormGroup-row tss-4gub8h-headerForm css-qfz70r-MuiFormGroup-root"
|
|
118
118
|
>
|
|
119
119
|
<button
|
|
120
|
-
class="MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium
|
|
120
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
|
|
121
121
|
tabindex="0"
|
|
122
122
|
type="button"
|
|
123
123
|
>
|
|
@@ -137,7 +137,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
137
137
|
/>
|
|
138
138
|
</button>
|
|
139
139
|
<button
|
|
140
|
-
class="MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium
|
|
140
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
|
|
141
141
|
tabindex="0"
|
|
142
142
|
type="button"
|
|
143
143
|
>
|
|
@@ -166,7 +166,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
166
166
|
style="margin: 7px; min-width: 175px;"
|
|
167
167
|
>
|
|
168
168
|
<div
|
|
169
|
-
class="
|
|
169
|
+
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd MuiAutocomplete-inputRoot css-154xyx0-MuiInputBase-root-MuiOutlinedInput-root"
|
|
170
170
|
style="padding: 0px; height: 32px; background: rgba(255, 255, 255, 0.8);"
|
|
171
171
|
>
|
|
172
172
|
<input
|
|
@@ -175,7 +175,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
175
175
|
aria-invalid="false"
|
|
176
176
|
autocapitalize="none"
|
|
177
177
|
autocomplete="off"
|
|
178
|
-
class="
|
|
178
|
+
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputAdornedEnd MuiAutocomplete-input MuiAutocomplete-inputFocused css-nxo287-MuiInputBase-input-MuiOutlinedInput-input"
|
|
179
179
|
id="refNameAutocomplete-lgv"
|
|
180
180
|
placeholder="Search for location"
|
|
181
181
|
role="combobox"
|
|
@@ -265,7 +265,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
265
265
|
</svg>
|
|
266
266
|
</button>
|
|
267
267
|
<span
|
|
268
|
-
class="MuiSlider-
|
|
268
|
+
class="MuiSlider-root MuiSlider-colorPrimary MuiSlider-sizeSmall tss-1c03ro5-slider css-53tbrc-MuiSlider-root"
|
|
269
269
|
>
|
|
270
270
|
<span
|
|
271
271
|
class="MuiSlider-rail css-14pt78w-MuiSlider-rail"
|
|
@@ -275,7 +275,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
275
275
|
style="left: 0%; width: 0%;"
|
|
276
276
|
/>
|
|
277
277
|
<span
|
|
278
|
-
class="MuiSlider-
|
|
278
|
+
class="MuiSlider-thumb MuiSlider-thumbColorPrimary MuiSlider-thumbSizeSmall css-14gf62f-MuiSlider-thumb"
|
|
279
279
|
data-focusvisible="false"
|
|
280
280
|
data-index="0"
|
|
281
281
|
style="left: 0%;"
|
|
@@ -500,7 +500,6 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
500
500
|
<div
|
|
501
501
|
class="tss-1ql7uaq-trackRenderingContainer"
|
|
502
502
|
data-testid="trackRenderingContainer-lgv-testConfig"
|
|
503
|
-
role="presentation"
|
|
504
503
|
style="height: 100px;"
|
|
505
504
|
>
|
|
506
505
|
<div
|
|
@@ -656,7 +655,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
656
655
|
class="tss-ig8oez-headerBar"
|
|
657
656
|
>
|
|
658
657
|
<button
|
|
659
|
-
class="MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium
|
|
658
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium tss-19jxj46-toggleButton css-1d3f8j8-MuiButtonBase-root-MuiButton-root"
|
|
660
659
|
tabindex="0"
|
|
661
660
|
title="Open track selector"
|
|
662
661
|
type="button"
|
|
@@ -683,7 +682,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
683
682
|
class="MuiFormGroup-root MuiFormGroup-row tss-4gub8h-headerForm css-qfz70r-MuiFormGroup-root"
|
|
684
683
|
>
|
|
685
684
|
<button
|
|
686
|
-
class="MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium
|
|
685
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
|
|
687
686
|
tabindex="0"
|
|
688
687
|
type="button"
|
|
689
688
|
>
|
|
@@ -703,7 +702,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
703
702
|
/>
|
|
704
703
|
</button>
|
|
705
704
|
<button
|
|
706
|
-
class="MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium
|
|
705
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
|
|
707
706
|
tabindex="0"
|
|
708
707
|
type="button"
|
|
709
708
|
>
|
|
@@ -732,7 +731,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
732
731
|
style="margin: 7px; min-width: 175px;"
|
|
733
732
|
>
|
|
734
733
|
<div
|
|
735
|
-
class="
|
|
734
|
+
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd MuiAutocomplete-inputRoot css-154xyx0-MuiInputBase-root-MuiOutlinedInput-root"
|
|
736
735
|
style="padding: 0px; height: 32px; background: rgba(255, 255, 255, 0.8);"
|
|
737
736
|
>
|
|
738
737
|
<input
|
|
@@ -741,7 +740,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
741
740
|
aria-invalid="false"
|
|
742
741
|
autocapitalize="none"
|
|
743
742
|
autocomplete="off"
|
|
744
|
-
class="
|
|
743
|
+
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputAdornedEnd MuiAutocomplete-input MuiAutocomplete-inputFocused css-nxo287-MuiInputBase-input-MuiOutlinedInput-input"
|
|
745
744
|
id="refNameAutocomplete-lgv"
|
|
746
745
|
placeholder="Search for location"
|
|
747
746
|
role="combobox"
|
|
@@ -833,7 +832,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
833
832
|
/>
|
|
834
833
|
</button>
|
|
835
834
|
<span
|
|
836
|
-
class="MuiSlider-
|
|
835
|
+
class="MuiSlider-root MuiSlider-colorPrimary MuiSlider-sizeSmall tss-1c03ro5-slider css-53tbrc-MuiSlider-root"
|
|
837
836
|
>
|
|
838
837
|
<span
|
|
839
838
|
class="MuiSlider-rail css-14pt78w-MuiSlider-rail"
|
|
@@ -843,7 +842,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
843
842
|
style="left: 0%; width: 9.774680693120512%;"
|
|
844
843
|
/>
|
|
845
844
|
<span
|
|
846
|
-
class="MuiSlider-
|
|
845
|
+
class="MuiSlider-thumb MuiSlider-thumbColorPrimary MuiSlider-thumbSizeSmall css-14gf62f-MuiSlider-thumb"
|
|
847
846
|
data-focusvisible="false"
|
|
848
847
|
data-index="0"
|
|
849
848
|
style="left: 9.774680693120512%;"
|
|
@@ -1361,7 +1360,6 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
1361
1360
|
<div
|
|
1362
1361
|
class="tss-1ql7uaq-trackRenderingContainer"
|
|
1363
1362
|
data-testid="trackRenderingContainer-lgv-testConfig"
|
|
1364
|
-
role="presentation"
|
|
1365
1363
|
style="height: 100px;"
|
|
1366
1364
|
>
|
|
1367
1365
|
<div
|
|
@@ -1498,7 +1496,6 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
1498
1496
|
<div
|
|
1499
1497
|
class="tss-1ql7uaq-trackRenderingContainer"
|
|
1500
1498
|
data-testid="trackRenderingContainer-lgv-testConfig2"
|
|
1501
|
-
role="presentation"
|
|
1502
1499
|
style="height: 100px;"
|
|
1503
1500
|
>
|
|
1504
1501
|
<div
|
|
@@ -290,13 +290,13 @@ test('can navToMultiple', () => {
|
|
|
290
290
|
{ refName: 'ctgC', start: 0, end: 5000 },
|
|
291
291
|
])
|
|
292
292
|
expect(model.offsetPx).toBe(199)
|
|
293
|
-
expect(model.bpPerPx).toBeCloseTo(25.
|
|
293
|
+
expect(model.bpPerPx).toBeCloseTo(25.125)
|
|
294
294
|
|
|
295
295
|
model.navToMultiple([
|
|
296
296
|
{ refName: 'ctgA', start: 5000, end: 10000 },
|
|
297
297
|
{ refName: 'ctgC', start: 0, end: 5000 },
|
|
298
298
|
])
|
|
299
|
-
expect(model.offsetPx).toBe(
|
|
299
|
+
expect(model.offsetPx).toBe(2793)
|
|
300
300
|
expect(model.bpPerPx).toBeCloseTo(12.531)
|
|
301
301
|
})
|
|
302
302
|
|
|
@@ -330,7 +330,7 @@ describe('Zoom to selected displayed regions', () => {
|
|
|
330
330
|
// 'ctgA' 15000 bp+ 'ctgA' 10000 bp+ 'ctgB' 3000 bp = 28000 totalbp
|
|
331
331
|
expect(model.totalBp).toEqual(28000)
|
|
332
332
|
|
|
333
|
-
model.
|
|
333
|
+
model.moveTo(
|
|
334
334
|
{
|
|
335
335
|
start: 5000,
|
|
336
336
|
index: 0,
|
|
@@ -354,32 +354,8 @@ describe('Zoom to selected displayed regions', () => {
|
|
|
354
354
|
expect(model.bpPerPx).toBeCloseTo(31.408)
|
|
355
355
|
})
|
|
356
356
|
|
|
357
|
-
it('can select if start and end object are swapped', () => {
|
|
358
|
-
// should be same results as above test
|
|
359
|
-
model.zoomToDisplayedRegions(
|
|
360
|
-
{
|
|
361
|
-
start: 0,
|
|
362
|
-
index: 2,
|
|
363
|
-
coord: 1,
|
|
364
|
-
end: 3000,
|
|
365
|
-
offset: 1,
|
|
366
|
-
refName: 'ctgB',
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
start: 5000,
|
|
370
|
-
index: 0,
|
|
371
|
-
end: 20000,
|
|
372
|
-
coord: 5001,
|
|
373
|
-
offset: 0,
|
|
374
|
-
refName: 'ctgA',
|
|
375
|
-
},
|
|
376
|
-
)
|
|
377
|
-
expect(model.offsetPx).toEqual(0)
|
|
378
|
-
expect(model.bpPerPx).toBeCloseTo(31.408)
|
|
379
|
-
})
|
|
380
|
-
|
|
381
357
|
it('can select over one refSeq', () => {
|
|
382
|
-
model.
|
|
358
|
+
model.moveTo(
|
|
383
359
|
{
|
|
384
360
|
start: 5000,
|
|
385
361
|
index: 0,
|
|
@@ -404,7 +380,7 @@ describe('Zoom to selected displayed regions', () => {
|
|
|
404
380
|
})
|
|
405
381
|
|
|
406
382
|
it('can select one region with start or end outside of displayed region', () => {
|
|
407
|
-
model.
|
|
383
|
+
model.moveTo(
|
|
408
384
|
{
|
|
409
385
|
start: 5000,
|
|
410
386
|
index: 0,
|
|
@@ -423,7 +399,8 @@ describe('Zoom to selected displayed regions', () => {
|
|
|
423
399
|
},
|
|
424
400
|
)
|
|
425
401
|
// offsetPx is still 0 since we are starting from the first coord
|
|
426
|
-
|
|
402
|
+
// needed Math.abs since it was giving negative-zero (-0)
|
|
403
|
+
expect(Math.abs(model.offsetPx)).toEqual(0)
|
|
427
404
|
// endOffset 19000 - (-1) = 19001 / 800 = zoomTo(23.75)
|
|
428
405
|
expect(model.bpPerPx).toBeCloseTo(23.75)
|
|
429
406
|
expect(model.bpPerPx).toBeLessThan(largestBpPerPx)
|
|
@@ -434,7 +411,7 @@ describe('Zoom to selected displayed regions', () => {
|
|
|
434
411
|
model.showAllRegions()
|
|
435
412
|
expect(model.bpPerPx).toBeCloseTo(38.8888)
|
|
436
413
|
// totalBp = 28000 / 1000 = 28 as maxBpPerPx
|
|
437
|
-
model.
|
|
414
|
+
model.moveTo(
|
|
438
415
|
{
|
|
439
416
|
start: 5000,
|
|
440
417
|
index: 0,
|
|
@@ -468,7 +445,7 @@ describe('Zoom to selected displayed regions', () => {
|
|
|
468
445
|
// totalBp 15000 + 3000 + 35000 = 53000
|
|
469
446
|
// then 53000 / (width*0.9) = 73.6111
|
|
470
447
|
expect(model.bpPerPx).toBeCloseTo(73.61111)
|
|
471
|
-
model.
|
|
448
|
+
model.moveTo(
|
|
472
449
|
{
|
|
473
450
|
start: 5000,
|
|
474
451
|
coord: 15000,
|
|
@@ -533,7 +510,7 @@ test('can instantiate a model that >2 regions', () => {
|
|
|
533
510
|
{ refName: 'ctgB', index: 1, offset: 0, start: 0, end: 10000 },
|
|
534
511
|
{ refName: 'ctgC', index: 2, offset: 0, start: 0, end: 10000 },
|
|
535
512
|
)
|
|
536
|
-
expect(model.offsetPx).toEqual(10000 / model.bpPerPx
|
|
513
|
+
expect(model.offsetPx).toEqual(10000 / model.bpPerPx)
|
|
537
514
|
expect(model.displayedRegionsTotalPx).toEqual(30000 / model.bpPerPx)
|
|
538
515
|
model.showAllRegions()
|
|
539
516
|
expect(model.offsetPx).toEqual(-40)
|
|
@@ -659,7 +636,7 @@ test('can perform pxToBp on human genome things with ellided blocks (zoomed out)
|
|
|
659
636
|
|
|
660
637
|
// chrX after an ellided block, this tests a specific coord but should just be
|
|
661
638
|
// probably somewhat around here
|
|
662
|
-
expect(model.pxToBp(1228).coord).toBe(
|
|
639
|
+
expect(model.pxToBp(1228).coord).toBe(118604872)
|
|
663
640
|
expect(model.pxToBp(1228).refName).toBe('X')
|
|
664
641
|
|
|
665
642
|
// chrY_random at the end
|
|
@@ -688,7 +665,7 @@ test('can showAllRegionsInAssembly', async () => {
|
|
|
688
665
|
])
|
|
689
666
|
})
|
|
690
667
|
|
|
691
|
-
describe('
|
|
668
|
+
describe('get sequence for selected displayed regions', () => {
|
|
692
669
|
const { Session, LinearGenomeModel } = initialize()
|
|
693
670
|
/* the start of all the results should be +1
|
|
694
671
|
the sequence dialog then handles converting from 1-based closed to interbase
|
|
@@ -778,7 +755,7 @@ describe('Get Sequence for selected displayed regions', () => {
|
|
|
778
755
|
model.rightOffset,
|
|
779
756
|
)
|
|
780
757
|
|
|
781
|
-
expect(outOfBounds.length).toEqual(
|
|
758
|
+
expect(outOfBounds.length).toEqual(1)
|
|
782
759
|
})
|
|
783
760
|
|
|
784
761
|
it('selects multiple regions with a region in between', () => {
|
|
@@ -948,6 +925,7 @@ test('navToLocString with human assembly', () => {
|
|
|
948
925
|
assemblyManager: {
|
|
949
926
|
assemblies: {
|
|
950
927
|
hg38: {
|
|
928
|
+
// @ts-ignore
|
|
951
929
|
regions: hg38DisplayedRegions,
|
|
952
930
|
},
|
|
953
931
|
},
|