@jbrowse/plugin-linear-genome-view 2.1.0 → 2.1.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.js +27 -54
- 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 +27 -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/Gridlines.js +18 -20
- package/dist/LinearGenomeView/components/Gridlines.js.map +1 -1
- 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 -158
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +20 -21
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +87 -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 +44 -76
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +14 -8
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +94 -117
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +107 -169
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/dist/LinearGenomeView/components/RubberBand.js +51 -71
- 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 +73 -133
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +38 -36
- 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.js +28 -30
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackLabel.js +37 -71
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +32 -49
- 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.d.ts +1 -0
- package/dist/LinearGenomeView/components/util.js +28 -88
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/index.d.ts +4 -4
- package/dist/LinearGenomeView/index.js +380 -430
- 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/LinearGenomeView/components/GetSequenceDialog.d.ts +9 -0
- package/esm/LinearGenomeView/components/{SequenceDialog.js → GetSequenceDialog.js} +4 -7
- package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/ImportForm.js +39 -42
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +2 -2
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +2 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +0 -11
- package/esm/LinearGenomeView/components/OverviewRubberBand.js +4 -12
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +14 -8
- package/esm/LinearGenomeView/components/OverviewScaleBar.js +0 -2
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +26 -6
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/esm/LinearGenomeView/components/RubberBand.js +0 -1
- package/esm/LinearGenomeView/components/RubberBand.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchBox.js +37 -33
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -4
- package/esm/LinearGenomeView/components/SearchResultsDialog.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/TrackLabel.js +1 -1
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/esm/LinearGenomeView/components/util.d.ts +1 -0
- package/esm/LinearGenomeView/components/util.js +12 -0
- package/esm/LinearGenomeView/components/util.js.map +1 -1
- package/esm/LinearGenomeView/index.d.ts +4 -4
- package/esm/LinearGenomeView/index.js +26 -19
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/package.json +2 -3
- package/src/LinearGenomeView/components/{SequenceDialog.tsx → GetSequenceDialog.tsx} +4 -17
- package/src/LinearGenomeView/components/ImportForm.tsx +40 -42
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +3 -3
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +4 -4
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +5 -15
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +0 -2
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +27 -8
- package/src/LinearGenomeView/components/RubberBand.tsx +0 -1
- package/src/LinearGenomeView/components/SearchBox.tsx +39 -36
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -4
- package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +165 -0
- package/src/LinearGenomeView/components/TrackLabel.tsx +3 -1
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +16 -16
- package/src/LinearGenomeView/components/util.ts +12 -0
- package/src/LinearGenomeView/index.tsx +32 -25
- package/dist/LinearGenomeView/components/SequenceDialog.js +0 -242
- package/dist/LinearGenomeView/components/SequenceDialog.js.map +0 -1
- package/esm/LinearGenomeView/components/SequenceDialog.js.map +0 -1
|
@@ -22,43 +22,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
26
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
|
-
if (!m) return o;
|
|
28
|
-
var i = m.call(o), r, ar = [], e;
|
|
29
|
-
try {
|
|
30
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
31
|
-
}
|
|
32
|
-
catch (error) { e = { error: error }; }
|
|
33
|
-
finally {
|
|
34
|
-
try {
|
|
35
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
36
|
-
}
|
|
37
|
-
finally { if (e) throw e.error; }
|
|
38
|
-
}
|
|
39
|
-
return ar;
|
|
40
|
-
};
|
|
41
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
|
-
};
|
|
44
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var _a = theme.palette, tertiary = _a.tertiary, primary = _a.primary;
|
|
55
|
-
var background = tertiary
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const material_1 = require("@mui/material");
|
|
28
|
+
const mui_1 = require("tss-react/mui");
|
|
29
|
+
const util_1 = require("@jbrowse/core/util");
|
|
30
|
+
const mobx_react_1 = require("mobx-react");
|
|
31
|
+
const __1 = require("..");
|
|
32
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
33
|
+
const { tertiary, primary } = theme.palette;
|
|
34
|
+
const background = tertiary
|
|
56
35
|
? (0, material_1.alpha)(tertiary.main, 0.7)
|
|
57
36
|
: (0, material_1.alpha)(primary.main, 0.7);
|
|
58
37
|
return {
|
|
59
38
|
rubberBand: {
|
|
60
39
|
height: '100%',
|
|
61
|
-
background
|
|
40
|
+
background,
|
|
62
41
|
position: 'absolute',
|
|
63
42
|
zIndex: 10,
|
|
64
43
|
textAlign: 'center',
|
|
@@ -89,40 +68,35 @@ var useStyles = (0, mui_1.makeStyles)()(function (theme) {
|
|
|
89
68
|
},
|
|
90
69
|
};
|
|
91
70
|
});
|
|
92
|
-
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
px.coord < f.get('end') &&
|
|
103
|
-
px.refName === assembly.getCanonicalRefName(f.get('refName'));
|
|
104
|
-
});
|
|
71
|
+
const HoverTooltip = (0, mobx_react_1.observer)(({ model, open, guideX, overview, }) => {
|
|
72
|
+
var _a;
|
|
73
|
+
const { classes } = useStyles();
|
|
74
|
+
const { cytobandOffset } = model;
|
|
75
|
+
const { assemblyManager } = (0, util_1.getSession)(model);
|
|
76
|
+
const px = overview.pxToBp(guideX - cytobandOffset);
|
|
77
|
+
const assembly = assemblyManager.get(px.assemblyName);
|
|
78
|
+
const cytoband = (_a = assembly === null || assembly === void 0 ? void 0 : assembly.cytobands) === null || _a === void 0 ? void 0 : _a.find(f => px.coord > f.get('start') &&
|
|
79
|
+
px.coord < f.get('end') &&
|
|
80
|
+
px.refName === assembly.getCanonicalRefName(f.get('refName')));
|
|
105
81
|
return (react_1.default.createElement(material_1.Tooltip, { open: open, placement: "top", title: [(0, util_1.stringify)(px), cytoband === null || cytoband === void 0 ? void 0 : cytoband.get('name')].join(' '), arrow: true },
|
|
106
82
|
react_1.default.createElement("div", { className: classes.guide, style: {
|
|
107
83
|
left: guideX,
|
|
108
84
|
} })));
|
|
109
85
|
});
|
|
110
|
-
function OverviewRubberBand(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var mouseDragging = startX !== undefined;
|
|
121
|
-
(0, react_1.useEffect)(function () {
|
|
86
|
+
function OverviewRubberBand({ model, overview, ControlComponent = react_1.default.createElement("div", null), }) {
|
|
87
|
+
const { cytobandOffset } = model;
|
|
88
|
+
const [startX, setStartX] = (0, react_1.useState)();
|
|
89
|
+
const [currentX, setCurrentX] = (0, react_1.useState)();
|
|
90
|
+
const [guideX, setGuideX] = (0, react_1.useState)();
|
|
91
|
+
const controlsRef = (0, react_1.useRef)(null);
|
|
92
|
+
const rubberBandRef = (0, react_1.useRef)(null);
|
|
93
|
+
const { classes } = useStyles();
|
|
94
|
+
const mouseDragging = startX !== undefined;
|
|
95
|
+
(0, react_1.useEffect)(() => {
|
|
122
96
|
function globalMouseMove(event) {
|
|
123
|
-
|
|
97
|
+
const ref = controlsRef.current;
|
|
124
98
|
if (ref && mouseDragging) {
|
|
125
|
-
|
|
99
|
+
const relativeX = event.clientX - ref.getBoundingClientRect().left;
|
|
126
100
|
setCurrentX(relativeX);
|
|
127
101
|
}
|
|
128
102
|
}
|
|
@@ -130,12 +104,14 @@ function OverviewRubberBand(_a) {
|
|
|
130
104
|
// click and drag
|
|
131
105
|
if (startX !== undefined && currentX !== undefined) {
|
|
132
106
|
if (Math.abs(currentX - startX) > 3) {
|
|
133
|
-
|
|
107
|
+
const left = Math.min(startX, currentX);
|
|
108
|
+
const right = Math.max(startX, currentX);
|
|
109
|
+
model.moveTo(overview.pxToBp(left - cytobandOffset), overview.pxToBp(right - cytobandOffset));
|
|
134
110
|
}
|
|
135
111
|
}
|
|
136
112
|
// just a click
|
|
137
113
|
if (startX !== undefined && currentX === undefined) {
|
|
138
|
-
|
|
114
|
+
const click = overview.pxToBp(startX - cytobandOffset);
|
|
139
115
|
if (!click.refName) {
|
|
140
116
|
(0, util_1.getSession)(model).notify('unknown position clicked');
|
|
141
117
|
console.error('unknown position clicked', click);
|
|
@@ -160,13 +136,13 @@ function OverviewRubberBand(_a) {
|
|
|
160
136
|
window.addEventListener('mousemove', globalMouseMove, true);
|
|
161
137
|
window.addEventListener('mouseup', globalMouseUp, true);
|
|
162
138
|
window.addEventListener('keydown', globalKeyDown, true);
|
|
163
|
-
return
|
|
139
|
+
return () => {
|
|
164
140
|
window.removeEventListener('mousemove', globalMouseMove, true);
|
|
165
141
|
window.removeEventListener('mouseup', globalMouseUp, true);
|
|
166
142
|
window.removeEventListener('keydown', globalKeyDown, true);
|
|
167
143
|
};
|
|
168
144
|
}
|
|
169
|
-
return
|
|
145
|
+
return () => { };
|
|
170
146
|
}, [mouseDragging, currentX, startX, model, overview, cytobandOffset]);
|
|
171
147
|
function mouseDown(event) {
|
|
172
148
|
event.preventDefault();
|
|
@@ -188,21 +164,21 @@ function OverviewRubberBand(_a) {
|
|
|
188
164
|
guideX !== undefined ? (react_1.default.createElement(HoverTooltip, { model: model, open: !mouseDragging, overview: overview, guideX: guideX })) : null,
|
|
189
165
|
react_1.default.createElement("div", { className: classes.rubberBandControl, role: "presentation", ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
190
166
|
}
|
|
191
|
-
|
|
192
|
-
|
|
167
|
+
let left = startX || 0;
|
|
168
|
+
let width = 0;
|
|
193
169
|
if (startX !== undefined && currentX !== undefined) {
|
|
194
170
|
left = currentX < startX ? currentX : startX;
|
|
195
171
|
width = currentX - startX;
|
|
196
172
|
}
|
|
197
173
|
// calculate the start and end bp of drag
|
|
198
|
-
|
|
199
|
-
|
|
174
|
+
let leftBpOffset;
|
|
175
|
+
let rightBpOffset;
|
|
200
176
|
if (startX) {
|
|
201
177
|
leftBpOffset = overview.pxToBp(startX - cytobandOffset);
|
|
202
178
|
rightBpOffset = overview.pxToBp(startX + width - cytobandOffset);
|
|
203
179
|
if (currentX && currentX < startX) {
|
|
204
180
|
;
|
|
205
|
-
|
|
181
|
+
[leftBpOffset, rightBpOffset] = [rightBpOffset, leftBpOffset];
|
|
206
182
|
}
|
|
207
183
|
}
|
|
208
184
|
return (react_1.default.createElement("div", { style: { position: 'relative' } },
|
|
@@ -228,19 +204,11 @@ function OverviewRubberBand(_a) {
|
|
|
228
204
|
}, keepMounted: true, disableRestoreFocus: true },
|
|
229
205
|
react_1.default.createElement(material_1.Typography, null, rightBpOffset ? (0, util_1.stringify)(rightBpOffset) : '')))) : null,
|
|
230
206
|
react_1.default.createElement("div", { ref: rubberBandRef, className: classes.rubberBand, style: {
|
|
231
|
-
left
|
|
207
|
+
left,
|
|
232
208
|
width: Math.abs(width),
|
|
233
209
|
height: __1.HEADER_OVERVIEW_HEIGHT,
|
|
234
210
|
} }),
|
|
235
211
|
react_1.default.createElement("div", { "data-testid": "rubberBand_controls", className: classes.rubberBandControl, role: "presentation", ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
236
212
|
}
|
|
237
|
-
OverviewRubberBand.propTypes = {
|
|
238
|
-
model: mobx_react_1.PropTypes.objectOrObservableObject.isRequired,
|
|
239
|
-
overview: mobx_react_1.PropTypes.objectOrObservableObject.isRequired,
|
|
240
|
-
ControlComponent: prop_types_1.default.node,
|
|
241
|
-
};
|
|
242
|
-
OverviewRubberBand.defaultProps = {
|
|
243
|
-
ControlComponent: react_1.default.createElement("div", null),
|
|
244
|
-
};
|
|
245
213
|
exports.default = (0, mobx_react_1.observer)(OverviewRubberBand);
|
|
246
214
|
//# sourceMappingURL=OverviewRubberBand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverviewRubberBand.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/OverviewRubberBand.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OverviewRubberBand.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/OverviewRubberBand.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0D;AAC1D,4CAAmE;AACnE,uCAA0C;AAC1C,6CAA0D;AAC1D,2CAAqC;AAErC,0BAAkE;AAIlE,MAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC,KAAK,CAAC,EAAE;IACrC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,CAAA;IAC3C,MAAM,UAAU,GAAG,QAAQ;QACzB,CAAC,CAAC,IAAA,gBAAK,EAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC;QAC3B,CAAC,CAAC,IAAA,gBAAK,EAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC5B,OAAO;QACL,UAAU,EAAE;YACV,MAAM,EAAE,MAAM;YACd,UAAU;YACV,QAAQ,EAAE,UAAU;YACpB,MAAM,EAA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,CAAC,CAAC,IAAA,gBAAS,EAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CACnC,CACL,CACT,CACJ,CAAC,CAAC,CAAC,IAAI;QACR,uCACE,GAAG,EAAE,aAAa,EAClB,SAAS,EAAE,OAAO,CAAC,UAAU,EAC7B,KAAK,EAAE;gBACL,IAAI;gBACJ,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;gBACtB,MAAM,EAAE,0BAAsB;aAC/B,GACD;QACF,sDACc,qBAAqB,EACjC,SAAS,EAAE,OAAO,CAAC,iBAAiB,EACpC,IAAI,EAAC,cAAc,EACnB,GAAG,EAAE,WAAW,EAChB,WAAW,EAAE,SAAS,EACtB,UAAU,EAAE,QAAQ,EACpB,WAAW,EAAE,SAAS,IAErB,gBAAgB,CACb,CACF,CACP,CAAA;AACH,CAAC;AAED,kBAAe,IAAA,qBAAQ,EAAC,kBAAkB,CAAC,CAAA"}
|
|
@@ -28,10 +28,13 @@ declare const Cytobands: ({ overview, block, assembly, }: {
|
|
|
28
28
|
readonly initialized: boolean;
|
|
29
29
|
readonly name: string;
|
|
30
30
|
readonly aliases: string[];
|
|
31
|
+
readonly displayName: string | undefined;
|
|
31
32
|
hasName(name: string): boolean;
|
|
32
33
|
readonly allAliases: string[];
|
|
33
34
|
readonly refNames: string[] | undefined;
|
|
34
35
|
readonly allRefNames: string[] | undefined;
|
|
36
|
+
readonly lowerCaseRefNames: string[] | undefined;
|
|
37
|
+
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
35
38
|
readonly rpcManager: any;
|
|
36
39
|
readonly refNameColors: string[];
|
|
37
40
|
} & {
|
|
@@ -62,17 +65,17 @@ declare const Cytobands: ({ overview, block, assembly, }: {
|
|
|
62
65
|
} & {
|
|
63
66
|
getAdapterMapEntry(adapterConf: unknown, options: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
64
67
|
forwardMap: {
|
|
65
|
-
[
|
|
68
|
+
[key: string]: string;
|
|
66
69
|
};
|
|
67
70
|
reverseMap: {
|
|
68
|
-
[
|
|
71
|
+
[key: string]: string;
|
|
69
72
|
};
|
|
70
73
|
}>;
|
|
71
74
|
getRefNameMapForAdapter(adapterConf: unknown, opts: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
72
|
-
[
|
|
75
|
+
[key: string]: string;
|
|
73
76
|
}>;
|
|
74
77
|
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
75
|
-
[
|
|
78
|
+
[key: string]: string;
|
|
76
79
|
}>;
|
|
77
80
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
78
81
|
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
@@ -90,10 +93,13 @@ declare const Cytobands: ({ overview, block, assembly, }: {
|
|
|
90
93
|
readonly initialized: boolean;
|
|
91
94
|
readonly name: string;
|
|
92
95
|
readonly aliases: string[];
|
|
96
|
+
readonly displayName: string | undefined;
|
|
93
97
|
hasName(name: string): boolean;
|
|
94
98
|
readonly allAliases: string[];
|
|
95
99
|
readonly refNames: string[] | undefined;
|
|
96
100
|
readonly allRefNames: string[] | undefined;
|
|
101
|
+
readonly lowerCaseRefNames: string[] | undefined;
|
|
102
|
+
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
97
103
|
readonly rpcManager: any;
|
|
98
104
|
readonly refNameColors: string[];
|
|
99
105
|
} & {
|
|
@@ -124,17 +130,17 @@ declare const Cytobands: ({ overview, block, assembly, }: {
|
|
|
124
130
|
} & {
|
|
125
131
|
getAdapterMapEntry(adapterConf: unknown, options: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
126
132
|
forwardMap: {
|
|
127
|
-
[
|
|
133
|
+
[key: string]: string;
|
|
128
134
|
};
|
|
129
135
|
reverseMap: {
|
|
130
|
-
[
|
|
136
|
+
[key: string]: string;
|
|
131
137
|
};
|
|
132
138
|
}>;
|
|
133
139
|
getRefNameMapForAdapter(adapterConf: unknown, opts: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
134
|
-
[
|
|
140
|
+
[key: string]: string;
|
|
135
141
|
}>;
|
|
136
142
|
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("@jbrowse/core/assemblyManager/assembly").BaseOptions): Promise<{
|
|
137
|
-
[
|
|
143
|
+
[key: string]: string;
|
|
138
144
|
}>;
|
|
139
145
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined;
|
|
140
146
|
block: ContentBlock;
|
|
@@ -1,49 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
4
|
};
|
|
32
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
6
|
exports.Polygon = exports.Cytobands = void 0;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const mui_1 = require("tss-react/mui");
|
|
10
|
+
const mobx_react_1 = require("mobx-react");
|
|
11
|
+
const Base1DViewModel_1 = __importDefault(require("@jbrowse/core/util/Base1DViewModel"));
|
|
12
|
+
const util_1 = require("@jbrowse/core/util");
|
|
13
|
+
const blockTypes_1 = require("@jbrowse/core/util/blockTypes");
|
|
41
14
|
// locals
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
15
|
+
const __1 = require("..");
|
|
16
|
+
const util_2 = require("../util");
|
|
17
|
+
const OverviewRubberBand_1 = __importDefault(require("./OverviewRubberBand"));
|
|
18
|
+
const wholeSeqSpacer = 2;
|
|
19
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
47
20
|
scaleBar: {
|
|
48
21
|
height: __1.HEADER_OVERVIEW_HEIGHT,
|
|
49
22
|
},
|
|
@@ -57,11 +30,11 @@ var useStyles = (0, mui_1.makeStyles)()(function (theme) { return ({
|
|
|
57
30
|
height: __1.HEADER_OVERVIEW_HEIGHT,
|
|
58
31
|
},
|
|
59
32
|
scaleBarContigForward: {
|
|
60
|
-
backgroundImage:
|
|
33
|
+
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M-.1 0L6 4.5L-.1 9' fill='none' stroke='%23ddd'/%3E%3C/svg%3E")`,
|
|
61
34
|
backgroundRepeat: 'repeat',
|
|
62
35
|
},
|
|
63
36
|
scaleBarContigReverse: {
|
|
64
|
-
backgroundImage:
|
|
37
|
+
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M6 0L0 4.5L6 9' fill='none' stroke='%23ddd'/%3E%3C/svg%3E")`,
|
|
65
38
|
backgroundRepeat: 'repeat',
|
|
66
39
|
},
|
|
67
40
|
scaleBarRefName: {
|
|
@@ -92,30 +65,34 @@ var useStyles = (0, mui_1.makeStyles)()(function (theme) { return ({
|
|
|
92
65
|
width: '100%',
|
|
93
66
|
position: 'absolute',
|
|
94
67
|
},
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
var _c = theme.palette, tertiary = _c.tertiary, primary = _c.primary;
|
|
104
|
-
var polygonColor = tertiary ? tertiary.light : primary.light;
|
|
68
|
+
}));
|
|
69
|
+
const Polygon = (0, mobx_react_1.observer)(({ model, overview, useOffset = true, }) => {
|
|
70
|
+
const theme = (0, material_1.useTheme)();
|
|
71
|
+
const multiplier = Number(useOffset);
|
|
72
|
+
const { interRegionPaddingWidth, offsetPx, dynamicBlocks, cytobandOffset } = model;
|
|
73
|
+
const { contentBlocks, totalWidthPxWithoutBorders } = dynamicBlocks;
|
|
74
|
+
const { tertiary, primary } = theme.palette;
|
|
75
|
+
const polygonColor = tertiary ? tertiary.light : primary.light;
|
|
105
76
|
if (!contentBlocks.length) {
|
|
106
77
|
return null;
|
|
107
78
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
79
|
+
const first = contentBlocks[0];
|
|
80
|
+
const last = contentBlocks[contentBlocks.length - 1];
|
|
81
|
+
const topLeft = (overview.bpToPx({
|
|
82
|
+
...first,
|
|
83
|
+
coord: first.reversed ? first.end : first.start,
|
|
84
|
+
}) || 0) +
|
|
111
85
|
cytobandOffset * multiplier;
|
|
112
|
-
|
|
86
|
+
const topRight = (overview.bpToPx({
|
|
87
|
+
...last,
|
|
88
|
+
coord: last.reversed ? last.start : last.end,
|
|
89
|
+
}) || 0) +
|
|
113
90
|
cytobandOffset * multiplier;
|
|
114
|
-
|
|
115
|
-
|
|
91
|
+
const startPx = Math.max(0, -offsetPx);
|
|
92
|
+
const endPx = startPx +
|
|
116
93
|
totalWidthPxWithoutBorders +
|
|
117
94
|
(contentBlocks.length * interRegionPaddingWidth) / 2;
|
|
118
|
-
|
|
95
|
+
const points = [
|
|
119
96
|
[startPx, __1.HEADER_BAR_HEIGHT],
|
|
120
97
|
[endPx, __1.HEADER_BAR_HEIGHT],
|
|
121
98
|
[topRight, 0],
|
|
@@ -146,7 +123,7 @@ function leftRoundedRect(x, y, width, height, radius) {
|
|
|
146
123
|
+ "a" + radius + "," + radius + " 0 0 1 " + radius + "," + (-radius)
|
|
147
124
|
+ "z";
|
|
148
125
|
}
|
|
149
|
-
|
|
126
|
+
const colorMap = {
|
|
150
127
|
gneg: 'rgb(227,227,227)',
|
|
151
128
|
gpos25: 'rgb(142,142,142)',
|
|
152
129
|
gpos50: 'rgb(85,85,85)',
|
|
@@ -158,38 +135,36 @@ var colorMap = {
|
|
|
158
135
|
};
|
|
159
136
|
function getCytobands(assembly, refName) {
|
|
160
137
|
var _a;
|
|
161
|
-
return (((_a = assembly === null || assembly === void 0 ? void 0 : assembly.cytobands) === null || _a === void 0 ? void 0 : _a.map(
|
|
138
|
+
return (((_a = assembly === null || assembly === void 0 ? void 0 : assembly.cytobands) === null || _a === void 0 ? void 0 : _a.map(f => ({
|
|
162
139
|
refName: assembly.getCanonicalRefName(f.get('refName')),
|
|
163
140
|
start: f.get('start'),
|
|
164
141
|
end: f.get('end'),
|
|
165
142
|
type: f.get('type'),
|
|
166
|
-
})
|
|
143
|
+
})).filter(f => f.refName === refName)) || []);
|
|
167
144
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
var refName = f.refName, start = f.start, end = f.end, type = f.type;
|
|
145
|
+
const Cytobands = (0, mobx_react_1.observer)(({ overview, block, assembly, }) => {
|
|
146
|
+
const { offsetPx, reversed } = block;
|
|
147
|
+
const cytobands = getCytobands(assembly, block.refName);
|
|
148
|
+
const coords = cytobands.map(f => {
|
|
149
|
+
const { refName, start, end, type } = f;
|
|
174
150
|
return [
|
|
175
151
|
overview.bpToPx({
|
|
176
|
-
refName
|
|
152
|
+
refName,
|
|
177
153
|
coord: start,
|
|
178
154
|
}),
|
|
179
155
|
overview.bpToPx({
|
|
180
|
-
refName
|
|
156
|
+
refName,
|
|
181
157
|
coord: end,
|
|
182
158
|
}),
|
|
183
159
|
type,
|
|
184
160
|
];
|
|
185
161
|
});
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return (react_1.default.createElement("g", { transform:
|
|
191
|
-
|
|
192
|
-
var key = "".concat(start, "-").concat(end, "-").concat(type);
|
|
162
|
+
const arr = cytobands || [];
|
|
163
|
+
const lcap = reversed ? arr.length - 1 : 0;
|
|
164
|
+
const rcap = reversed ? 0 : arr.length - 1;
|
|
165
|
+
let firstCent = true;
|
|
166
|
+
return (react_1.default.createElement("g", { transform: `translate(-${offsetPx})` }, coords.map(([start, end, type], index) => {
|
|
167
|
+
const key = `${start}-${end}-${type}`;
|
|
193
168
|
if (type === 'acen' && firstCent) {
|
|
194
169
|
firstCent = false;
|
|
195
170
|
return (react_1.default.createElement("polygon", { key: key, points: [
|
|
@@ -217,21 +192,20 @@ var Cytobands = (0, mobx_react_1.observer)(function (_a) {
|
|
|
217
192
|
})));
|
|
218
193
|
});
|
|
219
194
|
exports.Cytobands = Cytobands;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
var offsetLabel = (i + 1) * majorPitch;
|
|
195
|
+
const OverviewBox = (0, mobx_react_1.observer)(({ scale, model, block, overview, }) => {
|
|
196
|
+
const { classes, cx } = useStyles();
|
|
197
|
+
const { cytobandOffset, bpPerPx, showCytobands } = model;
|
|
198
|
+
const { start, end, reversed, refName, assemblyName } = block;
|
|
199
|
+
const { majorPitch } = (0, util_2.chooseGridPitch)(scale, 120, 15);
|
|
200
|
+
const { assemblyManager } = (0, util_1.getSession)(model);
|
|
201
|
+
const assembly = assemblyManager.get(assemblyName);
|
|
202
|
+
const refNameColor = assembly === null || assembly === void 0 ? void 0 : assembly.getRefNameColor(refName);
|
|
203
|
+
const tickLabels = [];
|
|
204
|
+
for (let i = 0; i < Math.floor((end - start) / majorPitch); i++) {
|
|
205
|
+
const offsetLabel = (i + 1) * majorPitch;
|
|
232
206
|
tickLabels.push(reversed ? end - offsetLabel : start + offsetLabel);
|
|
233
207
|
}
|
|
234
|
-
|
|
208
|
+
const canDisplayCytobands = showCytobands && getCytobands(assembly, block.refName).length;
|
|
235
209
|
return (react_1.default.createElement("div", null,
|
|
236
210
|
react_1.default.createElement(material_1.Typography, { style: {
|
|
237
211
|
left: block.offsetPx + 3,
|
|
@@ -247,34 +221,38 @@ var OverviewBox = (0, mobx_react_1.observer)(function (_a) {
|
|
|
247
221
|
borderColor: refNameColor,
|
|
248
222
|
} },
|
|
249
223
|
!canDisplayCytobands
|
|
250
|
-
? tickLabels.map(
|
|
224
|
+
? tickLabels.map((tickLabel, labelIdx) => (react_1.default.createElement(material_1.Typography, { key: `${JSON.stringify(block)}-${tickLabel}-${labelIdx}`, className: classes.scaleBarLabel, variant: "body2", style: {
|
|
251
225
|
left: ((labelIdx + 1) * majorPitch) / scale,
|
|
252
226
|
pointerEvents: 'none',
|
|
253
227
|
color: refNameColor,
|
|
254
|
-
} }, (0, util_1.getTickDisplayStr)(tickLabel, bpPerPx)))
|
|
228
|
+
} }, (0, util_1.getTickDisplayStr)(tickLabel, bpPerPx))))
|
|
255
229
|
: null,
|
|
256
230
|
canDisplayCytobands ? (react_1.default.createElement("svg", { style: { width: '100%' } },
|
|
257
231
|
react_1.default.createElement(Cytobands, { overview: overview, assembly: assembly, block: block }))) : null)));
|
|
258
232
|
});
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
var _b = theme.palette, tertiary = _b.tertiary, primary = _b.primary;
|
|
268
|
-
var scaleBarColor = tertiary ? tertiary.light : primary.light;
|
|
233
|
+
const ScaleBar = (0, mobx_react_1.observer)(({ model, scale, overview, }) => {
|
|
234
|
+
const { classes } = useStyles();
|
|
235
|
+
const theme = (0, material_1.useTheme)();
|
|
236
|
+
const { dynamicBlocks, showCytobands, cytobandOffset } = model;
|
|
237
|
+
const visibleRegions = dynamicBlocks.contentBlocks;
|
|
238
|
+
const overviewVisibleRegions = overview.dynamicBlocks;
|
|
239
|
+
const { tertiary, primary } = theme.palette;
|
|
240
|
+
const scaleBarColor = tertiary ? tertiary.light : primary.light;
|
|
269
241
|
if (!visibleRegions.length) {
|
|
270
242
|
return null;
|
|
271
243
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
244
|
+
const first = visibleRegions[0];
|
|
245
|
+
const firstOverviewPx = overview.bpToPx({
|
|
246
|
+
...first,
|
|
247
|
+
coord: first.reversed ? first.end : first.start,
|
|
248
|
+
}) || 0;
|
|
249
|
+
const last = visibleRegions[visibleRegions.length - 1];
|
|
250
|
+
const lastOverviewPx = overview.bpToPx({
|
|
251
|
+
...last,
|
|
252
|
+
coord: last.reversed ? last.start : last.end,
|
|
253
|
+
}) || 0;
|
|
254
|
+
const color = showCytobands ? '#f00' : scaleBarColor;
|
|
255
|
+
const transparency = showCytobands ? 0.1 : 0.3;
|
|
278
256
|
return (react_1.default.createElement("div", { className: classes.scaleBar },
|
|
279
257
|
react_1.default.createElement("div", { className: classes.scaleBarVisibleRegion, style: {
|
|
280
258
|
width: lastOverviewPx - firstOverviewPx,
|
|
@@ -282,28 +260,27 @@ var ScaleBar = (0, mobx_react_1.observer)(function (_a) {
|
|
|
282
260
|
background: (0, material_1.alpha)(color, transparency),
|
|
283
261
|
borderColor: color,
|
|
284
262
|
} }),
|
|
285
|
-
overviewVisibleRegions.map(
|
|
286
|
-
return !(block instanceof blockTypes_1.ContentBlock) ? (react_1.default.createElement("div", { key:
|
|
263
|
+
overviewVisibleRegions.map((block, idx) => {
|
|
264
|
+
return !(block instanceof blockTypes_1.ContentBlock) ? (react_1.default.createElement("div", { key: `${JSON.stringify(block)}-${idx}`, className: classes.scaleBarContig, style: {
|
|
287
265
|
width: block.widthPx,
|
|
288
266
|
left: block.offsetPx,
|
|
289
267
|
backgroundColor: '#999',
|
|
290
268
|
backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)',
|
|
291
|
-
} })) : (react_1.default.createElement(OverviewBox, { scale: scale, block: block, model: model, overview: overview, key:
|
|
269
|
+
} })) : (react_1.default.createElement(OverviewBox, { scale: scale, block: block, model: model, overview: overview, key: `${JSON.stringify(block)}-${idx}` }));
|
|
292
270
|
})));
|
|
293
271
|
});
|
|
294
|
-
function OverviewScaleBar(
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var overview = Base1DViewModel_1.default.create({
|
|
272
|
+
function OverviewScaleBar({ model, children, }) {
|
|
273
|
+
const { classes } = useStyles();
|
|
274
|
+
const { totalBp, width, cytobandOffset, displayedRegions } = model;
|
|
275
|
+
const overview = Base1DViewModel_1.default.create({
|
|
299
276
|
displayedRegions: JSON.parse(JSON.stringify(displayedRegions)),
|
|
300
277
|
interRegionPaddingWidth: 0,
|
|
301
278
|
minimumBlockWidth: model.minimumBlockWidth,
|
|
302
279
|
});
|
|
303
|
-
|
|
280
|
+
const modWidth = width - cytobandOffset;
|
|
304
281
|
overview.setVolatileWidth(modWidth);
|
|
305
282
|
overview.showAllRegions();
|
|
306
|
-
|
|
283
|
+
const scale = totalBp / (modWidth - (displayedRegions.length - 1) * wholeSeqSpacer);
|
|
307
284
|
return (react_1.default.createElement("div", null,
|
|
308
285
|
react_1.default.createElement(OverviewRubberBand_1.default, { model: model, overview: overview, ControlComponent: react_1.default.createElement(ScaleBar, { model: model, overview: overview, scale: scale }) }),
|
|
309
286
|
react_1.default.createElement("div", { className: classes.overview },
|