@jbrowse/plugin-breakpoint-split-view 2.18.0 → 3.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/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +1 -2
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +2 -9
- package/dist/BreakpointAlignmentsFeatureDetail/index.js +17 -7
- package/dist/BreakpointSplitView/components/AlignmentConnections.d.ts +2 -3
- package/dist/BreakpointSplitView/components/AlignmentConnections.js +91 -113
- package/dist/BreakpointSplitView/components/Breakends.d.ts +2 -3
- package/dist/BreakpointSplitView/components/Breakends.js +67 -89
- package/dist/BreakpointSplitView/components/BreakpointSplitView.d.ts +1 -2
- package/dist/BreakpointSplitView/components/BreakpointSplitView.js +12 -16
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +1 -2
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +9 -31
- package/dist/BreakpointSplitView/components/ExportSvgDialog.d.ts +2 -3
- package/dist/BreakpointSplitView/components/ExportSvgDialog.js +34 -73
- package/dist/BreakpointSplitView/components/Overlay.d.ts +2 -3
- package/dist/BreakpointSplitView/components/Overlay.js +7 -6
- package/dist/BreakpointSplitView/components/PairedFeatures.d.ts +2 -3
- package/dist/BreakpointSplitView/components/PairedFeatures.js +47 -69
- package/dist/BreakpointSplitView/components/Translocations.d.ts +2 -3
- package/dist/BreakpointSplitView/components/Translocations.js +57 -79
- package/dist/BreakpointSplitView/index.js +17 -7
- package/dist/BreakpointSplitView/model.d.ts +19 -46
- package/dist/BreakpointSplitView/model.js +46 -64
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js +2 -5
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -1
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +2 -23
- package/dist/BreakpointSplitView/types.d.ts +22 -0
- package/dist/BreakpointSplitView/types.js +2 -0
- package/dist/BreakpointSplitView/util.d.ts +11 -1
- package/dist/BreakpointSplitView/util.js +34 -0
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +1 -2
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +2 -6
- package/esm/BreakpointSplitView/components/AlignmentConnections.d.ts +2 -3
- package/esm/BreakpointSplitView/components/AlignmentConnections.js +91 -90
- package/esm/BreakpointSplitView/components/Breakends.d.ts +2 -3
- package/esm/BreakpointSplitView/components/Breakends.js +67 -66
- package/esm/BreakpointSplitView/components/BreakpointSplitView.d.ts +1 -2
- package/esm/BreakpointSplitView/components/BreakpointSplitView.js +12 -16
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +1 -2
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +9 -8
- package/esm/BreakpointSplitView/components/ExportSvgDialog.d.ts +2 -3
- package/esm/BreakpointSplitView/components/ExportSvgDialog.js +34 -50
- package/esm/BreakpointSplitView/components/Overlay.d.ts +2 -3
- package/esm/BreakpointSplitView/components/Overlay.js +7 -6
- package/esm/BreakpointSplitView/components/PairedFeatures.d.ts +2 -3
- package/esm/BreakpointSplitView/components/PairedFeatures.js +47 -46
- package/esm/BreakpointSplitView/components/Translocations.d.ts +2 -3
- package/esm/BreakpointSplitView/components/Translocations.js +57 -56
- package/esm/BreakpointSplitView/model.d.ts +19 -46
- package/esm/BreakpointSplitView/model.js +26 -53
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.js +2 -2
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -1
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +2 -23
- package/esm/BreakpointSplitView/types.d.ts +22 -0
- package/esm/BreakpointSplitView/types.js +1 -0
- package/esm/BreakpointSplitView/util.d.ts +11 -1
- package/esm/BreakpointSplitView/util.js +32 -1
- package/package.json +10 -10
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
3
2
|
declare const BreakpointAlignmentsFeatureDetail: ({ model, }: {
|
|
4
3
|
model: {
|
|
@@ -7,5 +6,5 @@ declare const BreakpointAlignmentsFeatureDetail: ({ model, }: {
|
|
|
7
6
|
feature2: SimpleFeatureSerialized;
|
|
8
7
|
};
|
|
9
8
|
};
|
|
10
|
-
}) =>
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export default BreakpointAlignmentsFeatureDetail;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
4
|
const BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
|
|
8
5
|
const material_1 = require("@mui/material");
|
|
9
6
|
const mobx_react_1 = require("mobx-react");
|
|
10
7
|
const BreakpointAlignmentsFeatureDetail = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
11
8
|
const { featureData } = model;
|
|
12
9
|
const { feature1, feature2 } = structuredClone(featureData);
|
|
13
|
-
return (
|
|
14
|
-
react_1.default.createElement(BaseFeatureDetail_1.BaseCoreDetails, { title: "Feature 1", feature: feature1 }),
|
|
15
|
-
react_1.default.createElement(BaseFeatureDetail_1.BaseCoreDetails, { title: "Feature 2", feature: feature2 }),
|
|
16
|
-
react_1.default.createElement(BaseFeatureDetail_1.BaseAttributes, { title: "Feature 1 attributes", feature: feature1 }),
|
|
17
|
-
react_1.default.createElement(BaseFeatureDetail_1.BaseAttributes, { title: "Feature 2 attributes", feature: feature2 })));
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { children: [(0, jsx_runtime_1.jsx)(BaseFeatureDetail_1.BaseCoreDetails, { title: "Feature 1", feature: feature1 }), (0, jsx_runtime_1.jsx)(BaseFeatureDetail_1.BaseCoreDetails, { title: "Feature 2", feature: feature2 }), (0, jsx_runtime_1.jsx)(BaseFeatureDetail_1.BaseAttributes, { title: "Feature 1 attributes", feature: feature1 }), (0, jsx_runtime_1.jsx)(BaseFeatureDetail_1.BaseAttributes, { title: "Feature 2 attributes", feature: feature2 })] }));
|
|
18
11
|
});
|
|
19
12
|
exports.default = BreakpointAlignmentsFeatureDetail;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.default = BreakpointAlignmentsFeatureDetailF;
|
|
27
37
|
const react_1 = require("react");
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { BreakpointViewModel } from '../model';
|
|
3
2
|
declare const AlignmentConnections: ({ model, trackId, parentRef, 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 AlignmentConnections;
|
|
@@ -1,29 +1,7 @@
|
|
|
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 material_1 = require("@mui/material");
|
|
29
7
|
const mobx_react_1 = require("mobx-react");
|
|
@@ -33,7 +11,7 @@ const util_3 = require("../util");
|
|
|
33
11
|
const getOrientationColor_1 = require("./getOrientationColor");
|
|
34
12
|
const [LEFT, , RIGHT] = [0, 1, 2, 3];
|
|
35
13
|
const AlignmentConnections = (0, mobx_react_1.observer)(function ({ model, trackId, parentRef, getTrackYPosOverride, }) {
|
|
36
|
-
const { views, showIntraviewLinks } = model;
|
|
14
|
+
const { interactiveOverlay, views, showIntraviewLinks } = model;
|
|
37
15
|
const theme = (0, material_1.useTheme)();
|
|
38
16
|
const session = (0, util_1.getSession)(model);
|
|
39
17
|
const snap = (0, mobx_state_tree_1.getSnapshot)(model);
|
|
@@ -60,96 +38,96 @@ const AlignmentConnections = (0, mobx_react_1.observer)(function ({ model, track
|
|
|
60
38
|
const rect = parentRef.current.getBoundingClientRect();
|
|
61
39
|
yOffset = rect.top;
|
|
62
40
|
}
|
|
63
|
-
return assembly ? (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
const f1ref = assembly.getCanonicalRefName(f1.get('refName'));
|
|
76
|
-
const f2ref = assembly.getCanonicalRefName(f2.get('refName'));
|
|
77
|
-
if (!f1ref || !f2ref) {
|
|
78
|
-
throw new Error(`unable to find ref for ${f1ref || f2ref}`);
|
|
79
|
-
}
|
|
80
|
-
const r = {
|
|
81
|
-
pair_orientation: f1.get('pair_orientation'),
|
|
82
|
-
};
|
|
83
|
-
const s1 = f1.get('strand');
|
|
84
|
-
const s2 = f2.get('strand');
|
|
85
|
-
const sameRef = f1ref === f2ref;
|
|
86
|
-
const checkOrientation = sameRef;
|
|
87
|
-
let orientationColor = '';
|
|
88
|
-
let isAbnormal = false;
|
|
89
|
-
if (checkOrientation) {
|
|
90
|
-
if (hasPaired) {
|
|
91
|
-
orientationColor = (0, getOrientationColor_1.getPairedOrientationColor)(r);
|
|
92
|
-
isAbnormal = (0, getOrientationColor_1.isAbnormalOrientation)(r);
|
|
41
|
+
return assembly ? ((0, jsx_runtime_1.jsx)("g", { fill: "none", "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId, children: layoutMatches.map(chunk => {
|
|
42
|
+
const ret = [];
|
|
43
|
+
for (let i = 0; i < chunk.length - 1; i++) {
|
|
44
|
+
const { layout: c1, feature: f1, level: level1 } = chunk[i];
|
|
45
|
+
const { layout: c2, feature: f2, level: level2 } = chunk[i + 1];
|
|
46
|
+
if (!c1 || !c2) {
|
|
47
|
+
console.warn('received null layout for a overlay feature');
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
if (!showIntraviewLinks && level1 === level2) {
|
|
51
|
+
return null;
|
|
93
52
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
53
|
+
const f1ref = assembly.getCanonicalRefName(f1.get('refName'));
|
|
54
|
+
const f2ref = assembly.getCanonicalRefName(f2.get('refName'));
|
|
55
|
+
if (!f1ref || !f2ref) {
|
|
56
|
+
throw new Error(`unable to find ref for ${f1ref || f2ref}`);
|
|
97
57
|
}
|
|
58
|
+
const r = {
|
|
59
|
+
pair_orientation: f1.get('pair_orientation'),
|
|
60
|
+
};
|
|
61
|
+
const s1 = f1.get('strand');
|
|
62
|
+
const s2 = f2.get('strand');
|
|
63
|
+
const sameRef = f1ref === f2ref;
|
|
64
|
+
const checkOrientation = sameRef;
|
|
65
|
+
let orientationColor = '';
|
|
66
|
+
let isAbnormal = false;
|
|
67
|
+
if (checkOrientation) {
|
|
68
|
+
if (hasPaired) {
|
|
69
|
+
orientationColor = (0, getOrientationColor_1.getPairedOrientationColor)(r);
|
|
70
|
+
isAbnormal = (0, getOrientationColor_1.isAbnormalOrientation)(r);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
orientationColor = (0, getOrientationColor_1.getLongReadOrientationColorOrDefault)(s1, s2);
|
|
74
|
+
isAbnormal = (0, getOrientationColor_1.getLongReadOrientationAbnormal)(s1, s2);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const p1 = c1[s1 === -1 ? LEFT : RIGHT];
|
|
78
|
+
const sn1 = s2 === -1;
|
|
79
|
+
const p2 = hasPaired ? c2[sn1 ? LEFT : RIGHT] : c2[sn1 ? RIGHT : LEFT];
|
|
80
|
+
const x1 = (0, util_3.getPxFromCoordinate)(views[level1], f1ref, p1);
|
|
81
|
+
const x2 = (0, util_3.getPxFromCoordinate)(views[level2], f2ref, p2);
|
|
82
|
+
const reversed1 = views[level1].pxToBp(x1).reversed;
|
|
83
|
+
const reversed2 = views[level2].pxToBp(x2).reversed;
|
|
84
|
+
const rf1 = reversed1 ? -1 : 1;
|
|
85
|
+
const rf2 = reversed2 ? -1 : 1;
|
|
86
|
+
const tracks = views.map(v => v.getTrack(trackId));
|
|
87
|
+
const y1 = (0, util_3.yPos)(trackId, level1, views, tracks, c1, getTrackYPosOverride) -
|
|
88
|
+
yOffset;
|
|
89
|
+
const y2 = (0, util_3.yPos)(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
|
|
90
|
+
yOffset;
|
|
91
|
+
const sameLevel = level1 === level2;
|
|
92
|
+
const abnormalSpecialRenderFlag = sameLevel && isAbnormal;
|
|
93
|
+
const trackHeight = abnormalSpecialRenderFlag
|
|
94
|
+
? tracks[level1].displays[0].height
|
|
95
|
+
: 0;
|
|
96
|
+
const pf1 = hasPaired ? -1 : 1;
|
|
97
|
+
const y0 = (0, util_3.heightFromSpecificLevel)(views, trackId, level1, getTrackYPosOverride);
|
|
98
|
+
const path = [
|
|
99
|
+
'M',
|
|
100
|
+
x1,
|
|
101
|
+
y1,
|
|
102
|
+
'C',
|
|
103
|
+
x1 + 200 * f1.get('strand') * rf1,
|
|
104
|
+
abnormalSpecialRenderFlag
|
|
105
|
+
? Math.min(y0 - yOffset + trackHeight, y1 + trackHeight)
|
|
106
|
+
: y1,
|
|
107
|
+
x2 - 200 * f2.get('strand') * rf2 * pf1,
|
|
108
|
+
abnormalSpecialRenderFlag
|
|
109
|
+
? Math.min(y0 - yOffset + trackHeight, y2 + trackHeight)
|
|
110
|
+
: y2,
|
|
111
|
+
x2,
|
|
112
|
+
y2,
|
|
113
|
+
].join(' ');
|
|
114
|
+
const id = `${f1.id()}-${f2.id()}`;
|
|
115
|
+
ret.push((0, jsx_runtime_1.jsx)("path", { d: path, "data-testid": "r1", pointerEvents: interactiveOverlay ? 'auto' : undefined, strokeWidth: mouseoverElt === id ? 5 : 1, ...(0, util_1.getStrokeProps)(orientationColor || theme.palette.text.disabled), onClick: () => {
|
|
116
|
+
var _a, _b;
|
|
117
|
+
const featureWidget = (_a = session.addWidget) === null || _a === void 0 ? void 0 : _a.call(session, 'BreakpointAlignmentsWidget', 'breakpointAlignments', {
|
|
118
|
+
featureData: {
|
|
119
|
+
feature1: (allFeatures.get(f1.id()) || { toJSON: () => { } }).toJSON(),
|
|
120
|
+
feature2: (allFeatures.get(f2.id()) || { toJSON: () => { } }).toJSON(),
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
(_b = session.showWidget) === null || _b === void 0 ? void 0 : _b.call(session, featureWidget);
|
|
124
|
+
}, onMouseOver: () => {
|
|
125
|
+
setMouseoverElt(id);
|
|
126
|
+
}, onMouseOut: () => {
|
|
127
|
+
setMouseoverElt(undefined);
|
|
128
|
+
} }, id));
|
|
98
129
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const p2 = hasPaired ? c2[sn1 ? LEFT : RIGHT] : c2[sn1 ? RIGHT : LEFT];
|
|
102
|
-
const x1 = (0, util_3.getPxFromCoordinate)(views[level1], f1ref, p1);
|
|
103
|
-
const x2 = (0, util_3.getPxFromCoordinate)(views[level2], f2ref, p2);
|
|
104
|
-
const reversed1 = views[level1].pxToBp(x1).reversed;
|
|
105
|
-
const reversed2 = views[level2].pxToBp(x2).reversed;
|
|
106
|
-
const rf1 = reversed1 ? -1 : 1;
|
|
107
|
-
const rf2 = reversed2 ? -1 : 1;
|
|
108
|
-
const tracks = views.map(v => v.getTrack(trackId));
|
|
109
|
-
const y1 = (0, util_3.yPos)(trackId, level1, views, tracks, c1, getTrackYPosOverride) -
|
|
110
|
-
yOffset;
|
|
111
|
-
const y2 = (0, util_3.yPos)(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
|
|
112
|
-
yOffset;
|
|
113
|
-
const sameLevel = level1 === level2;
|
|
114
|
-
const abnormalSpecialRenderFlag = sameLevel && isAbnormal;
|
|
115
|
-
const trackHeight = abnormalSpecialRenderFlag
|
|
116
|
-
? tracks[level1].displays[0].height
|
|
117
|
-
: 0;
|
|
118
|
-
const pf1 = hasPaired ? -1 : 1;
|
|
119
|
-
const y0 = (0, util_3.heightFromSpecificLevel)(views, trackId, level1, getTrackYPosOverride);
|
|
120
|
-
const path = [
|
|
121
|
-
'M',
|
|
122
|
-
x1,
|
|
123
|
-
y1,
|
|
124
|
-
'C',
|
|
125
|
-
x1 + 200 * f1.get('strand') * rf1,
|
|
126
|
-
abnormalSpecialRenderFlag
|
|
127
|
-
? Math.min(y0 - yOffset + trackHeight, y1 + trackHeight)
|
|
128
|
-
: y1,
|
|
129
|
-
x2 - 200 * f2.get('strand') * rf2 * pf1,
|
|
130
|
-
abnormalSpecialRenderFlag
|
|
131
|
-
? Math.min(y0 - yOffset + trackHeight, y2 + trackHeight)
|
|
132
|
-
: y2,
|
|
133
|
-
x2,
|
|
134
|
-
y2,
|
|
135
|
-
].join(' ');
|
|
136
|
-
const id = `${f1.id()}-${f2.id()}`;
|
|
137
|
-
ret.push(react_1.default.createElement("path", { d: path, key: id, "data-testid": "r1", strokeWidth: mouseoverElt === id ? 5 : 1, ...(0, util_1.getStrokeProps)(orientationColor || theme.palette.text.disabled), onClick: () => {
|
|
138
|
-
var _a, _b;
|
|
139
|
-
const featureWidget = (_a = session.addWidget) === null || _a === void 0 ? void 0 : _a.call(session, 'BreakpointAlignmentsWidget', 'breakpointAlignments', {
|
|
140
|
-
featureData: {
|
|
141
|
-
feature1: (allFeatures.get(f1.id()) || { toJSON: () => { } }).toJSON(),
|
|
142
|
-
feature2: (allFeatures.get(f2.id()) || { toJSON: () => { } }).toJSON(),
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
(_b = session.showWidget) === null || _b === void 0 ? void 0 : _b.call(session, featureWidget);
|
|
146
|
-
}, onMouseOver: () => {
|
|
147
|
-
setMouseoverElt(id);
|
|
148
|
-
}, onMouseOut: () => {
|
|
149
|
-
setMouseoverElt(undefined);
|
|
150
|
-
} }));
|
|
151
|
-
}
|
|
152
|
-
return ret;
|
|
153
|
-
}))) : null;
|
|
130
|
+
return ret;
|
|
131
|
+
}) })) : null;
|
|
154
132
|
});
|
|
155
133
|
exports.default = AlignmentConnections;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { BreakpointViewModel } from '../model';
|
|
3
2
|
declare const Breakends: ({ 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 Breakends;
|
|
@@ -1,29 +1,7 @@
|
|
|
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");
|
|
@@ -31,7 +9,7 @@ const util_2 = require("./util");
|
|
|
31
9
|
const util_3 = require("../util");
|
|
32
10
|
const [LEFT] = [0, 1, 2, 3];
|
|
33
11
|
const Breakends = (0, mobx_react_1.observer)(function ({ model, trackId, parentRef: ref, getTrackYPosOverride, }) {
|
|
34
|
-
const { views } = model;
|
|
12
|
+
const { interactiveOverlay, views } = model;
|
|
35
13
|
const session = (0, util_1.getSession)(model);
|
|
36
14
|
const { assemblyManager } = session;
|
|
37
15
|
const totalFeatures = model.getTrackFeatures(trackId);
|
|
@@ -48,70 +26,70 @@ const Breakends = (0, mobx_react_1.observer)(function ({ model, trackId, parentR
|
|
|
48
26
|
const rect = ref.current.getBoundingClientRect();
|
|
49
27
|
yoff = rect.top;
|
|
50
28
|
}
|
|
51
|
-
return (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
112
91
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
})));
|
|
92
|
+
return ret;
|
|
93
|
+
}) }));
|
|
116
94
|
});
|
|
117
95
|
exports.default = Breakends;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
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,7 +3,7 @@ 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 util_1 = require("@jbrowse/core/util");
|
|
8
8
|
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
const mui_1 = require("tss-react/mui");
|
|
@@ -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 React from 'react';
|
|
2
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,32 +1,10 @@
|
|
|
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");
|
|
30
8
|
const mobx_react_1 = require("mobx-react");
|
|
31
9
|
const mui_1 = require("tss-react/mui");
|
|
32
10
|
const Overlay_1 = __importDefault(require("./Overlay"));
|
|
@@ -40,16 +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 => (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))) }) }));
|
|
54
32
|
});
|
|
55
33
|
exports.default = BreakpointSplitViewOverlay;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { 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;
|