@jbrowse/plugin-breakpoint-split-view 2.17.0 → 3.0.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/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +6 -3
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +5 -11
- package/dist/BreakpointAlignmentsFeatureDetail/index.d.ts +1 -1
- package/dist/BreakpointAlignmentsFeatureDetail/index.js +18 -8
- package/dist/BreakpointSplitView/BreakpointSplitView.d.ts +22 -40
- package/dist/BreakpointSplitView/BreakpointSplitView.js +41 -90
- package/dist/BreakpointSplitView/components/AlignmentConnections.d.ts +3 -4
- package/dist/BreakpointSplitView/components/AlignmentConnections.js +93 -124
- package/dist/BreakpointSplitView/components/Breakends.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Breakends.js +67 -92
- package/dist/BreakpointSplitView/components/BreakpointSplitView.d.ts +2 -3
- package/dist/BreakpointSplitView/components/BreakpointSplitView.js +13 -17
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +2 -3
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +10 -39
- package/dist/BreakpointSplitView/components/ExportSvgDialog.d.ts +2 -3
- package/dist/BreakpointSplitView/components/ExportSvgDialog.js +35 -76
- package/dist/BreakpointSplitView/components/Overlay.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Overlay.js +8 -9
- package/dist/BreakpointSplitView/components/PairedFeatures.d.ts +3 -4
- package/dist/BreakpointSplitView/components/PairedFeatures.js +47 -72
- package/dist/BreakpointSplitView/components/Translocations.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Translocations.js +57 -86
- package/dist/BreakpointSplitView/components/getOrientationColor.js +0 -8
- package/dist/BreakpointSplitView/components/util.d.ts +1 -1
- package/dist/BreakpointSplitView/components/util.js +12 -12
- package/dist/BreakpointSplitView/index.d.ts +1 -1
- package/dist/BreakpointSplitView/index.js +19 -10
- package/dist/BreakpointSplitView/model.d.ts +23 -108
- package/dist/BreakpointSplitView/model.js +50 -153
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js +3 -6
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -1
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +6 -30
- package/dist/BreakpointSplitView/svgcomponents/util.d.ts +2 -2
- package/dist/BreakpointSplitView/svgcomponents/util.js +0 -1
- package/dist/BreakpointSplitView/types.d.ts +22 -0
- package/dist/BreakpointSplitView/types.js +2 -0
- package/dist/BreakpointSplitView/util.d.ts +12 -2
- package/dist/BreakpointSplitView/util.js +34 -8
- package/dist/index.d.ts +1 -1
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +6 -3
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +5 -8
- package/esm/BreakpointAlignmentsFeatureDetail/index.d.ts +1 -1
- package/esm/BreakpointAlignmentsFeatureDetail/index.js +1 -1
- package/esm/BreakpointSplitView/BreakpointSplitView.d.ts +22 -40
- package/esm/BreakpointSplitView/BreakpointSplitView.js +41 -90
- package/esm/BreakpointSplitView/components/AlignmentConnections.d.ts +3 -4
- package/esm/BreakpointSplitView/components/AlignmentConnections.js +94 -102
- package/esm/BreakpointSplitView/components/Breakends.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Breakends.js +68 -70
- package/esm/BreakpointSplitView/components/BreakpointSplitView.d.ts +2 -3
- package/esm/BreakpointSplitView/components/BreakpointSplitView.js +13 -17
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +2 -3
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +10 -16
- package/esm/BreakpointSplitView/components/ExportSvgDialog.d.ts +2 -3
- package/esm/BreakpointSplitView/components/ExportSvgDialog.js +35 -53
- package/esm/BreakpointSplitView/components/Overlay.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Overlay.js +8 -9
- package/esm/BreakpointSplitView/components/PairedFeatures.d.ts +3 -4
- package/esm/BreakpointSplitView/components/PairedFeatures.js +48 -50
- package/esm/BreakpointSplitView/components/Translocations.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Translocations.js +58 -64
- package/esm/BreakpointSplitView/components/getOrientationColor.js +0 -8
- package/esm/BreakpointSplitView/components/util.d.ts +1 -1
- package/esm/BreakpointSplitView/components/util.js +12 -12
- package/esm/BreakpointSplitView/index.d.ts +1 -1
- package/esm/BreakpointSplitView/index.js +2 -3
- package/esm/BreakpointSplitView/model.d.ts +23 -108
- package/esm/BreakpointSplitView/model.js +30 -142
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.js +3 -3
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -1
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +6 -30
- package/esm/BreakpointSplitView/svgcomponents/util.d.ts +2 -2
- package/esm/BreakpointSplitView/svgcomponents/util.js +0 -1
- package/esm/BreakpointSplitView/types.d.ts +22 -0
- package/esm/BreakpointSplitView/types.js +1 -0
- package/esm/BreakpointSplitView/util.d.ts +12 -2
- package/esm/BreakpointSplitView/util.js +33 -10
- package/esm/index.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
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;
|
|
17
|
-
});
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
27
5
|
const util_1 = require("@jbrowse/core/util");
|
|
28
6
|
const mobx_react_1 = require("mobx-react");
|
|
29
7
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
30
|
-
// locals
|
|
31
8
|
const util_2 = require("./util");
|
|
32
9
|
const util_3 = require("../util");
|
|
33
10
|
const [LEFT] = [0, 1, 2, 3];
|
|
34
11
|
const Breakends = (0, mobx_react_1.observer)(function ({ model, trackId, parentRef: ref, getTrackYPosOverride, }) {
|
|
35
|
-
const { views } = model;
|
|
12
|
+
const { interactiveOverlay, views } = model;
|
|
36
13
|
const session = (0, util_1.getSession)(model);
|
|
37
14
|
const { assemblyManager } = session;
|
|
38
15
|
const totalFeatures = model.getTrackFeatures(trackId);
|
|
@@ -49,72 +26,70 @@ const Breakends = (0, mobx_react_1.observer)(function ({ model, trackId, parentR
|
|
|
49
26
|
const rect = ref.current.getBoundingClientRect();
|
|
50
27
|
yoff = rect.top;
|
|
51
28
|
}
|
|
52
|
-
return (
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
} }));
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("g", { stroke: "green", strokeWidth: 5, fill: "none", "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId, children: layoutMatches.map(chunk => {
|
|
30
|
+
const ret = [];
|
|
31
|
+
for (let i = 0; i < chunk.length - 1; i += 1) {
|
|
32
|
+
const { layout: c1, feature: f1, level: level1 } = chunk[i];
|
|
33
|
+
const { layout: c2, feature: f2, level: level2 } = chunk[i + 1];
|
|
34
|
+
const id = f1.id();
|
|
35
|
+
const relevantAlt = (0, util_2.findMatchingAlt)(f1, f2);
|
|
36
|
+
if (!c1 || !c2) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const f1origref = f1.get('refName');
|
|
40
|
+
const f2origref = f2.get('refName');
|
|
41
|
+
const f1ref = assembly.getCanonicalRefName(f1origref);
|
|
42
|
+
const f2ref = assembly.getCanonicalRefName(f2origref);
|
|
43
|
+
if (!f1ref || !f2ref) {
|
|
44
|
+
throw new Error(`unable to find ref for ${f1ref || f2ref}`);
|
|
45
|
+
}
|
|
46
|
+
const x1 = (0, util_3.getPxFromCoordinate)(views[level1], f1ref, c1[LEFT]);
|
|
47
|
+
const x2 = (0, util_3.getPxFromCoordinate)(views[level2], f2ref, c2[LEFT]);
|
|
48
|
+
const reversed1 = views[level1].pxToBp(x1).reversed;
|
|
49
|
+
const reversed2 = views[level2].pxToBp(x2).reversed;
|
|
50
|
+
const tracks = views.map(v => v.getTrack(trackId));
|
|
51
|
+
const y1 = (0, util_3.yPos)(trackId, level1, views, tracks, c1, getTrackYPosOverride) -
|
|
52
|
+
yoff;
|
|
53
|
+
const y2 = (0, util_3.yPos)(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
|
|
54
|
+
yoff;
|
|
55
|
+
if (!relevantAlt) {
|
|
56
|
+
console.warn('the relevant ALT allele was not found, cannot render');
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const path = [
|
|
60
|
+
'M',
|
|
61
|
+
x1 -
|
|
62
|
+
20 *
|
|
63
|
+
(relevantAlt.Join === 'left' ? -1 : 1) *
|
|
64
|
+
(reversed1 ? -1 : 1),
|
|
65
|
+
y1,
|
|
66
|
+
'L',
|
|
67
|
+
x1,
|
|
68
|
+
y1,
|
|
69
|
+
'L',
|
|
70
|
+
x2,
|
|
71
|
+
y2,
|
|
72
|
+
'L',
|
|
73
|
+
x2 -
|
|
74
|
+
20 *
|
|
75
|
+
(relevantAlt.MateDirection === 'left' ? 1 : -1) *
|
|
76
|
+
(reversed2 ? -1 : 1),
|
|
77
|
+
y2,
|
|
78
|
+
].join(' ');
|
|
79
|
+
ret.push((0, jsx_runtime_1.jsx)("path", { d: path, "data-testid": "r2", pointerEvents: interactiveOverlay ? 'auto' : undefined, strokeWidth: id === mouseoverElt ? 10 : 5, onClick: () => {
|
|
80
|
+
var _a, _b, _c;
|
|
81
|
+
const featureWidget = (_a = session.addWidget) === null || _a === void 0 ? void 0 : _a.call(session, 'VariantFeatureWidget', 'variantFeature', {
|
|
82
|
+
featureData: (_b = totalFeatures.get(id)) === null || _b === void 0 ? void 0 : _b.toJSON(),
|
|
83
|
+
});
|
|
84
|
+
(_c = session.showWidget) === null || _c === void 0 ? void 0 : _c.call(session, featureWidget);
|
|
85
|
+
}, onMouseOver: () => {
|
|
86
|
+
setMouseoverElt(id);
|
|
87
|
+
}, onMouseOut: () => {
|
|
88
|
+
setMouseoverElt(undefined);
|
|
89
|
+
} }, JSON.stringify(path)));
|
|
90
|
+
}
|
|
115
91
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})));
|
|
92
|
+
return ret;
|
|
93
|
+
}) }));
|
|
119
94
|
});
|
|
120
95
|
exports.default = Breakends;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BreakpointViewModel } from '../model';
|
|
1
|
+
import type { BreakpointViewModel } from '../model';
|
|
3
2
|
declare const BreakpointSplitView: ({ model, }: {
|
|
4
3
|
model: BreakpointViewModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default BreakpointSplitView;
|
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const mobx_react_1 = require("mobx-react");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
7
|
const util_1 = require("@jbrowse/core/util");
|
|
8
|
+
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
const mui_1 = require("tss-react/mui");
|
|
10
10
|
const BreakpointSplitViewOverlay_1 = __importDefault(require("./BreakpointSplitViewOverlay"));
|
|
11
11
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
@@ -27,23 +27,19 @@ const BreakpointSplitViewLevels = (0, mobx_react_1.observer)(function ({ model,
|
|
|
27
27
|
const { classes } = useStyles();
|
|
28
28
|
const { views } = model;
|
|
29
29
|
const { pluginManager } = (0, util_1.getEnv)(model);
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}))));
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes.content, children: (0, jsx_runtime_1.jsx)("div", { className: classes.rel, children: views.map((view, idx) => {
|
|
31
|
+
const { ReactComponent } = pluginManager.getViewType(view.type);
|
|
32
|
+
const viewComponent = (0, jsx_runtime_1.jsx)(ReactComponent, { model: view }, view.id);
|
|
33
|
+
return idx === views.length - 1
|
|
34
|
+
? viewComponent
|
|
35
|
+
: [
|
|
36
|
+
viewComponent,
|
|
37
|
+
(0, jsx_runtime_1.jsx)("div", { className: classes.viewDivider }, `${view.id}-divider`),
|
|
38
|
+
];
|
|
39
|
+
}) }) }));
|
|
41
40
|
});
|
|
42
41
|
const BreakpointSplitView = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
43
42
|
const { classes } = useStyles();
|
|
44
|
-
return (
|
|
45
|
-
react_1.default.createElement("div", { className: classes.container },
|
|
46
|
-
react_1.default.createElement(BreakpointSplitViewLevels, { model: model }),
|
|
47
|
-
react_1.default.createElement(BreakpointSplitViewOverlay_1.default, { model: model }))));
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { className: classes.container, children: [(0, jsx_runtime_1.jsx)(BreakpointSplitViewLevels, { model: model }), (0, jsx_runtime_1.jsx)(BreakpointSplitViewOverlay_1.default, { model: model })] }) }));
|
|
48
44
|
});
|
|
49
45
|
exports.default = BreakpointSplitView;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BreakpointViewModel } from '../model';
|
|
1
|
+
import type { BreakpointViewModel } from '../model';
|
|
3
2
|
declare const BreakpointSplitViewOverlay: ({ model, }: {
|
|
4
3
|
model: BreakpointViewModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default BreakpointSplitViewOverlay;
|
|
@@ -1,35 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
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;
|
|
17
|
-
});
|
|
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const mobx_react_1 = require("mobx-react");
|
|
30
9
|
const mui_1 = require("tss-react/mui");
|
|
31
10
|
const Overlay_1 = __importDefault(require("./Overlay"));
|
|
32
|
-
const mobx_react_1 = require("mobx-react");
|
|
33
11
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
34
12
|
overlay: {
|
|
35
13
|
display: 'flex',
|
|
@@ -40,23 +18,16 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
40
18
|
fill: 'none',
|
|
41
19
|
},
|
|
42
20
|
},
|
|
21
|
+
base: {
|
|
22
|
+
pointerEvents: 'none',
|
|
23
|
+
width: '100%',
|
|
24
|
+
zIndex: 10,
|
|
25
|
+
},
|
|
43
26
|
});
|
|
44
27
|
const BreakpointSplitViewOverlay = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
45
28
|
const { classes } = useStyles();
|
|
46
|
-
const { matchedTracks
|
|
29
|
+
const { matchedTracks } = model;
|
|
47
30
|
const ref = (0, react_1.useRef)(null);
|
|
48
|
-
return (
|
|
49
|
-
react_1.default.createElement("svg", { ref: ref, style: {
|
|
50
|
-
width: '100%',
|
|
51
|
-
zIndex: 10,
|
|
52
|
-
pointerEvents: interactToggled ? undefined : 'none',
|
|
53
|
-
} }, matchedTracks.map(track => (
|
|
54
|
-
// note: we must pass ref down, because:
|
|
55
|
-
// - the child component needs to getBoundingClientRect on the this
|
|
56
|
-
// components SVG, and...
|
|
57
|
-
// - we cannot rely on using getBoundingClientRect in this component
|
|
58
|
-
// to make sure this works because if it gets shifted around by
|
|
59
|
-
// another element, this will not re-render necessarily
|
|
60
|
-
react_1.default.createElement(Overlay_1.default, { parentRef: ref, key: track.configuration.trackId, model: model, trackId: track.configuration.trackId }))))));
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes.overlay, children: (0, jsx_runtime_1.jsx)("svg", { ref: ref, className: classes.base, children: matchedTracks.map(track => ((0, jsx_runtime_1.jsx)(Overlay_1.default, { parentRef: ref, model: model, trackId: track.configuration.trackId }, track.configuration.trackId))) }) }));
|
|
61
32
|
});
|
|
62
33
|
exports.default = BreakpointSplitViewOverlay;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ExportSvgOptions } from '../model';
|
|
1
|
+
import type { ExportSvgOptions } from '../types';
|
|
3
2
|
export default function ExportSvgDialog({ model, handleClose, }: {
|
|
4
3
|
model: {
|
|
5
4
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
6
5
|
};
|
|
7
6
|
handleClose: () => void;
|
|
8
|
-
}):
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
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;
|
|
17
|
-
});
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.default = ExportSvgDialog;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
29
6
|
const ui_1 = require("@jbrowse/core/ui");
|
|
30
7
|
const util_1 = require("@jbrowse/core/util");
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
31
9
|
function LoadingMessage() {
|
|
32
|
-
return (
|
|
33
|
-
react_1.default.createElement(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }),
|
|
34
|
-
react_1.default.createElement(material_1.Typography, { display: "inline" }, "Creating SVG")));
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { display: "inline", children: "Creating SVG" })] }));
|
|
35
11
|
}
|
|
36
12
|
function TextField2({ children, ...rest }) {
|
|
37
|
-
return (
|
|
38
|
-
react_1.default.createElement(material_1.TextField, { ...rest }, children)));
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { ...rest, children: children }) }));
|
|
39
14
|
}
|
|
40
15
|
function useSvgLocal(key, val) {
|
|
41
16
|
return (0, util_1.useLocalStorage)(`svg-${key}`, val);
|
|
@@ -49,50 +24,34 @@ function ExportSvgDialog({ model, handleClose, }) {
|
|
|
49
24
|
const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
|
|
50
25
|
const [trackLabels, setTrackLabels] = useSvgLocal('tracklabels', 'offset');
|
|
51
26
|
const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
|
|
52
|
-
return (
|
|
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
|
-
await model.exportSvg({
|
|
83
|
-
rasterizeLayers,
|
|
84
|
-
filename,
|
|
85
|
-
trackLabels,
|
|
86
|
-
themeName,
|
|
87
|
-
});
|
|
88
|
-
handleClose();
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
console.error(e);
|
|
92
|
-
setError(e);
|
|
93
|
-
}
|
|
94
|
-
finally {
|
|
95
|
-
setLoading(false);
|
|
96
|
-
}
|
|
97
|
-
} }, "Submit"))));
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : loading ? ((0, jsx_runtime_1.jsx)(LoadingMessage, {})) : null, (0, jsx_runtime_1.jsx)(TextField2, { helperText: "filename", value: filename, onChange: event => {
|
|
28
|
+
setFilename(event.target.value);
|
|
29
|
+
} }), (0, jsx_runtime_1.jsxs)(TextField2, { select: true, label: "Track label positioning", variant: "outlined", style: { width: 150 }, value: trackLabels, onChange: event => {
|
|
30
|
+
setTrackLabels(event.target.value);
|
|
31
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "offset", children: "Offset" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "overlay", children: "Overlay" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "left", children: "Left" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "none", children: "None" })] }), (0, jsx_runtime_1.jsx)("br", {}), session.allThemes ? ((0, jsx_runtime_1.jsx)(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
|
|
32
|
+
setThemeName(event.target.value);
|
|
33
|
+
}, children: Object.entries(session.allThemes()).map(([key, val]) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, offscreenCanvas ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: rasterizeLayers, onChange: () => {
|
|
34
|
+
setRasterizeLayers(val => !val);
|
|
35
|
+
} }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
36
|
+
handleClose();
|
|
37
|
+
}, children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
|
|
38
|
+
setLoading(true);
|
|
39
|
+
setError(undefined);
|
|
40
|
+
try {
|
|
41
|
+
await model.exportSvg({
|
|
42
|
+
rasterizeLayers,
|
|
43
|
+
filename,
|
|
44
|
+
trackLabels,
|
|
45
|
+
themeName,
|
|
46
|
+
});
|
|
47
|
+
handleClose();
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
console.error(e);
|
|
51
|
+
setError(e);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
setLoading(false);
|
|
55
|
+
}
|
|
56
|
+
}, children: "Submit" })] })] }));
|
|
98
57
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BreakpointViewModel } from '../model';
|
|
1
|
+
import type { BreakpointViewModel } from '../model';
|
|
3
2
|
declare const Overlay: (props: {
|
|
4
|
-
parentRef: React.RefObject<SVGSVGElement>;
|
|
3
|
+
parentRef: React.RefObject<SVGSVGElement | null>;
|
|
5
4
|
model: BreakpointViewModel;
|
|
6
5
|
trackId: string;
|
|
7
6
|
getTrackYPosOverride?: (trackId: string, level: number) => number;
|
|
8
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
8
|
export default Overlay;
|
|
@@ -3,23 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const mobx_react_1 = require("mobx-react");
|
|
8
8
|
const AlignmentConnections_1 = __importDefault(require("./AlignmentConnections"));
|
|
9
9
|
const Breakends_1 = __importDefault(require("./Breakends"));
|
|
10
|
-
const Translocations_1 = __importDefault(require("./Translocations"));
|
|
11
10
|
const PairedFeatures_1 = __importDefault(require("./PairedFeatures"));
|
|
11
|
+
const Translocations_1 = __importDefault(require("./Translocations"));
|
|
12
12
|
const Overlay = (0, mobx_react_1.observer)(function (props) {
|
|
13
|
-
var _a
|
|
13
|
+
var _a;
|
|
14
14
|
const { model, trackId } = props;
|
|
15
15
|
const tracks = model.getMatchedTracks(trackId);
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
return
|
|
16
|
+
const type = (_a = tracks[0]) === null || _a === void 0 ? void 0 : _a.type;
|
|
17
|
+
if (type === 'AlignmentsTrack') {
|
|
18
|
+
return (0, jsx_runtime_1.jsx)(AlignmentConnections_1.default, { ...props });
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return model.hasTranslocations(trackId) ? (react_1.default.createElement(Translocations_1.default, { ...props })) : model.hasPairedFeatures(trackId) ? (react_1.default.createElement(PairedFeatures_1.default, { ...props })) : (react_1.default.createElement(Breakends_1.default, { ...props }));
|
|
20
|
+
else if (type === 'VariantTrack') {
|
|
21
|
+
return model.hasTranslocations(trackId) ? ((0, jsx_runtime_1.jsx)(Translocations_1.default, { ...props })) : model.hasPairedFeatures(trackId) ? ((0, jsx_runtime_1.jsx)(PairedFeatures_1.default, { ...props })) : ((0, jsx_runtime_1.jsx)(Breakends_1.default, { ...props }));
|
|
23
22
|
}
|
|
24
23
|
else {
|
|
25
24
|
return null;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BreakpointViewModel } from '../model';
|
|
1
|
+
import type { BreakpointViewModel } from '../model';
|
|
3
2
|
declare const PairedFeatures: ({ model, trackId, parentRef: ref, getTrackYPosOverride, }: {
|
|
4
3
|
model: BreakpointViewModel;
|
|
5
4
|
trackId: string;
|
|
6
|
-
parentRef: React.RefObject<SVGSVGElement>;
|
|
5
|
+
parentRef: React.RefObject<SVGSVGElement | null>;
|
|
7
6
|
getTrackYPosOverride?: (trackId: string, level: number) => number;
|
|
8
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
8
|
export default PairedFeatures;
|