@jbrowse/plugin-linear-genome-view 1.6.9 → 1.7.3
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.d.ts +13 -13
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +232 -0
- package/dist/BaseLinearDisplay/components/Block.d.ts +15 -15
- package/dist/BaseLinearDisplay/components/Block.js +86 -0
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +12 -12
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +110 -0
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -4
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +192 -0
- package/dist/BaseLinearDisplay/index.d.ts +5 -5
- package/dist/BaseLinearDisplay/index.js +41 -0
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +227 -230
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +763 -0
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +24 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -96
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +328 -0
- package/dist/LinearBareDisplay/configSchema.d.ts +2 -2
- package/dist/LinearBareDisplay/configSchema.js +19 -0
- package/dist/LinearBareDisplay/index.d.ts +2 -2
- package/dist/LinearBareDisplay/index.js +21 -0
- package/dist/LinearBareDisplay/index.test.js +33 -0
- package/dist/LinearBareDisplay/model.d.ts +192 -192
- package/dist/LinearBareDisplay/model.js +44 -0
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -10
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +94 -0
- package/dist/LinearBasicDisplay/configSchema.d.ts +2 -2
- package/dist/LinearBasicDisplay/configSchema.js +25 -0
- package/dist/LinearBasicDisplay/index.d.ts +2 -2
- package/dist/LinearBasicDisplay/index.js +23 -0
- package/dist/LinearBasicDisplay/model.d.ts +213 -213
- package/dist/LinearBasicDisplay/model.js +162 -0
- package/dist/LinearGenomeView/components/CenterLine.d.ts +14 -14
- package/dist/LinearGenomeView/components/CenterLine.js +80 -0
- package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -6
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +137 -0
- package/dist/LinearGenomeView/components/Header.d.ts +7 -7
- package/dist/LinearGenomeView/components/Header.js +144 -0
- package/dist/LinearGenomeView/components/HelpDialog.d.ts +5 -5
- package/dist/LinearGenomeView/components/HelpDialog.js +48 -0
- package/dist/LinearGenomeView/components/ImportForm.d.ts +7 -7
- package/dist/LinearGenomeView/components/ImportForm.js +330 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +7 -7
- package/dist/LinearGenomeView/components/LinearGenomeView.js +129 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.test.js +234 -0
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -4
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +349 -0
- package/dist/LinearGenomeView/components/MiniControls.d.ts +6 -6
- package/dist/LinearGenomeView/components/MiniControls.js +83 -0
- package/dist/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -22
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +310 -0
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +132 -124
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +403 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +21 -21
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +331 -0
- package/dist/LinearGenomeView/components/RubberBand.d.ts +9 -20
- package/dist/LinearGenomeView/components/RubberBand.js +309 -0
- package/dist/LinearGenomeView/components/Ruler.d.ts +27 -27
- package/dist/LinearGenomeView/components/Ruler.js +101 -0
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +401 -401
- package/dist/LinearGenomeView/components/ScaleBar.js +184 -0
- package/dist/LinearGenomeView/components/ScaleBar.test.js +180 -0
- package/dist/LinearGenomeView/components/SearchBox.d.ts +8 -8
- package/dist/LinearGenomeView/components/SearchBox.js +201 -0
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +8 -8
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +159 -0
- package/dist/LinearGenomeView/components/SequenceDialog.d.ts +8 -8
- package/dist/LinearGenomeView/components/SequenceDialog.js +304 -0
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +9 -9
- package/dist/LinearGenomeView/components/TrackContainer.js +179 -0
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +44 -44
- package/dist/LinearGenomeView/components/TrackLabel.js +165 -0
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +10 -10
- package/dist/LinearGenomeView/components/TracksContainer.js +214 -0
- package/dist/LinearGenomeView/components/VerticalGuides.d.ts +9 -9
- package/dist/LinearGenomeView/components/VerticalGuides.js +116 -0
- package/dist/LinearGenomeView/components/ZoomControls.d.ts +7 -7
- package/dist/LinearGenomeView/components/ZoomControls.js +92 -0
- package/dist/LinearGenomeView/components/util.d.ts +2 -2
- package/dist/LinearGenomeView/components/util.js +16 -0
- package/dist/LinearGenomeView/index.d.ts +292 -292
- package/dist/LinearGenomeView/index.js +1418 -0
- package/dist/LinearGenomeView/index.test.js +1170 -0
- package/dist/LinearGenomeView/util.d.ts +14 -14
- package/dist/LinearGenomeView/util.js +93 -0
- package/dist/LinearGenomeView/util.test.js +78 -0
- package/dist/index.d.ts +565 -565
- package/dist/index.js +293 -6
- package/package.json +6 -9
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +2 -0
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +10 -8
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +1 -1
- package/src/LinearBasicDisplay/model.ts +17 -18
- package/src/LinearGenomeView/components/Header.tsx +1 -1
- package/src/LinearGenomeView/components/ImportForm.tsx +10 -4
- package/src/LinearGenomeView/components/LinearGenomeView.test.js +1 -0
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +2 -2
- package/src/LinearGenomeView/components/RubberBand.tsx +14 -24
- package/src/LinearGenomeView/components/ScaleBar.test.tsx +1 -0
- package/src/LinearGenomeView/components/ScaleBar.tsx +3 -6
- package/src/LinearGenomeView/components/SequenceDialog.tsx +1 -1
- package/src/LinearGenomeView/components/TrackLabel.tsx +1 -1
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +0 -4
- package/src/LinearGenomeView/index.tsx +2 -3
- package/dist/LinearBareDisplay/index.test.d.ts +0 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.test.d.ts +0 -1
- package/dist/plugin-linear-genome-view.cjs.development.js +0 -8121
- package/dist/plugin-linear-genome-view.cjs.development.js.map +0 -1
- package/dist/plugin-linear-genome-view.cjs.production.min.js +0 -2
- package/dist/plugin-linear-genome-view.cjs.production.min.js.map +0 -1
- package/dist/plugin-linear-genome-view.esm.js +0 -8105
- package/dist/plugin-linear-genome-view.esm.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactPropTypes from 'prop-types';
|
|
3
|
-
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
4
|
-
import { LinearGenomeViewModel } from '..';
|
|
5
|
-
declare type LGV = LinearGenomeViewModel;
|
|
6
|
-
declare function OverviewRubberBand({ model, overview, ControlComponent, }: {
|
|
7
|
-
model: LGV;
|
|
8
|
-
overview: Base1DViewModel;
|
|
9
|
-
ControlComponent?: React.ReactElement;
|
|
10
|
-
}): JSX.Element;
|
|
11
|
-
declare namespace OverviewRubberBand {
|
|
12
|
-
var propTypes: {
|
|
13
|
-
model: ReactPropTypes.Validator<any>;
|
|
14
|
-
overview: ReactPropTypes.Validator<any>;
|
|
15
|
-
ControlComponent: ReactPropTypes.Requireable<ReactPropTypes.ReactNodeLike>;
|
|
16
|
-
};
|
|
17
|
-
var defaultProps: {
|
|
18
|
-
ControlComponent: JSX.Element;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
declare const _default: typeof OverviewRubberBand;
|
|
22
|
-
export default _default;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactPropTypes from 'prop-types';
|
|
3
|
+
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
4
|
+
import { LinearGenomeViewModel } from '..';
|
|
5
|
+
declare type LGV = LinearGenomeViewModel;
|
|
6
|
+
declare function OverviewRubberBand({ model, overview, ControlComponent, }: {
|
|
7
|
+
model: LGV;
|
|
8
|
+
overview: Base1DViewModel;
|
|
9
|
+
ControlComponent?: React.ReactElement;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
declare namespace OverviewRubberBand {
|
|
12
|
+
var propTypes: {
|
|
13
|
+
model: ReactPropTypes.Validator<any>;
|
|
14
|
+
overview: ReactPropTypes.Validator<any>;
|
|
15
|
+
ControlComponent: ReactPropTypes.Requireable<ReactPropTypes.ReactNodeLike>;
|
|
16
|
+
};
|
|
17
|
+
var defaultProps: {
|
|
18
|
+
ControlComponent: JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
declare const _default: typeof OverviewRubberBand;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _core = require("@material-ui/core");
|
|
17
|
+
|
|
18
|
+
var _util = require("@jbrowse/core/util");
|
|
19
|
+
|
|
20
|
+
var _mobxReact = require("mobx-react");
|
|
21
|
+
|
|
22
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
+
|
|
24
|
+
var _ = require("..");
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
var useStyles = (0, _core.makeStyles)(function (theme) {
|
|
31
|
+
var _theme$palette = theme.palette,
|
|
32
|
+
tertiary = _theme$palette.tertiary,
|
|
33
|
+
primary = _theme$palette.primary;
|
|
34
|
+
var background = tertiary ? (0, _core.alpha)(tertiary.main, 0.7) : (0, _core.alpha)(primary.main, 0.7);
|
|
35
|
+
return {
|
|
36
|
+
rubberBand: {
|
|
37
|
+
height: '100%',
|
|
38
|
+
background: background,
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
zIndex: 10,
|
|
41
|
+
textAlign: 'center',
|
|
42
|
+
overflow: 'hidden'
|
|
43
|
+
},
|
|
44
|
+
rubberBandControl: {
|
|
45
|
+
cursor: 'crosshair',
|
|
46
|
+
width: '100%',
|
|
47
|
+
minHeight: 8
|
|
48
|
+
},
|
|
49
|
+
rubberBandText: {
|
|
50
|
+
color: tertiary ? tertiary.contrastText : primary.contrastText
|
|
51
|
+
},
|
|
52
|
+
popover: {
|
|
53
|
+
mouseEvents: 'none',
|
|
54
|
+
cursor: 'crosshair'
|
|
55
|
+
},
|
|
56
|
+
paper: {
|
|
57
|
+
paddingLeft: theme.spacing(1),
|
|
58
|
+
paddingRight: theme.spacing(1)
|
|
59
|
+
},
|
|
60
|
+
guide: {
|
|
61
|
+
pointerEvents: 'none',
|
|
62
|
+
height: '100%',
|
|
63
|
+
width: 1,
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
zIndex: 10
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
var HoverTooltip = (0, _mobxReact.observer)(function (_ref) {
|
|
70
|
+
var _assembly$cytobands;
|
|
71
|
+
|
|
72
|
+
var model = _ref.model,
|
|
73
|
+
open = _ref.open,
|
|
74
|
+
guideX = _ref.guideX,
|
|
75
|
+
overview = _ref.overview;
|
|
76
|
+
var classes = useStyles();
|
|
77
|
+
var cytobandOffset = model.cytobandOffset;
|
|
78
|
+
|
|
79
|
+
var _getSession = (0, _util.getSession)(model),
|
|
80
|
+
assemblyManager = _getSession.assemblyManager;
|
|
81
|
+
|
|
82
|
+
var px = overview.pxToBp(guideX - cytobandOffset);
|
|
83
|
+
var assembly = assemblyManager.get(px.assemblyName);
|
|
84
|
+
var cytoband = assembly === null || assembly === void 0 ? void 0 : (_assembly$cytobands = assembly.cytobands) === null || _assembly$cytobands === void 0 ? void 0 : _assembly$cytobands.find(function (f) {
|
|
85
|
+
return px.coord > f.get('start') && px.coord < f.get('end') && px.refName === assembly.getCanonicalRefName(f.get('refName'));
|
|
86
|
+
});
|
|
87
|
+
return /*#__PURE__*/_react["default"].createElement(_core.Tooltip, {
|
|
88
|
+
open: open,
|
|
89
|
+
placement: "top",
|
|
90
|
+
title: [(0, _util.stringify)(px), cytoband === null || cytoband === void 0 ? void 0 : cytoband.get('name')].join(' '),
|
|
91
|
+
arrow: true
|
|
92
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
93
|
+
className: classes.guide,
|
|
94
|
+
style: {
|
|
95
|
+
left: guideX
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
function OverviewRubberBand(_ref2) {
|
|
101
|
+
var model = _ref2.model,
|
|
102
|
+
overview = _ref2.overview,
|
|
103
|
+
_ref2$ControlComponen = _ref2.ControlComponent,
|
|
104
|
+
ControlComponent = _ref2$ControlComponen === void 0 ? /*#__PURE__*/_react["default"].createElement("div", null) : _ref2$ControlComponen;
|
|
105
|
+
var cytobandOffset = model.cytobandOffset;
|
|
106
|
+
|
|
107
|
+
var _useState = (0, _react.useState)(),
|
|
108
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
109
|
+
startX = _useState2[0],
|
|
110
|
+
setStartX = _useState2[1];
|
|
111
|
+
|
|
112
|
+
var _useState3 = (0, _react.useState)(),
|
|
113
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
114
|
+
currentX = _useState4[0],
|
|
115
|
+
setCurrentX = _useState4[1];
|
|
116
|
+
|
|
117
|
+
var _useState5 = (0, _react.useState)(),
|
|
118
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
119
|
+
guideX = _useState6[0],
|
|
120
|
+
setGuideX = _useState6[1];
|
|
121
|
+
|
|
122
|
+
var controlsRef = (0, _react.useRef)(null);
|
|
123
|
+
var rubberBandRef = (0, _react.useRef)(null);
|
|
124
|
+
var classes = useStyles();
|
|
125
|
+
var mouseDragging = startX !== undefined;
|
|
126
|
+
(0, _react.useEffect)(function () {
|
|
127
|
+
function globalMouseMove(event) {
|
|
128
|
+
var ref = controlsRef.current;
|
|
129
|
+
|
|
130
|
+
if (ref && mouseDragging) {
|
|
131
|
+
var relativeX = event.clientX - ref.getBoundingClientRect().left;
|
|
132
|
+
setCurrentX(relativeX);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function globalMouseUp() {
|
|
137
|
+
if (controlsRef.current && startX !== undefined && currentX !== undefined) {
|
|
138
|
+
if (Math.abs(currentX - startX) > 3) {
|
|
139
|
+
model.zoomToDisplayedRegions(overview.pxToBp(startX - cytobandOffset), overview.pxToBp(currentX - cytobandOffset));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/* handling clicking and centering at a specific Bp */
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
if (controlsRef.current && startX !== undefined && currentX === undefined) {
|
|
146
|
+
var clickedAt = overview.pxToBp(startX - cytobandOffset);
|
|
147
|
+
model.centerAt(Math.round(clickedAt.coord), clickedAt.refName, clickedAt.index);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
setStartX(undefined);
|
|
151
|
+
setCurrentX(undefined);
|
|
152
|
+
|
|
153
|
+
if (startX !== undefined) {
|
|
154
|
+
setGuideX(undefined);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function globalKeyDown(event) {
|
|
159
|
+
if (event.key === 'Escape') {
|
|
160
|
+
setStartX(undefined);
|
|
161
|
+
setCurrentX(undefined);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (mouseDragging) {
|
|
166
|
+
window.addEventListener('mousemove', globalMouseMove, true);
|
|
167
|
+
window.addEventListener('mouseup', globalMouseUp, true);
|
|
168
|
+
window.addEventListener('keydown', globalKeyDown, true);
|
|
169
|
+
return function () {
|
|
170
|
+
window.removeEventListener('mousemove', globalMouseMove, true);
|
|
171
|
+
window.removeEventListener('mouseup', globalMouseUp, true);
|
|
172
|
+
window.removeEventListener('keydown', globalKeyDown, true);
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return function () {};
|
|
177
|
+
}, [mouseDragging, currentX, startX, model, overview, cytobandOffset]);
|
|
178
|
+
|
|
179
|
+
function mouseDown(event) {
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
event.stopPropagation();
|
|
182
|
+
|
|
183
|
+
if (controlsRef.current) {
|
|
184
|
+
setStartX(event.clientX - controlsRef.current.getBoundingClientRect().left);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function mouseMove(event) {
|
|
189
|
+
if (controlsRef.current) {
|
|
190
|
+
setGuideX(event.clientX - controlsRef.current.getBoundingClientRect().left);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function mouseOut() {
|
|
195
|
+
setGuideX(undefined);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (startX === undefined) {
|
|
199
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
200
|
+
style: {
|
|
201
|
+
position: 'relative'
|
|
202
|
+
}
|
|
203
|
+
}, guideX !== undefined ? /*#__PURE__*/_react["default"].createElement(HoverTooltip, {
|
|
204
|
+
model: model,
|
|
205
|
+
open: !mouseDragging,
|
|
206
|
+
overview: overview,
|
|
207
|
+
guideX: guideX
|
|
208
|
+
}) : null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
209
|
+
className: classes.rubberBandControl,
|
|
210
|
+
role: "presentation",
|
|
211
|
+
ref: controlsRef,
|
|
212
|
+
onMouseDown: mouseDown,
|
|
213
|
+
onMouseOut: mouseOut,
|
|
214
|
+
onMouseMove: mouseMove
|
|
215
|
+
}, ControlComponent));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
var left = startX || 0;
|
|
219
|
+
var width = 0;
|
|
220
|
+
|
|
221
|
+
if (startX !== undefined && currentX !== undefined) {
|
|
222
|
+
left = currentX < startX ? currentX : startX;
|
|
223
|
+
width = currentX - startX;
|
|
224
|
+
} // calculate the start and end bp of drag
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
var leftBpOffset;
|
|
228
|
+
var rightBpOffset;
|
|
229
|
+
|
|
230
|
+
if (startX) {
|
|
231
|
+
leftBpOffset = overview.pxToBp(startX - cytobandOffset);
|
|
232
|
+
rightBpOffset = overview.pxToBp(startX + width - cytobandOffset);
|
|
233
|
+
|
|
234
|
+
if (currentX && currentX < startX) {
|
|
235
|
+
;
|
|
236
|
+
var _ref3 = [rightBpOffset, leftBpOffset];
|
|
237
|
+
leftBpOffset = _ref3[0];
|
|
238
|
+
rightBpOffset = _ref3[1];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
243
|
+
style: {
|
|
244
|
+
position: 'relative'
|
|
245
|
+
}
|
|
246
|
+
}, rubberBandRef.current ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_core.Popover, {
|
|
247
|
+
className: classes.popover,
|
|
248
|
+
classes: {
|
|
249
|
+
paper: classes.paper
|
|
250
|
+
},
|
|
251
|
+
open: true,
|
|
252
|
+
anchorEl: rubberBandRef.current,
|
|
253
|
+
anchorOrigin: {
|
|
254
|
+
vertical: 'top',
|
|
255
|
+
horizontal: 'left'
|
|
256
|
+
},
|
|
257
|
+
transformOrigin: {
|
|
258
|
+
vertical: 'bottom',
|
|
259
|
+
horizontal: 'right'
|
|
260
|
+
},
|
|
261
|
+
keepMounted: true,
|
|
262
|
+
disableRestoreFocus: true
|
|
263
|
+
}, /*#__PURE__*/_react["default"].createElement(_core.Typography, null, leftBpOffset ? (0, _util.stringify)(leftBpOffset) : '')), /*#__PURE__*/_react["default"].createElement(_core.Popover, {
|
|
264
|
+
className: classes.popover,
|
|
265
|
+
classes: {
|
|
266
|
+
paper: classes.paper
|
|
267
|
+
},
|
|
268
|
+
open: true,
|
|
269
|
+
anchorEl: rubberBandRef.current,
|
|
270
|
+
anchorOrigin: {
|
|
271
|
+
vertical: 'top',
|
|
272
|
+
horizontal: 'right'
|
|
273
|
+
},
|
|
274
|
+
transformOrigin: {
|
|
275
|
+
vertical: 'bottom',
|
|
276
|
+
horizontal: 'left'
|
|
277
|
+
},
|
|
278
|
+
keepMounted: true,
|
|
279
|
+
disableRestoreFocus: true
|
|
280
|
+
}, /*#__PURE__*/_react["default"].createElement(_core.Typography, null, rightBpOffset ? (0, _util.stringify)(rightBpOffset) : ''))) : null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
281
|
+
ref: rubberBandRef,
|
|
282
|
+
className: classes.rubberBand,
|
|
283
|
+
style: {
|
|
284
|
+
left: left,
|
|
285
|
+
width: Math.abs(width),
|
|
286
|
+
height: _.HEADER_OVERVIEW_HEIGHT
|
|
287
|
+
}
|
|
288
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
289
|
+
"data-testid": "rubberBand_controls",
|
|
290
|
+
className: classes.rubberBandControl,
|
|
291
|
+
role: "presentation",
|
|
292
|
+
ref: controlsRef,
|
|
293
|
+
onMouseDown: mouseDown,
|
|
294
|
+
onMouseOut: mouseOut,
|
|
295
|
+
onMouseMove: mouseMove
|
|
296
|
+
}, ControlComponent));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
OverviewRubberBand.propTypes = {
|
|
300
|
+
model: _mobxReact.PropTypes.objectOrObservableObject.isRequired,
|
|
301
|
+
overview: _mobxReact.PropTypes.objectOrObservableObject.isRequired,
|
|
302
|
+
ControlComponent: _propTypes["default"].node
|
|
303
|
+
};
|
|
304
|
+
OverviewRubberBand.defaultProps = {
|
|
305
|
+
ControlComponent: /*#__PURE__*/_react["default"].createElement("div", null)
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
var _default = (0, _mobxReact.observer)(OverviewRubberBand);
|
|
309
|
+
|
|
310
|
+
exports["default"] = _default;
|
|
@@ -1,124 +1,132 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Instance } from 'mobx-state-tree';
|
|
3
|
-
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
4
|
-
import { ContentBlock } from '@jbrowse/core/util/blockTypes';
|
|
5
|
-
import { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
6
|
-
import { LinearGenomeViewModel } from '..';
|
|
7
|
-
declare const Polygon: ({ model, overview, useOffset, }: {
|
|
8
|
-
model: LGV;
|
|
9
|
-
overview: Instance<Base1DViewModel>;
|
|
10
|
-
useOffset?: boolean | undefined;
|
|
11
|
-
}) => JSX.Element | null;
|
|
12
|
-
declare type LGV = LinearGenomeViewModel;
|
|
13
|
-
declare const Cytobands: ({ overview, block, assembly, }: {
|
|
14
|
-
overview: Base1DViewModel;
|
|
15
|
-
assembly?: (import("mobx-state-tree").ModelInstanceTypeProps<{
|
|
16
|
-
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
17
|
-
}> & {
|
|
18
|
-
error: Error | undefined;
|
|
19
|
-
regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
20
|
-
refNameAliases: {
|
|
21
|
-
[key: string]: string;
|
|
22
|
-
} | undefined;
|
|
23
|
-
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
24
|
-
} & {
|
|
25
|
-
readonly initialized: boolean;
|
|
26
|
-
readonly name: string;
|
|
27
|
-
readonly aliases: string[];
|
|
28
|
-
hasName(name: string): boolean;
|
|
29
|
-
readonly allAliases: string[];
|
|
30
|
-
readonly refNames: string[] | undefined;
|
|
31
|
-
readonly allRefNames: string[] | undefined;
|
|
32
|
-
readonly rpcManager: any;
|
|
33
|
-
readonly refNameColors: string[];
|
|
34
|
-
} & {
|
|
35
|
-
getCanonicalRefName(refName: string): string;
|
|
36
|
-
getRefNameColor(refName: string): string | undefined;
|
|
37
|
-
isValidRefName(refName: string): boolean;
|
|
38
|
-
} & {
|
|
39
|
-
setLoading(): void;
|
|
40
|
-
setLoaded({ adapterRegionsWithAssembly, refNameAliases, cytobands, }: {
|
|
41
|
-
adapterRegionsWithAssembly: import("@jbrowse/core/util").Region[];
|
|
42
|
-
refNameAliases:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
readonly
|
|
80
|
-
readonly
|
|
81
|
-
readonly
|
|
82
|
-
|
|
83
|
-
readonly
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
} & {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Instance } from 'mobx-state-tree';
|
|
3
|
+
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
4
|
+
import { ContentBlock } from '@jbrowse/core/util/blockTypes';
|
|
5
|
+
import { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
6
|
+
import { LinearGenomeViewModel } from '..';
|
|
7
|
+
declare const Polygon: ({ model, overview, useOffset, }: {
|
|
8
|
+
model: LGV;
|
|
9
|
+
overview: Instance<Base1DViewModel>;
|
|
10
|
+
useOffset?: boolean | undefined;
|
|
11
|
+
}) => JSX.Element | null;
|
|
12
|
+
declare type LGV = LinearGenomeViewModel;
|
|
13
|
+
declare const Cytobands: ({ overview, block, assembly, }: {
|
|
14
|
+
overview: Base1DViewModel;
|
|
15
|
+
assembly?: (import("mobx-state-tree").ModelInstanceTypeProps<{
|
|
16
|
+
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
17
|
+
}> & {
|
|
18
|
+
error: Error | undefined;
|
|
19
|
+
regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
20
|
+
refNameAliases: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
} | undefined;
|
|
23
|
+
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
readonly initialized: boolean;
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly aliases: string[];
|
|
28
|
+
hasName(name: string): boolean;
|
|
29
|
+
readonly allAliases: string[];
|
|
30
|
+
readonly refNames: string[] | undefined;
|
|
31
|
+
readonly allRefNames: string[] | undefined;
|
|
32
|
+
readonly rpcManager: any;
|
|
33
|
+
readonly refNameColors: string[];
|
|
34
|
+
} & {
|
|
35
|
+
getCanonicalRefName(refName: string): string;
|
|
36
|
+
getRefNameColor(refName: string): string | undefined;
|
|
37
|
+
isValidRefName(refName: string): boolean;
|
|
38
|
+
} & {
|
|
39
|
+
setLoading(): void;
|
|
40
|
+
setLoaded({ adapterRegionsWithAssembly, refNameAliases, cytobands, }: {
|
|
41
|
+
adapterRegionsWithAssembly: import("@jbrowse/core/util").Region[];
|
|
42
|
+
refNameAliases: {
|
|
43
|
+
[x: string]: string;
|
|
44
|
+
};
|
|
45
|
+
cytobands: import("@jbrowse/core/util").Feature[];
|
|
46
|
+
}): void;
|
|
47
|
+
setError(e: Error): void;
|
|
48
|
+
setRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
49
|
+
setRefNameAliases(refNameAliases: {
|
|
50
|
+
[x: string]: string;
|
|
51
|
+
}): void;
|
|
52
|
+
setCytobands(cytobands: import("@jbrowse/core/util").Feature[]): void;
|
|
53
|
+
afterAttach(): void;
|
|
54
|
+
} & {
|
|
55
|
+
getAdapterMapEntry(adapterConf: unknown, options: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
56
|
+
forwardMap: {
|
|
57
|
+
[k: string]: string;
|
|
58
|
+
};
|
|
59
|
+
reverseMap: {
|
|
60
|
+
[k: string]: string;
|
|
61
|
+
};
|
|
62
|
+
}>;
|
|
63
|
+
getRefNameMapForAdapter(adapterConf: unknown, opts: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
64
|
+
[k: string]: string;
|
|
65
|
+
}>;
|
|
66
|
+
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
67
|
+
[k: string]: string;
|
|
68
|
+
}>;
|
|
69
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
70
|
+
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
71
|
+
}, {
|
|
72
|
+
error: Error | undefined;
|
|
73
|
+
regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
74
|
+
refNameAliases: {
|
|
75
|
+
[key: string]: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
78
|
+
} & {
|
|
79
|
+
readonly initialized: boolean;
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly aliases: string[];
|
|
82
|
+
hasName(name: string): boolean;
|
|
83
|
+
readonly allAliases: string[];
|
|
84
|
+
readonly refNames: string[] | undefined;
|
|
85
|
+
readonly allRefNames: string[] | undefined;
|
|
86
|
+
readonly rpcManager: any;
|
|
87
|
+
readonly refNameColors: string[];
|
|
88
|
+
} & {
|
|
89
|
+
getCanonicalRefName(refName: string): string;
|
|
90
|
+
getRefNameColor(refName: string): string | undefined;
|
|
91
|
+
isValidRefName(refName: string): boolean;
|
|
92
|
+
} & {
|
|
93
|
+
setLoading(): void;
|
|
94
|
+
setLoaded({ adapterRegionsWithAssembly, refNameAliases, cytobands, }: {
|
|
95
|
+
adapterRegionsWithAssembly: import("@jbrowse/core/util").Region[];
|
|
96
|
+
refNameAliases: {
|
|
97
|
+
[x: string]: string;
|
|
98
|
+
};
|
|
99
|
+
cytobands: import("@jbrowse/core/util").Feature[];
|
|
100
|
+
}): void;
|
|
101
|
+
setError(e: Error): void;
|
|
102
|
+
setRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
103
|
+
setRefNameAliases(refNameAliases: {
|
|
104
|
+
[x: string]: string;
|
|
105
|
+
}): void;
|
|
106
|
+
setCytobands(cytobands: import("@jbrowse/core/util").Feature[]): void;
|
|
107
|
+
afterAttach(): void;
|
|
108
|
+
} & {
|
|
109
|
+
getAdapterMapEntry(adapterConf: unknown, options: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
110
|
+
forwardMap: {
|
|
111
|
+
[k: string]: string;
|
|
112
|
+
};
|
|
113
|
+
reverseMap: {
|
|
114
|
+
[k: string]: string;
|
|
115
|
+
};
|
|
116
|
+
}>;
|
|
117
|
+
getRefNameMapForAdapter(adapterConf: unknown, opts: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
118
|
+
[k: string]: string;
|
|
119
|
+
}>;
|
|
120
|
+
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
121
|
+
[k: string]: string;
|
|
122
|
+
}>;
|
|
123
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined;
|
|
124
|
+
block: ContentBlock;
|
|
125
|
+
}) => JSX.Element | null;
|
|
126
|
+
declare function OverviewScaleBar({ model, children, }: {
|
|
127
|
+
model: LGV;
|
|
128
|
+
children: React.ReactNode;
|
|
129
|
+
}): JSX.Element;
|
|
130
|
+
declare const _default: typeof OverviewScaleBar;
|
|
131
|
+
export default _default;
|
|
132
|
+
export { Cytobands, Polygon };
|