@jbrowse/plugin-linear-genome-view 1.7.11 → 2.1.0
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 +119 -139
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Block.js +53 -74
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -0
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +11 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +64 -103
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +146 -175
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Tooltip.js +109 -116
- package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/dist/BaseLinearDisplay/index.js +13 -40
- package/dist/BaseLinearDisplay/index.js.map +1 -0
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +19 -14
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +605 -684
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +15 -22
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +7 -8
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +266 -312
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/dist/LinearBareDisplay/configSchema.js +11 -17
- package/dist/LinearBareDisplay/configSchema.js.map +1 -0
- package/dist/LinearBareDisplay/index.js +7 -20
- package/dist/LinearBareDisplay/index.js.map +1 -0
- package/dist/LinearBareDisplay/model.d.ts +15 -13
- package/dist/LinearBareDisplay/model.js +36 -42
- package/dist/LinearBareDisplay/model.js.map +1 -0
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +76 -85
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/dist/LinearBasicDisplay/configSchema.js +15 -23
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -0
- package/dist/LinearBasicDisplay/index.js +10 -22
- package/dist/LinearBasicDisplay/index.js.map +1 -0
- package/dist/LinearBasicDisplay/model.d.ts +20 -14
- package/dist/LinearBasicDisplay/model.js +180 -159
- package/dist/LinearBasicDisplay/model.js.map +1 -0
- package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -8
- package/dist/LinearGenomeView/components/CenterLine.js +60 -74
- package/dist/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +141 -141
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/Gridlines.d.ts +8 -0
- package/dist/LinearGenomeView/components/Gridlines.js +78 -0
- package/dist/LinearGenomeView/components/Gridlines.js.map +1 -0
- package/dist/LinearGenomeView/components/Header.d.ts +1 -0
- package/dist/LinearGenomeView/components/Header.js +70 -125
- package/dist/LinearGenomeView/components/Header.js.map +1 -0
- package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/HelpDialog.js +62 -44
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/ImportForm.d.ts +1 -0
- package/dist/LinearGenomeView/components/ImportForm.js +222 -289
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.js +60 -124
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +198 -337
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/dist/LinearGenomeView/components/MiniControls.js +64 -78
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +229 -293
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +3 -3
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +275 -370
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +237 -324
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/dist/LinearGenomeView/components/RubberBand.js +228 -296
- package/dist/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/Ruler.js +45 -90
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -0
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +8 -403
- package/dist/LinearGenomeView/components/ScaleBar.js +121 -172
- package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchBox.js +155 -166
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +105 -149
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/SequenceDialog.js +219 -272
- package/dist/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +2 -1
- package/dist/LinearGenomeView/components/TrackContainer.js +113 -158
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
- package/dist/LinearGenomeView/components/TrackLabel.js +113 -133
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +172 -199
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/ZoomControls.js +72 -87
- package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/dist/LinearGenomeView/components/util.js +94 -71
- package/dist/LinearGenomeView/components/util.js.map +1 -0
- package/dist/LinearGenomeView/index.d.ts +64 -77
- package/dist/LinearGenomeView/index.js +1035 -1412
- package/dist/LinearGenomeView/index.js.map +1 -0
- package/dist/LinearGenomeView/util.js +76 -83
- package/dist/LinearGenomeView/util.js.map +1 -0
- package/dist/index.d.ts +98 -48
- package/dist/index.js +225 -295
- package/dist/index.js.map +1 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +9 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +68 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Block.d.ts +15 -0
- package/esm/BaseLinearDisplay/components/Block.js +46 -0
- package/esm/BaseLinearDisplay/components/Block.js.map +1 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +22 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +62 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +114 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js +64 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/esm/BaseLinearDisplay/index.d.ts +5 -0
- package/esm/BaseLinearDisplay/index.js +4 -0
- package/esm/BaseLinearDisplay/index.js.map +1 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +232 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +541 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +14 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +225 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/esm/LinearBareDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBareDisplay/configSchema.js +9 -0
- package/esm/LinearBareDisplay/configSchema.js.map +1 -0
- package/esm/LinearBareDisplay/index.d.ts +2 -0
- package/esm/LinearBareDisplay/index.js +3 -0
- package/esm/LinearBareDisplay/index.js.map +1 -0
- package/esm/LinearBareDisplay/model.d.ts +194 -0
- package/esm/LinearBareDisplay/model.js +28 -0
- package/esm/LinearBareDisplay/model.js.map +1 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +40 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/esm/LinearBasicDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBasicDisplay/configSchema.js +14 -0
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -0
- package/esm/LinearBasicDisplay/index.d.ts +2 -0
- package/esm/LinearBasicDisplay/index.js +3 -0
- package/esm/LinearBasicDisplay/index.js.map +1 -0
- package/esm/LinearBasicDisplay/model.d.ts +218 -0
- package/esm/LinearBasicDisplay/model.js +127 -0
- package/esm/LinearBasicDisplay/model.js.map +1 -0
- package/esm/LinearGenomeView/components/CenterLine.d.ts +8 -0
- package/esm/LinearGenomeView/components/CenterLine.js +40 -0
- package/esm/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +52 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/Gridlines.d.ts +8 -0
- package/esm/LinearGenomeView/components/Gridlines.js +71 -0
- package/esm/LinearGenomeView/components/Gridlines.js.map +1 -0
- package/esm/LinearGenomeView/components/Header.d.ts +7 -0
- package/esm/LinearGenomeView/components/Header.js +81 -0
- package/esm/LinearGenomeView/components/Header.js.map +1 -0
- package/esm/LinearGenomeView/components/HelpDialog.d.ts +4 -0
- package/esm/LinearGenomeView/components/HelpDialog.js +58 -0
- package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +7 -0
- package/esm/LinearGenomeView/components/ImportForm.js +141 -0
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +7 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js +63 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +132 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/esm/LinearGenomeView/components/MiniControls.d.ts +6 -0
- package/esm/LinearGenomeView/components/MiniControls.js +25 -0
- package/esm/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js +197 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +148 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js +287 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +22 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +136 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/esm/LinearGenomeView/components/RubberBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/RubberBand.js +197 -0
- package/esm/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/Ruler.d.ts +27 -0
- package/esm/LinearGenomeView/components/Ruler.js +50 -0
- package/esm/LinearGenomeView/components/Ruler.js.map +1 -0
- package/esm/LinearGenomeView/components/ScaleBar.d.ts +10 -0
- package/esm/LinearGenomeView/components/ScaleBar.js +112 -0
- package/esm/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchBox.d.ts +8 -0
- package/esm/LinearGenomeView/components/SearchBox.js +94 -0
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +107 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/SequenceDialog.d.ts +8 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js +147 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +10 -0
- package/esm/LinearGenomeView/components/TrackContainer.js +104 -0
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +8 -0
- package/esm/LinearGenomeView/components/TrackLabel.js +88 -0
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/{dist/LinearGenomeView/components/VerticalGuides.d.ts → esm/LinearGenomeView/components/TracksContainer.d.ts} +4 -3
- package/esm/LinearGenomeView/components/TracksContainer.js +142 -0
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomControls.js +32 -0
- package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/esm/LinearGenomeView/components/util.d.ts +14 -0
- package/esm/LinearGenomeView/components/util.js +17 -0
- package/esm/LinearGenomeView/components/util.js.map +1 -0
- package/esm/LinearGenomeView/index.d.ts +275 -0
- package/esm/LinearGenomeView/index.js +978 -0
- package/esm/LinearGenomeView/index.js.map +1 -0
- package/esm/LinearGenomeView/util.d.ts +14 -0
- package/esm/LinearGenomeView/util.js +62 -0
- package/esm/LinearGenomeView/util.js.map +1 -0
- package/esm/index.d.ts +615 -0
- package/esm/index.js +127 -0
- package/esm/index.js.map +1 -0
- package/package.json +22 -15
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +4 -4
- package/src/BaseLinearDisplay/components/Block.tsx +5 -5
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +9 -9
- package/src/BaseLinearDisplay/components/Tooltip.tsx +14 -4
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +6 -4
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +10 -7
- package/src/LinearBasicDisplay/model.ts +19 -11
- package/src/LinearGenomeView/components/CenterLine.tsx +6 -11
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +5 -5
- package/src/LinearGenomeView/components/{VerticalGuides.tsx → Gridlines.tsx} +9 -11
- package/src/LinearGenomeView/components/Header.tsx +10 -15
- package/src/LinearGenomeView/components/HelpDialog.tsx +5 -5
- package/src/LinearGenomeView/components/ImportForm.tsx +6 -12
- package/src/LinearGenomeView/components/LinearGenomeView.test.js +16 -6
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +6 -9
- package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +20 -29
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +61 -59
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +13 -44
- package/src/LinearGenomeView/components/RubberBand.tsx +12 -18
- package/src/LinearGenomeView/components/Ruler.tsx +5 -11
- package/src/LinearGenomeView/components/ScaleBar.tsx +23 -27
- package/src/LinearGenomeView/components/SearchBox.tsx +4 -3
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -6
- package/src/LinearGenomeView/components/SequenceDialog.tsx +10 -10
- package/src/LinearGenomeView/components/TrackContainer.tsx +29 -39
- package/src/LinearGenomeView/components/TrackLabel.tsx +76 -79
- package/src/LinearGenomeView/components/TracksContainer.tsx +10 -15
- package/src/LinearGenomeView/components/ZoomControls.tsx +12 -13
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +500 -550
- package/src/LinearGenomeView/index.test.ts +15 -36
- package/src/LinearGenomeView/index.tsx +390 -564
- package/src/index.ts +1 -1
- package/dist/LinearBareDisplay/index.test.js +0 -33
- package/dist/LinearGenomeView/components/LinearGenomeView.test.js +0 -234
- package/dist/LinearGenomeView/components/ScaleBar.test.js +0 -180
- package/dist/LinearGenomeView/components/VerticalGuides.js +0 -116
- package/dist/LinearGenomeView/index.test.js +0 -1187
- package/dist/LinearGenomeView/util.test.js +0 -78
|
@@ -1,174 +1,163 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
55
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
var react_1 = __importDefault(require("react"));
|
|
59
|
+
var mobx_react_1 = require("mobx-react");
|
|
60
|
+
var material_1 = require("@mui/material");
|
|
61
|
+
var mui_1 = require("tss-react/mui");
|
|
62
|
+
var util_1 = require("@jbrowse/core/util");
|
|
30
63
|
// locals
|
|
31
|
-
var
|
|
32
|
-
|
|
64
|
+
var RefNameAutocomplete_1 = __importDefault(require("./RefNameAutocomplete"));
|
|
65
|
+
var util_2 = require("./util");
|
|
66
|
+
var __1 = require("..");
|
|
67
|
+
var useStyles = (0, mui_1.makeStyles)()(function () { return ({
|
|
33
68
|
headerRefName: {
|
|
34
|
-
|
|
69
|
+
minWidth: 100,
|
|
70
|
+
},
|
|
71
|
+
}); });
|
|
72
|
+
function SearchBox(_a) {
|
|
73
|
+
var model = _a.model, showHelp = _a.showHelp;
|
|
74
|
+
var classes = useStyles().classes;
|
|
75
|
+
var theme = (0, material_1.useTheme)();
|
|
76
|
+
var session = (0, util_1.getSession)(model);
|
|
77
|
+
var textSearchManager = session.textSearchManager, assemblyManager = session.assemblyManager;
|
|
78
|
+
var assemblyNames = model.assemblyNames, rankSearchResults = model.rankSearchResults;
|
|
79
|
+
var assemblyName = assemblyNames[0];
|
|
80
|
+
var assembly = assemblyManager.get(assemblyName);
|
|
81
|
+
var searchScope = model.searchScope(assemblyName);
|
|
82
|
+
// gets a string as input, or use stored option results from previous query,
|
|
83
|
+
// then re-query and
|
|
84
|
+
// 1) if it has multiple results: pop a dialog
|
|
85
|
+
// 2) if it's a single result navigate to it
|
|
86
|
+
// 3) else assume it's a locstring and navigate to it
|
|
87
|
+
function handleSelectedRegion(option) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
+
var trackId, location, label, _a, ref, rest, allRefs, results, e_1;
|
|
90
|
+
return __generator(this, function (_b) {
|
|
91
|
+
switch (_b.label) {
|
|
92
|
+
case 0:
|
|
93
|
+
trackId = option.getTrackId();
|
|
94
|
+
location = option.getLocation();
|
|
95
|
+
label = option.getLabel();
|
|
96
|
+
_a = __read(location.split(':'), 2), ref = _a[0], rest = _a[1];
|
|
97
|
+
allRefs = (assembly === null || assembly === void 0 ? void 0 : assembly.allRefNames) || [];
|
|
98
|
+
_b.label = 1;
|
|
99
|
+
case 1:
|
|
100
|
+
_b.trys.push([1, 5, , 6]);
|
|
101
|
+
if (!(allRefs.includes(location) ||
|
|
102
|
+
(allRefs.includes(ref) &&
|
|
103
|
+
rest !== undefined &&
|
|
104
|
+
!Number.isNaN(parseInt(rest, 10))))) return [3 /*break*/, 2];
|
|
105
|
+
model.navToLocString(location, assemblyName);
|
|
106
|
+
return [3 /*break*/, 4];
|
|
107
|
+
case 2: return [4 /*yield*/, (0, util_2.fetchResults)({
|
|
108
|
+
queryString: label,
|
|
109
|
+
searchType: 'exact',
|
|
110
|
+
searchScope: searchScope,
|
|
111
|
+
rankSearchResults: rankSearchResults,
|
|
112
|
+
textSearchManager: textSearchManager,
|
|
113
|
+
assembly: assembly,
|
|
114
|
+
})];
|
|
115
|
+
case 3:
|
|
116
|
+
results = _b.sent();
|
|
117
|
+
if (results.length > 1) {
|
|
118
|
+
model.setSearchResults(results, label.toLowerCase());
|
|
119
|
+
return [2 /*return*/];
|
|
120
|
+
}
|
|
121
|
+
else if (results.length === 1) {
|
|
122
|
+
location = results[0].getLocation();
|
|
123
|
+
trackId = results[0].getTrackId();
|
|
124
|
+
}
|
|
125
|
+
model.navToLocString(location, assemblyName);
|
|
126
|
+
if (trackId) {
|
|
127
|
+
model.showTrack(trackId);
|
|
128
|
+
}
|
|
129
|
+
_b.label = 4;
|
|
130
|
+
case 4: return [3 /*break*/, 6];
|
|
131
|
+
case 5:
|
|
132
|
+
e_1 = _b.sent();
|
|
133
|
+
console.error(e_1);
|
|
134
|
+
session.notify("".concat(e_1), 'warning');
|
|
135
|
+
return [3 /*break*/, 6];
|
|
136
|
+
case 6: return [2 /*return*/];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
35
140
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function SearchBox(_ref) {
|
|
40
|
-
var model = _ref.model,
|
|
41
|
-
showHelp = _ref.showHelp;
|
|
42
|
-
var classes = useStyles();
|
|
43
|
-
var theme = (0, _core.useTheme)();
|
|
44
|
-
var session = (0, _util.getSession)(model);
|
|
45
|
-
var textSearchManager = session.textSearchManager,
|
|
46
|
-
assemblyManager = session.assemblyManager;
|
|
47
|
-
var assemblyNames = model.assemblyNames,
|
|
48
|
-
rankSearchResults = model.rankSearchResults;
|
|
49
|
-
var assemblyName = assemblyNames[0];
|
|
50
|
-
var assembly = assemblyManager.get(assemblyName);
|
|
51
|
-
var searchScope = model.searchScope(assemblyName); // gets a string as input, or use stored option results from previous query,
|
|
52
|
-
// then re-query and
|
|
53
|
-
// 1) if it has multiple results: pop a dialog
|
|
54
|
-
// 2) if it's a single result navigate to it
|
|
55
|
-
// 3) else assume it's a locstring and navigate to it
|
|
56
|
-
|
|
57
|
-
function handleSelectedRegion(_x) {
|
|
58
|
-
return _handleSelectedRegion.apply(this, arguments);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function _handleSelectedRegion() {
|
|
62
|
-
_handleSelectedRegion = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(option) {
|
|
63
|
-
var trackId, location, label, _location$split, _location$split2, ref, rest, allRefs, results;
|
|
64
|
-
|
|
65
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
66
|
-
while (1) {
|
|
67
|
-
switch (_context.prev = _context.next) {
|
|
68
|
-
case 0:
|
|
69
|
-
trackId = option.getTrackId();
|
|
70
|
-
location = option.getLocation();
|
|
71
|
-
label = option.getLabel();
|
|
72
|
-
_location$split = location.split(':'), _location$split2 = (0, _slicedToArray2.default)(_location$split, 2), ref = _location$split2[0], rest = _location$split2[1];
|
|
73
|
-
allRefs = (assembly === null || assembly === void 0 ? void 0 : assembly.allRefNames) || [];
|
|
74
|
-
_context.prev = 5;
|
|
75
|
-
|
|
76
|
-
if (!(allRefs.includes(location) || allRefs.includes(ref) && rest !== undefined && !Number.isNaN(parseInt(rest, 10)))) {
|
|
77
|
-
_context.next = 10;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
model.navToLocString(location, assemblyName);
|
|
82
|
-
_context.next = 21;
|
|
83
|
-
break;
|
|
84
|
-
|
|
85
|
-
case 10:
|
|
86
|
-
_context.next = 12;
|
|
87
|
-
return (0, _util2.fetchResults)({
|
|
88
|
-
queryString: label,
|
|
89
|
-
searchType: 'exact',
|
|
141
|
+
return (react_1.default.createElement(RefNameAutocomplete_1.default, { showHelp: showHelp, onSelect: handleSelectedRegion, assemblyName: assemblyName, fetchResults: function (queryString) {
|
|
142
|
+
return (0, util_2.fetchResults)({
|
|
143
|
+
queryString: queryString,
|
|
90
144
|
searchScope: searchScope,
|
|
91
145
|
rankSearchResults: rankSearchResults,
|
|
92
146
|
textSearchManager: textSearchManager,
|
|
93
|
-
assembly: assembly
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
case 18:
|
|
108
|
-
if (results.length === 1) {
|
|
109
|
-
location = results[0].getLocation();
|
|
110
|
-
trackId = results[0].getTrackId();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
case 19:
|
|
114
|
-
model.navToLocString(location, assemblyName);
|
|
115
|
-
|
|
116
|
-
if (trackId) {
|
|
117
|
-
model.showTrack(trackId);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
case 21:
|
|
121
|
-
_context.next = 27;
|
|
122
|
-
break;
|
|
123
|
-
|
|
124
|
-
case 23:
|
|
125
|
-
_context.prev = 23;
|
|
126
|
-
_context.t0 = _context["catch"](5);
|
|
127
|
-
console.error(_context.t0);
|
|
128
|
-
session.notify("".concat(_context.t0), 'warning');
|
|
129
|
-
|
|
130
|
-
case 27:
|
|
131
|
-
case "end":
|
|
132
|
-
return _context.stop();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}, _callee, null, [[5, 23]]);
|
|
136
|
-
}));
|
|
137
|
-
return _handleSelectedRegion.apply(this, arguments);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return /*#__PURE__*/_react.default.createElement(_RefNameAutocomplete.default, {
|
|
141
|
-
showHelp: showHelp,
|
|
142
|
-
onSelect: handleSelectedRegion,
|
|
143
|
-
assemblyName: assemblyName,
|
|
144
|
-
fetchResults: function fetchResults(queryString) {
|
|
145
|
-
return (0, _util2.fetchResults)({
|
|
146
|
-
queryString: queryString,
|
|
147
|
-
searchScope: searchScope,
|
|
148
|
-
rankSearchResults: rankSearchResults,
|
|
149
|
-
textSearchManager: textSearchManager,
|
|
150
|
-
assembly: assembly
|
|
151
|
-
});
|
|
152
|
-
},
|
|
153
|
-
model: model,
|
|
154
|
-
TextFieldProps: {
|
|
155
|
-
variant: 'outlined',
|
|
156
|
-
className: classes.headerRefName,
|
|
157
|
-
style: {
|
|
158
|
-
margin: _.SPACING,
|
|
159
|
-
minWidth: '175px'
|
|
160
|
-
},
|
|
161
|
-
InputProps: {
|
|
162
|
-
style: {
|
|
163
|
-
padding: 0,
|
|
164
|
-
height: _.WIDGET_HEIGHT,
|
|
165
|
-
background: (0, _core.alpha)(theme.palette.background.paper, 0.8)
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
});
|
|
147
|
+
assembly: assembly,
|
|
148
|
+
});
|
|
149
|
+
}, model: model, TextFieldProps: {
|
|
150
|
+
variant: 'outlined',
|
|
151
|
+
className: classes.headerRefName,
|
|
152
|
+
style: { margin: __1.SPACING, minWidth: '175px' },
|
|
153
|
+
InputProps: {
|
|
154
|
+
style: {
|
|
155
|
+
padding: 0,
|
|
156
|
+
height: __1.WIDGET_HEIGHT,
|
|
157
|
+
background: (0, material_1.alpha)(theme.palette.background.paper, 0.8),
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
} }));
|
|
170
161
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
exports.default = _default;
|
|
162
|
+
exports.default = (0, mobx_react_1.observer)(SearchBox);
|
|
163
|
+
//# sourceMappingURL=SearchBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBox.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/SearchBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,yCAAqC;AACrC,0CAA+C;AAC/C,qCAA0C;AAE1C,2CAA+C;AAE/C,SAAS;AACT,8EAAuD;AACvD,+BAAqC;AACrC,wBAAkE;AAElE,IAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC,cAAM,OAAA,CAAC;IACpC,aAAa,EAAE;QACb,QAAQ,EAAE,GAAG;KACd;CACF,CAAC,EAJmC,CAInC,CAAC,CAAA;AAEH,SAAS,SAAS,CAAC,EAMlB;QALC,KAAK,WAAA,EACL,QAAQ,cAAA;IAKA,IAAA,OAAO,GAAK,SAAS,EAAE,QAAhB,CAAgB;IAC/B,IAAM,KAAK,GAAG,IAAA,mBAAQ,GAAE,CAAA;IACxB,IAAM,OAAO,GAAG,IAAA,iBAAU,EAAC,KAAK,CAAC,CAAA;IAEzB,IAAA,iBAAiB,GAAsB,OAAO,kBAA7B,EAAE,eAAe,GAAK,OAAO,gBAAZ,CAAY;IAC9C,IAAA,aAAa,GAAwB,KAAK,cAA7B,EAAE,iBAAiB,GAAK,KAAK,kBAAV,CAAU;IAClD,IAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;IACrC,IAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAClD,IAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;IAEnD,4EAA4E;IAC5E,oBAAoB;IACpB,8CAA8C;IAC9C,4CAA4C;IAC5C,qDAAqD;IACrD,SAAe,oBAAoB,CAAC,MAAkB;;;;;;wBAChD,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAA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C5C,IAAI,OAAO,EAAE;4BACX,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;yBACzB;;;;;wBAGH,OAAO,CAAC,KAAK,CAAC,GAAC,CAAC,CAAA;wBAChB,OAAO,CAAC,MAAM,CAAC,UAAG,GAAC,CAAE,EAAE,SAAS,CAAC,CAAA;;;;;;KAEpC;IACD,OAAO,CACL,8BAAC,6BAAmB,IAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,oBAAoB,EAC9B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,UAAA,WAAW;YACvB,OAAA,IAAA,mBAAY,EAAC;gBACX,WAAW,aAAA;gBACX,WAAW,aAAA;gBACX,iBAAiB,mBAAA;gBACjB,iBAAiB,mBAAA;gBACjB,QAAQ,UAAA;aACT,CAAC;QANF,CAME,EAEJ,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE;YACd,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,OAAO,CAAC,aAAa;YAChC,KAAK,EAAE,EAAE,MAAM,EAAE,WAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;YAC7C,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,OAAO,EAAE,CAAC;oBACV,MAAM,EAAE,iBAAa;oBACrB,UAAU,EAAE,IAAA,gBAAK,EAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC;iBACvD;aACF;SACF,GACD,CACH,CAAA;AACH,CAAC;AAED,kBAAe,IAAA,qBAAQ,EAAC,SAAS,CAAC,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LinearGenomeViewModel } from '../..';
|
|
3
|
-
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"dialogContent" | "closeButton">;
|
|
4
3
|
export default function SearchResultsDialog({ model, optAssemblyName, handleClose, }: {
|
|
5
4
|
model: LinearGenomeViewModel;
|
|
6
5
|
optAssemblyName?: string;
|
|
@@ -1,158 +1,114 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var _mobxStateTree = require("mobx-state-tree");
|
|
14
|
-
|
|
15
|
-
var _util = require("@jbrowse/core/util");
|
|
16
|
-
|
|
17
|
-
var _core = require("@material-ui/core");
|
|
18
|
-
|
|
19
|
-
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
20
|
-
|
|
21
|
-
var useStyles = (0, _core.makeStyles)(function (theme) {
|
|
22
|
-
return {
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var mui_1 = require("tss-react/mui");
|
|
8
|
+
var mobx_state_tree_1 = require("mobx-state-tree");
|
|
9
|
+
var util_1 = require("@jbrowse/core/util");
|
|
10
|
+
var material_1 = require("@mui/material");
|
|
11
|
+
var Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
12
|
+
var useStyles = (0, mui_1.makeStyles)()(function (theme) { return ({
|
|
23
13
|
dialogContent: {
|
|
24
|
-
|
|
14
|
+
width: '80em',
|
|
25
15
|
},
|
|
26
16
|
closeButton: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
right: theme.spacing(1),
|
|
19
|
+
top: theme.spacing(1),
|
|
20
|
+
color: theme.palette.grey[500],
|
|
21
|
+
},
|
|
22
|
+
}); });
|
|
23
|
+
function SearchResultsDialog(_a) {
|
|
24
|
+
var _b, _c;
|
|
25
|
+
var model = _a.model, optAssemblyName = _a.optAssemblyName, handleClose = _a.handleClose;
|
|
26
|
+
var classes = useStyles().classes;
|
|
27
|
+
var session = (0, util_1.getSession)(model);
|
|
28
|
+
var pluginManager = (0, mobx_state_tree_1.getEnv)(session).pluginManager;
|
|
29
|
+
var assemblyManager = session.assemblyManager;
|
|
30
|
+
var assemblyName = optAssemblyName;
|
|
31
|
+
if (model.displayedRegions.length > 0) {
|
|
32
|
+
assemblyName = (_b = model.displayedRegions[0]) === null || _b === void 0 ? void 0 : _b.assemblyName;
|
|
31
33
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
exports.useStyles = useStyles;
|
|
35
|
-
|
|
36
|
-
function SearchResultsDialog(_ref) {
|
|
37
|
-
var _model$searchResults;
|
|
38
|
-
|
|
39
|
-
var model = _ref.model,
|
|
40
|
-
optAssemblyName = _ref.optAssemblyName,
|
|
41
|
-
handleClose = _ref.handleClose;
|
|
42
|
-
var classes = useStyles();
|
|
43
|
-
var session = (0, _util.getSession)(model);
|
|
44
|
-
|
|
45
|
-
var _getEnv = (0, _mobxStateTree.getEnv)(session),
|
|
46
|
-
pluginManager = _getEnv.pluginManager;
|
|
47
|
-
|
|
48
|
-
var assemblyManager = session.assemblyManager;
|
|
49
|
-
var assemblyName = optAssemblyName;
|
|
50
|
-
|
|
51
|
-
if (model.displayedRegions.length > 0) {
|
|
52
|
-
var _model$displayedRegio;
|
|
53
|
-
|
|
54
|
-
assemblyName = (_model$displayedRegio = model.displayedRegions[0]) === null || _model$displayedRegio === void 0 ? void 0 : _model$displayedRegio.assemblyName;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (!assemblyName) {
|
|
58
|
-
throw new Error("Assembly name not found");
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
var assembly = assemblyManager.get(assemblyName);
|
|
62
|
-
|
|
63
|
-
if (!assembly) {
|
|
64
|
-
throw new Error("assembly ".concat(assemblyName, " not found"));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (!assembly.regions) {
|
|
68
|
-
throw new Error("assembly ".concat(assemblyName, " regions not loaded"));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
var assemblyRegions = assembly.regions;
|
|
72
|
-
|
|
73
|
-
function handleClick(location) {
|
|
74
|
-
try {
|
|
75
|
-
var newRegion = assemblyRegions.find(function (region) {
|
|
76
|
-
return location === region.refName;
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
if (newRegion) {
|
|
80
|
-
model.setDisplayedRegions([newRegion]); // we use showAllRegions after setDisplayedRegions to make the entire
|
|
81
|
-
// region visible, xref #1703
|
|
82
|
-
|
|
83
|
-
model.showAllRegions();
|
|
84
|
-
} else {
|
|
85
|
-
model.navToLocString(location, assemblyName);
|
|
86
|
-
}
|
|
87
|
-
} catch (e) {
|
|
88
|
-
console.warn(e);
|
|
89
|
-
session.notify("".concat(e), 'warning');
|
|
34
|
+
if (!assemblyName) {
|
|
35
|
+
throw new Error("Assembly name not found");
|
|
90
36
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (trackId) {
|
|
95
|
-
var trackConfigSchema = pluginManager.pluggableConfigSchemaType('track');
|
|
96
|
-
var configuration = (0, _mobxStateTree.resolveIdentifier)(trackConfigSchema, (0, _mobxStateTree.getRoot)(model), trackId);
|
|
97
|
-
|
|
98
|
-
if (configuration) {
|
|
99
|
-
var _configuration$name;
|
|
100
|
-
|
|
101
|
-
return (_configuration$name = configuration.name) === null || _configuration$name === void 0 ? void 0 : _configuration$name.value;
|
|
102
|
-
}
|
|
37
|
+
var assembly = assemblyManager.get(assemblyName);
|
|
38
|
+
if (!assembly) {
|
|
39
|
+
throw new Error("assembly ".concat(assemblyName, " not found"));
|
|
103
40
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return /*#__PURE__*/_react.default.createElement(_core.Dialog, {
|
|
109
|
-
open: true,
|
|
110
|
-
maxWidth: "xl",
|
|
111
|
-
onClose: handleClose
|
|
112
|
-
}, /*#__PURE__*/_react.default.createElement(_core.DialogTitle, null, "Search results", handleClose ? /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
113
|
-
"data-testid": "close-resultsDialog",
|
|
114
|
-
className: classes.closeButton,
|
|
115
|
-
onClick: function onClick() {
|
|
116
|
-
handleClose();
|
|
41
|
+
if (!assembly.regions) {
|
|
42
|
+
throw new Error("assembly ".concat(assemblyName, " regions not loaded"));
|
|
117
43
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
scope: "row"
|
|
132
|
-
}, result.getLabel()), /*#__PURE__*/_react.default.createElement(_core.TableCell, {
|
|
133
|
-
align: "right"
|
|
134
|
-
}, result.getLocation()), /*#__PURE__*/_react.default.createElement(_core.TableCell, {
|
|
135
|
-
align: "right"
|
|
136
|
-
}, getTrackName(result.getTrackId()) || 'N/A'), /*#__PURE__*/_react.default.createElement(_core.TableCell, {
|
|
137
|
-
align: "right"
|
|
138
|
-
}, /*#__PURE__*/_react.default.createElement(_core.Button, {
|
|
139
|
-
onClick: function onClick() {
|
|
140
|
-
handleClick(result.getLocation());
|
|
141
|
-
var resultTrackId = result.getTrackId();
|
|
142
|
-
|
|
143
|
-
if (resultTrackId) {
|
|
144
|
-
model.showTrack(resultTrackId);
|
|
44
|
+
var assemblyRegions = assembly.regions;
|
|
45
|
+
function handleClick(location) {
|
|
46
|
+
try {
|
|
47
|
+
var newRegion = assemblyRegions.find(function (region) { return location === region.refName; });
|
|
48
|
+
if (newRegion) {
|
|
49
|
+
model.setDisplayedRegions([newRegion]);
|
|
50
|
+
// we use showAllRegions after setDisplayedRegions to make the entire
|
|
51
|
+
// region visible, xref #1703
|
|
52
|
+
model.showAllRegions();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
model.navToLocString(location, assemblyName);
|
|
56
|
+
}
|
|
145
57
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
console.warn(e);
|
|
60
|
+
session.notify("".concat(e), 'warning');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function getTrackName(trackId) {
|
|
64
|
+
var _a;
|
|
65
|
+
if (trackId) {
|
|
66
|
+
var trackConfigSchema = pluginManager.pluggableConfigSchemaType('track');
|
|
67
|
+
var configuration = (0, mobx_state_tree_1.resolveIdentifier)(trackConfigSchema, (0, mobx_state_tree_1.getRoot)(model), trackId);
|
|
68
|
+
if (configuration) {
|
|
69
|
+
return (_a = configuration.name) === null || _a === void 0 ? void 0 : _a.value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
74
|
+
return (react_1.default.createElement(material_1.Dialog, { open: true, maxWidth: "xl", onClose: handleClose },
|
|
75
|
+
react_1.default.createElement(material_1.DialogTitle, null,
|
|
76
|
+
"Search results",
|
|
77
|
+
handleClose ? (react_1.default.createElement(material_1.IconButton, { "data-testid": "close-resultsDialog", className: classes.closeButton, onClick: function () {
|
|
78
|
+
handleClose();
|
|
79
|
+
}, size: "large" },
|
|
80
|
+
react_1.default.createElement(Close_1.default, null))) : null),
|
|
81
|
+
react_1.default.createElement(material_1.Divider, null),
|
|
82
|
+
react_1.default.createElement(material_1.DialogContent, null, !((_c = model.searchResults) === null || _c === void 0 ? void 0 : _c.length) ? (react_1.default.createElement(material_1.Typography, null,
|
|
83
|
+
"No results found for ",
|
|
84
|
+
react_1.default.createElement("b", null, model.searchQuery))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
85
|
+
react_1.default.createElement(material_1.Typography, null,
|
|
86
|
+
"Showing results for ",
|
|
87
|
+
react_1.default.createElement("b", null, model.searchQuery)),
|
|
88
|
+
react_1.default.createElement(material_1.TableContainer, { component: material_1.Paper },
|
|
89
|
+
react_1.default.createElement(material_1.Table, null,
|
|
90
|
+
react_1.default.createElement(material_1.TableHead, null,
|
|
91
|
+
react_1.default.createElement(material_1.TableRow, null,
|
|
92
|
+
react_1.default.createElement(material_1.TableCell, null, "Name"),
|
|
93
|
+
react_1.default.createElement(material_1.TableCell, { align: "right" }, "Location"),
|
|
94
|
+
react_1.default.createElement(material_1.TableCell, { align: "right" }, "Track"),
|
|
95
|
+
react_1.default.createElement(material_1.TableCell, { align: "right" }))),
|
|
96
|
+
react_1.default.createElement(material_1.TableBody, null, model.searchResults.map(function (result) { return (react_1.default.createElement(material_1.TableRow, { key: "".concat(result.getId()) },
|
|
97
|
+
react_1.default.createElement(material_1.TableCell, { component: "th", scope: "row" }, result.getLabel()),
|
|
98
|
+
react_1.default.createElement(material_1.TableCell, { align: "right" }, result.getLocation()),
|
|
99
|
+
react_1.default.createElement(material_1.TableCell, { align: "right" }, getTrackName(result.getTrackId()) || 'N/A'),
|
|
100
|
+
react_1.default.createElement(material_1.TableCell, { align: "right" },
|
|
101
|
+
react_1.default.createElement(material_1.Button, { onClick: function () {
|
|
102
|
+
handleClick(result.getLocation());
|
|
103
|
+
var resultTrackId = result.getTrackId();
|
|
104
|
+
if (resultTrackId) {
|
|
105
|
+
model.showTrack(resultTrackId);
|
|
106
|
+
}
|
|
107
|
+
handleClose();
|
|
108
|
+
}, color: "primary", variant: "contained" }, "Go")))); }))))))),
|
|
109
|
+
react_1.default.createElement(material_1.Divider, null),
|
|
110
|
+
react_1.default.createElement(material_1.DialogActions, null,
|
|
111
|
+
react_1.default.createElement(material_1.Button, { onClick: function () { return handleClose(); }, color: "primary" }, "Cancel"))));
|
|
112
|
+
}
|
|
113
|
+
exports.default = SearchResultsDialog;
|
|
114
|
+
//# sourceMappingURL=SearchResultsDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchResultsDialog.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/SearchResultsDialog.tsx"],"names":[],"mappings":";;;;;AAAA,gDAAyB;AACzB,qCAA0C;AAC1C,mDAAoE;AACpE,2CAA+C;AAC/C,0CAgBsB;AACtB,oEAAiD;AAGjD,IAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC,UAAA,KAAK,IAAI,OAAA,CAAC;IACvC,aAAa,EAAE;QACb,KAAK,EAAE,MAAM;KACd;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACvB,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACrB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;KAC/B;CACF,CAAC,EAVsC,CAUtC,CAAC,CAAA;AAEH,SAAwB,mBAAmB,CAAC,EAQ3C;;QAPC,KAAK,WAAA,EACL,eAAe,qBAAA,EACf,WAAW,iBAAA;IAMH,IAAA,OAAO,GAAK,SAAS,EAAE,QAAhB,CAAgB;IAC/B,IAAM,OAAO,GAAG,IAAA,iBAAU,EAAC,KAAK,CAAC,CAAA;IACzB,IAAA,aAAa,GAAK,IAAA,wBAAM,EAAC,OAAO,CAAC,cAApB,CAAoB;IACjC,IAAA,eAAe,GAAK,OAAO,gBAAZ,CAAY;IACnC,IAAI,YAAY,GAAG,eAAe,CAAA;IAClC,IAAI,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,YAAY,GAAG,MAAA,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,0CAAE,YAAY,CAAA;KACvD;IACD,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;KAC3C;IACD,IAAM,QAAQ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