@jbrowse/plugin-arc 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/ArcRenderer/ArcRendering.d.ts +1 -2
- package/dist/ArcRenderer/ArcRendering.js +37 -35
- package/dist/ArcTooltip.d.ts +1 -2
- package/dist/ArcTooltip.js +5 -29
- package/dist/LinearArcDisplay/model.d.ts +6 -6
- package/dist/LinearPairedArcDisplay/components/Arcs.d.ts +1 -2
- package/dist/LinearPairedArcDisplay/components/Arcs.js +44 -38
- package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +1 -2
- package/dist/LinearPairedArcDisplay/components/BaseDisplayComponent.js +29 -27
- package/dist/LinearPairedArcDisplay/components/ReactComponent.d.ts +1 -2
- package/dist/LinearPairedArcDisplay/components/ReactComponent.js +2 -3
- package/dist/LinearPairedArcDisplay/components/util.js +1 -1
- package/dist/LinearPairedArcDisplay/index.js +17 -7
- package/dist/LinearPairedArcDisplay/model.d.ts +1 -1
- package/dist/LinearPairedArcDisplay/model.js +17 -7
- package/dist/LinearPairedArcDisplay/renderSvg.d.ts +1 -2
- package/dist/LinearPairedArcDisplay/renderSvg.js +2 -7
- package/esm/ArcRenderer/ArcRendering.d.ts +1 -2
- package/esm/ArcRenderer/ArcRendering.js +20 -28
- package/esm/ArcTooltip.d.ts +1 -2
- package/esm/ArcTooltip.js +5 -6
- package/esm/LinearArcDisplay/model.d.ts +6 -6
- package/esm/LinearPairedArcDisplay/components/Arcs.d.ts +1 -2
- package/esm/LinearPairedArcDisplay/components/Arcs.js +27 -31
- package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.d.ts +1 -2
- package/esm/LinearPairedArcDisplay/components/BaseDisplayComponent.js +12 -20
- package/esm/LinearPairedArcDisplay/components/ReactComponent.d.ts +1 -2
- package/esm/LinearPairedArcDisplay/components/ReactComponent.js +2 -3
- package/esm/LinearPairedArcDisplay/components/util.js +1 -1
- package/esm/LinearPairedArcDisplay/model.d.ts +1 -1
- package/esm/LinearPairedArcDisplay/renderSvg.d.ts +1 -2
- package/esm/LinearPairedArcDisplay/renderSvg.js +2 -7
- package/package.json +10 -8
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
2
|
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
3
|
declare const ArcRendering: ({ features, config, regions, bpPerPx, height, exportSVG, displayModel, onFeatureClick, }: {
|
|
@@ -12,5 +11,5 @@ declare const ArcRendering: ({ features, config, regions, bpPerPx, height, expor
|
|
|
12
11
|
};
|
|
13
12
|
onFeatureClick: (event: React.MouseEvent, featureId: string) => void;
|
|
14
13
|
exportSVG: boolean;
|
|
15
|
-
}) =>
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
export default ArcRendering;
|
|
@@ -15,15 +15,26 @@ 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
|
-
const
|
|
36
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
37
|
+
const react_1 = require("react");
|
|
27
38
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
28
39
|
const util_1 = require("@jbrowse/core/util");
|
|
29
40
|
const mobx_react_1 = require("mobx-react");
|
|
@@ -39,22 +50,17 @@ function Arc({ selectedFeatureId, region, bpPerPx, config, height: displayHeight
|
|
|
39
50
|
const caption = (0, configuration_1.readConfObject)(config, 'caption', { feature });
|
|
40
51
|
const strokeWidth = (0, configuration_1.readConfObject)(config, 'thickness', { feature }) || 2;
|
|
41
52
|
const height = Math.min((0, configuration_1.readConfObject)(config, 'height', { feature }) || 100, displayHeight);
|
|
42
|
-
const ref = react_1.
|
|
53
|
+
const ref = (0, react_1.useRef)(null);
|
|
43
54
|
const t = 0.5;
|
|
44
55
|
const t1 = 1 - t;
|
|
45
56
|
const textYCoord = 3 * (t1 * t1) * (t * height) + 3 * t1 * (t * t) * height;
|
|
46
|
-
return (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, pointerEvents: "stroke" }),
|
|
54
|
-
isMouseOvered ? (react_1.default.createElement(react_1.Suspense, { fallback: null },
|
|
55
|
-
react_1.default.createElement(ArcTooltip, { contents: caption }))) : null,
|
|
56
|
-
react_1.default.createElement("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: "white", strokeWidth: "0.6em" }, label),
|
|
57
|
-
react_1.default.createElement("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: textStroke }, label)));
|
|
57
|
+
return ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("path", { ref: ref, ...(0, util_1.getStrokeProps)(stroke), d: `M ${left} 0 C ${left} ${height}, ${right} ${height}, ${right} 0`, strokeWidth: strokeWidth, fill: "transparent", onClick: e => {
|
|
58
|
+
onFeatureClick(e, featureId);
|
|
59
|
+
}, onMouseOver: () => {
|
|
60
|
+
setIsMouseOvered(true);
|
|
61
|
+
}, onMouseLeave: () => {
|
|
62
|
+
setIsMouseOvered(false);
|
|
63
|
+
}, pointerEvents: "stroke" }), isMouseOvered ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(ArcTooltip, { contents: caption }) })) : null, (0, jsx_runtime_1.jsx)("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: "white", strokeWidth: "0.6em", children: label }), (0, jsx_runtime_1.jsx)("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: textStroke, children: label })] }));
|
|
58
64
|
}
|
|
59
65
|
function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
|
|
60
66
|
const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180;
|
|
@@ -91,28 +97,24 @@ function SemiCircles({ selectedFeatureId, region, bpPerPx, config, onFeatureClic
|
|
|
91
97
|
const label = (0, configuration_1.readConfObject)(config, 'label', { feature });
|
|
92
98
|
const caption = (0, configuration_1.readConfObject)(config, 'caption', { feature });
|
|
93
99
|
const strokeWidth = (0, configuration_1.readConfObject)(config, 'thickness', { feature }) || 2;
|
|
94
|
-
const ref = react_1.
|
|
100
|
+
const ref = (0, react_1.useRef)(null);
|
|
95
101
|
const textYCoord = (right - left) / 2;
|
|
96
|
-
return (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}, ref: ref, pointerEvents: "stroke" }),
|
|
104
|
-
isMouseOvered ? react_1.default.createElement(ArcTooltip, { contents: caption }) : null,
|
|
105
|
-
react_1.default.createElement("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: "white", strokeWidth: "0.6em" }, label),
|
|
106
|
-
react_1.default.createElement("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: textStroke }, label)));
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("path", { d: describeArc(left + (right - left) / 2, 0, (right - left) / 2, 90, 270), ...(0, util_1.getStrokeProps)(stroke), strokeWidth: strokeWidth, fill: "transparent", onClick: e => {
|
|
103
|
+
onFeatureClick(e, featureId);
|
|
104
|
+
}, onMouseOver: () => {
|
|
105
|
+
setIsMouseOvered(true);
|
|
106
|
+
}, onMouseLeave: () => {
|
|
107
|
+
setIsMouseOvered(false);
|
|
108
|
+
}, ref: ref, pointerEvents: "stroke" }), isMouseOvered ? (0, jsx_runtime_1.jsx)(ArcTooltip, { contents: caption }) : null, (0, jsx_runtime_1.jsx)("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: "white", strokeWidth: "0.6em", children: label }), (0, jsx_runtime_1.jsx)("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: textStroke, children: label })] }));
|
|
107
109
|
}
|
|
108
110
|
const ArcRendering = (0, mobx_react_1.observer)(function ({ features, config, regions, bpPerPx, height, exportSVG, displayModel, onFeatureClick, }) {
|
|
109
111
|
const region = regions[0];
|
|
110
112
|
const width = (region.end - region.start) / bpPerPx;
|
|
111
113
|
const semicircles = (0, configuration_1.readConfObject)(config, 'displayMode') === 'semicircles';
|
|
112
114
|
const { selectedFeatureId } = displayModel || {};
|
|
113
|
-
return (
|
|
115
|
+
return ((0, jsx_runtime_1.jsx)(Wrapper, { exportSVG: exportSVG, width: width, height: height, children: [...features.values()].map(f => semicircles ? ((0, jsx_runtime_1.jsx)(SemiCircles, { config: config, region: region, bpPerPx: bpPerPx, selectedFeatureId: selectedFeatureId, onFeatureClick: onFeatureClick, feature: f }, f.id())) : ((0, jsx_runtime_1.jsx)(Arc, { height: height, config: config, region: region, bpPerPx: bpPerPx, selectedFeatureId: selectedFeatureId, onFeatureClick: onFeatureClick, feature: f }, f.id()))) }));
|
|
114
116
|
});
|
|
115
117
|
function Wrapper({ exportSVG, width, height, children, }) {
|
|
116
|
-
return exportSVG ? (children) : (
|
|
118
|
+
return exportSVG ? (children) : ((0, jsx_runtime_1.jsx)("svg", { width: width, height: height, children: children }));
|
|
117
119
|
}
|
|
118
120
|
exports.default = ArcRendering;
|
package/dist/ArcTooltip.d.ts
CHANGED
package/dist/ArcTooltip.js
CHANGED
|
@@ -1,41 +1,17 @@
|
|
|
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 ui_1 = require("@jbrowse/core/ui");
|
|
31
9
|
const BaseTooltip_1 = __importDefault(require("@jbrowse/core/ui/BaseTooltip"));
|
|
32
10
|
const mobx_react_1 = require("mobx-react");
|
|
33
|
-
const TooltipContents = react_1.
|
|
34
|
-
return (
|
|
11
|
+
const TooltipContents = (0, react_1.forwardRef)(function TooltipContents2({ message }, ref) {
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, children: (0, react_1.isValidElement)(message) ? (message) : message ? ((0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: String(message) })) : null }));
|
|
35
13
|
});
|
|
36
14
|
const ArcTooltip = (0, mobx_react_1.observer)(function ({ contents }) {
|
|
37
|
-
return contents ? (
|
|
38
|
-
react_1.default.createElement(BaseTooltip_1.default, null,
|
|
39
|
-
react_1.default.createElement(TooltipContents, { message: contents })))) : null;
|
|
15
|
+
return contents ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(BaseTooltip_1.default, { children: (0, jsx_runtime_1.jsx)(TooltipContents, { message: contents }) }) })) : null;
|
|
40
16
|
});
|
|
41
17
|
exports.default = ArcTooltip;
|
|
@@ -34,7 +34,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
34
34
|
status?: string;
|
|
35
35
|
reactElement?: React.ReactElement;
|
|
36
36
|
};
|
|
37
|
-
}) => import("react").JSX.Element | undefined;
|
|
37
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
38
38
|
renderProps: any;
|
|
39
39
|
} & {
|
|
40
40
|
doReload(): void;
|
|
@@ -170,13 +170,13 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
170
170
|
} & {
|
|
171
171
|
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
172
172
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
173
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
173
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
174
174
|
} & {
|
|
175
175
|
featureIdUnderMouse: undefined | string;
|
|
176
176
|
contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
|
|
177
177
|
} & {
|
|
178
|
-
readonly DisplayMessageComponent:
|
|
179
|
-
readonly blockType: "
|
|
178
|
+
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
179
|
+
readonly blockType: "staticBlocks" | "dynamicBlocks";
|
|
180
180
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
181
181
|
} & {
|
|
182
182
|
readonly renderDelay: number;
|
|
@@ -203,7 +203,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
203
203
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
204
204
|
renderProps(): any;
|
|
205
205
|
} & {
|
|
206
|
-
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
206
|
+
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
207
207
|
afterAttach(): void;
|
|
208
208
|
} & {
|
|
209
209
|
readonly blockType: string;
|
|
@@ -274,7 +274,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
274
274
|
status?: string;
|
|
275
275
|
reactElement?: React.ReactElement;
|
|
276
276
|
};
|
|
277
|
-
}) => import("react").JSX.Element | undefined;
|
|
277
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
278
278
|
renderProps: any;
|
|
279
279
|
} & {
|
|
280
280
|
doReload(): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearArcDisplayModel } from '../model';
|
|
3
2
|
declare const Arcs: ({ model, exportSVG, }: {
|
|
4
3
|
model: LinearArcDisplayModel;
|
|
5
4
|
exportSVG?: boolean;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export default Arcs;
|
|
@@ -15,15 +15,26 @@ 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
|
-
const
|
|
36
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
37
|
+
const react_1 = require("react");
|
|
27
38
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
28
39
|
const util_1 = require("@jbrowse/core/util");
|
|
29
40
|
const mobx_react_1 = require("mobx-react");
|
|
@@ -52,30 +63,25 @@ const Arc = (0, mobx_react_1.observer)(function ({ model, feature, alt, assembly
|
|
|
52
63
|
const right = p2;
|
|
53
64
|
const col = mouseOvered ? 'black' : c;
|
|
54
65
|
const sw = 3;
|
|
55
|
-
return absrad > 1 ? (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, onClick: () => {
|
|
75
|
-
model.selectFeature(feature);
|
|
76
|
-
}, x1: right, x2: right + k2.mateDirection * 20, y1: 1.5, y2: 1.5 })) : null,
|
|
77
|
-
mouseOvered ? (react_1.default.createElement(react_1.Suspense, { fallback: null },
|
|
78
|
-
react_1.default.createElement(ArcTooltip, { contents: (0, util_2.makeSummary)(feature, alt) }))) : null)) : null;
|
|
66
|
+
return absrad > 1 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: `M ${left} 0 C ${left} ${destY}, ${right} ${destY}, ${right} 0`, ref: ref, ...(0, util_1.getStrokeProps)(col), strokeWidth: sw, onMouseOut: () => {
|
|
67
|
+
setMouseOvered(false);
|
|
68
|
+
}, onMouseOver: () => {
|
|
69
|
+
setMouseOvered(true);
|
|
70
|
+
}, onClick: () => {
|
|
71
|
+
model.selectFeature(feature);
|
|
72
|
+
}, fill: "none", pointerEvents: "stroke" }), k1.mateDirection ? ((0, jsx_runtime_1.jsx)("line", { ...(0, util_1.getStrokeProps)(col), strokeWidth: sw, onMouseOut: () => {
|
|
73
|
+
setMouseOvered(false);
|
|
74
|
+
}, onMouseOver: () => {
|
|
75
|
+
setMouseOvered(true);
|
|
76
|
+
}, onClick: () => {
|
|
77
|
+
model.selectFeature(feature);
|
|
78
|
+
}, x1: left, x2: left + k1.mateDirection * 20, y1: 1.5, y2: 1.5 })) : null, k2.mateDirection ? ((0, jsx_runtime_1.jsx)("line", { ...(0, util_1.getStrokeProps)(col), strokeWidth: sw, onMouseOut: () => {
|
|
79
|
+
setMouseOvered(false);
|
|
80
|
+
}, onMouseOver: () => {
|
|
81
|
+
setMouseOvered(true);
|
|
82
|
+
}, onClick: () => {
|
|
83
|
+
model.selectFeature(feature);
|
|
84
|
+
}, x1: right, x2: right + k2.mateDirection * 20, y1: 1.5, y2: 1.5 })) : null, mouseOvered ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(ArcTooltip, { contents: (0, util_2.makeSummary)(feature, alt) }) })) : null] })) : null;
|
|
79
85
|
}
|
|
80
86
|
return null;
|
|
81
87
|
});
|
|
@@ -83,7 +89,7 @@ const Wrapper = (0, mobx_react_1.observer)(function ({ model, exportSVG, childre
|
|
|
83
89
|
const { height } = model;
|
|
84
90
|
const view = (0, util_1.getContainingView)(model);
|
|
85
91
|
const width = Math.round(view.dynamicBlocks.totalWidthPx);
|
|
86
|
-
return exportSVG ? (children) : (
|
|
92
|
+
return exportSVG ? (children) : ((0, jsx_runtime_1.jsx)("svg", { width: width, height: height, children: children }));
|
|
87
93
|
});
|
|
88
94
|
const Arcs = (0, mobx_react_1.observer)(function ({ model, exportSVG, }) {
|
|
89
95
|
const view = (0, util_1.getContainingView)(model);
|
|
@@ -91,10 +97,10 @@ const Arcs = (0, mobx_react_1.observer)(function ({ model, exportSVG, }) {
|
|
|
91
97
|
const { assemblyManager } = session;
|
|
92
98
|
const { features } = model;
|
|
93
99
|
const assembly = assemblyManager.get(view.assemblyNames[0]);
|
|
94
|
-
return assembly ? (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
return assembly ? ((0, jsx_runtime_1.jsx)(Wrapper, { model: model, exportSVG: exportSVG, children: features === null || features === void 0 ? void 0 : features.map(f => {
|
|
101
|
+
var _a;
|
|
102
|
+
const alts = f.get('ALT');
|
|
103
|
+
return ((_a = alts === null || alts === void 0 ? void 0 : alts.map(a => ((0, jsx_runtime_1.jsx)(Arc, { session: session, feature: f, alt: a, view: view, model: model, assembly: assembly }, `${f.id()}-${a}`)))) !== null && _a !== void 0 ? _a : ((0, jsx_runtime_1.jsx)(Arc, { session: session, feature: f, view: view, model: model, assembly: assembly }, f.id())));
|
|
104
|
+
}) })) : null;
|
|
99
105
|
});
|
|
100
106
|
exports.default = Arcs;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearArcDisplayModel } from '../model';
|
|
3
2
|
declare const BaseDisplayComponent: ({ model, children, }: {
|
|
4
3
|
model: LinearArcDisplayModel;
|
|
5
4
|
children?: React.ReactNode;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export default BaseDisplayComponent;
|
|
@@ -15,18 +15,29 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const react_1 = require("react");
|
|
30
41
|
const ui_1 = require("@jbrowse/core/ui");
|
|
31
42
|
const util_1 = require("@jbrowse/core/util");
|
|
32
43
|
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
@@ -51,31 +62,22 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
51
62
|
}));
|
|
52
63
|
const BaseDisplayComponent = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
53
64
|
const { error, regionTooLarge } = model;
|
|
54
|
-
return error ? (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
63
|
-
ErrorMessageStackTraceDialog,
|
|
64
|
-
{ onClose, error: model.error },
|
|
65
|
-
]);
|
|
66
|
-
} },
|
|
67
|
-
react_1.default.createElement(Report_1.default, null)))) })) : regionTooLarge ? (model.regionCannotBeRendered()) : (react_1.default.createElement(DataDisplay, { model: model }, children));
|
|
65
|
+
return error ? ((0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BlockMsg, { message: `${error}`, severity: "error", action: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Reload", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "data-testid": "reload_button", onClick: () => {
|
|
66
|
+
model.reload();
|
|
67
|
+
}, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Show stack trace", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
68
|
+
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
69
|
+
ErrorMessageStackTraceDialog,
|
|
70
|
+
{ onClose, error: model.error },
|
|
71
|
+
]);
|
|
72
|
+
}, children: (0, jsx_runtime_1.jsx)(Report_1.default, {}) }) })] }) })) : regionTooLarge ? (model.regionCannotBeRendered()) : ((0, jsx_runtime_1.jsx)(DataDisplay, { model: model, children: children }));
|
|
68
73
|
});
|
|
69
74
|
const DataDisplay = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
70
75
|
const { loading } = model;
|
|
71
|
-
return (
|
|
72
|
-
children,
|
|
73
|
-
loading ? react_1.default.createElement(LoadingBar, { model: model }) : null));
|
|
76
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [children, loading ? (0, jsx_runtime_1.jsx)(LoadingBar, { model: model }) : null] }));
|
|
74
77
|
});
|
|
75
78
|
const LoadingBar = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
76
79
|
const { classes } = useStyles();
|
|
77
80
|
const { message } = model;
|
|
78
|
-
return (
|
|
79
|
-
react_1.default.createElement(ui_1.LoadingEllipses, { message: message })));
|
|
81
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes.loading, children: (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { message: message }) }));
|
|
80
82
|
});
|
|
81
83
|
exports.default = BaseDisplayComponent;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearArcDisplayModel } from '../model';
|
|
3
2
|
declare const LinearArcReactComponent: ({ model, exportSVG, }: {
|
|
4
3
|
model: LinearArcDisplayModel;
|
|
5
4
|
exportSVG?: boolean;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default LinearArcReactComponent;
|
|
@@ -3,12 +3,11 @@ 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 Arcs_1 = __importDefault(require("./Arcs"));
|
|
9
9
|
const BaseDisplayComponent_1 = __importDefault(require("./BaseDisplayComponent"));
|
|
10
10
|
const LinearArcReactComponent = (0, mobx_react_1.observer)(function ({ model, exportSVG, }) {
|
|
11
|
-
return (
|
|
12
|
-
react_1.default.createElement(Arcs_1.default, { model: model, exportSVG: exportSVG })));
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(BaseDisplayComponent_1.default, { model: model, children: (0, jsx_runtime_1.jsx)(Arcs_1.default, { model: model, exportSVG: exportSVG }) }));
|
|
13
12
|
});
|
|
14
13
|
exports.default = LinearArcReactComponent;
|
|
@@ -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 = LinearPairedArcDisplayF;
|
|
27
37
|
const react_1 = require("react");
|
|
@@ -106,7 +106,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
106
106
|
} & {
|
|
107
107
|
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
108
108
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
109
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region):
|
|
109
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
110
110
|
} & {
|
|
111
111
|
lastDrawnOffsetPx: number;
|
|
112
112
|
features: Feature[] | undefined;
|
|
@@ -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.stateModelFactory = stateModelFactory;
|
|
27
37
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearArcDisplayModel } from './model';
|
|
3
2
|
export declare function renderArcSvg(model: LinearArcDisplayModel, _opts: {
|
|
4
3
|
rasterizeLayers?: boolean;
|
|
5
|
-
}): Promise<
|
|
4
|
+
}): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.renderArcSvg = renderArcSvg;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
const Arcs_1 = __importDefault(require("./components/Arcs"));
|
|
10
10
|
async function renderArcSvg(model, _opts) {
|
|
@@ -13,10 +13,5 @@ async function renderArcSvg(model, _opts) {
|
|
|
13
13
|
const width = view.dynamicBlocks.totalWidthPx;
|
|
14
14
|
const height = model.height;
|
|
15
15
|
const clipid = `arc-${model.id}`;
|
|
16
|
-
return (
|
|
17
|
-
react_1.default.createElement("defs", null,
|
|
18
|
-
react_1.default.createElement("clipPath", { id: clipid },
|
|
19
|
-
react_1.default.createElement("rect", { x: 0, y: 0, width: width, height: height }))),
|
|
20
|
-
react_1.default.createElement("g", { clipPath: `url(#${clipid})` },
|
|
21
|
-
react_1.default.createElement(Arcs_1.default, { model: model, exportSVG: true }))));
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: clipid, children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: width, height: height }) }) }), (0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${clipid})`, children: (0, jsx_runtime_1.jsx)(Arcs_1.default, { model: model, exportSVG: true }) })] }));
|
|
22
17
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
2
|
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
3
|
declare const ArcRendering: ({ features, config, regions, bpPerPx, height, exportSVG, displayModel, onFeatureClick, }: {
|
|
@@ -12,5 +11,5 @@ declare const ArcRendering: ({ features, config, regions, bpPerPx, height, expor
|
|
|
12
11
|
};
|
|
13
12
|
onFeatureClick: (event: React.MouseEvent, featureId: string) => void;
|
|
14
13
|
exportSVG: boolean;
|
|
15
|
-
}) =>
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
export default ArcRendering;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, lazy, useRef, useState } from 'react';
|
|
2
3
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
3
4
|
import { bpSpanPx, getStrokeProps } from '@jbrowse/core/util';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
@@ -14,22 +15,17 @@ function Arc({ selectedFeatureId, region, bpPerPx, config, height: displayHeight
|
|
|
14
15
|
const caption = readConfObject(config, 'caption', { feature });
|
|
15
16
|
const strokeWidth = readConfObject(config, 'thickness', { feature }) || 2;
|
|
16
17
|
const height = Math.min(readConfObject(config, 'height', { feature }) || 100, displayHeight);
|
|
17
|
-
const ref =
|
|
18
|
+
const ref = useRef(null);
|
|
18
19
|
const t = 0.5;
|
|
19
20
|
const t1 = 1 - t;
|
|
20
21
|
const textYCoord = 3 * (t1 * t1) * (t * height) + 3 * t1 * (t * t) * height;
|
|
21
|
-
return (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, pointerEvents: "stroke" }),
|
|
29
|
-
isMouseOvered ? (React.createElement(Suspense, { fallback: null },
|
|
30
|
-
React.createElement(ArcTooltip, { contents: caption }))) : null,
|
|
31
|
-
React.createElement("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: "white", strokeWidth: "0.6em" }, label),
|
|
32
|
-
React.createElement("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: textStroke }, label)));
|
|
22
|
+
return (_jsxs("g", { children: [_jsx("path", { ref: ref, ...getStrokeProps(stroke), d: `M ${left} 0 C ${left} ${height}, ${right} ${height}, ${right} 0`, strokeWidth: strokeWidth, fill: "transparent", onClick: e => {
|
|
23
|
+
onFeatureClick(e, featureId);
|
|
24
|
+
}, onMouseOver: () => {
|
|
25
|
+
setIsMouseOvered(true);
|
|
26
|
+
}, onMouseLeave: () => {
|
|
27
|
+
setIsMouseOvered(false);
|
|
28
|
+
}, pointerEvents: "stroke" }), isMouseOvered ? (_jsx(Suspense, { fallback: null, children: _jsx(ArcTooltip, { contents: caption }) })) : null, _jsx("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: "white", strokeWidth: "0.6em", children: label }), _jsx("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: textStroke, children: label })] }));
|
|
33
29
|
}
|
|
34
30
|
function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
|
|
35
31
|
const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180;
|
|
@@ -66,28 +62,24 @@ function SemiCircles({ selectedFeatureId, region, bpPerPx, config, onFeatureClic
|
|
|
66
62
|
const label = readConfObject(config, 'label', { feature });
|
|
67
63
|
const caption = readConfObject(config, 'caption', { feature });
|
|
68
64
|
const strokeWidth = readConfObject(config, 'thickness', { feature }) || 2;
|
|
69
|
-
const ref =
|
|
65
|
+
const ref = useRef(null);
|
|
70
66
|
const textYCoord = (right - left) / 2;
|
|
71
|
-
return (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}, ref: ref, pointerEvents: "stroke" }),
|
|
79
|
-
isMouseOvered ? React.createElement(ArcTooltip, { contents: caption }) : null,
|
|
80
|
-
React.createElement("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: "white", strokeWidth: "0.6em" }, label),
|
|
81
|
-
React.createElement("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: textStroke }, label)));
|
|
67
|
+
return (_jsxs("g", { children: [_jsx("path", { d: describeArc(left + (right - left) / 2, 0, (right - left) / 2, 90, 270), ...getStrokeProps(stroke), strokeWidth: strokeWidth, fill: "transparent", onClick: e => {
|
|
68
|
+
onFeatureClick(e, featureId);
|
|
69
|
+
}, onMouseOver: () => {
|
|
70
|
+
setIsMouseOvered(true);
|
|
71
|
+
}, onMouseLeave: () => {
|
|
72
|
+
setIsMouseOvered(false);
|
|
73
|
+
}, ref: ref, pointerEvents: "stroke" }), isMouseOvered ? _jsx(ArcTooltip, { contents: caption }) : null, _jsx("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: "white", strokeWidth: "0.6em", children: label }), _jsx("text", { x: left + (right - left) / 2, y: textYCoord + 3, stroke: textStroke, children: label })] }));
|
|
82
74
|
}
|
|
83
75
|
const ArcRendering = observer(function ({ features, config, regions, bpPerPx, height, exportSVG, displayModel, onFeatureClick, }) {
|
|
84
76
|
const region = regions[0];
|
|
85
77
|
const width = (region.end - region.start) / bpPerPx;
|
|
86
78
|
const semicircles = readConfObject(config, 'displayMode') === 'semicircles';
|
|
87
79
|
const { selectedFeatureId } = displayModel || {};
|
|
88
|
-
return (
|
|
80
|
+
return (_jsx(Wrapper, { exportSVG: exportSVG, width: width, height: height, children: [...features.values()].map(f => semicircles ? (_jsx(SemiCircles, { config: config, region: region, bpPerPx: bpPerPx, selectedFeatureId: selectedFeatureId, onFeatureClick: onFeatureClick, feature: f }, f.id())) : (_jsx(Arc, { height: height, config: config, region: region, bpPerPx: bpPerPx, selectedFeatureId: selectedFeatureId, onFeatureClick: onFeatureClick, feature: f }, f.id()))) }));
|
|
89
81
|
});
|
|
90
82
|
function Wrapper({ exportSVG, width, height, children, }) {
|
|
91
|
-
return exportSVG ? (children) : (
|
|
83
|
+
return exportSVG ? (children) : (_jsx("svg", { width: width, height: height, children: children }));
|
|
92
84
|
}
|
|
93
85
|
export default ArcRendering;
|
package/esm/ArcTooltip.d.ts
CHANGED
package/esm/ArcTooltip.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, forwardRef, isValidElement } from 'react';
|
|
2
3
|
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
3
4
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
5
|
-
const TooltipContents =
|
|
6
|
-
return (
|
|
6
|
+
const TooltipContents = forwardRef(function TooltipContents2({ message }, ref) {
|
|
7
|
+
return (_jsx("div", { ref: ref, children: isValidElement(message) ? (message) : message ? (_jsx(SanitizedHTML, { html: String(message) })) : null }));
|
|
7
8
|
});
|
|
8
9
|
const ArcTooltip = observer(function ({ contents }) {
|
|
9
|
-
return contents ? (
|
|
10
|
-
React.createElement(BaseTooltip, null,
|
|
11
|
-
React.createElement(TooltipContents, { message: contents })))) : null;
|
|
10
|
+
return contents ? (_jsx(Suspense, { fallback: null, children: _jsx(BaseTooltip, { children: _jsx(TooltipContents, { message: contents }) }) })) : null;
|
|
12
11
|
});
|
|
13
12
|
export default ArcTooltip;
|
|
@@ -34,7 +34,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
34
34
|
status?: string;
|
|
35
35
|
reactElement?: React.ReactElement;
|
|
36
36
|
};
|
|
37
|
-
}) => import("react").JSX.Element | undefined;
|
|
37
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
38
38
|
renderProps: any;
|
|
39
39
|
} & {
|
|
40
40
|
doReload(): void;
|
|
@@ -170,13 +170,13 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
170
170
|
} & {
|
|
171
171
|
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
172
172
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
173
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
173
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
174
174
|
} & {
|
|
175
175
|
featureIdUnderMouse: undefined | string;
|
|
176
176
|
contextMenuFeature: undefined | import("@jbrowse/core/util").Feature;
|
|
177
177
|
} & {
|
|
178
|
-
readonly DisplayMessageComponent:
|
|
179
|
-
readonly blockType: "
|
|
178
|
+
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
179
|
+
readonly blockType: "staticBlocks" | "dynamicBlocks";
|
|
180
180
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
181
181
|
} & {
|
|
182
182
|
readonly renderDelay: number;
|
|
@@ -203,7 +203,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
203
203
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
204
204
|
renderProps(): any;
|
|
205
205
|
} & {
|
|
206
|
-
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
206
|
+
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
207
207
|
afterAttach(): void;
|
|
208
208
|
} & {
|
|
209
209
|
readonly blockType: string;
|
|
@@ -274,7 +274,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
274
274
|
status?: string;
|
|
275
275
|
reactElement?: React.ReactElement;
|
|
276
276
|
};
|
|
277
|
-
}) => import("react").JSX.Element | undefined;
|
|
277
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
278
278
|
renderProps: any;
|
|
279
279
|
} & {
|
|
280
280
|
doReload(): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearArcDisplayModel } from '../model';
|
|
3
2
|
declare const Arcs: ({ model, exportSVG, }: {
|
|
4
3
|
model: LinearArcDisplayModel;
|
|
5
4
|
exportSVG?: boolean;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export default Arcs;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, lazy, useRef, useState } from 'react';
|
|
2
3
|
import { getConf } from '@jbrowse/core/configuration';
|
|
3
4
|
import { getContainingView, getSession, getStrokeProps, } from '@jbrowse/core/util';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
@@ -27,30 +28,25 @@ const Arc = observer(function ({ model, feature, alt, assembly, view, }) {
|
|
|
27
28
|
const right = p2;
|
|
28
29
|
const col = mouseOvered ? 'black' : c;
|
|
29
30
|
const sw = 3;
|
|
30
|
-
return absrad > 1 ? (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, onClick: () => {
|
|
50
|
-
model.selectFeature(feature);
|
|
51
|
-
}, x1: right, x2: right + k2.mateDirection * 20, y1: 1.5, y2: 1.5 })) : null,
|
|
52
|
-
mouseOvered ? (React.createElement(Suspense, { fallback: null },
|
|
53
|
-
React.createElement(ArcTooltip, { contents: makeSummary(feature, alt) }))) : null)) : null;
|
|
31
|
+
return absrad > 1 ? (_jsxs(_Fragment, { children: [_jsx("path", { d: `M ${left} 0 C ${left} ${destY}, ${right} ${destY}, ${right} 0`, ref: ref, ...getStrokeProps(col), strokeWidth: sw, onMouseOut: () => {
|
|
32
|
+
setMouseOvered(false);
|
|
33
|
+
}, onMouseOver: () => {
|
|
34
|
+
setMouseOvered(true);
|
|
35
|
+
}, onClick: () => {
|
|
36
|
+
model.selectFeature(feature);
|
|
37
|
+
}, fill: "none", pointerEvents: "stroke" }), k1.mateDirection ? (_jsx("line", { ...getStrokeProps(col), strokeWidth: sw, onMouseOut: () => {
|
|
38
|
+
setMouseOvered(false);
|
|
39
|
+
}, onMouseOver: () => {
|
|
40
|
+
setMouseOvered(true);
|
|
41
|
+
}, onClick: () => {
|
|
42
|
+
model.selectFeature(feature);
|
|
43
|
+
}, x1: left, x2: left + k1.mateDirection * 20, y1: 1.5, y2: 1.5 })) : null, k2.mateDirection ? (_jsx("line", { ...getStrokeProps(col), strokeWidth: sw, onMouseOut: () => {
|
|
44
|
+
setMouseOvered(false);
|
|
45
|
+
}, onMouseOver: () => {
|
|
46
|
+
setMouseOvered(true);
|
|
47
|
+
}, onClick: () => {
|
|
48
|
+
model.selectFeature(feature);
|
|
49
|
+
}, x1: right, x2: right + k2.mateDirection * 20, y1: 1.5, y2: 1.5 })) : null, mouseOvered ? (_jsx(Suspense, { fallback: null, children: _jsx(ArcTooltip, { contents: makeSummary(feature, alt) }) })) : null] })) : null;
|
|
54
50
|
}
|
|
55
51
|
return null;
|
|
56
52
|
});
|
|
@@ -58,7 +54,7 @@ const Wrapper = observer(function ({ model, exportSVG, children, }) {
|
|
|
58
54
|
const { height } = model;
|
|
59
55
|
const view = getContainingView(model);
|
|
60
56
|
const width = Math.round(view.dynamicBlocks.totalWidthPx);
|
|
61
|
-
return exportSVG ? (children) : (
|
|
57
|
+
return exportSVG ? (children) : (_jsx("svg", { width: width, height: height, children: children }));
|
|
62
58
|
});
|
|
63
59
|
const Arcs = observer(function ({ model, exportSVG, }) {
|
|
64
60
|
const view = getContainingView(model);
|
|
@@ -66,10 +62,10 @@ const Arcs = observer(function ({ model, exportSVG, }) {
|
|
|
66
62
|
const { assemblyManager } = session;
|
|
67
63
|
const { features } = model;
|
|
68
64
|
const assembly = assemblyManager.get(view.assemblyNames[0]);
|
|
69
|
-
return assembly ? (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
return assembly ? (_jsx(Wrapper, { model: model, exportSVG: exportSVG, children: features === null || features === void 0 ? void 0 : features.map(f => {
|
|
66
|
+
var _a;
|
|
67
|
+
const alts = f.get('ALT');
|
|
68
|
+
return ((_a = alts === null || alts === void 0 ? void 0 : alts.map(a => (_jsx(Arc, { session: session, feature: f, alt: a, view: view, model: model, assembly: assembly }, `${f.id()}-${a}`)))) !== null && _a !== void 0 ? _a : (_jsx(Arc, { session: session, feature: f, view: view, model: model, assembly: assembly }, f.id())));
|
|
69
|
+
}) })) : null;
|
|
74
70
|
});
|
|
75
71
|
export default Arcs;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearArcDisplayModel } from '../model';
|
|
3
2
|
declare const BaseDisplayComponent: ({ model, children, }: {
|
|
4
3
|
model: LinearArcDisplayModel;
|
|
5
4
|
children?: React.ReactNode;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export default BaseDisplayComponent;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { lazy } from 'react';
|
|
2
3
|
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
4
|
import { getSession } from '@jbrowse/core/util';
|
|
4
5
|
import { BlockMsg } from '@jbrowse/plugin-linear-genome-view';
|
|
@@ -23,31 +24,22 @@ const useStyles = makeStyles()(theme => ({
|
|
|
23
24
|
}));
|
|
24
25
|
const BaseDisplayComponent = observer(function ({ model, children, }) {
|
|
25
26
|
const { error, regionTooLarge } = model;
|
|
26
|
-
return error ? (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
getSession(model).queueDialog(onClose => [
|
|
35
|
-
ErrorMessageStackTraceDialog,
|
|
36
|
-
{ onClose, error: model.error },
|
|
37
|
-
]);
|
|
38
|
-
} },
|
|
39
|
-
React.createElement(ReportIcon, null)))) })) : regionTooLarge ? (model.regionCannotBeRendered()) : (React.createElement(DataDisplay, { model: model }, children));
|
|
27
|
+
return error ? (_jsx(BlockMsg, { message: `${error}`, severity: "error", action: _jsxs(_Fragment, { children: [_jsx(Tooltip, { title: "Reload", children: _jsx(IconButton, { "data-testid": "reload_button", onClick: () => {
|
|
28
|
+
model.reload();
|
|
29
|
+
}, children: _jsx(RefreshIcon, {}) }) }), _jsx(Tooltip, { title: "Show stack trace", children: _jsx(IconButton, { onClick: () => {
|
|
30
|
+
getSession(model).queueDialog(onClose => [
|
|
31
|
+
ErrorMessageStackTraceDialog,
|
|
32
|
+
{ onClose, error: model.error },
|
|
33
|
+
]);
|
|
34
|
+
}, children: _jsx(ReportIcon, {}) }) })] }) })) : regionTooLarge ? (model.regionCannotBeRendered()) : (_jsx(DataDisplay, { model: model, children: children }));
|
|
40
35
|
});
|
|
41
36
|
const DataDisplay = observer(function ({ model, children, }) {
|
|
42
37
|
const { loading } = model;
|
|
43
|
-
return (
|
|
44
|
-
children,
|
|
45
|
-
loading ? React.createElement(LoadingBar, { model: model }) : null));
|
|
38
|
+
return (_jsxs("div", { children: [children, loading ? _jsx(LoadingBar, { model: model }) : null] }));
|
|
46
39
|
});
|
|
47
40
|
const LoadingBar = observer(function ({ model, }) {
|
|
48
41
|
const { classes } = useStyles();
|
|
49
42
|
const { message } = model;
|
|
50
|
-
return (
|
|
51
|
-
React.createElement(LoadingEllipses, { message: message })));
|
|
43
|
+
return (_jsx("div", { className: classes.loading, children: _jsx(LoadingEllipses, { message: message }) }));
|
|
52
44
|
});
|
|
53
45
|
export default BaseDisplayComponent;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearArcDisplayModel } from '../model';
|
|
3
2
|
declare const LinearArcReactComponent: ({ model, exportSVG, }: {
|
|
4
3
|
model: LinearArcDisplayModel;
|
|
5
4
|
exportSVG?: boolean;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default LinearArcReactComponent;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
3
|
import Arcs from './Arcs';
|
|
4
4
|
import BaseDisplayComponent from './BaseDisplayComponent';
|
|
5
5
|
const LinearArcReactComponent = observer(function ({ model, exportSVG, }) {
|
|
6
|
-
return (
|
|
7
|
-
React.createElement(Arcs, { model: model, exportSVG: exportSVG })));
|
|
6
|
+
return (_jsx(BaseDisplayComponent, { model: model, children: _jsx(Arcs, { model: model, exportSVG: exportSVG }) }));
|
|
8
7
|
});
|
|
9
8
|
export default LinearArcReactComponent;
|
|
@@ -106,7 +106,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
106
106
|
} & {
|
|
107
107
|
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
108
108
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
109
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region):
|
|
109
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
110
110
|
} & {
|
|
111
111
|
lastDrawnOffsetPx: number;
|
|
112
112
|
features: Feature[] | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearArcDisplayModel } from './model';
|
|
3
2
|
export declare function renderArcSvg(model: LinearArcDisplayModel, _opts: {
|
|
4
3
|
rasterizeLayers?: boolean;
|
|
5
|
-
}): Promise<
|
|
4
|
+
}): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getContainingView, when } from '@jbrowse/core/util';
|
|
3
3
|
import Arcs from './components/Arcs';
|
|
4
4
|
export async function renderArcSvg(model, _opts) {
|
|
@@ -7,10 +7,5 @@ export async function renderArcSvg(model, _opts) {
|
|
|
7
7
|
const width = view.dynamicBlocks.totalWidthPx;
|
|
8
8
|
const height = model.height;
|
|
9
9
|
const clipid = `arc-${model.id}`;
|
|
10
|
-
return (
|
|
11
|
-
React.createElement("defs", null,
|
|
12
|
-
React.createElement("clipPath", { id: clipid },
|
|
13
|
-
React.createElement("rect", { x: 0, y: 0, width: width, height: height }))),
|
|
14
|
-
React.createElement("g", { clipPath: `url(#${clipid})` },
|
|
15
|
-
React.createElement(Arcs, { model: model, exportSVG: true }))));
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("clipPath", { id: clipid, children: _jsx("rect", { x: 0, y: 0, width: width, height: height }) }) }), _jsx("g", { clipPath: `url(#${clipid})`, children: _jsx(Arcs, { model: model, exportSVG: true }) })] }));
|
|
16
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-arc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "JBrowse 2 arc adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -35,23 +35,25 @@
|
|
|
35
35
|
"build:commonjs": "tsc --build tsconfig.build.commonjs.json",
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
|
-
"
|
|
39
|
-
"@jbrowse/core": "^
|
|
40
|
-
"@jbrowse/plugin-linear-genome-view": "^
|
|
41
|
-
"@jbrowse/plugin-wiggle": "^
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@jbrowse/core": "^3.0.1",
|
|
40
|
+
"@jbrowse/plugin-linear-genome-view": "^3.0.1",
|
|
41
|
+
"@jbrowse/plugin-wiggle": "^3.0.1",
|
|
42
42
|
"@mui/material": "^6.0.0",
|
|
43
43
|
"mobx": "^6.0.0",
|
|
44
44
|
"mobx-react": "^9.0.0",
|
|
45
45
|
"mobx-state-tree": "^5.0.0",
|
|
46
|
-
"react": ">=16.8.0",
|
|
47
|
-
"react-dom": ">=16.8.0",
|
|
48
46
|
"rxjs": "^7.0.0"
|
|
49
47
|
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": ">=18.0.0",
|
|
50
|
+
"react-dom": ">=18.0.0"
|
|
51
|
+
},
|
|
50
52
|
"distModule": "esm/index.js",
|
|
51
53
|
"srcModule": "src/index.ts",
|
|
52
54
|
"module": "esm/index.js",
|
|
53
55
|
"publishConfig": {
|
|
54
56
|
"access": "public"
|
|
55
57
|
},
|
|
56
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "aa2f1d1a89d2361c7fd1a93fe29506fa4554f5cc"
|
|
57
59
|
}
|