@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,349 +1,210 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.renderToSvg = void 0;
|
|
54
|
+
var react_1 = __importDefault(require("react"));
|
|
55
|
+
var server_1 = require("react-dom/server");
|
|
56
|
+
var mobx_1 = require("mobx");
|
|
57
|
+
var mobx_state_tree_1 = require("mobx-state-tree");
|
|
58
|
+
var configuration_1 = require("@jbrowse/core/configuration");
|
|
59
|
+
var util_1 = require("@jbrowse/core/util");
|
|
60
|
+
var Base1DViewModel_1 = __importDefault(require("@jbrowse/core/util/Base1DViewModel"));
|
|
61
|
+
// locals
|
|
62
|
+
var Ruler_1 = __importDefault(require("./Ruler"));
|
|
63
|
+
var __1 = require("..");
|
|
64
|
+
var OverviewScaleBar_1 = require("./OverviewScaleBar");
|
|
65
|
+
function ScaleBar(_a) {
|
|
66
|
+
var model = _a.model, fontSize = _a.fontSize;
|
|
67
|
+
var offsetPx = model.offsetPx, _b = model.dynamicBlocks, totalWidthPx = _b.totalWidthPxWithoutBorders, totalBp = _b.totalBp;
|
|
68
|
+
var displayBp = (0, util_1.getBpDisplayStr)(totalBp);
|
|
69
|
+
var x0 = Math.max(-offsetPx, 0);
|
|
70
|
+
var x1 = x0 + totalWidthPx;
|
|
71
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
72
|
+
react_1.default.createElement("line", { x1: x0, x2: x1, y1: 10, y2: 10, stroke: "black" }),
|
|
73
|
+
react_1.default.createElement("line", { x1: x0, x2: x0, y1: 5, y2: 15, stroke: "black" }),
|
|
74
|
+
react_1.default.createElement("line", { x1: x1, x2: x1, y1: 5, y2: 15, stroke: "black" }),
|
|
75
|
+
react_1.default.createElement("text", { x: x0 + (x1 - x0) / 2, y: fontSize * 2, textAnchor: "middle", fontSize: fontSize }, displayBp)));
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}))), contentBlocks.map(function (block) {
|
|
92
|
-
var key = block.key,
|
|
93
|
-
start = block.start,
|
|
94
|
-
end = block.end,
|
|
95
|
-
reversed = block.reversed,
|
|
96
|
-
offsetPx = block.offsetPx,
|
|
97
|
-
refName = block.refName;
|
|
98
|
-
var offsetLeft = offsetPx - viewOffsetPx;
|
|
99
|
-
return /*#__PURE__*/_react.default.createElement("g", {
|
|
100
|
-
key: "".concat(key),
|
|
101
|
-
transform: "translate(".concat(offsetLeft, " 0)")
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
103
|
-
x: offsetLeft / bpPerPx,
|
|
104
|
-
y: fontSize,
|
|
105
|
-
fontSize: fontSize
|
|
106
|
-
}, refName), renderRuler ? /*#__PURE__*/_react.default.createElement("g", {
|
|
107
|
-
transform: "translate(0 20)",
|
|
108
|
-
clipPath: "url(#clip-ruler)"
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement(_Ruler.default, {
|
|
110
|
-
start: start,
|
|
111
|
-
end: end,
|
|
112
|
-
bpPerPx: bpPerPx,
|
|
113
|
-
reversed: reversed
|
|
114
|
-
})) : /*#__PURE__*/_react.default.createElement("line", {
|
|
115
|
-
strokeWidth: 1,
|
|
116
|
-
stroke: "black",
|
|
117
|
-
x1: start / bpPerPx,
|
|
118
|
-
x2: end / bpPerPx,
|
|
119
|
-
y1: 20,
|
|
120
|
-
y2: 20
|
|
121
|
-
}));
|
|
122
|
-
}));
|
|
77
|
+
function SVGRuler(_a) {
|
|
78
|
+
var model = _a.model, fontSize = _a.fontSize, width = _a.width;
|
|
79
|
+
var contentBlocks = model.dynamicBlocks.contentBlocks, viewOffsetPx = model.offsetPx, bpPerPx = model.bpPerPx;
|
|
80
|
+
var renderRuler = contentBlocks.length < 5;
|
|
81
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
82
|
+
react_1.default.createElement("defs", null,
|
|
83
|
+
react_1.default.createElement("clipPath", { id: "clip-ruler" },
|
|
84
|
+
react_1.default.createElement("rect", { x: 0, y: 0, width: width, height: 20 }))),
|
|
85
|
+
contentBlocks.map(function (block) {
|
|
86
|
+
var key = block.key, start = block.start, end = block.end, reversed = block.reversed, offsetPx = block.offsetPx, refName = block.refName;
|
|
87
|
+
var offsetLeft = offsetPx - viewOffsetPx;
|
|
88
|
+
return (react_1.default.createElement("g", { key: "".concat(key), transform: "translate(".concat(offsetLeft, " 0)") },
|
|
89
|
+
react_1.default.createElement("text", { x: offsetLeft / bpPerPx, y: fontSize, fontSize: fontSize }, refName),
|
|
90
|
+
renderRuler ? (react_1.default.createElement("g", { transform: "translate(0 20)", clipPath: "url(#clip-ruler)" },
|
|
91
|
+
react_1.default.createElement(Ruler_1.default, { start: start, end: end, bpPerPx: bpPerPx, reversed: reversed }))) : (react_1.default.createElement("line", { strokeWidth: 1, stroke: "black", x1: start / bpPerPx, x2: end / bpPerPx, y1: 20, y2: 20 }))));
|
|
92
|
+
})));
|
|
123
93
|
}
|
|
124
|
-
|
|
125
94
|
var fontSize = 15;
|
|
126
95
|
var rulerHeight = 50;
|
|
127
96
|
var textHeight = fontSize + 5;
|
|
128
97
|
var paddingHeight = 20;
|
|
129
98
|
var headerHeight = textHeight + 20;
|
|
130
99
|
var cytobandHeightIfExists = 100;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
assemblyManager = _getSession.assemblyManager;
|
|
149
|
-
|
|
150
|
-
var assemblyName = assemblyNames.length > 1 ? '' : assemblyNames[0];
|
|
151
|
-
var assembly = assemblyManager.get(assemblyName);
|
|
152
|
-
|
|
153
|
-
var overview = _Base1DViewModel.default.create({
|
|
154
|
-
displayedRegions: JSON.parse(JSON.stringify(displayedRegions)),
|
|
155
|
-
interRegionPaddingWidth: 0,
|
|
156
|
-
minimumBlockWidth: model.minimumBlockWidth
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
var visibleRegions = model.dynamicBlocks.contentBlocks;
|
|
160
|
-
overview.setVolatileWidth(width);
|
|
161
|
-
overview.showAllRegions();
|
|
162
|
-
var block = overview.dynamicBlocks.contentBlocks[0];
|
|
163
|
-
var first = visibleRegions[0];
|
|
164
|
-
var firstOverviewPx = overview.bpToPx(_objectSpread(_objectSpread({}, first), {}, {
|
|
165
|
-
coord: first.reversed ? first.end : first.start
|
|
166
|
-
})) || 0;
|
|
167
|
-
var last = visibleRegions[visibleRegions.length - 1];
|
|
168
|
-
var lastOverviewPx = overview.bpToPx(_objectSpread(_objectSpread({}, last), {}, {
|
|
169
|
-
coord: last.reversed ? last.start : last.end
|
|
170
|
-
})) || 0;
|
|
171
|
-
var cytobandHeight = showCytobands ? cytobandHeightIfExists : 0;
|
|
172
|
-
return /*#__PURE__*/_react.default.createElement("g", {
|
|
173
|
-
id: "header"
|
|
174
|
-
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
175
|
-
x: 0,
|
|
176
|
-
y: fontSize,
|
|
177
|
-
fontSize: fontSize
|
|
178
|
-
}, assemblyName), showCytobands ? /*#__PURE__*/_react.default.createElement("g", {
|
|
179
|
-
transform: "translate(0 ".concat(rulerHeight, ")")
|
|
180
|
-
}, /*#__PURE__*/_react.default.createElement(_OverviewScaleBar.Cytobands, {
|
|
181
|
-
overview: overview,
|
|
182
|
-
assembly: assembly,
|
|
183
|
-
block: block
|
|
184
|
-
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
185
|
-
stroke: "red",
|
|
186
|
-
fill: "rgb(255,0,0,0.1)",
|
|
187
|
-
width: Math.max(lastOverviewPx - firstOverviewPx, 0.5),
|
|
188
|
-
height: _.HEADER_OVERVIEW_HEIGHT - 1,
|
|
189
|
-
x: firstOverviewPx,
|
|
190
|
-
y: 0.5
|
|
191
|
-
}), /*#__PURE__*/_react.default.createElement("g", {
|
|
192
|
-
transform: "translate(0,".concat(_.HEADER_OVERVIEW_HEIGHT, ")")
|
|
193
|
-
}, /*#__PURE__*/_react.default.createElement(_OverviewScaleBar.Polygon, {
|
|
194
|
-
overview: overview,
|
|
195
|
-
model: model,
|
|
196
|
-
useOffset: false
|
|
197
|
-
}))) : null, /*#__PURE__*/_react.default.createElement("g", {
|
|
198
|
-
transform: "translate(0 ".concat(fontSize + cytobandHeight, ")")
|
|
199
|
-
}, /*#__PURE__*/_react.default.createElement(ScaleBar, {
|
|
200
|
-
model: model,
|
|
201
|
-
fontSize: fontSize
|
|
202
|
-
})), /*#__PURE__*/_react.default.createElement("g", {
|
|
203
|
-
transform: "translate(0 ".concat(rulerHeight + cytobandHeight, ")")
|
|
204
|
-
}, /*#__PURE__*/_react.default.createElement(SVGRuler, {
|
|
205
|
-
model: model,
|
|
206
|
-
fontSize: fontSize,
|
|
207
|
-
width: width
|
|
208
|
-
})));
|
|
209
|
-
}; // SVG component, region separator
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
var SVGRegionSeparators = function SVGRegionSeparators(_ref4) {
|
|
213
|
-
var model = _ref4.model,
|
|
214
|
-
height = _ref4.height;
|
|
215
|
-
var dynamicBlocks = model.dynamicBlocks,
|
|
216
|
-
offsetPx = model.offsetPx,
|
|
217
|
-
interRegionPaddingWidth = model.interRegionPaddingWidth;
|
|
218
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, dynamicBlocks.contentBlocks.slice(1).map(function (block) {
|
|
219
|
-
return /*#__PURE__*/_react.default.createElement("rect", {
|
|
220
|
-
key: block.key,
|
|
221
|
-
x: block.offsetPx - offsetPx - interRegionPaddingWidth,
|
|
222
|
-
width: interRegionPaddingWidth,
|
|
223
|
-
y: 0,
|
|
224
|
-
height: height,
|
|
225
|
-
stroke: "none",
|
|
226
|
-
fill: "grey"
|
|
100
|
+
var totalHeight = function (tracks) {
|
|
101
|
+
return tracks.reduce(function (accum, track) {
|
|
102
|
+
var display = track.displays[0];
|
|
103
|
+
return accum + display.height + paddingHeight + textHeight;
|
|
104
|
+
}, 0);
|
|
105
|
+
};
|
|
106
|
+
// SVG component, ruler and assembly name
|
|
107
|
+
var SVGHeader = function (_a) {
|
|
108
|
+
var model = _a.model;
|
|
109
|
+
var width = model.width, assemblyNames = model.assemblyNames, showCytobands = model.showCytobands, displayedRegions = model.displayedRegions;
|
|
110
|
+
var assemblyManager = (0, util_1.getSession)(model).assemblyManager;
|
|
111
|
+
var assemblyName = assemblyNames.length > 1 ? '' : assemblyNames[0];
|
|
112
|
+
var assembly = assemblyManager.get(assemblyName);
|
|
113
|
+
var overview = Base1DViewModel_1.default.create({
|
|
114
|
+
displayedRegions: JSON.parse(JSON.stringify(displayedRegions)),
|
|
115
|
+
interRegionPaddingWidth: 0,
|
|
116
|
+
minimumBlockWidth: model.minimumBlockWidth,
|
|
227
117
|
});
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
118
|
+
var visibleRegions = model.dynamicBlocks.contentBlocks;
|
|
119
|
+
overview.setVolatileWidth(width);
|
|
120
|
+
overview.showAllRegions();
|
|
121
|
+
var block = overview.dynamicBlocks.contentBlocks[0];
|
|
122
|
+
var first = visibleRegions[0];
|
|
123
|
+
var firstOverviewPx = overview.bpToPx(__assign(__assign({}, first), { coord: first.reversed ? first.end : first.start })) || 0;
|
|
124
|
+
var last = visibleRegions[visibleRegions.length - 1];
|
|
125
|
+
var lastOverviewPx = overview.bpToPx(__assign(__assign({}, last), { coord: last.reversed ? last.start : last.end })) || 0;
|
|
126
|
+
var cytobandHeight = showCytobands ? cytobandHeightIfExists : 0;
|
|
127
|
+
return (react_1.default.createElement("g", { id: "header" },
|
|
128
|
+
react_1.default.createElement("text", { x: 0, y: fontSize, fontSize: fontSize }, assemblyName),
|
|
129
|
+
showCytobands ? (react_1.default.createElement("g", { transform: "translate(0 ".concat(rulerHeight, ")") },
|
|
130
|
+
react_1.default.createElement(OverviewScaleBar_1.Cytobands, { overview: overview, assembly: assembly, block: block }),
|
|
131
|
+
react_1.default.createElement("rect", { stroke: "red", fill: "rgb(255,0,0,0.1)", width: Math.max(lastOverviewPx - firstOverviewPx, 0.5), height: __1.HEADER_OVERVIEW_HEIGHT - 1, x: firstOverviewPx, y: 0.5 }),
|
|
132
|
+
react_1.default.createElement("g", { transform: "translate(0,".concat(__1.HEADER_OVERVIEW_HEIGHT, ")") },
|
|
133
|
+
react_1.default.createElement(OverviewScaleBar_1.Polygon, { overview: overview, model: model, useOffset: false })))) : null,
|
|
134
|
+
react_1.default.createElement("g", { transform: "translate(0 ".concat(fontSize + cytobandHeight, ")") },
|
|
135
|
+
react_1.default.createElement(ScaleBar, { model: model, fontSize: fontSize })),
|
|
136
|
+
react_1.default.createElement("g", { transform: "translate(0 ".concat(rulerHeight + cytobandHeight, ")") },
|
|
137
|
+
react_1.default.createElement(SVGRuler, { model: model, fontSize: fontSize, width: width }))));
|
|
138
|
+
};
|
|
139
|
+
// SVG component, region separator
|
|
140
|
+
var SVGRegionSeparators = function (_a) {
|
|
141
|
+
var model = _a.model, height = _a.height;
|
|
142
|
+
var dynamicBlocks = model.dynamicBlocks, offsetPx = model.offsetPx, interRegionPaddingWidth = model.interRegionPaddingWidth;
|
|
143
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, dynamicBlocks.contentBlocks.slice(1).map(function (block) { return (react_1.default.createElement("rect", { key: block.key, x: block.offsetPx - offsetPx - interRegionPaddingWidth, width: interRegionPaddingWidth, y: 0, height: height, stroke: "none", fill: "grey" })); })));
|
|
144
|
+
};
|
|
145
|
+
// SVG component, tracks
|
|
146
|
+
function SVGTracks(_a) {
|
|
147
|
+
var displayResults = _a.displayResults, model = _a.model, offset = _a.offset;
|
|
148
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, displayResults.map(function (_a) {
|
|
149
|
+
var track = _a.track, result = _a.result;
|
|
150
|
+
var current = offset;
|
|
151
|
+
var trackName = (0, configuration_1.getConf)(track, 'name') ||
|
|
152
|
+
"Reference sequence (".concat((0, configuration_1.readConfObject)((0, mobx_state_tree_1.getParent)(track.configuration), 'name'), ")");
|
|
153
|
+
var display = track.displays[0];
|
|
154
|
+
offset += display.height + paddingHeight + textHeight;
|
|
155
|
+
return (react_1.default.createElement("g", { key: track.configuration.trackId, transform: "translate(0 ".concat(current, ")") },
|
|
156
|
+
react_1.default.createElement("text", { fontSize: fontSize, x: Math.max(-model.offsetPx, 0) }, trackName),
|
|
157
|
+
react_1.default.createElement("g", { transform: "translate(0 ".concat(textHeight, ")") },
|
|
158
|
+
result,
|
|
159
|
+
react_1.default.createElement(SVGRegionSeparators, { model: model, height: display.height }))));
|
|
254
160
|
})));
|
|
255
|
-
}));
|
|
256
|
-
} // render LGV to SVG
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
function renderToSvg(_x, _x2) {
|
|
260
|
-
return _renderToSvg.apply(this, arguments);
|
|
261
161
|
}
|
|
262
|
-
|
|
263
|
-
function
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}));
|
|
312
|
-
|
|
313
|
-
return function (_x3) {
|
|
314
|
-
return _ref7.apply(this, arguments);
|
|
315
|
-
};
|
|
316
|
-
}()));
|
|
317
|
-
|
|
318
|
-
case 8:
|
|
319
|
-
displayResults = _context2.sent;
|
|
320
|
-
return _context2.abrupt("return", (0, _server.renderToStaticMarkup)( /*#__PURE__*/_react.default.createElement("svg", {
|
|
321
|
-
width: width,
|
|
322
|
-
height: height,
|
|
323
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
324
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
325
|
-
viewBox: [0, 0, width + shift * 2, height].toString()
|
|
326
|
-
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
327
|
-
width: width + shift * 2,
|
|
328
|
-
height: height,
|
|
329
|
-
fill: "white"
|
|
330
|
-
}), /*#__PURE__*/_react.default.createElement("g", {
|
|
331
|
-
stroke: "none",
|
|
332
|
-
transform: "translate(".concat(shift, " ").concat(fontSize, ")")
|
|
333
|
-
}, /*#__PURE__*/_react.default.createElement(SVGHeader, {
|
|
334
|
-
model: model
|
|
335
|
-
}), /*#__PURE__*/_react.default.createElement(SVGTracks, {
|
|
336
|
-
model: model,
|
|
337
|
-
displayResults: displayResults,
|
|
338
|
-
offset: offset
|
|
339
|
-
})))));
|
|
340
|
-
|
|
341
|
-
case 10:
|
|
342
|
-
case "end":
|
|
343
|
-
return _context2.stop();
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}, _callee2);
|
|
347
|
-
}));
|
|
348
|
-
return _renderToSvg.apply(this, arguments);
|
|
349
|
-
}
|
|
162
|
+
// render LGV to SVG
|
|
163
|
+
function renderToSvg(model, opts) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
165
|
+
var width, tracks, showCytobands, shift, offset, height, displayResults;
|
|
166
|
+
var _this = this;
|
|
167
|
+
return __generator(this, function (_a) {
|
|
168
|
+
switch (_a.label) {
|
|
169
|
+
case 0: return [4 /*yield*/, (0, mobx_1.when)(function () { return model.initialized; })];
|
|
170
|
+
case 1:
|
|
171
|
+
_a.sent();
|
|
172
|
+
width = model.width, tracks = model.tracks, showCytobands = model.showCytobands;
|
|
173
|
+
shift = 50;
|
|
174
|
+
offset = headerHeight +
|
|
175
|
+
rulerHeight +
|
|
176
|
+
(showCytobands ? cytobandHeightIfExists : 0) +
|
|
177
|
+
20;
|
|
178
|
+
height = totalHeight(tracks) + offset;
|
|
179
|
+
return [4 /*yield*/, Promise.all(tracks.map(function (track) { return __awaiter(_this, void 0, void 0, function () {
|
|
180
|
+
var display, result;
|
|
181
|
+
return __generator(this, function (_a) {
|
|
182
|
+
switch (_a.label) {
|
|
183
|
+
case 0:
|
|
184
|
+
display = track.displays[0];
|
|
185
|
+
return [4 /*yield*/, (0, mobx_1.when)(function () { return (display.ready !== undefined ? display.ready : true); })];
|
|
186
|
+
case 1:
|
|
187
|
+
_a.sent();
|
|
188
|
+
return [4 /*yield*/, display.renderSvg(opts)];
|
|
189
|
+
case 2:
|
|
190
|
+
result = _a.sent();
|
|
191
|
+
return [2 /*return*/, { track: track, result: result }];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}); }))
|
|
195
|
+
// the xlink namespace is used for rendering <image> tag
|
|
196
|
+
];
|
|
197
|
+
case 2:
|
|
198
|
+
displayResults = _a.sent();
|
|
199
|
+
// the xlink namespace is used for rendering <image> tag
|
|
200
|
+
return [2 /*return*/, (0, server_1.renderToStaticMarkup)(react_1.default.createElement("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, width + shift * 2, height].toString() },
|
|
201
|
+
react_1.default.createElement("rect", { width: width + shift * 2, height: height, fill: "white" }),
|
|
202
|
+
react_1.default.createElement("g", { stroke: "none", transform: "translate(".concat(shift, " ").concat(fontSize, ")") },
|
|
203
|
+
react_1.default.createElement(SVGHeader, { model: model }),
|
|
204
|
+
react_1.default.createElement(SVGTracks, { model: model, displayResults: displayResults, offset: offset }))))];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
exports.renderToSvg = renderToSvg;
|
|
210
|
+
//# sourceMappingURL=LinearGenomeViewSvg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinearGenomeViewSvg.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/LinearGenomeViewSvg.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,2CAAuD;AACvD,6BAA2B;AAC3B,mDAA2C;AAC3C,6DAAqE;AACrE,2CAAgE;AAEhE,uFAA2D;AAE3D,SAAS;AACT,kDAA2B;AAC3B,wBAIW;AACX,uDAAuD;AAIvD,SAAS,QAAQ,CAAC,EAAqD;QAAnD,KAAK,WAAA,EAAE,QAAQ,cAAA;IAE/B,IAAA,QAAQ,GAEN,KAAK,SAFC,EACR,KACE,KAAK,cAD6D,EAAvB,YAAY,gCAAA,EAAE,OAAO,aAAE,CAC7D;IACT,IAAM,SAAS,GAAG,IAAA,sBAAe,EAAC,OAAO,CAAC,CAAA;IAC1C,IAAM,EAAE,GAAG,IAAI,CAA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