@jbrowse/plugin-linear-genome-view 2.1.0 → 2.1.2
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 -154
- 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 +86 -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.js +94 -117
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +90 -172
- 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 +69 -133
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +32 -33
- 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.js +14 -87
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/index.d.ts +3 -3
- 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 +1 -0
- 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/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.js +0 -2
- package/esm/LinearGenomeView/components/OverviewScaleBar.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.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/index.d.ts +3 -3
- 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 +1 -0
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +3 -3
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +5 -15
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +0 -2
- package/src/LinearGenomeView/components/RubberBand.tsx +0 -1
- package/src/LinearGenomeView/components/SearchBox.tsx +1 -1
- package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +165 -0
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +14 -14
- 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,33 +22,17 @@ 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
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
27
|
};
|
|
44
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const mobx_react_1 = require("mobx-react");
|
|
31
|
+
const material_1 = require("@mui/material");
|
|
32
|
+
const mui_1 = require("tss-react/mui");
|
|
33
|
+
const ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
|
|
34
|
+
const ZoomOut_1 = __importDefault(require("@mui/icons-material/ZoomOut"));
|
|
35
|
+
const useStyles = (0, mui_1.makeStyles)()({
|
|
52
36
|
container: {
|
|
53
37
|
display: 'flex',
|
|
54
38
|
flexDirection: 'row',
|
|
@@ -58,19 +42,18 @@ var useStyles = (0, mui_1.makeStyles)()({
|
|
|
58
42
|
width: 70,
|
|
59
43
|
},
|
|
60
44
|
});
|
|
61
|
-
function ZoomControls(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
(0, react_1.useEffect)(function () {
|
|
45
|
+
function ZoomControls({ model }) {
|
|
46
|
+
const { classes } = useStyles();
|
|
47
|
+
const { maxBpPerPx, minBpPerPx, bpPerPx, scaleFactor } = model;
|
|
48
|
+
const [value, setValue] = (0, react_1.useState)(-Math.log2(bpPerPx) * 100);
|
|
49
|
+
(0, react_1.useEffect)(() => {
|
|
67
50
|
setValue(-Math.log2(bpPerPx) * 100);
|
|
68
51
|
}, [setValue, bpPerPx]);
|
|
69
52
|
return (react_1.default.createElement("div", { className: classes.container },
|
|
70
|
-
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_out", onClick:
|
|
53
|
+
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_out", onClick: () => model.zoom(bpPerPx * 2), disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1, color: "secondary", size: "large" },
|
|
71
54
|
react_1.default.createElement(ZoomOut_1.default, null)),
|
|
72
|
-
react_1.default.createElement(material_1.Slider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChange:
|
|
73
|
-
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick:
|
|
55
|
+
react_1.default.createElement(material_1.Slider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChange: (_, val) => setValue(val), onChangeCommitted: () => model.zoomTo(2 ** (-value / 100)), disabled: scaleFactor !== 1 }),
|
|
56
|
+
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick: () => model.zoom(model.bpPerPx / 2), disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1, color: "secondary", size: "large" },
|
|
74
57
|
react_1.default.createElement(ZoomIn_1.default, null))));
|
|
75
58
|
}
|
|
76
59
|
exports.default = (0, mobx_react_1.observer)(ZoomControls);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomControls.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/ZoomControls.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ZoomControls.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/ZoomControls.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkD;AAClD,2CAAqC;AACrC,4CAAkD;AAClD,uCAA0C;AAC1C,wEAA+C;AAC/C,0EAAiD;AAGjD,MAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC;IAC7B,SAAS,EAAE;QACT,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;KACrB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAA;AAEF,SAAS,YAAY,CAAC,EAAE,KAAK,EAAoC;IAC/D,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAA;IAC/B,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAC9D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAA;IAC7D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAA;IACrC,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;IAEvB,OAAO,CACL,uCAAK,SAAS,EAAE,OAAO,CAAC,SAAS;QAC/B,8BAAC,qBAAU,mBACG,UAAU,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,EACtC,QAAQ,EAAE,OAAO,IAAI,UAAU,GAAG,MAAM,IAAI,WAAW,KAAK,CAAC,EAC7D,KAAK,EAAC,WAAW,EACjB,IAAI,EAAC,OAAO;YAEZ,8BAAC,iBAAO,OAAG,CACA;QAEb,8BAAC,iBAAM,IACL,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,OAAO,CAAC,MAAM,EACzB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,EACjC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,EACjC,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAa,CAAC,EAC7C,iBAAiB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,EAC1D,QAAQ,EAAE,WAAW,KAAK,CAAC,GAC3B;QACF,8BAAC,qBAAU,mBACG,SAAS,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,EAC5C,QAAQ,EAAE,OAAO,IAAI,UAAU,GAAG,MAAM,IAAI,WAAW,KAAK,CAAC,EAC7D,KAAK,EAAC,WAAW,EACjB,IAAI,EAAC,OAAO;YAEZ,8BAAC,gBAAM,OAAG,CACC,CACT,CACP,CAAA;AACH,CAAC;AAED,kBAAe,IAAA,qBAAQ,EAAC,YAAY,CAAC,CAAA"}
|
|
@@ -1,98 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
-
if (!m) return o;
|
|
41
|
-
var i = m.call(o), r, ar = [], e;
|
|
42
|
-
try {
|
|
43
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
-
}
|
|
45
|
-
catch (error) { e = { error: error }; }
|
|
46
|
-
finally {
|
|
47
|
-
try {
|
|
48
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
-
}
|
|
50
|
-
finally { if (e) throw e.error; }
|
|
51
|
-
}
|
|
52
|
-
return ar;
|
|
53
|
-
};
|
|
54
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
-
if (ar || !(i in from)) {
|
|
57
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
-
ar[i] = from[i];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
-
};
|
|
63
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
64
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
65
4
|
};
|
|
66
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
6
|
exports.fetchResults = exports.dedupe = void 0;
|
|
68
|
-
|
|
69
|
-
function dedupe(results, cb) {
|
|
70
|
-
|
|
71
|
-
return results.filter(function (elt, idx, self) { return idx === self.findIndex(function (t) { return cb(t) === cb(elt); }); });
|
|
7
|
+
const BaseResults_1 = __importDefault(require("@jbrowse/core/TextSearch/BaseResults"));
|
|
8
|
+
function dedupe(results = [], cb) {
|
|
9
|
+
return results.filter((elt, idx, self) => idx === self.findIndex(t => cb(t) === cb(elt)));
|
|
72
10
|
}
|
|
73
11
|
exports.dedupe = dedupe;
|
|
74
|
-
function fetchResults(
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return [4 /*yield*/, (textSearchManager === null || textSearchManager === void 0 ? void 0 : textSearchManager.search({
|
|
86
|
-
queryString: queryString,
|
|
87
|
-
searchType: searchType,
|
|
88
|
-
}, searchScope, rankSearchResults))];
|
|
89
|
-
case 1:
|
|
90
|
-
textSearchResults = _c.sent();
|
|
91
|
-
refNameResults = (_b = assembly === null || assembly === void 0 ? void 0 : assembly.allRefNames) === null || _b === void 0 ? void 0 : _b.filter(function (ref) { return ref.toLowerCase().startsWith(queryString.toLowerCase()); }).slice(0, 10).map(function (r) { return new BaseResults_1.default({ label: r }); });
|
|
92
|
-
return [2 /*return*/, dedupe(__spreadArray(__spreadArray([], __read((refNameResults || [])), false), __read((textSearchResults || [])), false), function (elt) { return elt.getId(); })];
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
});
|
|
12
|
+
async function fetchResults({ queryString, searchType, searchScope, rankSearchResults, textSearchManager, assembly, }) {
|
|
13
|
+
var _a;
|
|
14
|
+
if (!textSearchManager) {
|
|
15
|
+
console.warn('No text search manager');
|
|
16
|
+
}
|
|
17
|
+
const textSearchResults = await (textSearchManager === null || textSearchManager === void 0 ? void 0 : textSearchManager.search({
|
|
18
|
+
queryString,
|
|
19
|
+
searchType,
|
|
20
|
+
}, searchScope, rankSearchResults));
|
|
21
|
+
const refNameResults = (_a = assembly === null || assembly === void 0 ? void 0 : assembly.allRefNames) === null || _a === void 0 ? void 0 : _a.filter(ref => ref.toLowerCase().startsWith(queryString.toLowerCase())).slice(0, 10).map(r => new BaseResults_1.default({ label: r }));
|
|
22
|
+
return dedupe([...(refNameResults || []), ...(textSearchResults || [])], elt => elt.getId());
|
|
96
23
|
}
|
|
97
24
|
exports.fetchResults = fetchResults;
|
|
98
25
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/util.ts"],"names":[],"mappings":";;;;;;AAEA,uFAA6D;AAI7D,SAAgB,MAAM,CACpB,UAAwB,EAAE,EAC1B,EAAkC;IAElC,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CACnE,CAAA;AACH,CAAC;AAPD,wBAOC;AAEM,KAAK,UAAU,YAAY,CAAC,EACjC,WAAW,EACX,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,GAQT;;IACC,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;KACvC;IAED,MAAM,iBAAiB,GAAG,MAAM,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,CACvD;QACE,WAAW;QACX,UAAU;KACX,EACD,WAAW,EACX,iBAAiB,CAClB,CAAA,CAAA;IAED,MAAM,cAAc,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,0CACxC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,EACtE,KAAK,CAAC,CAAC,EAAE,EAAE,EACX,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,qBAAU,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAEzC,OAAO,MAAM,CACX,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,EACzD,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CACnB,CAAA;AACH,CAAC;AArCD,oCAqCC"}
|
|
@@ -128,9 +128,9 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
128
128
|
toggleShowGridlines(): void;
|
|
129
129
|
scrollTo(offsetPx: number): number;
|
|
130
130
|
zoomTo(bpPerPx: number): number;
|
|
131
|
-
setOffsets(left
|
|
132
|
-
setSearchResults(results
|
|
133
|
-
|
|
131
|
+
setOffsets(left?: BpOffset, right?: BpOffset): void;
|
|
132
|
+
setSearchResults(results?: BaseResult[], query?: string): void;
|
|
133
|
+
setGetSequenceDialogOpen(open: boolean): void;
|
|
134
134
|
setNewView(bpPerPx: number, offsetPx: number): void;
|
|
135
135
|
horizontallyFlip(): void;
|
|
136
136
|
showTrack(trackId: string, initialSnapshot?: {}, displayInitialSnapshot?: {}): any;
|