@jbrowse/plugin-linear-genome-view 1.7.10 → 2.0.1
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 +145 -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 +20 -15
- 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 +16 -14
- 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 -15
- 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.js +70 -126
- 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.js +223 -320
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.js +64 -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 +24 -8
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +277 -365
- 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 +158 -205
- 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 -150
- 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.js +116 -156
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
- package/dist/LinearGenomeView/components/TrackLabel.js +115 -134
- 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.d.ts +12 -0
- package/dist/LinearGenomeView/components/util.js +95 -13
- 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 +101 -51
- 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 +113 -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 +67 -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 +9 -0
- package/esm/LinearGenomeView/components/TrackContainer.js +109 -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 +89 -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 -3
- package/src/BaseLinearDisplay/components/Block.tsx +5 -5
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +7 -8
- 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 +21 -15
- 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 +13 -18
- package/src/LinearGenomeView/components/HelpDialog.tsx +5 -5
- package/src/LinearGenomeView/components/ImportForm.tsx +24 -37
- package/src/LinearGenomeView/components/LinearGenomeView.test.js +16 -6
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +4 -3
- package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +20 -29
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +100 -89
- 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 +22 -32
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -7
- package/src/LinearGenomeView/components/SequenceDialog.tsx +10 -10
- package/src/LinearGenomeView/components/TrackContainer.tsx +12 -12
- package/src/LinearGenomeView/components/TrackLabel.tsx +21 -31
- 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 -547
- package/src/LinearGenomeView/components/util.ts +43 -0
- package/src/LinearGenomeView/index.test.ts +14 -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,214 +1,187 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
9
17
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
26
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
|
+
if (!m) return o;
|
|
28
|
+
var i = m.call(o), r, ar = [], e;
|
|
29
|
+
try {
|
|
30
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
31
|
+
}
|
|
32
|
+
catch (error) { e = { error: error }; }
|
|
33
|
+
finally {
|
|
34
|
+
try {
|
|
35
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
36
|
+
}
|
|
37
|
+
finally { if (e) throw e.error; }
|
|
38
|
+
}
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
var react_1 = __importStar(require("react"));
|
|
46
|
+
var mui_1 = require("tss-react/mui");
|
|
47
|
+
var mobx_react_1 = require("mobx-react");
|
|
48
|
+
var normalize_wheel_1 = __importDefault(require("normalize-wheel"));
|
|
49
|
+
var __1 = require("..");
|
|
50
|
+
var RubberBand_1 = __importDefault(require("./RubberBand"));
|
|
51
|
+
var ScaleBar_1 = __importDefault(require("./ScaleBar"));
|
|
52
|
+
var Gridlines_1 = __importDefault(require("./Gridlines"));
|
|
53
|
+
var CenterLine_1 = __importDefault(require("./CenterLine"));
|
|
54
|
+
var useStyles = (0, mui_1.makeStyles)()({
|
|
38
55
|
tracksContainer: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
overflow: 'hidden'
|
|
56
|
+
position: 'relative',
|
|
57
|
+
overflow: 'hidden',
|
|
42
58
|
},
|
|
43
59
|
spacer: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
};
|
|
60
|
+
position: 'relative',
|
|
61
|
+
height: 3,
|
|
62
|
+
},
|
|
48
63
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
function TracksContainer(_a) {
|
|
65
|
+
var children = _a.children, model = _a.model;
|
|
66
|
+
var classes = useStyles().classes;
|
|
67
|
+
// refs are to store these variables to avoid repeated rerenders associated
|
|
68
|
+
// with useState/setState
|
|
69
|
+
var delta = (0, react_1.useRef)(0);
|
|
70
|
+
var scheduled = (0, react_1.useRef)(false);
|
|
71
|
+
var timeout = (0, react_1.useRef)();
|
|
72
|
+
var ref = (0, react_1.useRef)(null);
|
|
73
|
+
var prevX = (0, react_1.useRef)(0);
|
|
74
|
+
var _b = __read((0, react_1.useState)(false), 2), mouseDragging = _b[0], setMouseDragging = _b[1];
|
|
75
|
+
(0, react_1.useEffect)(function () {
|
|
76
|
+
var cleanup = function () { };
|
|
77
|
+
function globalMouseMove(event) {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
var currX = event.clientX;
|
|
80
|
+
var distance = currX - prevX.current;
|
|
81
|
+
if (distance) {
|
|
82
|
+
// use rAF to make it so multiple event handlers aren't fired per-frame
|
|
83
|
+
// see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
|
|
84
|
+
if (!scheduled.current) {
|
|
85
|
+
scheduled.current = true;
|
|
86
|
+
window.requestAnimationFrame(function () {
|
|
87
|
+
model.horizontalScroll(-distance);
|
|
88
|
+
scheduled.current = false;
|
|
89
|
+
prevX.current = event.clientX;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function globalMouseUp() {
|
|
95
|
+
prevX.current = 0;
|
|
96
|
+
if (mouseDragging) {
|
|
97
|
+
setMouseDragging(false);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (mouseDragging) {
|
|
101
|
+
window.addEventListener('mousemove', globalMouseMove, true);
|
|
102
|
+
window.addEventListener('mouseup', globalMouseUp, true);
|
|
103
|
+
cleanup = function () {
|
|
104
|
+
window.removeEventListener('mousemove', globalMouseMove, true);
|
|
105
|
+
window.removeEventListener('mouseup', globalMouseUp, true);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return cleanup;
|
|
109
|
+
}, [model, mouseDragging, prevX]);
|
|
110
|
+
function mouseDown(event) {
|
|
111
|
+
// check if clicking a draggable element or a resize handle
|
|
112
|
+
var target = event.target;
|
|
113
|
+
if (target.draggable || target.dataset.resizer) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
// otherwise do click and drag scroll
|
|
117
|
+
if (event.button === 0) {
|
|
83
118
|
prevX.current = event.clientX;
|
|
84
|
-
|
|
119
|
+
setMouseDragging(true);
|
|
85
120
|
}
|
|
86
|
-
}
|
|
87
121
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (mouseDragging) {
|
|
122
|
+
// this local mouseup is used in addition to the global because sometimes
|
|
123
|
+
// the global add/remove are not called in time, resulting in issue #533
|
|
124
|
+
function mouseUp(event) {
|
|
125
|
+
event.preventDefault();
|
|
93
126
|
setMouseDragging(false);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (mouseDragging) {
|
|
98
|
-
window.addEventListener('mousemove', globalMouseMove, true);
|
|
99
|
-
window.addEventListener('mouseup', globalMouseUp, true);
|
|
100
|
-
|
|
101
|
-
cleanup = function cleanup() {
|
|
102
|
-
window.removeEventListener('mousemove', globalMouseMove, true);
|
|
103
|
-
window.removeEventListener('mouseup', globalMouseUp, true);
|
|
104
|
-
};
|
|
105
127
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}, [model, mouseDragging, prevX]);
|
|
109
|
-
|
|
110
|
-
function mouseDown(event) {
|
|
111
|
-
// check if clicking a draggable element or a resize handle
|
|
112
|
-
var target = event.target;
|
|
113
|
-
|
|
114
|
-
if (target.draggable || target.dataset.resizer) {
|
|
115
|
-
return;
|
|
116
|
-
} // otherwise do click and drag scroll
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (event.button === 0) {
|
|
120
|
-
prevX.current = event.clientX;
|
|
121
|
-
setMouseDragging(true);
|
|
128
|
+
function mouseLeave(event) {
|
|
129
|
+
event.preventDefault();
|
|
122
130
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
131
|
+
(0, react_1.useEffect)(function () {
|
|
132
|
+
var curr = ref.current;
|
|
133
|
+
// if ctrl is held down, zoom in with y-scroll
|
|
134
|
+
// else scroll horizontally with x-scroll
|
|
135
|
+
function onWheel(origEvent) {
|
|
136
|
+
var event = (0, normalize_wheel_1.default)(origEvent);
|
|
137
|
+
if (origEvent.ctrlKey === true) {
|
|
138
|
+
origEvent.preventDefault();
|
|
139
|
+
delta.current += event.pixelY / 500;
|
|
140
|
+
model.setScaleFactor(delta.current < 0 ? 1 - delta.current : 1 / (1 + delta.current));
|
|
141
|
+
if (timeout.current) {
|
|
142
|
+
clearTimeout(timeout.current);
|
|
143
|
+
}
|
|
144
|
+
timeout.current = setTimeout(function () {
|
|
145
|
+
model.setScaleFactor(1);
|
|
146
|
+
model.zoomTo(delta.current > 0
|
|
147
|
+
? model.bpPerPx * (1 + delta.current)
|
|
148
|
+
: model.bpPerPx / (1 - delta.current));
|
|
149
|
+
delta.current = 0;
|
|
150
|
+
}, 300);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
// this is needed to stop the event from triggering "back button
|
|
154
|
+
// action" on MacOSX etc. but is a heuristic to avoid preventing the
|
|
155
|
+
// inner-track scroll behavior
|
|
156
|
+
if (Math.abs(event.pixelX) > Math.abs(2 * event.pixelY)) {
|
|
157
|
+
origEvent.preventDefault();
|
|
158
|
+
}
|
|
159
|
+
delta.current += event.pixelX;
|
|
160
|
+
if (!scheduled.current) {
|
|
161
|
+
// use rAF to make it so multiple event handlers aren't fired per-frame
|
|
162
|
+
// see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
|
|
163
|
+
scheduled.current = true;
|
|
164
|
+
window.requestAnimationFrame(function () {
|
|
165
|
+
model.horizontalScroll(delta.current);
|
|
166
|
+
delta.current = 0;
|
|
167
|
+
scheduled.current = false;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
150
171
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}, 300);
|
|
157
|
-
} else {
|
|
158
|
-
// this is needed to stop the event from triggering "back button
|
|
159
|
-
// action" on MacOSX etc. but is a heuristic to avoid preventing the
|
|
160
|
-
// inner-track scroll behavior
|
|
161
|
-
if (Math.abs(event.pixelX) > Math.abs(2 * event.pixelY)) {
|
|
162
|
-
origEvent.preventDefault();
|
|
172
|
+
if (curr) {
|
|
173
|
+
curr.addEventListener('wheel', onWheel);
|
|
174
|
+
return function () {
|
|
175
|
+
curr.removeEventListener('wheel', onWheel);
|
|
176
|
+
};
|
|
163
177
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
window.requestAnimationFrame(function () {
|
|
172
|
-
model.horizontalScroll(delta.current);
|
|
173
|
-
delta.current = 0;
|
|
174
|
-
scheduled.current = false;
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if (curr) {
|
|
181
|
-
curr.addEventListener('wheel', onWheel);
|
|
182
|
-
return function () {
|
|
183
|
-
curr.removeEventListener('wheel', onWheel);
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return function () {};
|
|
188
|
-
}, [model]);
|
|
189
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
-
ref: ref,
|
|
191
|
-
role: "presentation",
|
|
192
|
-
className: classes.tracksContainer,
|
|
193
|
-
onMouseDown: mouseDown,
|
|
194
|
-
onMouseUp: mouseUp,
|
|
195
|
-
onMouseLeave: mouseLeave
|
|
196
|
-
}, /*#__PURE__*/_react.default.createElement(_VerticalGuides.default, {
|
|
197
|
-
model: model
|
|
198
|
-
}), model.showCenterLine ? /*#__PURE__*/_react.default.createElement(_CenterLine.default, {
|
|
199
|
-
model: model
|
|
200
|
-
}) : null, /*#__PURE__*/_react.default.createElement(_RubberBand.default, {
|
|
201
|
-
model: model,
|
|
202
|
-
ControlComponent: /*#__PURE__*/_react.default.createElement(_ScaleBar.default, {
|
|
203
|
-
model: model,
|
|
204
|
-
style: {
|
|
205
|
-
height: _.SCALE_BAR_HEIGHT,
|
|
206
|
-
boxSizing: 'border-box'
|
|
207
|
-
}
|
|
208
|
-
})
|
|
209
|
-
}), children);
|
|
178
|
+
return function () { };
|
|
179
|
+
}, [model]);
|
|
180
|
+
return (react_1.default.createElement("div", { ref: ref, "data-testid": "trackContainer", className: classes.tracksContainer, onMouseDown: mouseDown, onMouseUp: mouseUp, onMouseLeave: mouseLeave },
|
|
181
|
+
model.showGridlines ? react_1.default.createElement(Gridlines_1.default, { model: model }) : null,
|
|
182
|
+
model.showCenterLine ? react_1.default.createElement(CenterLine_1.default, { model: model }) : null,
|
|
183
|
+
react_1.default.createElement(RubberBand_1.default, { model: model, ControlComponent: react_1.default.createElement(ScaleBar_1.default, { model: model, style: { height: __1.SCALE_BAR_HEIGHT, boxSizing: 'border-box' } }) }),
|
|
184
|
+
children));
|
|
210
185
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
exports.default = _default;
|
|
186
|
+
exports.default = (0, mobx_react_1.observer)(TracksContainer);
|
|
187
|
+
//# sourceMappingURL=TracksContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TracksContainer.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/TracksContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0D;AAC1D,qCAA0C;AAC1C,yCAAqC;AAErC,oEAA4C;AAE5C,wBAAiE;AACjE,4DAAqC;AACrC,wDAAiC;AACjC,0DAAmC;AACnC,4DAAqC;AAErC,IAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC;IAC7B,eAAe,EAAE;QACf,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,QAAQ;KACnB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;KACV;CACF,CAAC,CAAA;AAKF,SAAS,eAAe,CAAC,EAMxB;QALC,QAAQ,cAAA,EACR,KAAK,WAAA;IAKG,IAAA,OAAO,GAAK,SAAS,EAAE,QAAhB,CAAgB;IAC/B,2EAA2E;IAC3E,yBAAyB;IACzB,IAAM,KAAK,GAAG,IAAA,cAAM,EAAC,CAAC,CAAC,CAAA;IACvB,IAAM,SAAS,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAA;IAC/B,IAAM,OAAO,GAAG,IAAA,cAAM,GAAS,CAAA;IAC/B,IAAM,GAAG,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAA;IACxC,IAAM,KAAK,GAAG,IAAA,cAAM,EAAS,CAAC,CAAC,CAAA;IAEzB,IAAA,KAAA,OAAoC,IAAA,gBAAQ,EAAC,KAAK,CAAC,IAAA,EAAlD,aAAa,QAAA,EAAE,gBAAgB,QAAmB,CAAA;IAEzD,IAAA,iBAAS,EAAC;QACR,IAAI,OAAO,GAAG,cAAO,CAAC,CAAA;QAEtB,SAAS,eAAe,CAAC,KAAiB;YACxC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G,EAAE,GAAG,iBACI,gBAAgB,EAC5B,SAAS,EAAE,OAAO,CAAC,eAAe,EAClC,WAAW,EAAE,SAAS,EACtB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,UAAU;QAEvB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,8BAAC,mBAAS,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI;QACxD,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,8BAAC,oBAAU,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI;QAE3D,8BAAC,oBAAU,IACT,KAAK,EAAE,KAAK,EACZ,gBAAgB,EACd,8BAAC,kBAAQ,IACP,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,EAAE,MAAM,EAAE,oBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,GAC5D,GAEJ;QACD,QAAQ,CACL,CACP,CAAA;AACH,CAAC;AAED,kBAAe,IAAA,qBAAQ,EAAC,eAAe,CAAC,CAAA"}
|
|
@@ -1,92 +1,77 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
9
17
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
bpPerPx = model.bpPerPx,
|
|
49
|
-
scaleFactor = model.scaleFactor;
|
|
50
|
-
|
|
51
|
-
var _useState = (0, _react.useState)(-Math.log2(bpPerPx) * 100),
|
|
52
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
53
|
-
value = _useState2[0],
|
|
54
|
-
setValue = _useState2[1];
|
|
55
|
-
|
|
56
|
-
(0, _react.useEffect)(function () {
|
|
57
|
-
setValue(-Math.log2(bpPerPx) * 100);
|
|
58
|
-
}, [setValue, bpPerPx]);
|
|
59
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
-
className: classes.container
|
|
61
|
-
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
62
|
-
"data-testid": "zoom_out",
|
|
63
|
-
onClick: function onClick() {
|
|
64
|
-
model.zoom(bpPerPx * 2);
|
|
65
|
-
},
|
|
66
|
-
disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1,
|
|
67
|
-
color: "secondary"
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement(_ZoomOut.default, null)), /*#__PURE__*/_react.default.createElement(_Slider.default, {
|
|
69
|
-
className: classes.slider,
|
|
70
|
-
value: value,
|
|
71
|
-
min: -Math.log2(maxBpPerPx) * 100,
|
|
72
|
-
max: -Math.log2(minBpPerPx) * 100,
|
|
73
|
-
onChange: function onChange(_, val) {
|
|
74
|
-
return setValue(val);
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
26
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
|
+
if (!m) return o;
|
|
28
|
+
var i = m.call(o), r, ar = [], e;
|
|
29
|
+
try {
|
|
30
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
31
|
+
}
|
|
32
|
+
catch (error) { e = { error: error }; }
|
|
33
|
+
finally {
|
|
34
|
+
try {
|
|
35
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
36
|
+
}
|
|
37
|
+
finally { if (e) throw e.error; }
|
|
38
|
+
}
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
var react_1 = __importStar(require("react"));
|
|
46
|
+
var mobx_react_1 = require("mobx-react");
|
|
47
|
+
var material_1 = require("@mui/material");
|
|
48
|
+
var mui_1 = require("tss-react/mui");
|
|
49
|
+
var ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
|
|
50
|
+
var ZoomOut_1 = __importDefault(require("@mui/icons-material/ZoomOut"));
|
|
51
|
+
var useStyles = (0, mui_1.makeStyles)()({
|
|
52
|
+
container: {
|
|
53
|
+
display: 'flex',
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
alignItems: 'center',
|
|
75
56
|
},
|
|
76
|
-
|
|
77
|
-
|
|
57
|
+
slider: {
|
|
58
|
+
width: 70,
|
|
78
59
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
60
|
+
});
|
|
61
|
+
function ZoomControls(_a) {
|
|
62
|
+
var model = _a.model;
|
|
63
|
+
var classes = useStyles().classes;
|
|
64
|
+
var maxBpPerPx = model.maxBpPerPx, minBpPerPx = model.minBpPerPx, bpPerPx = model.bpPerPx, scaleFactor = model.scaleFactor;
|
|
65
|
+
var _b = __read((0, react_1.useState)(-Math.log2(bpPerPx) * 100), 2), value = _b[0], setValue = _b[1];
|
|
66
|
+
(0, react_1.useEffect)(function () {
|
|
67
|
+
setValue(-Math.log2(bpPerPx) * 100);
|
|
68
|
+
}, [setValue, bpPerPx]);
|
|
69
|
+
return (react_1.default.createElement("div", { className: classes.container },
|
|
70
|
+
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_out", onClick: function () { return model.zoom(bpPerPx * 2); }, disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1, color: "secondary", size: "large" },
|
|
71
|
+
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: function (_, val) { return setValue(val); }, onChangeCommitted: function () { return model.zoomTo(Math.pow(2, (-value / 100))); }, disabled: scaleFactor !== 1 }),
|
|
73
|
+
react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick: function () { return model.zoom(model.bpPerPx / 2); }, disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1, color: "secondary", size: "large" },
|
|
74
|
+
react_1.default.createElement(ZoomIn_1.default, null))));
|
|
88
75
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
exports.default = _default;
|
|
76
|
+
exports.default = (0, mobx_react_1.observer)(ZoomControls);
|
|
77
|
+
//# sourceMappingURL=ZoomControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZoomControls.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/ZoomControls.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAkD;AAClD,yCAAqC;AACrC,0CAAkD;AAClD,qCAA0C;AAC1C,sEAA+C;AAC/C,wEAAiD;AAGjD,IAAM,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,EAA2C;QAAzC,KAAK,WAAA;IACnB,IAAA,OAAO,GAAK,SAAS,EAAE,QAAhB,CAAgB;IACvB,IAAA,UAAU,GAAuC,KAAK,WAA5C,EAAE,UAAU,GAA2B,KAAK,WAAhC,EAAE,OAAO,GAAkB,KAAK,QAAvB,EAAE,WAAW,GAAK,KAAK,YAAV,CAAU;IACxD,IAAA,KAAA,OAAoB,IAAA,gBAAQ,EAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,IAAA,EAAtD,KAAK,QAAA,EAAE,QAAQ,QAAuC,CAAA;IAC7D,IAAA,iBAAS,EAAC;QACR,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAA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BAAC,gBAAM,OAAG,CACC,CACT,CACP,CAAA;AACH,CAAC;AAED,kBAAe,IAAA,qBAAQ,EAAC,YAAY,CAAC,CAAA"}
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
import { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
2
|
+
import { SearchType } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
1
3
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
4
|
+
import { SearchScope } from '@jbrowse/core/TextSearch/TextSearchManager';
|
|
5
|
+
import { TextSearchManager } from '@jbrowse/core/util';
|
|
2
6
|
export declare function dedupe(results: BaseResult[] | undefined, cb: (result: BaseResult) => string): BaseResult[];
|
|
7
|
+
export declare function fetchResults({ queryString, searchType, searchScope, rankSearchResults, textSearchManager, assembly, }: {
|
|
8
|
+
queryString: string;
|
|
9
|
+
searchScope: SearchScope;
|
|
10
|
+
rankSearchResults: (results: BaseResult[]) => BaseResult[];
|
|
11
|
+
searchType?: SearchType;
|
|
12
|
+
textSearchManager?: TextSearchManager;
|
|
13
|
+
assembly?: Assembly;
|
|
14
|
+
}): Promise<BaseResult[]>;
|