@jbrowse/plugin-arc 2.10.3 → 2.11.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/ArcRenderer/ArcRendering.js +3 -5
- package/dist/ArcTooltip.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/components/Arcs.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/components/Arcs.js +1 -1
- package/dist/LinearPairedArcDisplay/components/ReactComponent.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/components/util.js +1 -2
- package/esm/ArcRenderer/ArcRendering.js +3 -5
- package/esm/ArcTooltip.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/Arcs.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/Arcs.js +1 -1
- package/esm/LinearPairedArcDisplay/components/ReactComponent.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/components/util.js +1 -2
- package/package.json +2 -2
|
@@ -48,10 +48,8 @@ function Arc({ selectedFeatureId, region, bpPerPx, config, onFeatureClick, featu
|
|
|
48
48
|
const ref = react_1.default.createRef();
|
|
49
49
|
const t = 0.5;
|
|
50
50
|
// formula: https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B%C3%A9zier_curves
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
3 * (1 - t) * (t * t) * height +
|
|
54
|
-
t * t * t * 0;
|
|
51
|
+
const t1 = 1 - t;
|
|
52
|
+
const textYCoord = 3 * (t1 * t1) * (t * height) + 3 * t1 * (t * t) * height;
|
|
55
53
|
return (react_1.default.createElement("g", null,
|
|
56
54
|
react_1.default.createElement("path", { d: `M ${left} 0 C ${left} ${height}, ${right} ${height}, ${right} 0`, stroke: stroke, strokeWidth: strokeWidth, fill: "transparent", onClick: e => onFeatureClick === null || onFeatureClick === void 0 ? void 0 : onFeatureClick(e, featureId), onMouseOver: () => setIsMouseOvered(true), onMouseLeave: () => setIsMouseOvered(false), ref: ref, pointerEvents: "stroke" }),
|
|
57
55
|
isMouseOvered ? react_1.default.createElement(ArcTooltip_1.default, { contents: caption }) : null,
|
|
@@ -110,6 +108,6 @@ const ArcRendering = (0, mobx_react_1.observer)(function ({ features, config, re
|
|
|
110
108
|
return (react_1.default.createElement(Wrapper, { exportSVG: exportSVG, width: width, height: height }, [...features.values()].map(f => semicircles ? (react_1.default.createElement(SemiCircles, { key: f.id(), config: config, region: region, bpPerPx: bpPerPx, selectedFeatureId: selectedFeatureId, feature: f })) : (react_1.default.createElement(Arc, { key: f.id(), config: config, region: region, bpPerPx: bpPerPx, selectedFeatureId: selectedFeatureId, feature: f })))));
|
|
111
109
|
});
|
|
112
110
|
function Wrapper({ exportSVG, width, height, children, }) {
|
|
113
|
-
return exportSVG ? (
|
|
111
|
+
return exportSVG ? (children) : (react_1.default.createElement("svg", { width: width, height: height }, children));
|
|
114
112
|
}
|
|
115
113
|
exports.default = ArcRendering;
|
package/dist/ArcTooltip.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { LinearArcDisplayModel } from '../model';
|
|
3
3
|
declare const Arcs: ({ model, exportSVG, }: {
|
|
4
4
|
model: LinearArcDisplayModel;
|
|
5
|
-
exportSVG?: boolean
|
|
5
|
+
exportSVG?: boolean;
|
|
6
6
|
}) => React.JSX.Element | null;
|
|
7
7
|
export default Arcs;
|
|
@@ -67,7 +67,7 @@ const Wrapper = (0, mobx_react_1.observer)(function ({ model, exportSVG, childre
|
|
|
67
67
|
const { height } = model;
|
|
68
68
|
const view = (0, util_1.getContainingView)(model);
|
|
69
69
|
const width = Math.round(view.dynamicBlocks.totalWidthPx);
|
|
70
|
-
return exportSVG ? (
|
|
70
|
+
return exportSVG ? (children) : (react_1.default.createElement("svg", { width: width, height: height }, children));
|
|
71
71
|
});
|
|
72
72
|
const Arcs = (0, mobx_react_1.observer)(function ({ model, exportSVG, }) {
|
|
73
73
|
const view = (0, util_1.getContainingView)(model);
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { LinearArcDisplayModel } from '../model';
|
|
3
3
|
declare const LinearArcReactComponent: ({ model, exportSVG, }: {
|
|
4
4
|
model: LinearArcDisplayModel;
|
|
5
|
-
exportSVG?: boolean
|
|
5
|
+
exportSVG?: boolean;
|
|
6
6
|
}) => React.JSX.Element;
|
|
7
7
|
export default LinearArcReactComponent;
|
|
@@ -6,7 +6,7 @@ const util_1 = require("@jbrowse/core/util");
|
|
|
6
6
|
function makeFeaturePair(feature, alt) {
|
|
7
7
|
var _a, _b, _c, _d;
|
|
8
8
|
const bnd = alt ? (0, vcf_1.parseBreakend)(alt) : undefined;
|
|
9
|
-
|
|
9
|
+
const start = feature.get('start');
|
|
10
10
|
let end = feature.get('end');
|
|
11
11
|
const strand = feature.get('strand');
|
|
12
12
|
const mate = feature.get('mate');
|
|
@@ -29,7 +29,6 @@ function makeFeaturePair(feature, alt) {
|
|
|
29
29
|
mateStart = e - 1;
|
|
30
30
|
// re-adjust the arc to be from start to end of feature by re-assigning end
|
|
31
31
|
// to the 'mate'
|
|
32
|
-
start = start;
|
|
33
32
|
end = start + 1;
|
|
34
33
|
}
|
|
35
34
|
else if (bnd === null || bnd === void 0 ? void 0 : bnd.MatePosition) {
|
|
@@ -20,10 +20,8 @@ function Arc({ selectedFeatureId, region, bpPerPx, config, onFeatureClick, featu
|
|
|
20
20
|
const ref = React.createRef();
|
|
21
21
|
const t = 0.5;
|
|
22
22
|
// formula: https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B%C3%A9zier_curves
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
3 * (1 - t) * (t * t) * height +
|
|
26
|
-
t * t * t * 0;
|
|
23
|
+
const t1 = 1 - t;
|
|
24
|
+
const textYCoord = 3 * (t1 * t1) * (t * height) + 3 * t1 * (t * t) * height;
|
|
27
25
|
return (React.createElement("g", null,
|
|
28
26
|
React.createElement("path", { d: `M ${left} 0 C ${left} ${height}, ${right} ${height}, ${right} 0`, stroke: stroke, strokeWidth: strokeWidth, fill: "transparent", onClick: e => onFeatureClick === null || onFeatureClick === void 0 ? void 0 : onFeatureClick(e, featureId), onMouseOver: () => setIsMouseOvered(true), onMouseLeave: () => setIsMouseOvered(false), ref: ref, pointerEvents: "stroke" }),
|
|
29
27
|
isMouseOvered ? React.createElement(ArcTooltip, { contents: caption }) : null,
|
|
@@ -82,6 +80,6 @@ const ArcRendering = observer(function ({ features, config, regions, bpPerPx, he
|
|
|
82
80
|
return (React.createElement(Wrapper, { exportSVG: exportSVG, width: width, height: height }, [...features.values()].map(f => semicircles ? (React.createElement(SemiCircles, { key: f.id(), config: config, region: region, bpPerPx: bpPerPx, selectedFeatureId: selectedFeatureId, feature: f })) : (React.createElement(Arc, { key: f.id(), config: config, region: region, bpPerPx: bpPerPx, selectedFeatureId: selectedFeatureId, feature: f })))));
|
|
83
81
|
});
|
|
84
82
|
function Wrapper({ exportSVG, width, height, children, }) {
|
|
85
|
-
return exportSVG ? (
|
|
83
|
+
return exportSVG ? (children) : (React.createElement("svg", { width: width, height: height }, children));
|
|
86
84
|
}
|
|
87
85
|
export default ArcRendering;
|
package/esm/ArcTooltip.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { LinearArcDisplayModel } from '../model';
|
|
3
3
|
declare const Arcs: ({ model, exportSVG, }: {
|
|
4
4
|
model: LinearArcDisplayModel;
|
|
5
|
-
exportSVG?: boolean
|
|
5
|
+
exportSVG?: boolean;
|
|
6
6
|
}) => React.JSX.Element | null;
|
|
7
7
|
export default Arcs;
|
|
@@ -39,7 +39,7 @@ const Wrapper = observer(function ({ model, exportSVG, children, }) {
|
|
|
39
39
|
const { height } = model;
|
|
40
40
|
const view = getContainingView(model);
|
|
41
41
|
const width = Math.round(view.dynamicBlocks.totalWidthPx);
|
|
42
|
-
return exportSVG ? (
|
|
42
|
+
return exportSVG ? (children) : (React.createElement("svg", { width: width, height: height }, children));
|
|
43
43
|
});
|
|
44
44
|
const Arcs = observer(function ({ model, exportSVG, }) {
|
|
45
45
|
const view = getContainingView(model);
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { LinearArcDisplayModel } from '../model';
|
|
3
3
|
declare const LinearArcReactComponent: ({ model, exportSVG, }: {
|
|
4
4
|
model: LinearArcDisplayModel;
|
|
5
|
-
exportSVG?: boolean
|
|
5
|
+
exportSVG?: boolean;
|
|
6
6
|
}) => React.JSX.Element;
|
|
7
7
|
export default LinearArcReactComponent;
|
|
@@ -3,7 +3,7 @@ import { assembleLocString } from '@jbrowse/core/util';
|
|
|
3
3
|
export function makeFeaturePair(feature, alt) {
|
|
4
4
|
var _a, _b, _c, _d;
|
|
5
5
|
const bnd = alt ? parseBreakend(alt) : undefined;
|
|
6
|
-
|
|
6
|
+
const start = feature.get('start');
|
|
7
7
|
let end = feature.get('end');
|
|
8
8
|
const strand = feature.get('strand');
|
|
9
9
|
const mate = feature.get('mate');
|
|
@@ -26,7 +26,6 @@ export function makeFeaturePair(feature, alt) {
|
|
|
26
26
|
mateStart = e - 1;
|
|
27
27
|
// re-adjust the arc to be from start to end of feature by re-assigning end
|
|
28
28
|
// to the 'mate'
|
|
29
|
-
start = start;
|
|
30
29
|
end = start + 1;
|
|
31
30
|
}
|
|
32
31
|
else if (bnd === null || bnd === void 0 ? void 0 : bnd.MatePosition) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-arc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "JBrowse 2 arc adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "3d43a820b9274a6160aa4dc15616147f390d9094"
|
|
57
57
|
}
|