@jbrowse/plugin-linear-genome-view 3.6.2 → 3.6.4
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/LinearGenomeView/components/RubberbandSpan.js +0 -4
- package/dist/LinearGenomeView/components/SearchResultsTable.js +12 -14
- package/dist/LinearGenomeView/components/useRangeSelect.js +0 -1
- package/dist/LinearGenomeView/model.js +75 -42
- package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -4
- package/esm/LinearGenomeView/components/SearchResultsTable.js +12 -14
- package/esm/LinearGenomeView/components/useRangeSelect.js +0 -1
- package/esm/LinearGenomeView/model.js +75 -42
- package/package.json +3 -3
|
@@ -20,11 +20,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
|
20
20
|
position: 'absolute',
|
|
21
21
|
zIndex: 830,
|
|
22
22
|
textAlign: 'center',
|
|
23
|
-
},
|
|
24
|
-
rubberbandControl: {
|
|
25
23
|
cursor: 'crosshair',
|
|
26
|
-
width: '100%',
|
|
27
|
-
minHeight: 8,
|
|
28
24
|
},
|
|
29
25
|
rubberbandText: {
|
|
30
26
|
color: theme.palette.tertiary.contrastText,
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const util_1 = require("@jbrowse/core/util");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
8
|
+
const searchUtils_1 = require("../../searchUtils");
|
|
8
9
|
function SearchResultsTable({ searchResults, assemblyName: optAssemblyName, model, handleClose, }) {
|
|
9
10
|
const session = (0, util_1.getSession)(model);
|
|
10
11
|
const { pluginManager } = (0, util_1.getEnv)(session);
|
|
@@ -26,21 +27,22 @@ function SearchResultsTable({ searchResults, assemblyName: optAssemblyName, mode
|
|
|
26
27
|
}
|
|
27
28
|
return '';
|
|
28
29
|
}
|
|
29
|
-
async function handleClick(
|
|
30
|
+
async function handleClick(result) {
|
|
30
31
|
var _a;
|
|
31
|
-
|
|
32
|
+
if (result.hasLocation()) {
|
|
33
|
+
await (0, searchUtils_1.navToOption)({
|
|
34
|
+
option: result,
|
|
35
|
+
model,
|
|
36
|
+
assemblyName,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const location = result.getLabel();
|
|
32
41
|
const newRegion = (_a = assembly === null || assembly === void 0 ? void 0 : assembly.regions) === null || _a === void 0 ? void 0 : _a.find(region => location === region.refName);
|
|
33
42
|
if (newRegion) {
|
|
34
43
|
model.setDisplayedRegions([newRegion]);
|
|
35
44
|
model.showAllRegions();
|
|
36
45
|
}
|
|
37
|
-
else {
|
|
38
|
-
await model.navToLocString(location, assemblyName);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
console.warn(e);
|
|
43
|
-
session.notify(`${e}`, 'warning');
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
return ((0, jsx_runtime_1.jsx)(material_1.TableContainer, { component: material_1.Paper, children: (0, jsx_runtime_1.jsxs)(material_1.Table, { children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { children: "Name" }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: "Location" }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: "Track" }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right" })] }) }), (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: searchResults.map(result => {
|
|
@@ -60,11 +62,7 @@ function SearchResultsTable({ searchResults, assemblyName: optAssemblyName, mode
|
|
|
60
62
|
})
|
|
61
63
|
: locString }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: getTrackName(result.getTrackId()) || 'N/A' }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: async () => {
|
|
62
64
|
try {
|
|
63
|
-
await handleClick(result
|
|
64
|
-
const resultTrackId = result.getTrackId();
|
|
65
|
-
if (resultTrackId) {
|
|
66
|
-
model.showTrack(resultTrackId);
|
|
67
|
-
}
|
|
65
|
+
await handleClick(result);
|
|
68
66
|
}
|
|
69
67
|
catch (e) {
|
|
70
68
|
console.error(e);
|
|
@@ -654,7 +654,10 @@ function stateModelFactory(pluginManager) {
|
|
|
654
654
|
onClick: () => {
|
|
655
655
|
(0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
656
656
|
SequenceSearchDialog,
|
|
657
|
-
{
|
|
657
|
+
{
|
|
658
|
+
model: self,
|
|
659
|
+
handleClose,
|
|
660
|
+
},
|
|
658
661
|
]);
|
|
659
662
|
},
|
|
660
663
|
},
|
|
@@ -666,7 +669,10 @@ function stateModelFactory(pluginManager) {
|
|
|
666
669
|
onClick: () => {
|
|
667
670
|
(0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
668
671
|
ExportSvgDialog,
|
|
669
|
-
{
|
|
672
|
+
{
|
|
673
|
+
model: self,
|
|
674
|
+
handleClose,
|
|
675
|
+
},
|
|
670
676
|
]);
|
|
671
677
|
},
|
|
672
678
|
},
|
|
@@ -875,17 +881,31 @@ function stateModelFactory(pluginManager) {
|
|
|
875
881
|
grow,
|
|
876
882
|
});
|
|
877
883
|
if (locations.length === 1) {
|
|
878
|
-
const
|
|
879
|
-
const { reversed, parentRegion, start, end } =
|
|
880
|
-
self.setDisplayedRegions([
|
|
884
|
+
const location = locations[0];
|
|
885
|
+
const { reversed, parentRegion, start, end } = location;
|
|
886
|
+
self.setDisplayedRegions([
|
|
887
|
+
{
|
|
888
|
+
reversed,
|
|
889
|
+
...parentRegion,
|
|
890
|
+
},
|
|
891
|
+
]);
|
|
881
892
|
this.navTo({
|
|
882
|
-
...
|
|
893
|
+
...location,
|
|
883
894
|
start: (0, util_1.clamp)(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
|
|
884
895
|
end: (0, util_1.clamp)(end !== null && end !== void 0 ? end : parentRegion.end, 0, parentRegion.end),
|
|
885
896
|
});
|
|
886
897
|
}
|
|
887
898
|
else {
|
|
888
|
-
self.setDisplayedRegions(locations.map(
|
|
899
|
+
self.setDisplayedRegions(locations.map(location => {
|
|
900
|
+
const { start, end } = location;
|
|
901
|
+
return start === undefined || end === undefined
|
|
902
|
+
? location.parentRegion
|
|
903
|
+
: {
|
|
904
|
+
...location,
|
|
905
|
+
start,
|
|
906
|
+
end,
|
|
907
|
+
};
|
|
908
|
+
}));
|
|
889
909
|
self.showAllRegions();
|
|
890
910
|
}
|
|
891
911
|
},
|
|
@@ -896,50 +916,62 @@ function stateModelFactory(pluginManager) {
|
|
|
896
916
|
if (locations.some(l => l.start !== undefined && l.end !== undefined && l.start > l.end)) {
|
|
897
917
|
throw new Error('found start greater than end');
|
|
898
918
|
}
|
|
899
|
-
const
|
|
900
|
-
const
|
|
901
|
-
if (!
|
|
919
|
+
const firstLocation = locations.at(0);
|
|
920
|
+
const lastLocation = locations.at(-1);
|
|
921
|
+
if (!firstLocation || !lastLocation) {
|
|
902
922
|
return;
|
|
903
923
|
}
|
|
904
|
-
const
|
|
924
|
+
const defaultAssemblyName = self.assemblyNames[0];
|
|
905
925
|
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
906
|
-
const
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
const
|
|
910
|
-
const
|
|
911
|
-
const
|
|
912
|
-
|
|
913
|
-
|
|
926
|
+
const firstAssembly = assemblyManager.get(firstLocation.assemblyName || defaultAssemblyName);
|
|
927
|
+
const firstRefName = (firstAssembly === null || firstAssembly === void 0 ? void 0 : firstAssembly.getCanonicalRefName(firstLocation.refName)) ||
|
|
928
|
+
firstLocation.refName;
|
|
929
|
+
const firstRegion = self.displayedRegions.find(r => r.refName === firstRefName);
|
|
930
|
+
const lastAssembly = assemblyManager.get(lastLocation.assemblyName || defaultAssemblyName);
|
|
931
|
+
const lastRefName = (lastAssembly === null || lastAssembly === void 0 ? void 0 : lastAssembly.getCanonicalRefName(lastLocation.refName)) ||
|
|
932
|
+
lastLocation.refName;
|
|
933
|
+
const lastRegion = (0, util_1.findLast)(self.displayedRegions, r => r.refName === lastRefName);
|
|
934
|
+
if (!firstRegion) {
|
|
935
|
+
throw new Error(`could not find a region with refName "${firstRefName}"`);
|
|
914
936
|
}
|
|
915
|
-
if (!
|
|
916
|
-
throw new Error(`could not find a region with refName "${
|
|
937
|
+
if (!lastRegion) {
|
|
938
|
+
throw new Error(`could not find a region with refName "${lastRefName}"`);
|
|
917
939
|
}
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
const
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
940
|
+
const firstStart = firstLocation.start === undefined
|
|
941
|
+
? firstRegion.start
|
|
942
|
+
: firstLocation.start;
|
|
943
|
+
const firstEnd = firstLocation.end === undefined ? firstRegion.end : firstLocation.end;
|
|
944
|
+
const lastStart = lastLocation.start === undefined
|
|
945
|
+
? lastRegion.start
|
|
946
|
+
: lastLocation.start;
|
|
947
|
+
const lastEnd = lastLocation.end === undefined ? lastRegion.end : lastLocation.end;
|
|
948
|
+
const firstIndex = self.displayedRegions.findIndex(r => firstRefName === r.refName &&
|
|
949
|
+
firstStart >= r.start &&
|
|
950
|
+
firstStart <= r.end &&
|
|
951
|
+
firstEnd <= r.end &&
|
|
952
|
+
firstEnd >= r.start);
|
|
953
|
+
const lastIndex = self.displayedRegions.findIndex(r => lastRefName === r.refName &&
|
|
954
|
+
lastStart >= r.start &&
|
|
955
|
+
lastStart <= r.end &&
|
|
956
|
+
lastEnd <= r.end &&
|
|
957
|
+
lastEnd >= r.start);
|
|
958
|
+
if (firstIndex === -1 || lastIndex === -1) {
|
|
933
959
|
throw new Error(`could not find a region that contained "${locations.map(l => (0, util_1.assembleLocString)(l))}"`);
|
|
934
960
|
}
|
|
935
|
-
const
|
|
936
|
-
const
|
|
961
|
+
const startDisplayedRegion = self.displayedRegions[firstIndex];
|
|
962
|
+
const endDisplayedRegion = self.displayedRegions[lastIndex];
|
|
963
|
+
const startOffset = startDisplayedRegion.reversed
|
|
964
|
+
? startDisplayedRegion.end - firstEnd
|
|
965
|
+
: firstStart - startDisplayedRegion.start;
|
|
966
|
+
const endOffset = endDisplayedRegion.reversed
|
|
967
|
+
? endDisplayedRegion.end - lastStart
|
|
968
|
+
: lastEnd - endDisplayedRegion.start;
|
|
937
969
|
this.moveTo({
|
|
938
|
-
index,
|
|
939
|
-
offset:
|
|
970
|
+
index: firstIndex,
|
|
971
|
+
offset: startOffset,
|
|
940
972
|
}, {
|
|
941
|
-
index:
|
|
942
|
-
offset:
|
|
973
|
+
index: lastIndex,
|
|
974
|
+
offset: endOffset,
|
|
943
975
|
});
|
|
944
976
|
},
|
|
945
977
|
}))
|
|
@@ -1023,6 +1055,7 @@ function stateModelFactory(pluginManager) {
|
|
|
1023
1055
|
self
|
|
1024
1056
|
.navToLocString(init.loc, init.assembly)
|
|
1025
1057
|
.catch((e) => {
|
|
1058
|
+
console.error(init, e);
|
|
1026
1059
|
(0, util_1.getSession)(self).notifyError(`${e}`, e);
|
|
1027
1060
|
});
|
|
1028
1061
|
(_a = init.tracks) === null || _a === void 0 ? void 0 : _a.map(t => self.showTrack(t));
|
|
@@ -14,11 +14,7 @@ const useStyles = makeStyles()(theme => {
|
|
|
14
14
|
position: 'absolute',
|
|
15
15
|
zIndex: 830,
|
|
16
16
|
textAlign: 'center',
|
|
17
|
-
},
|
|
18
|
-
rubberbandControl: {
|
|
19
17
|
cursor: 'crosshair',
|
|
20
|
-
width: '100%',
|
|
21
|
-
minHeight: 8,
|
|
22
18
|
},
|
|
23
19
|
rubberbandText: {
|
|
24
20
|
color: theme.palette.tertiary.contrastText,
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { assembleLocString, getEnv, getSession, parseLocString, } from '@jbrowse/core/util';
|
|
3
3
|
import { Button, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, } from '@mui/material';
|
|
4
4
|
import { getRoot, resolveIdentifier } from 'mobx-state-tree';
|
|
5
|
+
import { navToOption } from '../../searchUtils';
|
|
5
6
|
export default function SearchResultsTable({ searchResults, assemblyName: optAssemblyName, model, handleClose, }) {
|
|
6
7
|
const session = getSession(model);
|
|
7
8
|
const { pluginManager } = getEnv(session);
|
|
@@ -23,21 +24,22 @@ export default function SearchResultsTable({ searchResults, assemblyName: optAss
|
|
|
23
24
|
}
|
|
24
25
|
return '';
|
|
25
26
|
}
|
|
26
|
-
async function handleClick(
|
|
27
|
+
async function handleClick(result) {
|
|
27
28
|
var _a;
|
|
28
|
-
|
|
29
|
+
if (result.hasLocation()) {
|
|
30
|
+
await navToOption({
|
|
31
|
+
option: result,
|
|
32
|
+
model,
|
|
33
|
+
assemblyName,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const location = result.getLabel();
|
|
29
38
|
const newRegion = (_a = assembly === null || assembly === void 0 ? void 0 : assembly.regions) === null || _a === void 0 ? void 0 : _a.find(region => location === region.refName);
|
|
30
39
|
if (newRegion) {
|
|
31
40
|
model.setDisplayedRegions([newRegion]);
|
|
32
41
|
model.showAllRegions();
|
|
33
42
|
}
|
|
34
|
-
else {
|
|
35
|
-
await model.navToLocString(location, assemblyName);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
console.warn(e);
|
|
40
|
-
session.notify(`${e}`, 'warning');
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
return (_jsx(TableContainer, { component: Paper, children: _jsxs(Table, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: "Name" }), _jsx(TableCell, { align: "right", children: "Location" }), _jsx(TableCell, { align: "right", children: "Track" }), _jsx(TableCell, { align: "right" })] }) }), _jsx(TableBody, { children: searchResults.map(result => {
|
|
@@ -57,11 +59,7 @@ export default function SearchResultsTable({ searchResults, assemblyName: optAss
|
|
|
57
59
|
})
|
|
58
60
|
: locString }), _jsx(TableCell, { align: "right", children: getTrackName(result.getTrackId()) || 'N/A' }), _jsx(TableCell, { align: "right", children: _jsx(Button, { onClick: async () => {
|
|
59
61
|
try {
|
|
60
|
-
await handleClick(result
|
|
61
|
-
const resultTrackId = result.getTrackId();
|
|
62
|
-
if (resultTrackId) {
|
|
63
|
-
model.showTrack(resultTrackId);
|
|
64
|
-
}
|
|
62
|
+
await handleClick(result);
|
|
65
63
|
}
|
|
66
64
|
catch (e) {
|
|
67
65
|
console.error(e);
|
|
@@ -614,7 +614,10 @@ export function stateModelFactory(pluginManager) {
|
|
|
614
614
|
onClick: () => {
|
|
615
615
|
getSession(self).queueDialog(handleClose => [
|
|
616
616
|
SequenceSearchDialog,
|
|
617
|
-
{
|
|
617
|
+
{
|
|
618
|
+
model: self,
|
|
619
|
+
handleClose,
|
|
620
|
+
},
|
|
618
621
|
]);
|
|
619
622
|
},
|
|
620
623
|
},
|
|
@@ -626,7 +629,10 @@ export function stateModelFactory(pluginManager) {
|
|
|
626
629
|
onClick: () => {
|
|
627
630
|
getSession(self).queueDialog(handleClose => [
|
|
628
631
|
ExportSvgDialog,
|
|
629
|
-
{
|
|
632
|
+
{
|
|
633
|
+
model: self,
|
|
634
|
+
handleClose,
|
|
635
|
+
},
|
|
630
636
|
]);
|
|
631
637
|
},
|
|
632
638
|
},
|
|
@@ -835,17 +841,31 @@ export function stateModelFactory(pluginManager) {
|
|
|
835
841
|
grow,
|
|
836
842
|
});
|
|
837
843
|
if (locations.length === 1) {
|
|
838
|
-
const
|
|
839
|
-
const { reversed, parentRegion, start, end } =
|
|
840
|
-
self.setDisplayedRegions([
|
|
844
|
+
const location = locations[0];
|
|
845
|
+
const { reversed, parentRegion, start, end } = location;
|
|
846
|
+
self.setDisplayedRegions([
|
|
847
|
+
{
|
|
848
|
+
reversed,
|
|
849
|
+
...parentRegion,
|
|
850
|
+
},
|
|
851
|
+
]);
|
|
841
852
|
this.navTo({
|
|
842
|
-
...
|
|
853
|
+
...location,
|
|
843
854
|
start: clamp(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
|
|
844
855
|
end: clamp(end !== null && end !== void 0 ? end : parentRegion.end, 0, parentRegion.end),
|
|
845
856
|
});
|
|
846
857
|
}
|
|
847
858
|
else {
|
|
848
|
-
self.setDisplayedRegions(locations.map(
|
|
859
|
+
self.setDisplayedRegions(locations.map(location => {
|
|
860
|
+
const { start, end } = location;
|
|
861
|
+
return start === undefined || end === undefined
|
|
862
|
+
? location.parentRegion
|
|
863
|
+
: {
|
|
864
|
+
...location,
|
|
865
|
+
start,
|
|
866
|
+
end,
|
|
867
|
+
};
|
|
868
|
+
}));
|
|
849
869
|
self.showAllRegions();
|
|
850
870
|
}
|
|
851
871
|
},
|
|
@@ -856,50 +876,62 @@ export function stateModelFactory(pluginManager) {
|
|
|
856
876
|
if (locations.some(l => l.start !== undefined && l.end !== undefined && l.start > l.end)) {
|
|
857
877
|
throw new Error('found start greater than end');
|
|
858
878
|
}
|
|
859
|
-
const
|
|
860
|
-
const
|
|
861
|
-
if (!
|
|
879
|
+
const firstLocation = locations.at(0);
|
|
880
|
+
const lastLocation = locations.at(-1);
|
|
881
|
+
if (!firstLocation || !lastLocation) {
|
|
862
882
|
return;
|
|
863
883
|
}
|
|
864
|
-
const
|
|
884
|
+
const defaultAssemblyName = self.assemblyNames[0];
|
|
865
885
|
const { assemblyManager } = getSession(self);
|
|
866
|
-
const
|
|
867
|
-
const
|
|
868
|
-
|
|
869
|
-
const
|
|
870
|
-
const
|
|
871
|
-
const
|
|
872
|
-
|
|
873
|
-
|
|
886
|
+
const firstAssembly = assemblyManager.get(firstLocation.assemblyName || defaultAssemblyName);
|
|
887
|
+
const firstRefName = (firstAssembly === null || firstAssembly === void 0 ? void 0 : firstAssembly.getCanonicalRefName(firstLocation.refName)) ||
|
|
888
|
+
firstLocation.refName;
|
|
889
|
+
const firstRegion = self.displayedRegions.find(r => r.refName === firstRefName);
|
|
890
|
+
const lastAssembly = assemblyManager.get(lastLocation.assemblyName || defaultAssemblyName);
|
|
891
|
+
const lastRefName = (lastAssembly === null || lastAssembly === void 0 ? void 0 : lastAssembly.getCanonicalRefName(lastLocation.refName)) ||
|
|
892
|
+
lastLocation.refName;
|
|
893
|
+
const lastRegion = findLast(self.displayedRegions, r => r.refName === lastRefName);
|
|
894
|
+
if (!firstRegion) {
|
|
895
|
+
throw new Error(`could not find a region with refName "${firstRefName}"`);
|
|
874
896
|
}
|
|
875
|
-
if (!
|
|
876
|
-
throw new Error(`could not find a region with refName "${
|
|
897
|
+
if (!lastRegion) {
|
|
898
|
+
throw new Error(`could not find a region with refName "${lastRefName}"`);
|
|
877
899
|
}
|
|
878
|
-
const
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
const
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
900
|
+
const firstStart = firstLocation.start === undefined
|
|
901
|
+
? firstRegion.start
|
|
902
|
+
: firstLocation.start;
|
|
903
|
+
const firstEnd = firstLocation.end === undefined ? firstRegion.end : firstLocation.end;
|
|
904
|
+
const lastStart = lastLocation.start === undefined
|
|
905
|
+
? lastRegion.start
|
|
906
|
+
: lastLocation.start;
|
|
907
|
+
const lastEnd = lastLocation.end === undefined ? lastRegion.end : lastLocation.end;
|
|
908
|
+
const firstIndex = self.displayedRegions.findIndex(r => firstRefName === r.refName &&
|
|
909
|
+
firstStart >= r.start &&
|
|
910
|
+
firstStart <= r.end &&
|
|
911
|
+
firstEnd <= r.end &&
|
|
912
|
+
firstEnd >= r.start);
|
|
913
|
+
const lastIndex = self.displayedRegions.findIndex(r => lastRefName === r.refName &&
|
|
914
|
+
lastStart >= r.start &&
|
|
915
|
+
lastStart <= r.end &&
|
|
916
|
+
lastEnd <= r.end &&
|
|
917
|
+
lastEnd >= r.start);
|
|
918
|
+
if (firstIndex === -1 || lastIndex === -1) {
|
|
893
919
|
throw new Error(`could not find a region that contained "${locations.map(l => assembleLocString(l))}"`);
|
|
894
920
|
}
|
|
895
|
-
const
|
|
896
|
-
const
|
|
921
|
+
const startDisplayedRegion = self.displayedRegions[firstIndex];
|
|
922
|
+
const endDisplayedRegion = self.displayedRegions[lastIndex];
|
|
923
|
+
const startOffset = startDisplayedRegion.reversed
|
|
924
|
+
? startDisplayedRegion.end - firstEnd
|
|
925
|
+
: firstStart - startDisplayedRegion.start;
|
|
926
|
+
const endOffset = endDisplayedRegion.reversed
|
|
927
|
+
? endDisplayedRegion.end - lastStart
|
|
928
|
+
: lastEnd - endDisplayedRegion.start;
|
|
897
929
|
this.moveTo({
|
|
898
|
-
index,
|
|
899
|
-
offset:
|
|
930
|
+
index: firstIndex,
|
|
931
|
+
offset: startOffset,
|
|
900
932
|
}, {
|
|
901
|
-
index:
|
|
902
|
-
offset:
|
|
933
|
+
index: lastIndex,
|
|
934
|
+
offset: endOffset,
|
|
903
935
|
});
|
|
904
936
|
},
|
|
905
937
|
}))
|
|
@@ -983,6 +1015,7 @@ export function stateModelFactory(pluginManager) {
|
|
|
983
1015
|
self
|
|
984
1016
|
.navToLocString(init.loc, init.assembly)
|
|
985
1017
|
.catch((e) => {
|
|
1018
|
+
console.error(init, e);
|
|
986
1019
|
getSession(self).notifyError(`${e}`, e);
|
|
987
1020
|
});
|
|
988
1021
|
(_a = init.tracks) === null || _a === void 0 ? void 0 : _a.map(t => self.showTrack(t));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-genome-view",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"description": "JBrowse 2 linear genome view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"useSrc": "node ../../scripts/useSrc.js"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@jbrowse/core": "^3.6.
|
|
41
|
+
"@jbrowse/core": "^3.6.4",
|
|
42
42
|
"@mui/icons-material": "^7.0.0",
|
|
43
43
|
"@mui/material": "^7.0.0",
|
|
44
44
|
"@types/file-saver": "^2.0.1",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"module": "esm/index.js",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "3db8e50ce2bd9c081efbf6c2e7ae5f342380a25a"
|
|
61
61
|
}
|