@jbrowse/plugin-linear-genome-view 2.6.3 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +4 -14
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +5 -6
- package/dist/BaseLinearDisplay/components/Tooltip.js +1 -1
- package/dist/BaseLinearDisplay/models/util.d.ts +2 -6
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +4 -5
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +3 -3
- package/dist/LinearBasicDisplay/model.d.ts +3 -1
- package/dist/LinearGenomeView/components/CenterLine.d.ts +3 -4
- package/dist/LinearGenomeView/components/CenterLine.js +3 -3
- package/dist/LinearGenomeView/components/Cytobands.d.ts +6 -2
- package/dist/LinearGenomeView/components/Cytobands.js +37 -38
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +3 -4
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +3 -3
- package/dist/LinearGenomeView/components/Gridlines.d.ts +3 -4
- package/dist/LinearGenomeView/components/Gridlines.js +21 -18
- package/dist/LinearGenomeView/components/ImportForm.d.ts +2 -2
- package/dist/LinearGenomeView/components/ImportForm.js +2 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +19 -1
- package/dist/LinearGenomeView/components/MiniControls.js +13 -5
- package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +2 -2
- package/dist/LinearGenomeView/components/OverviewRubberband.js +2 -1
- package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +2 -2
- package/dist/LinearGenomeView/components/OverviewScalebar.js +41 -13
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +2 -2
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +2 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +1 -3
- package/dist/LinearGenomeView/components/Rubberband.d.ts +4 -5
- package/dist/LinearGenomeView/components/Rubberband.js +3 -3
- package/dist/LinearGenomeView/components/Scalebar.d.ts +2 -2
- package/dist/LinearGenomeView/components/Scalebar.js +29 -24
- package/dist/LinearGenomeView/components/SearchBox.d.ts +4 -5
- package/dist/LinearGenomeView/components/SearchBox.js +3 -3
- package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -5
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js +20 -18
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +2 -2
- package/dist/LinearGenomeView/components/TrackContainer.js +2 -1
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +2 -2
- package/dist/LinearGenomeView/components/TrackLabel.js +5 -21
- package/dist/LinearGenomeView/components/TrackLabelDragHandle.d.ts +9 -0
- package/dist/LinearGenomeView/components/TrackLabelDragHandle.js +32 -0
- package/dist/LinearGenomeView/components/TrackRenderingContainer.d.ts +2 -2
- package/dist/LinearGenomeView/components/TrackRenderingContainer.js +2 -1
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +2 -2
- package/dist/LinearGenomeView/components/TracksContainer.js +2 -1
- package/dist/LinearGenomeView/components/VerticalGuide.d.ts +3 -4
- package/dist/LinearGenomeView/components/VerticalGuide.js +3 -3
- package/dist/LinearGenomeView/components/ZoomControls.d.ts +3 -4
- package/dist/LinearGenomeView/components/ZoomControls.js +3 -3
- package/dist/LinearGenomeView/components/util.d.ts +1 -1
- package/dist/LinearGenomeView/index.d.ts +1 -2
- package/dist/LinearGenomeView/index.js +3 -2
- package/dist/LinearGenomeView/model.d.ts +6 -6
- package/dist/LinearGenomeView/model.js +33 -0
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.js +2 -2
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +1 -4
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.js +2 -3
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js +1 -2
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +3 -1
- package/dist/index.d.ts +37 -37
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +4 -14
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +5 -5
- package/esm/BaseLinearDisplay/components/Tooltip.js +1 -1
- package/esm/BaseLinearDisplay/models/util.d.ts +2 -6
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +4 -5
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +3 -3
- package/esm/LinearBasicDisplay/model.d.ts +3 -1
- package/esm/LinearGenomeView/components/CenterLine.d.ts +3 -4
- package/esm/LinearGenomeView/components/CenterLine.js +3 -3
- package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -2
- package/esm/LinearGenomeView/components/Cytobands.js +37 -38
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +3 -4
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +3 -3
- package/esm/LinearGenomeView/components/Gridlines.d.ts +3 -4
- package/esm/LinearGenomeView/components/Gridlines.js +21 -18
- package/esm/LinearGenomeView/components/ImportForm.d.ts +2 -2
- package/esm/LinearGenomeView/components/ImportForm.js +2 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +20 -2
- package/esm/LinearGenomeView/components/MiniControls.js +13 -5
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +2 -2
- package/esm/LinearGenomeView/components/OverviewRubberband.js +2 -1
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +18 -13
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +2 -2
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +2 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +1 -3
- package/esm/LinearGenomeView/components/Rubberband.d.ts +4 -5
- package/esm/LinearGenomeView/components/Rubberband.js +3 -3
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/Scalebar.js +29 -24
- package/esm/LinearGenomeView/components/SearchBox.d.ts +4 -5
- package/esm/LinearGenomeView/components/SearchBox.js +3 -3
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -5
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +21 -19
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +2 -2
- package/esm/LinearGenomeView/components/TrackContainer.js +2 -1
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -2
- package/esm/LinearGenomeView/components/TrackLabel.js +5 -21
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +9 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +27 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +2 -2
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +2 -1
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +2 -2
- package/esm/LinearGenomeView/components/TracksContainer.js +2 -1
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +3 -4
- package/esm/LinearGenomeView/components/VerticalGuide.js +3 -3
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +3 -4
- package/esm/LinearGenomeView/components/ZoomControls.js +3 -3
- package/esm/LinearGenomeView/components/util.d.ts +1 -1
- package/esm/LinearGenomeView/index.d.ts +1 -2
- package/esm/LinearGenomeView/index.js +2 -2
- package/esm/LinearGenomeView/model.d.ts +6 -6
- package/esm/LinearGenomeView/model.js +33 -0
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +2 -5
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +3 -4
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +2 -3
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +3 -1
- package/esm/index.d.ts +37 -37
- package/package.json +4 -5
|
@@ -4,13 +4,13 @@ import { Dialog } from '@jbrowse/core/ui';
|
|
|
4
4
|
import { getSnapshot } from 'mobx-state-tree';
|
|
5
5
|
import { makeStyles } from 'tss-react/mui';
|
|
6
6
|
import { observer } from 'mobx-react';
|
|
7
|
-
import { getSession } from '@jbrowse/core/util';
|
|
7
|
+
import { getSession, isSessionWithAddTracks } from '@jbrowse/core/util';
|
|
8
8
|
const useStyles = makeStyles()({
|
|
9
9
|
dialogContent: {
|
|
10
10
|
width: '40em',
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
|
-
function
|
|
13
|
+
const SequenceSearchDialog = observer(function ({ model, handleClose, }) {
|
|
14
14
|
const { classes } = useStyles();
|
|
15
15
|
const [value, setValue] = useState('');
|
|
16
16
|
const [searchForward, setSearchForward] = useState(true);
|
|
@@ -40,24 +40,26 @@ function SequenceDialog({ model, handleClose, }) {
|
|
|
40
40
|
const session = getSession(model);
|
|
41
41
|
const { assemblyManager } = session;
|
|
42
42
|
const assemblyName = model.assemblyNames[0];
|
|
43
|
-
session
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
if (isSessionWithAddTracks(session)) {
|
|
44
|
+
session.addTrackConf({
|
|
45
|
+
trackId,
|
|
46
|
+
name: `Sequence search ${value}`,
|
|
47
|
+
assemblyNames: [assemblyName],
|
|
48
|
+
type: 'FeatureTrack',
|
|
49
|
+
adapter: {
|
|
50
|
+
type: 'SequenceSearchAdapter',
|
|
51
|
+
search: value,
|
|
52
|
+
searchForward,
|
|
53
|
+
searchReverse,
|
|
54
|
+
caseInsensitive,
|
|
55
|
+
sequenceAdapter: getSnapshot((_a = assemblyManager.get(assemblyName)) === null || _a === void 0 ? void 0 : _a.configuration.sequence.adapter),
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
model.showTrack(trackId);
|
|
59
|
+
}
|
|
58
60
|
}
|
|
59
61
|
handleClose();
|
|
60
62
|
}, variant: "contained", color: "primary" }, "Submit"),
|
|
61
63
|
React.createElement(Button, { onClick: () => handleClose(), variant: "contained", color: "secondary" }, "Close"))));
|
|
62
|
-
}
|
|
63
|
-
export default
|
|
64
|
+
});
|
|
65
|
+
export default SequenceSearchDialog;
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
3
|
import { LinearGenomeViewModel } from '..';
|
|
4
4
|
type LGV = LinearGenomeViewModel;
|
|
5
|
-
declare const
|
|
5
|
+
declare const TrackContainer: ({ model, track, }: {
|
|
6
6
|
model: LGV;
|
|
7
7
|
track: BaseTrackModel;
|
|
8
8
|
}) => React.JSX.Element;
|
|
9
|
-
export default
|
|
9
|
+
export default TrackContainer;
|
|
@@ -27,7 +27,7 @@ const useStyles = makeStyles()({
|
|
|
27
27
|
zIndex: 3,
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
const TrackContainer = observer(function ({ model, track, }) {
|
|
31
31
|
const { classes } = useStyles();
|
|
32
32
|
const display = track.displays[0];
|
|
33
33
|
const { draggingTrackId } = model;
|
|
@@ -54,3 +54,4 @@ export default observer(function TrackContainer({ model, track, }) {
|
|
|
54
54
|
}, onDragEnter: debouncedOnDragEnter }),
|
|
55
55
|
React.createElement(ResizeHandle, { onDrag: display.resizeHeight, className: classes.resizeHandle })));
|
|
56
56
|
});
|
|
57
|
+
export default TrackContainer;
|
|
@@ -4,5 +4,5 @@ interface Props {
|
|
|
4
4
|
track: BaseTrackModel;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
7
|
+
declare const TrackLabel: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default TrackLabel;
|
|
@@ -9,10 +9,10 @@ import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
|
9
9
|
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
10
10
|
// icons
|
|
11
11
|
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
12
|
-
import DragIcon from '@mui/icons-material/DragIndicator';
|
|
13
12
|
import CloseIcon from '@mui/icons-material/Close';
|
|
14
13
|
import MinimizeIcon from '@mui/icons-material/Minimize';
|
|
15
14
|
import AddIcon from '@mui/icons-material/Add';
|
|
15
|
+
import TrackLabelDragHandle from './TrackLabelDragHandle';
|
|
16
16
|
const useStyles = makeStyles()(theme => ({
|
|
17
17
|
root: {
|
|
18
18
|
background: alpha(theme.palette.background.paper, 0.8),
|
|
@@ -29,19 +29,11 @@ const useStyles = makeStyles()(theme => ({
|
|
|
29
29
|
fontSize: '0.8rem',
|
|
30
30
|
pointerEvents: 'none',
|
|
31
31
|
},
|
|
32
|
-
dragHandle: {
|
|
33
|
-
cursor: 'grab',
|
|
34
|
-
},
|
|
35
|
-
dragHandleIcon: {
|
|
36
|
-
display: 'inline-block',
|
|
37
|
-
verticalAlign: 'middle',
|
|
38
|
-
pointerEvents: 'none',
|
|
39
|
-
},
|
|
40
32
|
iconButton: {
|
|
41
33
|
padding: theme.spacing(1),
|
|
42
34
|
},
|
|
43
35
|
}));
|
|
44
|
-
const TrackLabel = React.forwardRef(function ({ track, className }, ref) {
|
|
36
|
+
const TrackLabel = observer(React.forwardRef(function TrackLabel2({ track, className }, ref) {
|
|
45
37
|
var _a;
|
|
46
38
|
const { classes, cx } = useStyles();
|
|
47
39
|
const view = getContainingView(track);
|
|
@@ -60,15 +52,7 @@ const TrackLabel = React.forwardRef(function ({ track, className }, ref) {
|
|
|
60
52
|
...track.trackMenuItems(),
|
|
61
53
|
].sort((a, b) => ((b === null || b === void 0 ? void 0 : b.priority) || 0) - ((a === null || a === void 0 ? void 0 : a.priority) || 0));
|
|
62
54
|
return (React.createElement(Paper, { ref: ref, className: cx(className, classes.root) },
|
|
63
|
-
React.createElement(
|
|
64
|
-
const target = event.currentTarget;
|
|
65
|
-
if (target.parentNode) {
|
|
66
|
-
const parent = target.parentNode;
|
|
67
|
-
event.dataTransfer.setDragImage(parent, 20, 20);
|
|
68
|
-
view.setDraggingTrackId(track.id);
|
|
69
|
-
}
|
|
70
|
-
}, onDragEnd: () => view.setDraggingTrackId(undefined), "data-testid": `dragHandle-${view.id}-${trackId}` },
|
|
71
|
-
React.createElement(DragIcon, { className: classes.dragHandleIcon, fontSize: "small" })),
|
|
55
|
+
React.createElement(TrackLabelDragHandle, { track: track, trackId: trackId, view: view }),
|
|
72
56
|
React.createElement(IconButton, { onClick: () => view.hideTrack(trackId), className: classes.iconButton, title: "close this track" },
|
|
73
57
|
React.createElement(CloseIcon, { fontSize: "small" })),
|
|
74
58
|
React.createElement(Typography, { variant: "body1", component: "span", className: classes.trackName },
|
|
@@ -77,5 +61,5 @@ const TrackLabel = React.forwardRef(function ({ track, className }, ref) {
|
|
|
77
61
|
.join(' ') })),
|
|
78
62
|
React.createElement(CascadingMenuButton, { menuItems: items, "data-testid": "track_menu_icon" },
|
|
79
63
|
React.createElement(MoreVertIcon, { fontSize: "small" }))));
|
|
80
|
-
});
|
|
81
|
-
export default
|
|
64
|
+
}));
|
|
65
|
+
export default TrackLabel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
|
+
import { LinearGenomeViewModel } from '..';
|
|
4
|
+
declare function TrackLabelDragHandle({ trackId, view, track, }: {
|
|
5
|
+
trackId: string;
|
|
6
|
+
track: BaseTrackModel;
|
|
7
|
+
view: LinearGenomeViewModel;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export default TrackLabelDragHandle;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { makeStyles } from 'tss-react/mui';
|
|
3
|
+
// icons
|
|
4
|
+
import DragIcon from '@mui/icons-material/DragIndicator';
|
|
5
|
+
const useStyles = makeStyles()({
|
|
6
|
+
dragHandle: {
|
|
7
|
+
cursor: 'grab',
|
|
8
|
+
},
|
|
9
|
+
dragHandleIcon: {
|
|
10
|
+
display: 'inline-block',
|
|
11
|
+
verticalAlign: 'middle',
|
|
12
|
+
pointerEvents: 'none',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
function TrackLabelDragHandle({ trackId, view, track, }) {
|
|
16
|
+
const { classes } = useStyles();
|
|
17
|
+
return (React.createElement("span", { draggable: true, className: classes.dragHandle, onDragStart: event => {
|
|
18
|
+
const target = event.currentTarget;
|
|
19
|
+
if (target.parentNode) {
|
|
20
|
+
const parent = target.parentNode;
|
|
21
|
+
event.dataTransfer.setDragImage(parent, 20, 20);
|
|
22
|
+
view.setDraggingTrackId(track.id);
|
|
23
|
+
}
|
|
24
|
+
}, onDragEnd: () => view.setDraggingTrackId(undefined), "data-testid": `dragHandle-${view.id}-${trackId}` },
|
|
25
|
+
React.createElement(DragIcon, { className: classes.dragHandleIcon, fontSize: "small" })));
|
|
26
|
+
}
|
|
27
|
+
export default TrackLabelDragHandle;
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
3
|
import { LinearGenomeViewModel } from '..';
|
|
4
4
|
type LGV = LinearGenomeViewModel;
|
|
5
|
-
declare const
|
|
5
|
+
declare const TrackRenderingContainer: ({ model, track, onDragEnter, }: {
|
|
6
6
|
model: LGV;
|
|
7
7
|
track: BaseTrackModel;
|
|
8
8
|
onDragEnter: () => void;
|
|
9
9
|
}) => React.JSX.Element;
|
|
10
|
-
export default
|
|
10
|
+
export default TrackRenderingContainer;
|
|
@@ -22,7 +22,7 @@ const useStyles = makeStyles()({
|
|
|
22
22
|
zIndex: 2,
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
|
-
|
|
25
|
+
const TrackRenderingContainer = observer(function ({ model, track, onDragEnter, }) {
|
|
26
26
|
const { classes } = useStyles();
|
|
27
27
|
const display = track.displays[0];
|
|
28
28
|
const { height, RenderingComponent, DisplayBlurb } = display;
|
|
@@ -48,3 +48,4 @@ export default observer(function TrackRenderingContainer({ model, track, onDragE
|
|
|
48
48
|
} },
|
|
49
49
|
React.createElement(DisplayBlurb, { model: display }))) : null)) : null));
|
|
50
50
|
});
|
|
51
|
+
export default TrackRenderingContainer;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
declare const
|
|
4
|
+
declare const TracksContainer: ({ children, model, }: {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
model: LGV;
|
|
7
7
|
}) => React.JSX.Element;
|
|
8
|
-
export default
|
|
8
|
+
export default TracksContainer;
|
|
@@ -19,7 +19,7 @@ const useStyles = makeStyles()({
|
|
|
19
19
|
overflow: 'hidden',
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
const TracksContainer = observer(function TracksContainer({ children, model, }) {
|
|
23
23
|
const { classes } = useStyles();
|
|
24
24
|
const { pluginManager } = getEnv(model);
|
|
25
25
|
const { mouseDown: mouseDown1, mouseUp } = useSideScroll(model);
|
|
@@ -42,3 +42,4 @@ export default observer(function TracksContainer({ children, model, }) {
|
|
|
42
42
|
additional,
|
|
43
43
|
children));
|
|
44
44
|
});
|
|
45
|
+
export default TracksContainer;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
declare
|
|
4
|
+
declare const VerticalGuide: ({ model, coordX, }: {
|
|
5
5
|
model: LGV;
|
|
6
6
|
coordX: number;
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default VerticalGuide;
|
|
@@ -12,12 +12,12 @@ const useStyles = makeStyles()({
|
|
|
12
12
|
zIndex: 10,
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
-
function VerticalGuide({ model, coordX }) {
|
|
15
|
+
const VerticalGuide = observer(function VerticalGuide({ model, coordX, }) {
|
|
16
16
|
const { classes } = useStyles();
|
|
17
17
|
return (React.createElement(Tooltip, { open: true, placement: "top", title: stringify(model.pxToBp(coordX)), arrow: true },
|
|
18
18
|
React.createElement("div", { className: classes.guide, style: {
|
|
19
19
|
left: coordX,
|
|
20
20
|
background: 'red',
|
|
21
21
|
} })));
|
|
22
|
-
}
|
|
23
|
-
export default
|
|
22
|
+
});
|
|
23
|
+
export default VerticalGuide;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearGenomeViewModel } from '..';
|
|
3
|
-
declare
|
|
3
|
+
declare const ZoomControls: ({ model, }: {
|
|
4
4
|
model: LinearGenomeViewModel;
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
export default _default;
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
export default ZoomControls;
|
|
@@ -15,7 +15,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
15
15
|
color: theme.palette.text.secondary,
|
|
16
16
|
},
|
|
17
17
|
}));
|
|
18
|
-
|
|
18
|
+
const ZoomControls = observer(function ({ model, }) {
|
|
19
19
|
const { classes } = useStyles();
|
|
20
20
|
const { maxBpPerPx, minBpPerPx, bpPerPx, scaleFactor } = model;
|
|
21
21
|
const [value, setValue] = useState(-Math.log2(bpPerPx) * 100);
|
|
@@ -28,5 +28,5 @@ function ZoomControls({ model }) {
|
|
|
28
28
|
React.createElement(Slider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChange: (_, val) => setValue(val), onChangeCommitted: () => model.zoomTo(2 ** (-value / 100)), disabled: scaleFactor !== 1 }),
|
|
29
29
|
React.createElement(IconButton, { "data-testid": "zoom_in", onClick: () => model.zoom(model.bpPerPx / 2), disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1, size: "large" },
|
|
30
30
|
React.createElement(ZoomIn, null))));
|
|
31
|
-
}
|
|
32
|
-
export default
|
|
31
|
+
});
|
|
32
|
+
export default ZoomControls;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { ViewType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
3
|
import { stateModelFactory } from './model';
|
|
4
|
-
export default (pluginManager)
|
|
4
|
+
export default function LinearGenomeViewF(pluginManager) {
|
|
5
5
|
pluginManager.addViewType(() => {
|
|
6
6
|
return new ViewType({
|
|
7
7
|
name: 'LinearGenomeView',
|
|
@@ -10,5 +10,5 @@ export default (pluginManager) => {
|
|
|
10
10
|
ReactComponent: lazy(() => import('./components/LinearGenomeView')),
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
14
|
export * from './model';
|
|
@@ -87,12 +87,10 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
87
87
|
volatileWidth: number | undefined;
|
|
88
88
|
minimumBlockWidth: number;
|
|
89
89
|
draggingTrackId: string | undefined;
|
|
90
|
-
volatileError:
|
|
90
|
+
volatileError: unknown;
|
|
91
91
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
92
92
|
scaleFactor: number;
|
|
93
|
-
trackRefs:
|
|
94
|
-
[key: string]: HTMLDivElement;
|
|
95
|
-
};
|
|
93
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
96
94
|
coarseDynamicBlocks: BaseBlock[];
|
|
97
95
|
coarseTotalBp: number;
|
|
98
96
|
leftOffset: BpOffset | undefined;
|
|
@@ -170,7 +168,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
170
168
|
/**
|
|
171
169
|
* #getter
|
|
172
170
|
*/
|
|
173
|
-
readonly error:
|
|
171
|
+
readonly error: {};
|
|
174
172
|
/**
|
|
175
173
|
* #getter
|
|
176
174
|
*/
|
|
@@ -224,7 +222,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
224
222
|
/**
|
|
225
223
|
* #action
|
|
226
224
|
*/
|
|
227
|
-
setError(error:
|
|
225
|
+
setError(error: unknown): void;
|
|
228
226
|
/**
|
|
229
227
|
* #action
|
|
230
228
|
*/
|
|
@@ -545,6 +543,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
545
543
|
end: number;
|
|
546
544
|
reversed: boolean;
|
|
547
545
|
} | undefined;
|
|
546
|
+
} & {
|
|
547
|
+
afterCreate(): void;
|
|
548
548
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
549
549
|
export type LinearGenomeViewStateModel = ReturnType<typeof stateModelFactory>;
|
|
550
550
|
export type LinearGenomeViewModel = Instance<LinearGenomeViewStateModel>;
|
|
@@ -1227,6 +1227,39 @@ export function stateModelFactory(pluginManager) {
|
|
|
1227
1227
|
? this.pxToBp(self.width / 2)
|
|
1228
1228
|
: undefined;
|
|
1229
1229
|
},
|
|
1230
|
+
}))
|
|
1231
|
+
.actions(self => ({
|
|
1232
|
+
afterCreate() {
|
|
1233
|
+
function handler(e) {
|
|
1234
|
+
const session = getSession(self);
|
|
1235
|
+
if (session.focusedViewId === self.id && (e.ctrlKey || e.metaKey)) {
|
|
1236
|
+
if (e.code === 'ArrowLeft') {
|
|
1237
|
+
e.preventDefault();
|
|
1238
|
+
// pan left
|
|
1239
|
+
self.slide(-0.9);
|
|
1240
|
+
}
|
|
1241
|
+
if (e.code === 'ArrowRight') {
|
|
1242
|
+
e.preventDefault();
|
|
1243
|
+
// pan right
|
|
1244
|
+
self.slide(0.9);
|
|
1245
|
+
}
|
|
1246
|
+
if (e.code === 'ArrowUp' && self.scaleFactor === 1) {
|
|
1247
|
+
e.preventDefault();
|
|
1248
|
+
// zoom in
|
|
1249
|
+
self.zoom(self.bpPerPx / 2);
|
|
1250
|
+
}
|
|
1251
|
+
if (e.code === 'ArrowDown' && self.scaleFactor === 1) {
|
|
1252
|
+
e.preventDefault();
|
|
1253
|
+
// zoom out
|
|
1254
|
+
self.zoom(self.bpPerPx * 2);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
document.addEventListener('keydown', handler);
|
|
1259
|
+
addDisposer(self, () => {
|
|
1260
|
+
document.removeEventListener('keydown', handler);
|
|
1261
|
+
});
|
|
1262
|
+
},
|
|
1230
1263
|
}));
|
|
1231
1264
|
}
|
|
1232
1265
|
export { default as ReactComponent, default as LinearGenomeView, } from './components/LinearGenomeView';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTheme } from '@mui/material';
|
|
3
|
-
import
|
|
3
|
+
import { stripAlpha } from '@jbrowse/core/util';
|
|
4
4
|
export default function SVGBackground({ width, height, shift, }) {
|
|
5
5
|
const theme = useTheme();
|
|
6
|
-
return (React.createElement("rect", { width: width + shift * 2, height: height, fill:
|
|
6
|
+
return (React.createElement("rect", { width: width + shift * 2, height: height, fill: stripAlpha(theme.palette.background.default) }));
|
|
7
7
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getSession } from '@jbrowse/core/util';
|
|
2
|
+
import { getSession, stripAlpha } from '@jbrowse/core/util';
|
|
3
3
|
import Base1DView from '@jbrowse/core/util/Base1DViewModel';
|
|
4
4
|
import { useTheme } from '@mui/material';
|
|
5
|
-
import Color from 'color';
|
|
6
5
|
// locals
|
|
7
6
|
import { HEADER_OVERVIEW_HEIGHT } from '..';
|
|
8
7
|
import Cytobands from '../components/Cytobands';
|
|
@@ -15,7 +14,7 @@ export default function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight
|
|
|
15
14
|
const assemblyName = assemblyNames.length > 1 ? '' : assemblyNames[0];
|
|
16
15
|
const assembly = assemblyManager.get(assemblyName);
|
|
17
16
|
const theme = useTheme();
|
|
18
|
-
const c =
|
|
17
|
+
const c = stripAlpha(theme.palette.text.primary);
|
|
19
18
|
const overview = Base1DView.create({
|
|
20
19
|
displayedRegions: JSON.parse(JSON.stringify(displayedRegions)),
|
|
21
20
|
interRegionPaddingWidth: 0,
|
|
@@ -28,9 +27,7 @@ export default function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight
|
|
|
28
27
|
overview.setVolatileWidth(width);
|
|
29
28
|
overview.showAllRegions();
|
|
30
29
|
const block = overview.dynamicBlocks.contentBlocks[0];
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
32
30
|
const first = visibleRegions.at(0);
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
34
31
|
const last = visibleRegions.at(-1);
|
|
35
32
|
const firstOverviewPx = overview.bpToPx({
|
|
36
33
|
...first,
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getTickDisplayStr } from '@jbrowse/core/util';
|
|
2
|
+
import { getTickDisplayStr, stripAlpha } from '@jbrowse/core/util';
|
|
3
3
|
import { useTheme } from '@mui/material';
|
|
4
4
|
// locals
|
|
5
5
|
import { makeTicks } from '../util';
|
|
6
6
|
import SVGRegionSeparators from './SVGRegionSeparators';
|
|
7
|
-
import Color from 'color';
|
|
8
7
|
function Ruler({ start, end, bpPerPx, reversed = false, major = true, minor = true, hideText = false, }) {
|
|
9
8
|
const ticks = makeTicks(start, end, bpPerPx, major, minor);
|
|
10
9
|
const theme = useTheme();
|
|
11
|
-
const c =
|
|
10
|
+
const c = stripAlpha(theme.palette.text.secondary);
|
|
12
11
|
return (React.createElement(React.Fragment, null,
|
|
13
12
|
ticks.map(tick => {
|
|
14
13
|
const x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
|
|
@@ -27,7 +26,7 @@ export default function SVGRuler({ model, fontSize, }) {
|
|
|
27
26
|
const { dynamicBlocks: { contentBlocks }, offsetPx: viewOffsetPx, bpPerPx, } = model;
|
|
28
27
|
const renderRuler = contentBlocks.length < 5;
|
|
29
28
|
const theme = useTheme();
|
|
30
|
-
const c =
|
|
29
|
+
const c = stripAlpha(theme.palette.text.primary);
|
|
31
30
|
return (React.createElement(React.Fragment, null,
|
|
32
31
|
React.createElement(SVGRegionSeparators, { model: model, height: 30 }),
|
|
33
32
|
contentBlocks.map(block => {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getBpDisplayStr } from '@jbrowse/core/util';
|
|
2
|
+
import { getBpDisplayStr, stripAlpha } from '@jbrowse/core/util';
|
|
3
3
|
import { useTheme } from '@mui/material';
|
|
4
|
-
import Color from 'color';
|
|
5
4
|
export default function SVGScalebar({ model, fontSize, }) {
|
|
6
5
|
const { offsetPx, dynamicBlocks: { totalWidthPxWithoutBorders: totalWidthPx, totalBp }, } = model;
|
|
7
6
|
const theme = useTheme();
|
|
8
7
|
const displayBp = getBpDisplayStr(totalBp);
|
|
9
8
|
const x0 = Math.max(-offsetPx, 0);
|
|
10
9
|
const x1 = x0 + totalWidthPx;
|
|
11
|
-
const c =
|
|
10
|
+
const c = stripAlpha(theme.palette.text.secondary);
|
|
12
11
|
const x = x0 + (x1 - x0) / 2;
|
|
13
12
|
const y = fontSize;
|
|
14
13
|
return (React.createElement(React.Fragment, null,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTheme } from '@mui/material';
|
|
3
|
+
import { coarseStripHTML } from '@jbrowse/core/util';
|
|
3
4
|
export default function SVGTrackLabel({ trackLabels, trackName, fontSize, trackLabelOffset, x, }) {
|
|
4
5
|
const theme = useTheme();
|
|
5
6
|
const fill = theme.palette.text.primary;
|
|
6
7
|
const xoff = trackLabels === 'overlay' ? 5 : 0;
|
|
7
8
|
const yoff = trackLabels === 'offset' ? 5 : 0;
|
|
8
|
-
|
|
9
|
+
const name = coarseStripHTML(trackName);
|
|
10
|
+
return trackLabels !== 'none' ? (React.createElement("g", null, trackLabels === 'left' ? (React.createElement("text", { x: trackLabelOffset - 40, y: 20, fill: fill, fontSize: fontSize, dominantBaseline: "hanging", textAnchor: "end" }, name)) : (React.createElement("text", { x: x + xoff, y: yoff, fill: fill, fontSize: fontSize, dominantBaseline: "hanging" }, name)))) : null;
|
|
9
11
|
}
|