@jbrowse/plugin-linear-genome-view 1.6.3 → 1.6.6
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 +0 -5
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -1
- package/dist/LinearBareDisplay/configSchema.d.ts +1 -1
- package/dist/LinearBasicDisplay/configSchema.d.ts +1 -1
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +2 -0
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +3 -2
- package/dist/LinearGenomeView/index.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/plugin-linear-genome-view.cjs.development.js +143 -250
- package/dist/plugin-linear-genome-view.cjs.development.js.map +1 -1
- package/dist/plugin-linear-genome-view.cjs.production.min.js +1 -1
- package/dist/plugin-linear-genome-view.cjs.production.min.js.map +1 -1
- package/dist/plugin-linear-genome-view.esm.js +145 -252
- package/dist/plugin-linear-genome-view.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +2 -4
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -8
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +11 -3
- package/src/LinearBasicDisplay/model.ts +1 -1
- package/src/LinearGenomeView/components/HelpDialog.tsx +14 -1
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +1 -13
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +7 -3
- package/src/LinearGenomeView/components/TrackContainer.tsx +24 -39
- package/src/LinearGenomeView/components/TrackLabel.tsx +5 -5
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +194 -191
- package/src/LinearGenomeView/index.test.ts +44 -42
- package/src/LinearGenomeView/index.tsx +176 -245
- package/src/LinearGenomeView/volvoxDisplayedRegions.json +16 -0
- package/dist/LinearGenomeView/components/ReturnToImportFormDialog.d.ts +0 -9
- package/src/LinearGenomeView/components/ReturnToImportFormDialog.tsx +0 -83
|
@@ -6,15 +6,15 @@ import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType';
|
|
|
6
6
|
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType';
|
|
7
7
|
import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
|
|
8
8
|
import Plugin from '@jbrowse/core/Plugin';
|
|
9
|
-
import { getContainingView, getContainingDisplay, makeAbortableReaction, assembleLocString, getSession, isSessionModelWithWidgets, isSelectionContainer, isAbortException, stringify, useDebounce, measureText, useDebouncedCallback, viewBpToPx, clamp, isViewContainer, parseLocString, findLastIndex, springAnimate, isAbstractMenuManager } from '@jbrowse/core/util';
|
|
9
|
+
import { getContainingView, getContainingDisplay, makeAbortableReaction, assembleLocString, getSession, isSessionModelWithWidgets, isSelectionContainer, isAbortException, stringify, getBpDisplayStr, useDebounce, measureText, useDebouncedCallback, viewBpToPx, clamp, isViewContainer, parseLocString, findLastIndex, springAnimate, isAbstractMenuManager } from '@jbrowse/core/util';
|
|
10
10
|
import LineStyleIcon from '@material-ui/icons/LineStyle';
|
|
11
|
-
import { useTheme, makeStyles as makeStyles$1, alpha, Portal, Typography as Typography$1, Button as Button$1, Popover, Tooltip as Tooltip$1, TextField, Popper, CircularProgress, InputAdornment, IconButton, Dialog, DialogTitle, DialogContent, FormControlLabel, Checkbox, DialogActions,
|
|
11
|
+
import { useTheme, makeStyles as makeStyles$1, alpha, Portal, Typography as Typography$1, Button as Button$1, Popover, Tooltip as Tooltip$1, TextField, Popper, CircularProgress, InputAdornment, IconButton, Dialog, DialogTitle, DialogContent, FormControlLabel, Checkbox, DialogActions, FormGroup, Paper, Container, Grid, Divider, TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from '@material-ui/core';
|
|
12
12
|
import CompositeMap from '@jbrowse/core/util/compositeMap';
|
|
13
13
|
import { isFeature } from '@jbrowse/core/util/simpleFeature';
|
|
14
14
|
import { getParentRenderProps, getTrackAssemblyNames, getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
15
15
|
import { getParent, types, cast, isAlive, addDisposer, getEnv, resolveIdentifier, getRoot, getSnapshot } from 'mobx-state-tree';
|
|
16
16
|
import MenuOpenIcon from '@material-ui/icons/MenuOpen';
|
|
17
|
-
import { Menu, ResizeHandle } from '@jbrowse/core/ui';
|
|
17
|
+
import { Menu, ResizeHandle, ReturnToImportFormDialog } from '@jbrowse/core/ui';
|
|
18
18
|
import { observer, PropTypes } from 'mobx-react';
|
|
19
19
|
import { usePopper } from 'react-popper';
|
|
20
20
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -50,13 +50,13 @@ import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
|
|
50
50
|
import IconButton$1 from '@material-ui/core/IconButton';
|
|
51
51
|
import Slider from '@material-ui/core/Slider';
|
|
52
52
|
import ZoomOut from '@material-ui/icons/ZoomOut';
|
|
53
|
-
import Paper$1 from '@material-ui/core/Paper';
|
|
54
53
|
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
|
55
54
|
import DragIcon from '@material-ui/icons/DragIndicator';
|
|
56
55
|
import normalizeWheel from 'normalize-wheel';
|
|
57
56
|
import { alpha as alpha$1 } from '@material-ui/core/styles/colorManipulator';
|
|
58
57
|
import Popover$1 from '@material-ui/core/Popover';
|
|
59
58
|
import Tooltip$2 from '@material-ui/core/Tooltip';
|
|
59
|
+
import Paper$1 from '@material-ui/core/Paper';
|
|
60
60
|
import ErrorMessage from '@jbrowse/core/ui/ErrorMessage';
|
|
61
61
|
import AssemblySelector from '@jbrowse/core/ui/AssemblySelector';
|
|
62
62
|
import ArrowDown from '@material-ui/icons/KeyboardArrowDown';
|
|
@@ -1305,8 +1305,7 @@ var RenderedBlocks = /*#__PURE__*/observer(function (_ref) {
|
|
|
1305
1305
|
function LinearBlocks(_ref2) {
|
|
1306
1306
|
var model = _ref2.model;
|
|
1307
1307
|
var classes = useStyles$1();
|
|
1308
|
-
var blockDefinitions = model.blockDefinitions;
|
|
1309
|
-
|
|
1308
|
+
var blockDefinitions = model.blockDefinitions;
|
|
1310
1309
|
var viewModel = getContainingView(model);
|
|
1311
1310
|
return /*#__PURE__*/React.createElement("div", {
|
|
1312
1311
|
"data-testid": "Blockset",
|
|
@@ -1318,10 +1317,6 @@ function LinearBlocks(_ref2) {
|
|
|
1318
1317
|
model: model
|
|
1319
1318
|
}));
|
|
1320
1319
|
}
|
|
1321
|
-
|
|
1322
|
-
LinearBlocks.propTypes = {
|
|
1323
|
-
model: PropTypes.observableObject.isRequired
|
|
1324
|
-
};
|
|
1325
1320
|
var LinearBlocks$1 = /*#__PURE__*/observer(LinearBlocks);
|
|
1326
1321
|
|
|
1327
1322
|
function round(value) {
|
|
@@ -1346,7 +1341,7 @@ var useStyles$2 = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
|
1346
1341
|
color: theme.palette.common.white,
|
|
1347
1342
|
fontFamily: theme.typography.fontFamily,
|
|
1348
1343
|
padding: '4px 8px',
|
|
1349
|
-
fontSize: theme.typography.pxToRem(
|
|
1344
|
+
fontSize: theme.typography.pxToRem(12),
|
|
1350
1345
|
lineHeight: "".concat(round(14 / 10), "em"),
|
|
1351
1346
|
maxWidth: 300,
|
|
1352
1347
|
wordWrap: 'break-word'
|
|
@@ -2324,9 +2319,10 @@ var BaseLinearDisplay$1 = /*#__PURE__*/types.compose('BaseLinearDisplay', BaseDi
|
|
|
2324
2319
|
case 0:
|
|
2325
2320
|
self.setError();
|
|
2326
2321
|
aborter = new AbortController();
|
|
2327
|
-
view = getContainingView(self);
|
|
2322
|
+
view = getContainingView(self); // extra check for contentBlocks.length
|
|
2323
|
+
// https://github.com/GMOD/jbrowse-components/issues/2694
|
|
2328
2324
|
|
|
2329
|
-
if (view.initialized) {
|
|
2325
|
+
if (!(!view.initialized || !view.staticBlocks.contentBlocks.length)) {
|
|
2330
2326
|
_context.next = 5;
|
|
2331
2327
|
break;
|
|
2332
2328
|
}
|
|
@@ -2377,7 +2373,7 @@ var BaseLinearDisplay$1 = /*#__PURE__*/types.compose('BaseLinearDisplay', BaseDi
|
|
|
2377
2373
|
afterAttach: function afterAttach() {
|
|
2378
2374
|
// this autorun performs stats estimation
|
|
2379
2375
|
//
|
|
2380
|
-
// the chain of events calls
|
|
2376
|
+
// the chain of events calls estimateRegionsStats against the data
|
|
2381
2377
|
// adapter which by default uses featureDensity, but can also respond
|
|
2382
2378
|
// with a byte size estimate and fetch size limit (data adapter can
|
|
2383
2379
|
// define what is too much data)
|
|
@@ -2390,9 +2386,10 @@ var BaseLinearDisplay$1 = /*#__PURE__*/types.compose('BaseLinearDisplay', BaseDi
|
|
|
2390
2386
|
case 0:
|
|
2391
2387
|
_context2.prev = 0;
|
|
2392
2388
|
aborter = new AbortController();
|
|
2393
|
-
view = getContainingView(self);
|
|
2389
|
+
view = getContainingView(self); // extra check for contentBlocks.length
|
|
2390
|
+
// https://github.com/GMOD/jbrowse-components/issues/2694
|
|
2394
2391
|
|
|
2395
|
-
if (view.initialized) {
|
|
2392
|
+
if (!(!view.initialized || !view.staticBlocks.contentBlocks.length)) {
|
|
2396
2393
|
_context2.next = 5;
|
|
2397
2394
|
break;
|
|
2398
2395
|
}
|
|
@@ -3241,7 +3238,8 @@ var Cytobands = /*#__PURE__*/observer(function (_ref2) {
|
|
|
3241
3238
|
var overview = _ref2.overview,
|
|
3242
3239
|
block = _ref2.block,
|
|
3243
3240
|
assembly = _ref2.assembly;
|
|
3244
|
-
var offsetPx = block.offsetPx
|
|
3241
|
+
var offsetPx = block.offsetPx,
|
|
3242
|
+
reversed = block.reversed;
|
|
3245
3243
|
var cytobands = assembly === null || assembly === void 0 ? void 0 : (_assembly$cytobands = assembly.cytobands) === null || _assembly$cytobands === void 0 ? void 0 : _assembly$cytobands.map(function (f) {
|
|
3246
3244
|
return {
|
|
3247
3245
|
refName: assembly.getCanonicalRefName(f.get('refName')),
|
|
@@ -3264,6 +3262,9 @@ var Cytobands = /*#__PURE__*/observer(function (_ref2) {
|
|
|
3264
3262
|
coord: end
|
|
3265
3263
|
}), type];
|
|
3266
3264
|
});
|
|
3265
|
+
var arr = cytobands || [];
|
|
3266
|
+
var lcap = reversed ? arr.length - 1 : 0;
|
|
3267
|
+
var rcap = reversed ? 0 : arr.length - 1;
|
|
3267
3268
|
var firstCent = true;
|
|
3268
3269
|
return cytobands ? /*#__PURE__*/React.createElement("g", {
|
|
3269
3270
|
transform: "translate(-".concat(offsetPx, ")")
|
|
@@ -3292,13 +3293,13 @@ var Cytobands = /*#__PURE__*/observer(function (_ref2) {
|
|
|
3292
3293
|
});
|
|
3293
3294
|
}
|
|
3294
3295
|
|
|
3295
|
-
if (
|
|
3296
|
+
if (lcap === index) {
|
|
3296
3297
|
return /*#__PURE__*/React.createElement("path", {
|
|
3297
3298
|
key: key,
|
|
3298
3299
|
d: leftRoundedRect(Math.min(start, end), 0, Math.abs(end - start), HEADER_OVERVIEW_HEIGHT, 8),
|
|
3299
3300
|
fill: colorMap[type]
|
|
3300
3301
|
});
|
|
3301
|
-
} else if (
|
|
3302
|
+
} else if (rcap === index) {
|
|
3302
3303
|
return /*#__PURE__*/React.createElement("path", {
|
|
3303
3304
|
key: key,
|
|
3304
3305
|
d: rightRoundedRect(Math.min(start, end), 0, Math.abs(end - start) - 2, HEADER_OVERVIEW_HEIGHT, 8),
|
|
@@ -3477,20 +3478,6 @@ function OverviewScaleBar(_ref7) {
|
|
|
3477
3478
|
|
|
3478
3479
|
var OverviewScaleBar$1 = /*#__PURE__*/observer(OverviewScaleBar);
|
|
3479
3480
|
|
|
3480
|
-
function getBpDisplayStr(totalBp) {
|
|
3481
|
-
var displayBp;
|
|
3482
|
-
|
|
3483
|
-
if (Math.floor(totalBp / 1000000) > 0) {
|
|
3484
|
-
displayBp = "".concat(parseFloat((totalBp / 1000000).toPrecision(3)), "Mbp");
|
|
3485
|
-
} else if (Math.floor(totalBp / 1000) > 0) {
|
|
3486
|
-
displayBp = "".concat(parseFloat((totalBp / 1000).toPrecision(3)), "Kbp");
|
|
3487
|
-
} else {
|
|
3488
|
-
displayBp = "".concat(Math.floor(totalBp), "bp");
|
|
3489
|
-
}
|
|
3490
|
-
|
|
3491
|
-
return displayBp;
|
|
3492
|
-
}
|
|
3493
|
-
|
|
3494
3481
|
function ScaleBar$1(_ref) {
|
|
3495
3482
|
var model = _ref.model,
|
|
3496
3483
|
fontSize = _ref.fontSize;
|
|
@@ -4373,51 +4360,7 @@ function ExportSvgDlg(_ref) {
|
|
|
4373
4360
|
}, "Submit")));
|
|
4374
4361
|
}
|
|
4375
4362
|
|
|
4376
|
-
var useStyles$9 = /*#__PURE__*/makeStyles(
|
|
4377
|
-
return {
|
|
4378
|
-
closeButton: {
|
|
4379
|
-
position: 'absolute',
|
|
4380
|
-
right: theme.spacing(1),
|
|
4381
|
-
top: theme.spacing(1),
|
|
4382
|
-
color: theme.palette.grey[500]
|
|
4383
|
-
}
|
|
4384
|
-
};
|
|
4385
|
-
});
|
|
4386
|
-
|
|
4387
|
-
function ReturnToImportFormDialog(_ref) {
|
|
4388
|
-
var model = _ref.model,
|
|
4389
|
-
handleClose = _ref.handleClose;
|
|
4390
|
-
var classes = useStyles$9();
|
|
4391
|
-
return /*#__PURE__*/React.createElement(Dialog, {
|
|
4392
|
-
maxWidth: "xl",
|
|
4393
|
-
open: true,
|
|
4394
|
-
onClose: handleClose
|
|
4395
|
-
}, /*#__PURE__*/React.createElement(DialogTitle, null, "Reference sequence", handleClose ? /*#__PURE__*/React.createElement(IconButton, {
|
|
4396
|
-
className: classes.closeButton,
|
|
4397
|
-
onClick: function onClick() {
|
|
4398
|
-
handleClose();
|
|
4399
|
-
}
|
|
4400
|
-
}, /*#__PURE__*/React.createElement(CloseIcon, null)) : null), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement(Typography$1, null, "Are you sure you want to return to the import form? This will lose your current view")), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button$1, {
|
|
4401
|
-
onClick: function onClick() {
|
|
4402
|
-
model.clearView();
|
|
4403
|
-
handleClose();
|
|
4404
|
-
},
|
|
4405
|
-
variant: "contained",
|
|
4406
|
-
color: "primary",
|
|
4407
|
-
autoFocus: true
|
|
4408
|
-
}, "OK"), /*#__PURE__*/React.createElement(Button$1, {
|
|
4409
|
-
onClick: function onClick() {
|
|
4410
|
-
handleClose();
|
|
4411
|
-
},
|
|
4412
|
-
color: "secondary",
|
|
4413
|
-
variant: "contained",
|
|
4414
|
-
autoFocus: true
|
|
4415
|
-
}, "Cancel")));
|
|
4416
|
-
}
|
|
4417
|
-
|
|
4418
|
-
var ReturnToImportFormDlg = /*#__PURE__*/observer(ReturnToImportFormDialog);
|
|
4419
|
-
|
|
4420
|
-
var useStyles$a = /*#__PURE__*/makeStyles({
|
|
4363
|
+
var useStyles$9 = /*#__PURE__*/makeStyles({
|
|
4421
4364
|
container: {
|
|
4422
4365
|
display: 'flex',
|
|
4423
4366
|
flexDirection: 'row',
|
|
@@ -4430,7 +4373,7 @@ var useStyles$a = /*#__PURE__*/makeStyles({
|
|
|
4430
4373
|
|
|
4431
4374
|
function ZoomControls(_ref) {
|
|
4432
4375
|
var model = _ref.model;
|
|
4433
|
-
var classes = useStyles$
|
|
4376
|
+
var classes = useStyles$9();
|
|
4434
4377
|
var maxBpPerPx = model.maxBpPerPx,
|
|
4435
4378
|
minBpPerPx = model.minBpPerPx,
|
|
4436
4379
|
bpPerPx = model.bpPerPx,
|
|
@@ -4477,7 +4420,7 @@ function ZoomControls(_ref) {
|
|
|
4477
4420
|
|
|
4478
4421
|
var ZoomControls$1 = /*#__PURE__*/observer(ZoomControls);
|
|
4479
4422
|
|
|
4480
|
-
var useStyles$
|
|
4423
|
+
var useStyles$a = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
4481
4424
|
return {
|
|
4482
4425
|
headerBar: {
|
|
4483
4426
|
height: HEADER_BAR_HEIGHT,
|
|
@@ -4512,7 +4455,7 @@ var useStyles$b = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
|
4512
4455
|
});
|
|
4513
4456
|
var HeaderButtons = /*#__PURE__*/observer(function (_ref) {
|
|
4514
4457
|
var model = _ref.model;
|
|
4515
|
-
var classes = useStyles$
|
|
4458
|
+
var classes = useStyles$a();
|
|
4516
4459
|
return /*#__PURE__*/React.createElement(Button$1, {
|
|
4517
4460
|
onClick: model.activateTrackSelector,
|
|
4518
4461
|
className: classes.toggleButton,
|
|
@@ -4526,7 +4469,7 @@ var HeaderButtons = /*#__PURE__*/observer(function (_ref) {
|
|
|
4526
4469
|
|
|
4527
4470
|
function PanControls(_ref2) {
|
|
4528
4471
|
var model = _ref2.model;
|
|
4529
|
-
var classes = useStyles$
|
|
4472
|
+
var classes = useStyles$a();
|
|
4530
4473
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button$1, {
|
|
4531
4474
|
variant: "outlined",
|
|
4532
4475
|
className: classes.panButton,
|
|
@@ -4544,7 +4487,7 @@ function PanControls(_ref2) {
|
|
|
4544
4487
|
|
|
4545
4488
|
var RegionWidth = /*#__PURE__*/observer(function (_ref3) {
|
|
4546
4489
|
var model = _ref3.model;
|
|
4547
|
-
var classes = useStyles$
|
|
4490
|
+
var classes = useStyles$a();
|
|
4548
4491
|
var coarseTotalBp = model.coarseTotalBp;
|
|
4549
4492
|
return /*#__PURE__*/React.createElement(Typography$1, {
|
|
4550
4493
|
variant: "body2",
|
|
@@ -4555,7 +4498,7 @@ var RegionWidth = /*#__PURE__*/observer(function (_ref3) {
|
|
|
4555
4498
|
|
|
4556
4499
|
var Controls = function Controls(_ref4) {
|
|
4557
4500
|
var model = _ref4.model;
|
|
4558
|
-
var classes = useStyles$
|
|
4501
|
+
var classes = useStyles$a();
|
|
4559
4502
|
return /*#__PURE__*/React.createElement("div", {
|
|
4560
4503
|
className: classes.headerBar
|
|
4561
4504
|
}, /*#__PURE__*/React.createElement(HeaderButtons, {
|
|
@@ -4589,7 +4532,7 @@ var LinearGenomeViewHeader = /*#__PURE__*/observer(function (_ref5) {
|
|
|
4589
4532
|
}));
|
|
4590
4533
|
});
|
|
4591
4534
|
|
|
4592
|
-
var useStyles$
|
|
4535
|
+
var useStyles$b = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
4593
4536
|
return {
|
|
4594
4537
|
root: {
|
|
4595
4538
|
background: alpha(theme.palette.background.paper, 0.8),
|
|
@@ -4623,7 +4566,7 @@ var useStyles$c = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
|
4623
4566
|
var TrackLabel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
4624
4567
|
var _session$getTrackActi;
|
|
4625
4568
|
|
|
4626
|
-
var classes = useStyles$
|
|
4569
|
+
var classes = useStyles$b();
|
|
4627
4570
|
|
|
4628
4571
|
var _React$useState = React.useState(null),
|
|
4629
4572
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -4674,7 +4617,9 @@ var TrackLabel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
4674
4617
|
handleClose();
|
|
4675
4618
|
}
|
|
4676
4619
|
|
|
4677
|
-
var items = track.trackMenuItems()
|
|
4620
|
+
var items = [].concat(_toConsumableArray((_session$getTrackActi = session.getTrackActionMenuItems) === null || _session$getTrackActi === void 0 ? void 0 : _session$getTrackActi.call(session, trackConf)), _toConsumableArray(track.trackMenuItems())).sort(function (a, b) {
|
|
4621
|
+
return (b.priority || 0) - (a.priority || 0);
|
|
4622
|
+
});
|
|
4678
4623
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Paper, {
|
|
4679
4624
|
ref: ref,
|
|
4680
4625
|
className: clsx(className, classes.root)
|
|
@@ -4710,20 +4655,16 @@ var TrackLabel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
4710
4655
|
onMenuItemClick: handleMenuItemClick,
|
|
4711
4656
|
open: Boolean(anchorEl),
|
|
4712
4657
|
onClose: handleClose,
|
|
4713
|
-
menuItems:
|
|
4714
|
-
return (b.priority || 0) - (a.priority || 0);
|
|
4715
|
-
})
|
|
4658
|
+
menuItems: items
|
|
4716
4659
|
}));
|
|
4717
4660
|
});
|
|
4718
4661
|
var TrackLabel$1 = /*#__PURE__*/observer(TrackLabel);
|
|
4719
4662
|
|
|
4720
|
-
var useStyles$
|
|
4663
|
+
var useStyles$c = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
4721
4664
|
return {
|
|
4722
4665
|
root: {},
|
|
4723
4666
|
resizeHandle: {
|
|
4724
4667
|
height: RESIZE_HANDLE_HEIGHT,
|
|
4725
|
-
boxSizing: 'border-box',
|
|
4726
|
-
position: 'relative',
|
|
4727
4668
|
zIndex: 2
|
|
4728
4669
|
},
|
|
4729
4670
|
overlay: {
|
|
@@ -4735,13 +4676,6 @@ var useStyles$d = /*#__PURE__*/makeStyles(function (theme) {
|
|
|
4735
4676
|
zIndex: 3,
|
|
4736
4677
|
borderRadius: theme.shape.borderRadius
|
|
4737
4678
|
},
|
|
4738
|
-
renderingComponentContainer: {
|
|
4739
|
-
position: 'absolute',
|
|
4740
|
-
// -1 offset because of the 1px border of the Paper
|
|
4741
|
-
left: -1,
|
|
4742
|
-
height: '100%',
|
|
4743
|
-
width: '100%'
|
|
4744
|
-
},
|
|
4745
4679
|
trackLabel: {
|
|
4746
4680
|
zIndex: 3,
|
|
4747
4681
|
margin: theme.spacing(1)
|
|
@@ -4759,22 +4693,22 @@ var useStyles$d = /*#__PURE__*/makeStyles(function (theme) {
|
|
|
4759
4693
|
whiteSpace: 'nowrap',
|
|
4760
4694
|
position: 'relative',
|
|
4761
4695
|
background: 'none',
|
|
4762
|
-
zIndex: 2
|
|
4763
|
-
boxSizing: 'content-box'
|
|
4696
|
+
zIndex: 2
|
|
4764
4697
|
}
|
|
4765
4698
|
};
|
|
4766
4699
|
});
|
|
4767
4700
|
|
|
4768
|
-
function TrackContainer(
|
|
4769
|
-
var
|
|
4770
|
-
|
|
4771
|
-
|
|
4701
|
+
function TrackContainer(_ref) {
|
|
4702
|
+
var model = _ref.model,
|
|
4703
|
+
track = _ref.track;
|
|
4704
|
+
var classes = useStyles$c();
|
|
4772
4705
|
var display = track.displays[0];
|
|
4773
|
-
var
|
|
4706
|
+
var id = model.id,
|
|
4707
|
+
trackLabels = model.trackLabels,
|
|
4708
|
+
horizontalScroll = model.horizontalScroll,
|
|
4774
4709
|
draggingTrackId = model.draggingTrackId,
|
|
4775
4710
|
moveTrack = model.moveTrack;
|
|
4776
4711
|
var height = display.height;
|
|
4777
|
-
var view = getContainingView(display);
|
|
4778
4712
|
var trackId = getConf(track, 'trackId');
|
|
4779
4713
|
var ref = useRef(null);
|
|
4780
4714
|
useEffect(function () {
|
|
@@ -4799,10 +4733,7 @@ function TrackContainer(props) {
|
|
|
4799
4733
|
var dimmed = draggingTrackId !== undefined && draggingTrackId !== display.id;
|
|
4800
4734
|
return /*#__PURE__*/React.createElement("div", {
|
|
4801
4735
|
className: classes.root
|
|
4802
|
-
},
|
|
4803
|
-
track: track,
|
|
4804
|
-
className: clsx(classes.trackLabel, view.trackLabels === 'overlapping' ? classes.trackLabelOverlap : classes.trackLabelInline)
|
|
4805
|
-
}) : null, /*#__PURE__*/React.createElement(Paper$1, {
|
|
4736
|
+
}, /*#__PURE__*/React.createElement(Paper, {
|
|
4806
4737
|
variant: "outlined",
|
|
4807
4738
|
className: classes.trackRenderingContainer,
|
|
4808
4739
|
style: {
|
|
@@ -4813,11 +4744,13 @@ function TrackContainer(props) {
|
|
|
4813
4744
|
display.setScrollTop(target.scrollTop);
|
|
4814
4745
|
},
|
|
4815
4746
|
onDragEnter: debouncedOnDragEnter,
|
|
4816
|
-
"data-testid": "trackRenderingContainer-".concat(
|
|
4747
|
+
"data-testid": "trackRenderingContainer-".concat(id, "-").concat(trackId),
|
|
4817
4748
|
role: "presentation"
|
|
4818
|
-
}, /*#__PURE__*/React.createElement(
|
|
4749
|
+
}, trackLabels !== 'hidden' ? /*#__PURE__*/React.createElement(TrackLabel$1, {
|
|
4750
|
+
track: track,
|
|
4751
|
+
className: clsx(classes.trackLabel, trackLabels === 'overlapping' ? classes.trackLabelOverlap : classes.trackLabelInline)
|
|
4752
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
4819
4753
|
ref: ref,
|
|
4820
|
-
className: classes.renderingComponentContainer,
|
|
4821
4754
|
style: {
|
|
4822
4755
|
transform: "scaleX(".concat(model.scaleFactor, ")")
|
|
4823
4756
|
}
|
|
@@ -4831,7 +4764,7 @@ function TrackContainer(props) {
|
|
|
4831
4764
|
left: 0,
|
|
4832
4765
|
top: display.height - 20
|
|
4833
4766
|
}
|
|
4834
|
-
},
|
|
4767
|
+
}, /*#__PURE__*/React.createElement(DisplayBlurb, {
|
|
4835
4768
|
model: display
|
|
4836
4769
|
})) : null), /*#__PURE__*/React.createElement("div", {
|
|
4837
4770
|
className: classes.overlay,
|
|
@@ -4848,7 +4781,7 @@ function TrackContainer(props) {
|
|
|
4848
4781
|
|
|
4849
4782
|
var TrackContainer$1 = /*#__PURE__*/observer(TrackContainer);
|
|
4850
4783
|
|
|
4851
|
-
var useStyles$
|
|
4784
|
+
var useStyles$d = /*#__PURE__*/makeStyles(function (theme) {
|
|
4852
4785
|
var background = theme.palette.tertiary ? alpha$1(theme.palette.tertiary.main, 0.7) : alpha$1(theme.palette.primary.main, 0.7);
|
|
4853
4786
|
return {
|
|
4854
4787
|
rubberBand: {
|
|
@@ -4887,7 +4820,7 @@ var useStyles$e = /*#__PURE__*/makeStyles(function (theme) {
|
|
|
4887
4820
|
var VerticalGuide = /*#__PURE__*/observer(function (_ref) {
|
|
4888
4821
|
var model = _ref.model,
|
|
4889
4822
|
coordX = _ref.coordX;
|
|
4890
|
-
var classes = useStyles$
|
|
4823
|
+
var classes = useStyles$d();
|
|
4891
4824
|
return /*#__PURE__*/React.createElement(Tooltip$2, {
|
|
4892
4825
|
open: true,
|
|
4893
4826
|
placement: "top",
|
|
@@ -4931,7 +4864,7 @@ function RubberBand(_ref2) {
|
|
|
4931
4864
|
|
|
4932
4865
|
var controlsRef = useRef(null);
|
|
4933
4866
|
var rubberBandRef = useRef(null);
|
|
4934
|
-
var classes = useStyles$
|
|
4867
|
+
var classes = useStyles$d();
|
|
4935
4868
|
var mouseDragging = startX !== undefined && anchorPosition === undefined;
|
|
4936
4869
|
var setOffsets = model.setOffsets,
|
|
4937
4870
|
pxToBp = model.pxToBp;
|
|
@@ -5134,7 +5067,7 @@ RubberBand.defaultProps = {
|
|
|
5134
5067
|
var RubberBand$1 = /*#__PURE__*/observer(RubberBand);
|
|
5135
5068
|
|
|
5136
5069
|
var _excluded$1 = ["model", "style", "className"];
|
|
5137
|
-
var useStyles$
|
|
5070
|
+
var useStyles$e = /*#__PURE__*/makeStyles(function (theme) {
|
|
5138
5071
|
return {
|
|
5139
5072
|
scaleBarContainer: {
|
|
5140
5073
|
overflow: 'hidden',
|
|
@@ -5178,7 +5111,7 @@ var useStyles$f = /*#__PURE__*/makeStyles(function (theme) {
|
|
|
5178
5111
|
});
|
|
5179
5112
|
var RenderedRefNameLabels = /*#__PURE__*/observer(function (_ref) {
|
|
5180
5113
|
var model = _ref.model;
|
|
5181
|
-
var classes = useStyles$
|
|
5114
|
+
var classes = useStyles$e(); // find the block that needs pinning to the left side for context
|
|
5182
5115
|
|
|
5183
5116
|
var lastLeftBlock = 0;
|
|
5184
5117
|
model.staticBlocks.forEach(function (block, i) {
|
|
@@ -5200,7 +5133,7 @@ var RenderedRefNameLabels = /*#__PURE__*/observer(function (_ref) {
|
|
|
5200
5133
|
});
|
|
5201
5134
|
var RenderedScaleBarLabels = /*#__PURE__*/observer(function (_ref2) {
|
|
5202
5135
|
var model = _ref2.model;
|
|
5203
|
-
var classes = useStyles$
|
|
5136
|
+
var classes = useStyles$e();
|
|
5204
5137
|
return /*#__PURE__*/React.createElement(React.Fragment, null, model.staticBlocks.map(function (block, index) {
|
|
5205
5138
|
if (block instanceof ContentBlock$1) {
|
|
5206
5139
|
var ticks = makeTicks(block.start, block.end, model.bpPerPx, true, false);
|
|
@@ -5253,7 +5186,7 @@ var ScaleBar$2 = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
5253
5186
|
className = _ref3.className,
|
|
5254
5187
|
other = _objectWithoutProperties(_ref3, _excluded$1);
|
|
5255
5188
|
|
|
5256
|
-
var classes = useStyles$
|
|
5189
|
+
var classes = useStyles$e();
|
|
5257
5190
|
var offsetLeft = model.staticBlocks.offsetPx - model.offsetPx;
|
|
5258
5191
|
return /*#__PURE__*/React.createElement(Paper$1, Object.assign({
|
|
5259
5192
|
"data-resizer": "true" // used to avoid click-and-drag scrolls on trackscontainer
|
|
@@ -5281,7 +5214,7 @@ var ScaleBar$2 = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
5281
5214
|
});
|
|
5282
5215
|
var ScaleBar$3 = /*#__PURE__*/observer(ScaleBar$2);
|
|
5283
5216
|
|
|
5284
|
-
var useStyles$
|
|
5217
|
+
var useStyles$f = /*#__PURE__*/makeStyles(function (theme) {
|
|
5285
5218
|
return {
|
|
5286
5219
|
verticalGuidesZoomContainer: {
|
|
5287
5220
|
position: 'absolute',
|
|
@@ -5312,7 +5245,7 @@ var useStyles$g = /*#__PURE__*/makeStyles(function (theme) {
|
|
|
5312
5245
|
});
|
|
5313
5246
|
var RenderedVerticalGuides = /*#__PURE__*/observer(function (_ref) {
|
|
5314
5247
|
var model = _ref.model;
|
|
5315
|
-
var classes = useStyles$
|
|
5248
|
+
var classes = useStyles$f();
|
|
5316
5249
|
return /*#__PURE__*/React.createElement(React.Fragment, null, model.staticBlocks.map(function (block, index) {
|
|
5317
5250
|
if (block instanceof ContentBlock$1) {
|
|
5318
5251
|
var ticks = makeTicks(block.start, block.end, model.bpPerPx);
|
|
@@ -5352,7 +5285,7 @@ var RenderedVerticalGuides = /*#__PURE__*/observer(function (_ref) {
|
|
|
5352
5285
|
|
|
5353
5286
|
function VerticalGuides(_ref2) {
|
|
5354
5287
|
var model = _ref2.model;
|
|
5355
|
-
var classes = useStyles$
|
|
5288
|
+
var classes = useStyles$f(); // find the block that needs pinning to the left side for context
|
|
5356
5289
|
|
|
5357
5290
|
var offsetLeft = model.staticBlocks.offsetPx - model.offsetPx;
|
|
5358
5291
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -5373,7 +5306,7 @@ function VerticalGuides(_ref2) {
|
|
|
5373
5306
|
|
|
5374
5307
|
var VerticalGuides$1 = /*#__PURE__*/observer(VerticalGuides);
|
|
5375
5308
|
|
|
5376
|
-
var useStyles$
|
|
5309
|
+
var useStyles$g = /*#__PURE__*/makeStyles(function () {
|
|
5377
5310
|
return {
|
|
5378
5311
|
centerLineContainer: {
|
|
5379
5312
|
background: 'transparent',
|
|
@@ -5402,7 +5335,7 @@ function CenterLine(_ref) {
|
|
|
5402
5335
|
tracks = model.tracks,
|
|
5403
5336
|
width = model.width;
|
|
5404
5337
|
var ref = useRef(null);
|
|
5405
|
-
var classes = useStyles$
|
|
5338
|
+
var classes = useStyles$g();
|
|
5406
5339
|
var startingPosition = width / 2;
|
|
5407
5340
|
return tracks.length ? /*#__PURE__*/React.createElement("div", {
|
|
5408
5341
|
"data-testid": "centerline_container",
|
|
@@ -5429,7 +5362,7 @@ CenterLine.propTypes = {
|
|
|
5429
5362
|
};
|
|
5430
5363
|
var CenterLine$1 = /*#__PURE__*/observer(CenterLine);
|
|
5431
5364
|
|
|
5432
|
-
var useStyles$
|
|
5365
|
+
var useStyles$h = /*#__PURE__*/makeStyles(function (theme) {
|
|
5433
5366
|
return {
|
|
5434
5367
|
tracksContainer: {
|
|
5435
5368
|
position: 'relative',
|
|
@@ -5446,7 +5379,7 @@ var useStyles$i = /*#__PURE__*/makeStyles(function (theme) {
|
|
|
5446
5379
|
function TracksContainer(_ref) {
|
|
5447
5380
|
var children = _ref.children,
|
|
5448
5381
|
model = _ref.model;
|
|
5449
|
-
var classes = useStyles$
|
|
5382
|
+
var classes = useStyles$h(); // refs are to store these variables to avoid repeated rerenders associated
|
|
5450
5383
|
// with useState/setState
|
|
5451
5384
|
|
|
5452
5385
|
var delta = useRef(0);
|
|
@@ -5612,7 +5545,7 @@ var TracksContainer$1 = /*#__PURE__*/observer(TracksContainer);
|
|
|
5612
5545
|
var SearchResultsDialog = /*#__PURE__*/lazy(function () {
|
|
5613
5546
|
return Promise.resolve().then(function () { return SearchResultsDialog$2; });
|
|
5614
5547
|
});
|
|
5615
|
-
var useStyles$
|
|
5548
|
+
var useStyles$i = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
5616
5549
|
return {
|
|
5617
5550
|
importFormContainer: {
|
|
5618
5551
|
padding: theme.spacing(2)
|
|
@@ -5626,7 +5559,7 @@ var ImportForm = /*#__PURE__*/observer(function (_ref) {
|
|
|
5626
5559
|
var _regions$;
|
|
5627
5560
|
|
|
5628
5561
|
var model = _ref.model;
|
|
5629
|
-
var classes = useStyles$
|
|
5562
|
+
var classes = useStyles$i();
|
|
5630
5563
|
var session = getSession(model);
|
|
5631
5564
|
var assemblyNames = session.assemblyNames,
|
|
5632
5565
|
assemblyManager = session.assemblyManager,
|
|
@@ -5926,7 +5859,7 @@ var MiniControls = /*#__PURE__*/observer(function (props) {
|
|
|
5926
5859
|
}));
|
|
5927
5860
|
});
|
|
5928
5861
|
|
|
5929
|
-
var useStyles$
|
|
5862
|
+
var useStyles$j = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
5930
5863
|
return {
|
|
5931
5864
|
loadingMessage: {
|
|
5932
5865
|
padding: theme.spacing(5)
|
|
@@ -6022,7 +5955,7 @@ function _fetchSequence() {
|
|
|
6022
5955
|
function SequenceDialog(_ref) {
|
|
6023
5956
|
var model = _ref.model,
|
|
6024
5957
|
handleClose = _ref.handleClose;
|
|
6025
|
-
var classes = useStyles$
|
|
5958
|
+
var classes = useStyles$j();
|
|
6026
5959
|
var session = getSession(model);
|
|
6027
5960
|
|
|
6028
5961
|
var _useState = useState(),
|
|
@@ -6187,7 +6120,7 @@ function SequenceDialog(_ref) {
|
|
|
6187
6120
|
|
|
6188
6121
|
var SequenceDialog$1 = /*#__PURE__*/observer(SequenceDialog);
|
|
6189
6122
|
|
|
6190
|
-
var useStyles$
|
|
6123
|
+
var useStyles$k = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
6191
6124
|
return {
|
|
6192
6125
|
dialogContent: {
|
|
6193
6126
|
width: '80em'
|
|
@@ -6206,7 +6139,7 @@ function SearchResultsDialog$1(_ref) {
|
|
|
6206
6139
|
var model = _ref.model,
|
|
6207
6140
|
optAssemblyName = _ref.optAssemblyName,
|
|
6208
6141
|
handleClose = _ref.handleClose;
|
|
6209
|
-
var classes = useStyles$
|
|
6142
|
+
var classes = useStyles$k();
|
|
6210
6143
|
var session = getSession(model);
|
|
6211
6144
|
|
|
6212
6145
|
var _getEnv = getEnv(session),
|
|
@@ -6327,11 +6260,11 @@ function SearchResultsDialog$1(_ref) {
|
|
|
6327
6260
|
|
|
6328
6261
|
var SearchResultsDialog$2 = {
|
|
6329
6262
|
__proto__: null,
|
|
6330
|
-
useStyles: useStyles$
|
|
6263
|
+
useStyles: useStyles$k,
|
|
6331
6264
|
'default': SearchResultsDialog$1
|
|
6332
6265
|
};
|
|
6333
6266
|
|
|
6334
|
-
var useStyles$
|
|
6267
|
+
var useStyles$l = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
6335
6268
|
return {
|
|
6336
6269
|
note: {
|
|
6337
6270
|
textAlign: 'center',
|
|
@@ -6367,7 +6300,7 @@ var LinearGenomeView = /*#__PURE__*/observer(function (_ref) {
|
|
|
6367
6300
|
hideHeader = model.hideHeader,
|
|
6368
6301
|
initialized = model.initialized,
|
|
6369
6302
|
hasDisplayedRegions = model.hasDisplayedRegions;
|
|
6370
|
-
var classes = useStyles$
|
|
6303
|
+
var classes = useStyles$l();
|
|
6371
6304
|
|
|
6372
6305
|
if (!initialized && !error) {
|
|
6373
6306
|
return /*#__PURE__*/React.createElement(Typography$1, {
|
|
@@ -6448,7 +6381,7 @@ function calculateVisibleLocStrings(contentBlocks) {
|
|
|
6448
6381
|
assemblyName: isSingleAssemblyName ? undefined : block.assemblyName
|
|
6449
6382
|
}));
|
|
6450
6383
|
});
|
|
6451
|
-
return locs.join('
|
|
6384
|
+
return locs.join(' ');
|
|
6452
6385
|
}
|
|
6453
6386
|
|
|
6454
6387
|
var HEADER_BAR_HEIGHT = 48;
|
|
@@ -6458,6 +6391,11 @@ var RESIZE_HANDLE_HEIGHT = 3;
|
|
|
6458
6391
|
var INTER_REGION_PADDING_WIDTH = 2;
|
|
6459
6392
|
var WIDGET_HEIGHT = 32;
|
|
6460
6393
|
var SPACING = 7;
|
|
6394
|
+
|
|
6395
|
+
function localStorageGetItem(item) {
|
|
6396
|
+
return typeof localStorage !== 'undefined' ? localStorage.getItem(item) : undefined;
|
|
6397
|
+
}
|
|
6398
|
+
|
|
6461
6399
|
function stateModelFactory$1(pluginManager) {
|
|
6462
6400
|
return types.compose(BaseViewModel, types.model('LinearGenomeView', {
|
|
6463
6401
|
id: ElementId,
|
|
@@ -6472,15 +6410,15 @@ function stateModelFactory$1(pluginManager) {
|
|
|
6472
6410
|
hideHeaderOverview: false,
|
|
6473
6411
|
trackSelectorType: types.optional(types.enumeration(['hierarchical']), 'hierarchical'),
|
|
6474
6412
|
trackLabels: types.optional(types.string, function () {
|
|
6475
|
-
return
|
|
6413
|
+
return localStorageGetItem('lgv-trackLabels') || 'overlapping';
|
|
6476
6414
|
}),
|
|
6477
6415
|
showCenterLine: types.optional(types["boolean"], function () {
|
|
6478
|
-
var setting =
|
|
6479
|
-
return setting !== undefined ?
|
|
6416
|
+
var setting = localStorageGetItem('lgv-showCenterLine');
|
|
6417
|
+
return setting !== undefined && setting !== null ? !!+setting : false;
|
|
6480
6418
|
}),
|
|
6481
6419
|
showCytobandsSetting: types.optional(types["boolean"], function () {
|
|
6482
|
-
var setting =
|
|
6483
|
-
return setting !== undefined ?
|
|
6420
|
+
var setting = localStorageGetItem('lgv-showCytobands');
|
|
6421
|
+
return setting !== undefined && setting !== null ? !!+setting : true;
|
|
6484
6422
|
})
|
|
6485
6423
|
}))["volatile"](function () {
|
|
6486
6424
|
return {
|
|
@@ -7007,100 +6945,73 @@ function stateModelFactory$1(pluginManager) {
|
|
|
7007
6945
|
throw new Error("invalid track selector type ".concat(self.trackSelectorType));
|
|
7008
6946
|
},
|
|
7009
6947
|
navToLocString: function navToLocString(locString, optAssemblyName) {
|
|
6948
|
+
var assemblyNames = self.assemblyNames;
|
|
6949
|
+
|
|
7010
6950
|
var _getSession3 = getSession(self),
|
|
7011
6951
|
assemblyManager = _getSession3.assemblyManager;
|
|
7012
6952
|
|
|
7013
6953
|
var isValidRefName = assemblyManager.isValidRefName;
|
|
7014
|
-
var
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
6954
|
+
var assemblyName = optAssemblyName || assemblyNames[0];
|
|
6955
|
+
var parsedLocStrings = locString.split(' ').filter(function (f) {
|
|
6956
|
+
return !!f.trim();
|
|
6957
|
+
}).map(function (l) {
|
|
6958
|
+
return parseLocString(l, function (ref) {
|
|
6959
|
+
return isValidRefName(ref, assemblyName);
|
|
7019
6960
|
});
|
|
7020
|
-
this.navToMultiple(locations);
|
|
7021
|
-
return;
|
|
7022
|
-
}
|
|
7023
|
-
|
|
7024
|
-
var assemblyName = optAssemblyName;
|
|
7025
|
-
var defaultRefName = '';
|
|
7026
|
-
|
|
7027
|
-
if (self.displayedRegions.length !== 0) {
|
|
7028
|
-
// defaults
|
|
7029
|
-
assemblyName = self.displayedRegions[0].assemblyName;
|
|
7030
|
-
defaultRefName = self.displayedRegions[0].refName;
|
|
7031
|
-
}
|
|
7032
|
-
|
|
7033
|
-
var assembly = assemblyName && assemblyManager.get(assemblyName);
|
|
7034
|
-
|
|
7035
|
-
if (!assembly) {
|
|
7036
|
-
throw new Error("Could not find assembly ".concat(assemblyName));
|
|
7037
|
-
}
|
|
7038
|
-
|
|
7039
|
-
var _assembly = assembly,
|
|
7040
|
-
regions = _assembly.regions;
|
|
7041
|
-
|
|
7042
|
-
if (!regions) {
|
|
7043
|
-
throw new Error("Regions for assembly ".concat(assemblyName, " not yet loaded"));
|
|
7044
|
-
}
|
|
7045
|
-
|
|
7046
|
-
if (locStrings.length > 1) {
|
|
7047
|
-
throw new Error('Navigating to multiple locations is not allowed when viewing a whole chromosome');
|
|
7048
|
-
}
|
|
7049
|
-
|
|
7050
|
-
var parsedLocString = parseLocString(locStrings[0], function (refName) {
|
|
7051
|
-
return isValidRefName(refName, assemblyName);
|
|
7052
6961
|
});
|
|
7053
|
-
var
|
|
6962
|
+
var locations = parsedLocStrings.map(function (region) {
|
|
6963
|
+
var asmName = region.assemblyName || assemblyName;
|
|
6964
|
+
var asm = assemblyManager.get(asmName);
|
|
6965
|
+
var refName = region.refName;
|
|
7054
6966
|
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
if (!newAssembly) {
|
|
7059
|
-
throw new Error("Could not find assembly ".concat(parsedLocString.assemblyName));
|
|
6967
|
+
if (!asm) {
|
|
6968
|
+
throw new Error("assembly ".concat(asmName, " not found"));
|
|
7060
6969
|
}
|
|
7061
6970
|
|
|
7062
|
-
|
|
7063
|
-
changedAssembly = true;
|
|
7064
|
-
var newRegions = newAssembly.regions;
|
|
6971
|
+
var regions = asm.regions;
|
|
7065
6972
|
|
|
7066
|
-
if (!
|
|
7067
|
-
throw new Error("
|
|
6973
|
+
if (!regions) {
|
|
6974
|
+
throw new Error("regions not loaded yet for ".concat(asmName));
|
|
7068
6975
|
}
|
|
7069
6976
|
|
|
7070
|
-
|
|
7071
|
-
}
|
|
7072
|
-
|
|
7073
|
-
var canonicalRefName = assembly.getCanonicalRefName(parsedLocString.refName);
|
|
6977
|
+
var canonicalRefName = asm.getCanonicalRefName(region.refName);
|
|
7074
6978
|
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
6979
|
+
if (!canonicalRefName) {
|
|
6980
|
+
throw new Error("Could not find refName ".concat(refName, " in ").concat(asm.name));
|
|
6981
|
+
}
|
|
7078
6982
|
|
|
7079
|
-
|
|
7080
|
-
var newDisplayedRegion = regions.find(function (region) {
|
|
6983
|
+
var parentRegion = regions.find(function (region) {
|
|
7081
6984
|
return region.refName === canonicalRefName;
|
|
7082
6985
|
});
|
|
7083
6986
|
|
|
7084
|
-
if (
|
|
7085
|
-
|
|
7086
|
-
} else {
|
|
7087
|
-
throw new Error("Could not find refName ".concat(parsedLocString.refName, " in ").concat(assembly.name));
|
|
6987
|
+
if (!parentRegion) {
|
|
6988
|
+
throw new Error("Could not find refName ".concat(refName, " in ").concat(asmName));
|
|
7088
6989
|
}
|
|
7089
|
-
}
|
|
7090
6990
|
|
|
7091
|
-
|
|
7092
|
-
|
|
6991
|
+
return _objectSpread2(_objectSpread2({}, region), {}, {
|
|
6992
|
+
assemblyName: asmName,
|
|
6993
|
+
parentRegion: parentRegion
|
|
6994
|
+
});
|
|
7093
6995
|
});
|
|
7094
6996
|
|
|
7095
|
-
if (
|
|
7096
|
-
var
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
6997
|
+
if (locations.length === 1) {
|
|
6998
|
+
var loc = locations[0];
|
|
6999
|
+
this.setDisplayedRegions([_objectSpread2({
|
|
7000
|
+
reversed: loc.reversed
|
|
7001
|
+
}, loc.parentRegion)]);
|
|
7002
|
+
var start = loc.start,
|
|
7003
|
+
end = loc.end,
|
|
7004
|
+
parentRegion = loc.parentRegion;
|
|
7005
|
+
this.navTo(_objectSpread2(_objectSpread2({}, loc), {}, {
|
|
7006
|
+
start: clamp(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
|
|
7007
|
+
end: clamp(end !== null && end !== void 0 ? end : parentRegion.end, 0, parentRegion.end)
|
|
7008
|
+
}));
|
|
7009
|
+
} else {
|
|
7010
|
+
this.setDisplayedRegions( // @ts-ignore
|
|
7011
|
+
locations.map(function (r) {
|
|
7012
|
+
return r.start === undefined ? r.parentRegion : r;
|
|
7103
7013
|
}));
|
|
7014
|
+
this.showAllRegions();
|
|
7104
7015
|
}
|
|
7105
7016
|
},
|
|
7106
7017
|
|
|
@@ -7222,26 +7133,6 @@ function stateModelFactory$1(pluginManager) {
|
|
|
7222
7133
|
if (location.refName !== region.refName) {
|
|
7223
7134
|
throw new Error("Entered location ".concat(assembleLocString(location), " does not match with displayed regions"));
|
|
7224
7135
|
}
|
|
7225
|
-
|
|
7226
|
-
if (locationIndex > 0) {
|
|
7227
|
-
// does it reach the left side?
|
|
7228
|
-
var matchesLeft = region.reversed ? locationEnd === region.end : locationStart === region.start;
|
|
7229
|
-
|
|
7230
|
-
if (!matchesLeft) {
|
|
7231
|
-
throw new Error("".concat(region.reversed ? 'End' : 'Start', " of region ").concat(assembleLocString(location), " should be ").concat((region.reversed ? region.end : region.start + 1).toLocaleString('en-US'), ", but it is not"));
|
|
7232
|
-
}
|
|
7233
|
-
}
|
|
7234
|
-
|
|
7235
|
-
var isLast = locationIndex === locations.length - 1;
|
|
7236
|
-
|
|
7237
|
-
if (!isLast) {
|
|
7238
|
-
// does it reach the right side?
|
|
7239
|
-
var matchesRight = region.reversed ? locationStart === region.start : locationEnd === region.end;
|
|
7240
|
-
|
|
7241
|
-
if (!matchesRight) {
|
|
7242
|
-
throw new Error("".concat(region.reversed ? 'Start' : 'End', " of region ").concat(assembleLocString(location), " should be ").concat((region.reversed ? region.start + 1 : region.end).toLocaleString('en-US'), ", but it is not"));
|
|
7243
|
-
}
|
|
7244
|
-
}
|
|
7245
7136
|
}
|
|
7246
7137
|
|
|
7247
7138
|
locationIndex -= 1;
|
|
@@ -7529,8 +7420,6 @@ function stateModelFactory$1(pluginManager) {
|
|
|
7529
7420
|
|
|
7530
7421
|
};
|
|
7531
7422
|
}).views(function (self) {
|
|
7532
|
-
var currentlyCalculatedStaticBlocks;
|
|
7533
|
-
var stringifiedCurrentlyCalculatedStaticBlocks = '';
|
|
7534
7423
|
return {
|
|
7535
7424
|
menuItems: function menuItems() {
|
|
7536
7425
|
var canShowCytobands = self.canShowCytobands,
|
|
@@ -7538,10 +7427,10 @@ function stateModelFactory$1(pluginManager) {
|
|
|
7538
7427
|
var menuItems = [{
|
|
7539
7428
|
label: 'Return to import form',
|
|
7540
7429
|
onClick: function onClick() {
|
|
7541
|
-
getSession(self).queueDialog(function (
|
|
7542
|
-
return [
|
|
7430
|
+
getSession(self).queueDialog(function (handleClose) {
|
|
7431
|
+
return [ReturnToImportFormDialog, {
|
|
7543
7432
|
model: self,
|
|
7544
|
-
handleClose:
|
|
7433
|
+
handleClose: handleClose
|
|
7545
7434
|
}];
|
|
7546
7435
|
});
|
|
7547
7436
|
},
|
|
@@ -7550,10 +7439,10 @@ function stateModelFactory$1(pluginManager) {
|
|
|
7550
7439
|
label: 'Export SVG',
|
|
7551
7440
|
icon: PhotoCameraIcon,
|
|
7552
7441
|
onClick: function onClick() {
|
|
7553
|
-
getSession(self).queueDialog(function (
|
|
7442
|
+
getSession(self).queueDialog(function (handleClose) {
|
|
7554
7443
|
return [ExportSvgDlg, {
|
|
7555
7444
|
model: self,
|
|
7556
|
-
handleClose:
|
|
7445
|
+
handleClose: handleClose
|
|
7557
7446
|
}];
|
|
7558
7447
|
});
|
|
7559
7448
|
}
|
|
@@ -7653,8 +7542,12 @@ function stateModelFactory$1(pluginManager) {
|
|
|
7653
7542
|
}
|
|
7654
7543
|
|
|
7655
7544
|
return menuItems;
|
|
7656
|
-
}
|
|
7657
|
-
|
|
7545
|
+
}
|
|
7546
|
+
};
|
|
7547
|
+
}).views(function (self) {
|
|
7548
|
+
var currentlyCalculatedStaticBlocks;
|
|
7549
|
+
var stringifiedCurrentlyCalculatedStaticBlocks = '';
|
|
7550
|
+
return {
|
|
7658
7551
|
get staticBlocks() {
|
|
7659
7552
|
var ret = calculateStaticBlocks(self);
|
|
7660
7553
|
var sret = JSON.stringify(ret);
|
|
@@ -8076,7 +7969,7 @@ var LinearGenomeViewPlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
8076
7969
|
return LinearGenomeViewPlugin;
|
|
8077
7970
|
}(Plugin);
|
|
8078
7971
|
|
|
8079
|
-
var useStyles$
|
|
7972
|
+
var useStyles$m = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
8080
7973
|
return {
|
|
8081
7974
|
closeButton: {
|
|
8082
7975
|
position: 'absolute',
|
|
@@ -8088,7 +7981,7 @@ var useStyles$n = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
|
8088
7981
|
});
|
|
8089
7982
|
function HelpDialog$1(_ref) {
|
|
8090
7983
|
var handleClose = _ref.handleClose;
|
|
8091
|
-
var classes = useStyles$
|
|
7984
|
+
var classes = useStyles$m();
|
|
8092
7985
|
return /*#__PURE__*/React.createElement(Dialog, {
|
|
8093
7986
|
open: true,
|
|
8094
7987
|
maxWidth: "xl",
|
|
@@ -8099,7 +7992,7 @@ function HelpDialog$1(_ref) {
|
|
|
8099
7992
|
onClick: function onClick() {
|
|
8100
7993
|
handleClose();
|
|
8101
7994
|
}
|
|
8102
|
-
}, /*#__PURE__*/React.createElement(CloseIcon, null)) : null), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement("h3", null, "Searching"), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, "Jump to a feature or reference sequence by typing its name in the location box and pressing Enter."), /*#__PURE__*/React.createElement("li", null, "Jump to a specific region by typing the region into the location box as: ", /*#__PURE__*/React.createElement("code", null, "ref:start..end"), " or ", /*#__PURE__*/React.createElement("code", null, "ref:start-end"), ". Commas are allowed in the start and end coordinates.")), /*#__PURE__*/React.createElement("h3", null, "Example Searches"), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "BRCA"), " - searches for the feature named BRCA"), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "chr4"), " - jumps to chromosome 4"), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "chr4:79,500,000..80,000,000"), " - jumps the region on chromosome 4 between 79.5Mb and 80Mb."))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button$1, {
|
|
7995
|
+
}, /*#__PURE__*/React.createElement(CloseIcon, null)) : null), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement("h3", null, "Searching"), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, "Jump to a feature or reference sequence by typing its name in the location box and pressing Enter."), /*#__PURE__*/React.createElement("li", null, "Jump to a specific region by typing the region into the location box as: ", /*#__PURE__*/React.createElement("code", null, "ref:start..end"), " or ", /*#__PURE__*/React.createElement("code", null, "ref:start-end"), ". Commas are allowed in the start and end coordinates. A space-separated list of locstrings can be used to open up multiple chromosomes at a time")), /*#__PURE__*/React.createElement("h3", null, "Example Searches"), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "BRCA"), " - searches for the feature named BRCA"), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "chr4"), " - jumps to chromosome 4"), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "chr4:79,500,000..80,000,000"), " - jumps the region on chromosome 4 between 79.5Mb and 80Mb."), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "chr1:1-100 chr2:1-100"), " - create a split view of chr1:1-100 and chr2:1-100"), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "chr1 chr2 chr3"), " - open up multiple chromosomes at once"), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("code", null, "chr1:1-100[rev] chr2:1-100"), " - open up the first region in the horizontally flipped orientation"))), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(Button$1, {
|
|
8103
7996
|
onClick: function onClick() {
|
|
8104
7997
|
return handleClose();
|
|
8105
7998
|
},
|
|
@@ -8109,11 +8002,11 @@ function HelpDialog$1(_ref) {
|
|
|
8109
8002
|
|
|
8110
8003
|
var HelpDialog$2 = {
|
|
8111
8004
|
__proto__: null,
|
|
8112
|
-
useStyles: useStyles$
|
|
8005
|
+
useStyles: useStyles$m,
|
|
8113
8006
|
'default': HelpDialog$1
|
|
8114
8007
|
};
|
|
8115
8008
|
|
|
8116
|
-
var useStyles$
|
|
8009
|
+
var useStyles$n = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
8117
8010
|
return {
|
|
8118
8011
|
root: {
|
|
8119
8012
|
width: 500
|
|
@@ -8133,7 +8026,7 @@ var useStyles$o = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
|
8133
8026
|
function SetMaxHeightDlg$1(props) {
|
|
8134
8027
|
var model = props.model,
|
|
8135
8028
|
handleClose = props.handleClose;
|
|
8136
|
-
var classes = useStyles$
|
|
8029
|
+
var classes = useStyles$n();
|
|
8137
8030
|
var _model$maxHeight = model.maxHeight,
|
|
8138
8031
|
maxHeight = _model$maxHeight === void 0 ? '' : _model$maxHeight;
|
|
8139
8032
|
|