@jbrowse/plugin-linear-comparative-view 2.14.0 → 2.15.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/LinearSyntenyDisplay/components/util.js +6 -5
- package/dist/index.js +0 -2
- package/esm/LinearSyntenyDisplay/components/util.js +7 -6
- package/esm/index.js +0 -2
- package/package.json +4 -4
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +0 -7
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +0 -65
- package/dist/SyntenyFeatureDetail/index.d.ts +0 -2
- package/dist/SyntenyFeatureDetail/index.js +0 -58
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +0 -7
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +0 -37
- package/esm/SyntenyFeatureDetail/index.d.ts +0 -2
- package/esm/SyntenyFeatureDetail/index.js +0 -29
|
@@ -86,6 +86,8 @@ function drawBezierBox(ctx, x1, x2, y1, x3, x4, y2, mid) {
|
|
|
86
86
|
ctx.fill();
|
|
87
87
|
}
|
|
88
88
|
function onSynClick(event, model) {
|
|
89
|
+
const view = (0, util_1.getContainingView)(model);
|
|
90
|
+
const track = (0, util_1.getContainingTrack)(model);
|
|
89
91
|
const ref1 = model.clickMapCanvas;
|
|
90
92
|
const ref2 = model.cigarClickMapCanvas;
|
|
91
93
|
if (!ref1 || !ref2) {
|
|
@@ -108,11 +110,10 @@ function onSynClick(event, model) {
|
|
|
108
110
|
model.setClickId(f.id());
|
|
109
111
|
const session = (0, util_1.getSession)(model);
|
|
110
112
|
if ((0, util_1.isSessionModelWithWidgets)(session)) {
|
|
111
|
-
session.showWidget(session.addWidget('
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
113
|
+
session.showWidget(session.addWidget('BaseFeatureWidget', 'baseFeature', {
|
|
114
|
+
view,
|
|
115
|
+
track,
|
|
116
|
+
featureData: f.toJSON(),
|
|
116
117
|
}));
|
|
117
118
|
}
|
|
118
119
|
}
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,6 @@ const LGVSyntenyDisplay_1 = __importDefault(require("./LGVSyntenyDisplay"));
|
|
|
13
13
|
const LinearSyntenyView_1 = __importDefault(require("./LinearSyntenyView"));
|
|
14
14
|
const LaunchLinearSyntenyView_1 = __importDefault(require("./LaunchLinearSyntenyView"));
|
|
15
15
|
const SyntenyTrack_1 = __importDefault(require("./SyntenyTrack"));
|
|
16
|
-
const SyntenyFeatureDetail_1 = __importDefault(require("./SyntenyFeatureDetail"));
|
|
17
16
|
const LinearReadVsRef_1 = __importDefault(require("./LinearReadVsRef"));
|
|
18
17
|
class LinearComparativeViewPlugin extends Plugin_1.default {
|
|
19
18
|
constructor() {
|
|
@@ -28,7 +27,6 @@ class LinearComparativeViewPlugin extends Plugin_1.default {
|
|
|
28
27
|
(0, LGVSyntenyDisplay_1.default)(pluginManager);
|
|
29
28
|
(0, LaunchLinearSyntenyView_1.default)(pluginManager);
|
|
30
29
|
(0, SyntenyTrack_1.default)(pluginManager);
|
|
31
|
-
(0, SyntenyFeatureDetail_1.default)(pluginManager);
|
|
32
30
|
(0, LinearReadVsRef_1.default)(pluginManager);
|
|
33
31
|
}
|
|
34
32
|
configure(pluginManager) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assembleLocString, doesIntersect2, getSession, isSessionModelWithWidgets, } from '@jbrowse/core/util';
|
|
1
|
+
import { assembleLocString, doesIntersect2, getSession, isSessionModelWithWidgets, getContainingTrack, getContainingView, } from '@jbrowse/core/util';
|
|
2
2
|
// locals
|
|
3
3
|
import { getId, MAX_COLOR_RANGE } from '../drawSynteny';
|
|
4
4
|
export function drawMatchSimple({ feature, ctx, offsets, cb, height, drawCurves, oobLimit, viewWidth, hideTiny, }) {
|
|
@@ -77,6 +77,8 @@ export function drawBezierBox(ctx, x1, x2, y1, x3, x4, y2, mid) {
|
|
|
77
77
|
ctx.fill();
|
|
78
78
|
}
|
|
79
79
|
export function onSynClick(event, model) {
|
|
80
|
+
const view = getContainingView(model);
|
|
81
|
+
const track = getContainingTrack(model);
|
|
80
82
|
const ref1 = model.clickMapCanvas;
|
|
81
83
|
const ref2 = model.cigarClickMapCanvas;
|
|
82
84
|
if (!ref1 || !ref2) {
|
|
@@ -99,11 +101,10 @@ export function onSynClick(event, model) {
|
|
|
99
101
|
model.setClickId(f.id());
|
|
100
102
|
const session = getSession(model);
|
|
101
103
|
if (isSessionModelWithWidgets(session)) {
|
|
102
|
-
session.showWidget(session.addWidget('
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
104
|
+
session.showWidget(session.addWidget('BaseFeatureWidget', 'baseFeature', {
|
|
105
|
+
view,
|
|
106
|
+
track,
|
|
107
|
+
featureData: f.toJSON(),
|
|
107
108
|
}));
|
|
108
109
|
}
|
|
109
110
|
}
|
package/esm/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import LGVSyntenyDisplayF from './LGVSyntenyDisplay';
|
|
|
8
8
|
import LinearSyntenyViewF from './LinearSyntenyView';
|
|
9
9
|
import LaunchLinearSyntenyViewF from './LaunchLinearSyntenyView';
|
|
10
10
|
import SyntenyTrackF from './SyntenyTrack';
|
|
11
|
-
import SyntenyFeatureWidgetF from './SyntenyFeatureDetail';
|
|
12
11
|
import LinearReadVsRefMenuItemF from './LinearReadVsRef';
|
|
13
12
|
export default class LinearComparativeViewPlugin extends Plugin {
|
|
14
13
|
constructor() {
|
|
@@ -23,7 +22,6 @@ export default class LinearComparativeViewPlugin extends Plugin {
|
|
|
23
22
|
LGVSyntenyDisplayF(pluginManager);
|
|
24
23
|
LaunchLinearSyntenyViewF(pluginManager);
|
|
25
24
|
SyntenyTrackF(pluginManager);
|
|
26
|
-
SyntenyFeatureWidgetF(pluginManager);
|
|
27
25
|
LinearReadVsRefMenuItemF(pluginManager);
|
|
28
26
|
}
|
|
29
27
|
configure(pluginManager) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-comparative-view",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "JBrowse 2 linear comparative view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@floating-ui/react": "^0.26.3",
|
|
40
|
-
"@mui/icons-material": "^
|
|
40
|
+
"@mui/icons-material": "^6.0.0",
|
|
41
41
|
"clone": "^2.1.2",
|
|
42
42
|
"copy-to-clipboard": "^3.3.1",
|
|
43
43
|
"file-saver": "^2.0.0"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@jbrowse/core": "^2.0.0",
|
|
47
47
|
"@jbrowse/plugin-alignments": "^2.0.0",
|
|
48
48
|
"@jbrowse/plugin-linear-genome-view": "^2.0.0",
|
|
49
|
-
"@mui/material": "^
|
|
49
|
+
"@mui/material": "^6.0.0",
|
|
50
50
|
"mobx": "^6.0.0",
|
|
51
51
|
"mobx-react": "^9.0.0",
|
|
52
52
|
"mobx-state-tree": "^5.0.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "87eeb1fbf8311dbf88d5e75b5a265f03beffdda8"
|
|
65
65
|
}
|
|
@@ -1,65 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
31
|
-
const material_1 = require("@mui/material");
|
|
32
|
-
const mobx_react_1 = require("mobx-react");
|
|
33
|
-
const BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
|
|
34
|
-
function Formatter({ value }) {
|
|
35
|
-
const [show, setShow] = (0, react_1.useState)(false);
|
|
36
|
-
const [copied, setCopied] = (0, react_1.useState)(false);
|
|
37
|
-
const display = String(value);
|
|
38
|
-
if (display.length > 100) {
|
|
39
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
40
|
-
react_1.default.createElement("button", { type: "button", onClick: () => {
|
|
41
|
-
(0, copy_to_clipboard_1.default)(display);
|
|
42
|
-
setCopied(true);
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
setCopied(false);
|
|
45
|
-
}, 700);
|
|
46
|
-
} }, copied ? 'Copied to clipboard' : 'Copy'),
|
|
47
|
-
react_1.default.createElement("button", { type: "button", onClick: () => {
|
|
48
|
-
setShow(val => !val);
|
|
49
|
-
} }, show ? 'Show less' : 'Show more'),
|
|
50
|
-
react_1.default.createElement("div", null, show ? display : `${display.slice(0, 100)}...`)));
|
|
51
|
-
}
|
|
52
|
-
return react_1.default.createElement("div", null, display);
|
|
53
|
-
}
|
|
54
|
-
function CustomFeatureDetails(props) {
|
|
55
|
-
return (react_1.default.createElement(BaseFeatureDetail_1.BaseAttributes, { ...props, formatter: (value) => react_1.default.createElement(Formatter, { value: value }) }));
|
|
56
|
-
}
|
|
57
|
-
const SyntenyFeatureDetail = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
58
|
-
const { feature1, feature2 } = JSON.parse(JSON.stringify(model.featureData));
|
|
59
|
-
return (react_1.default.createElement(material_1.Paper, { "data-testid": "alignment-side-drawer" },
|
|
60
|
-
react_1.default.createElement(BaseFeatureDetail_1.BaseCoreDetails, { title: "Feature 1", feature: feature1 }),
|
|
61
|
-
react_1.default.createElement(BaseFeatureDetail_1.BaseCoreDetails, { title: "Feature 2", feature: feature2 }),
|
|
62
|
-
react_1.default.createElement(CustomFeatureDetails, { feature: feature1 }),
|
|
63
|
-
react_1.default.createElement(CustomFeatureDetails, { feature: feature2 })));
|
|
64
|
-
});
|
|
65
|
-
exports.default = SyntenyFeatureDetail;
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.default = SyntenyFeatureWidgetF;
|
|
30
|
-
const react_1 = require("react");
|
|
31
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
32
|
-
const WidgetType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/WidgetType"));
|
|
33
|
-
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
34
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
35
|
-
const configSchema = (0, configuration_1.ConfigurationSchema)('SyntenyFeatureWidget', {});
|
|
36
|
-
const stateModel = mobx_state_tree_1.types
|
|
37
|
-
.model('SyntenyFeatureWidget', {
|
|
38
|
-
id: mst_1.ElementId,
|
|
39
|
-
type: mobx_state_tree_1.types.literal('SyntenyFeatureWidget'),
|
|
40
|
-
featureData: mobx_state_tree_1.types.frozen(),
|
|
41
|
-
})
|
|
42
|
-
.actions(self => ({
|
|
43
|
-
setFeatureData(data) {
|
|
44
|
-
self.featureData = data;
|
|
45
|
-
},
|
|
46
|
-
clearFeatureData() {
|
|
47
|
-
self.featureData = undefined;
|
|
48
|
-
},
|
|
49
|
-
}));
|
|
50
|
-
function SyntenyFeatureWidgetF(pluginManager) {
|
|
51
|
-
pluginManager.addWidgetType(() => new WidgetType_1.default({
|
|
52
|
-
name: 'SyntenyFeatureWidget',
|
|
53
|
-
heading: 'Synteny feature details',
|
|
54
|
-
configSchema,
|
|
55
|
-
stateModel,
|
|
56
|
-
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./SyntenyFeatureDetail')))),
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import copy from 'copy-to-clipboard';
|
|
3
|
-
import { Paper } from '@mui/material';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
import { BaseCoreDetails, BaseAttributes, } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
|
|
6
|
-
function Formatter({ value }) {
|
|
7
|
-
const [show, setShow] = useState(false);
|
|
8
|
-
const [copied, setCopied] = useState(false);
|
|
9
|
-
const display = String(value);
|
|
10
|
-
if (display.length > 100) {
|
|
11
|
-
return (React.createElement(React.Fragment, null,
|
|
12
|
-
React.createElement("button", { type: "button", onClick: () => {
|
|
13
|
-
copy(display);
|
|
14
|
-
setCopied(true);
|
|
15
|
-
setTimeout(() => {
|
|
16
|
-
setCopied(false);
|
|
17
|
-
}, 700);
|
|
18
|
-
} }, copied ? 'Copied to clipboard' : 'Copy'),
|
|
19
|
-
React.createElement("button", { type: "button", onClick: () => {
|
|
20
|
-
setShow(val => !val);
|
|
21
|
-
} }, show ? 'Show less' : 'Show more'),
|
|
22
|
-
React.createElement("div", null, show ? display : `${display.slice(0, 100)}...`)));
|
|
23
|
-
}
|
|
24
|
-
return React.createElement("div", null, display);
|
|
25
|
-
}
|
|
26
|
-
function CustomFeatureDetails(props) {
|
|
27
|
-
return (React.createElement(BaseAttributes, { ...props, formatter: (value) => React.createElement(Formatter, { value: value }) }));
|
|
28
|
-
}
|
|
29
|
-
const SyntenyFeatureDetail = observer(function ({ model, }) {
|
|
30
|
-
const { feature1, feature2 } = JSON.parse(JSON.stringify(model.featureData));
|
|
31
|
-
return (React.createElement(Paper, { "data-testid": "alignment-side-drawer" },
|
|
32
|
-
React.createElement(BaseCoreDetails, { title: "Feature 1", feature: feature1 }),
|
|
33
|
-
React.createElement(BaseCoreDetails, { title: "Feature 2", feature: feature2 }),
|
|
34
|
-
React.createElement(CustomFeatureDetails, { feature: feature1 }),
|
|
35
|
-
React.createElement(CustomFeatureDetails, { feature: feature2 })));
|
|
36
|
-
});
|
|
37
|
-
export default SyntenyFeatureDetail;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { lazy } from 'react';
|
|
2
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
|
-
import WidgetType from '@jbrowse/core/pluggableElementTypes/WidgetType';
|
|
4
|
-
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
|
-
import { types } from 'mobx-state-tree';
|
|
6
|
-
const configSchema = ConfigurationSchema('SyntenyFeatureWidget', {});
|
|
7
|
-
const stateModel = types
|
|
8
|
-
.model('SyntenyFeatureWidget', {
|
|
9
|
-
id: ElementId,
|
|
10
|
-
type: types.literal('SyntenyFeatureWidget'),
|
|
11
|
-
featureData: types.frozen(),
|
|
12
|
-
})
|
|
13
|
-
.actions(self => ({
|
|
14
|
-
setFeatureData(data) {
|
|
15
|
-
self.featureData = data;
|
|
16
|
-
},
|
|
17
|
-
clearFeatureData() {
|
|
18
|
-
self.featureData = undefined;
|
|
19
|
-
},
|
|
20
|
-
}));
|
|
21
|
-
export default function SyntenyFeatureWidgetF(pluginManager) {
|
|
22
|
-
pluginManager.addWidgetType(() => new WidgetType({
|
|
23
|
-
name: 'SyntenyFeatureWidget',
|
|
24
|
-
heading: 'Synteny feature details',
|
|
25
|
-
configSchema,
|
|
26
|
-
stateModel,
|
|
27
|
-
ReactComponent: lazy(() => import('./SyntenyFeatureDetail')),
|
|
28
|
-
}));
|
|
29
|
-
}
|