@jbrowse/plugin-sv-inspector 2.17.0 → 2.18.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/LaunchSvInspectorView/index.d.ts +1 -1
- package/dist/LaunchSvInspectorView/index.js +1 -3
- package/dist/SvInspectorView/components/CircularViewOptions.d.ts +1 -1
- package/dist/SvInspectorView/components/CircularViewOptions.js +1 -1
- package/dist/SvInspectorView/components/SvInspectorView.d.ts +1 -1
- package/dist/SvInspectorView/components/SvInspectorView.js +1 -1
- package/dist/SvInspectorView/index.d.ts +1 -1
- package/dist/SvInspectorView/index.js +26 -13
- package/dist/SvInspectorView/model.d.ts +772 -0
- package/dist/SvInspectorView/{models/SvInspectorView.js → model.js} +50 -161
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -3
- package/esm/LaunchSvInspectorView/index.d.ts +1 -1
- package/esm/LaunchSvInspectorView/index.js +1 -3
- package/esm/SvInspectorView/components/CircularViewOptions.d.ts +1 -1
- package/esm/SvInspectorView/components/CircularViewOptions.js +1 -1
- package/esm/SvInspectorView/components/SvInspectorView.d.ts +1 -1
- package/esm/SvInspectorView/components/SvInspectorView.js +1 -1
- package/esm/SvInspectorView/index.d.ts +1 -1
- package/esm/SvInspectorView/index.js +25 -12
- package/esm/SvInspectorView/model.d.ts +772 -0
- package/esm/SvInspectorView/{models/SvInspectorView.js → model.js} +50 -161
- package/esm/index.d.ts +1 -1
- package/esm/index.js +2 -4
- package/package.json +4 -4
- package/dist/SvInspectorView/models/SvInspectorView.d.ts +0 -1010
- package/dist/SvInspectorView/models/adhocFeatureUtils.d.ts +0 -44
- package/dist/SvInspectorView/models/adhocFeatureUtils.js +0 -96
- package/dist/SvInspectorView/models/breakpointSplitViewFromTableRow.d.ts +0 -4
- package/dist/SvInspectorView/models/breakpointSplitViewFromTableRow.js +0 -48
- package/esm/SvInspectorView/models/SvInspectorView.d.ts +0 -1010
- package/esm/SvInspectorView/models/adhocFeatureUtils.d.ts +0 -44
- package/esm/SvInspectorView/models/adhocFeatureUtils.js +0 -90
- package/esm/SvInspectorView/models/breakpointSplitViewFromTableRow.d.ts +0 -4
- package/esm/SvInspectorView/models/breakpointSplitViewFromTableRow.js +0 -42
|
@@ -3,28 +3,13 @@ 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 clone_1 = __importDefault(require("clone"));
|
|
7
|
-
const mobx_1 = require("mobx");
|
|
8
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
9
|
-
const util_1 = require("@jbrowse/core/util");
|
|
10
6
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
11
|
-
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
12
7
|
const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
|
|
13
|
-
|
|
14
|
-
const
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
9
|
+
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
15
10
|
const FolderOpen_1 = __importDefault(require("@mui/icons-material/FolderOpen"));
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
/**
|
|
19
|
-
* #stateModel SvInspectorView
|
|
20
|
-
* #category view
|
|
21
|
-
* does not extend, but is a combination of a
|
|
22
|
-
* - [SpreadsheetView](../spreadsheetview)
|
|
23
|
-
* - [CircularView](../circularview)
|
|
24
|
-
*
|
|
25
|
-
* extends
|
|
26
|
-
* - [BaseViewModel](../baseviewmodel)
|
|
27
|
-
*/
|
|
11
|
+
const mobx_1 = require("mobx");
|
|
12
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
28
13
|
function SvInspectorViewF(pluginManager) {
|
|
29
14
|
const SpreadsheetViewType = pluginManager.getViewType('SpreadsheetView');
|
|
30
15
|
const CircularViewType = pluginManager.getViewType('CircularView');
|
|
@@ -36,38 +21,14 @@ function SvInspectorViewF(pluginManager) {
|
|
|
36
21
|
const circularViewOptionsBarHeight = 52;
|
|
37
22
|
return mobx_state_tree_1.types
|
|
38
23
|
.compose('SvInspectorView', models_1.BaseViewModel, mobx_state_tree_1.types.model({
|
|
39
|
-
/**
|
|
40
|
-
* #property
|
|
41
|
-
*/
|
|
42
24
|
id: mst_1.ElementId,
|
|
43
|
-
/**
|
|
44
|
-
* #property
|
|
45
|
-
*/
|
|
46
25
|
type: mobx_state_tree_1.types.literal('SvInspectorView'),
|
|
47
|
-
|
|
48
|
-
* #property
|
|
49
|
-
*/
|
|
50
|
-
height: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.refinement('SvInspectorViewHeight', mobx_state_tree_1.types.number, n => n >= minHeight), defaultHeight),
|
|
51
|
-
/**
|
|
52
|
-
* #property
|
|
53
|
-
*/
|
|
26
|
+
height: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.number, defaultHeight),
|
|
54
27
|
onlyDisplayRelevantRegionsInCircularView: false,
|
|
55
|
-
/**
|
|
56
|
-
* #property
|
|
57
|
-
* switch specifying whether we are showing the import wizard or the
|
|
58
|
-
* spreadsheet in our viewing area
|
|
59
|
-
*/
|
|
60
|
-
mode: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.enumeration('SvInspectorViewMode', ['import', 'display']), 'import'),
|
|
61
|
-
/**
|
|
62
|
-
* #property
|
|
63
|
-
*/
|
|
64
28
|
spreadsheetView: mobx_state_tree_1.types.optional(SpreadsheetModel, () => SpreadsheetModel.create({
|
|
65
29
|
type: 'SpreadsheetView',
|
|
66
30
|
hideVerticalResizeHandle: true,
|
|
67
31
|
})),
|
|
68
|
-
/**
|
|
69
|
-
* #property
|
|
70
|
-
*/
|
|
71
32
|
circularView: mobx_state_tree_1.types.optional(CircularModel, () => CircularModel.create({
|
|
72
33
|
type: 'CircularView',
|
|
73
34
|
hideVerticalResizeHandle: true,
|
|
@@ -77,61 +38,51 @@ function SvInspectorViewF(pluginManager) {
|
|
|
77
38
|
}))
|
|
78
39
|
.volatile(() => ({
|
|
79
40
|
width: 800,
|
|
41
|
+
SpreadsheetViewReactComponent: SpreadsheetViewType.ReactComponent,
|
|
42
|
+
CircularViewReactComponent: CircularViewType.ReactComponent,
|
|
43
|
+
circularViewOptionsBarHeight,
|
|
80
44
|
}))
|
|
81
45
|
.views(self => ({
|
|
82
|
-
/**
|
|
83
|
-
* #getter
|
|
84
|
-
*/
|
|
85
|
-
get selectedRows() {
|
|
86
|
-
var _a;
|
|
87
|
-
return (_a = self.spreadsheetView.spreadsheet) === null || _a === void 0 ? void 0 : _a.rowSet.selectedRows;
|
|
88
|
-
},
|
|
89
|
-
/**
|
|
90
|
-
* #getter
|
|
91
|
-
*/
|
|
92
46
|
get assemblyName() {
|
|
93
47
|
const { assembly } = self.spreadsheetView;
|
|
94
48
|
return assembly
|
|
95
49
|
? (0, configuration_1.readConfObject)(assembly, 'name')
|
|
96
50
|
: undefined;
|
|
97
51
|
},
|
|
98
|
-
/**
|
|
99
|
-
* #getter
|
|
100
|
-
*/
|
|
101
52
|
get showCircularView() {
|
|
102
|
-
return self.spreadsheetView.
|
|
53
|
+
return !!self.spreadsheetView.spreadsheet;
|
|
103
54
|
},
|
|
104
|
-
/**
|
|
105
|
-
* #getter
|
|
106
|
-
*/
|
|
107
55
|
get features() {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const { outputRows = [] } = spreadsheetView;
|
|
111
|
-
return outputRows
|
|
112
|
-
.map((r, i) => (0, breakpointSplitViewFromTableRow_1.getFeatureForRow)(session, spreadsheetView, r, i))
|
|
113
|
-
.filter(f => !!f);
|
|
56
|
+
var _a, _b;
|
|
57
|
+
return (((_b = structuredClone((_a = self.spreadsheetView.spreadsheet) === null || _a === void 0 ? void 0 : _a.visibleRows)) === null || _b === void 0 ? void 0 : _b.map(row => row.feature).filter(f => !!f)) || []);
|
|
114
58
|
},
|
|
115
|
-
/**
|
|
116
|
-
* #getter
|
|
117
|
-
*/
|
|
118
59
|
get featuresAdapterConfigSnapshot() {
|
|
119
60
|
return {
|
|
120
61
|
type: 'FromConfigAdapter',
|
|
121
62
|
features: this.features,
|
|
122
63
|
};
|
|
123
64
|
},
|
|
124
|
-
/**
|
|
125
|
-
* #getter
|
|
126
|
-
*/
|
|
127
65
|
get featureRefNames() {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
66
|
+
return [
|
|
67
|
+
...new Set([
|
|
68
|
+
...this.features.map(r => r.refName),
|
|
69
|
+
...this.features.flatMap(r => { var _a; return (_a = r.INFO) === null || _a === void 0 ? void 0 : _a.CHR2; }),
|
|
70
|
+
...this.features.flatMap(r => { var _a; return (_a = r.mate) === null || _a === void 0 ? void 0 : _a.refName; }),
|
|
71
|
+
].filter(f => !!f)),
|
|
72
|
+
];
|
|
73
|
+
},
|
|
74
|
+
get currentAssembly() {
|
|
75
|
+
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
76
|
+
return this.assemblyName
|
|
77
|
+
? assemblyManager.get(this.assemblyName)
|
|
78
|
+
: undefined;
|
|
79
|
+
},
|
|
80
|
+
get canonicalFeatureRefNameSet() {
|
|
81
|
+
const asm = this.currentAssembly;
|
|
82
|
+
return new Set((asm === null || asm === void 0 ? void 0 : asm.initialized)
|
|
83
|
+
? this.featureRefNames.map(r => asm.getCanonicalRefName(r) || r)
|
|
84
|
+
: []);
|
|
131
85
|
},
|
|
132
|
-
/**
|
|
133
|
-
* #getter
|
|
134
|
-
*/
|
|
135
86
|
get featuresCircularTrackConfiguration() {
|
|
136
87
|
return {
|
|
137
88
|
type: 'VariantTrack',
|
|
@@ -144,83 +95,49 @@ function SvInspectorViewF(pluginManager) {
|
|
|
144
95
|
type: 'ChordVariantDisplay',
|
|
145
96
|
displayId: `sv-inspector-variant-track-chord-display-${self.id}`,
|
|
146
97
|
onChordClick: 'jexl:defaultOnChordClick(feature, track, pluginManager)',
|
|
147
|
-
renderer: {
|
|
98
|
+
renderer: {
|
|
99
|
+
type: 'StructuralVariantChordRenderer',
|
|
100
|
+
},
|
|
148
101
|
},
|
|
149
102
|
],
|
|
150
103
|
};
|
|
151
104
|
},
|
|
152
|
-
}))
|
|
153
|
-
.volatile(() => ({
|
|
154
|
-
SpreadsheetViewReactComponent: SpreadsheetViewType.ReactComponent,
|
|
155
|
-
CircularViewReactComponent: CircularViewType.ReactComponent,
|
|
156
|
-
circularViewOptionsBarHeight,
|
|
157
105
|
}))
|
|
158
106
|
.actions(self => ({
|
|
159
|
-
/**
|
|
160
|
-
* #action
|
|
161
|
-
*/
|
|
162
107
|
setWidth(newWidth) {
|
|
163
108
|
self.width = newWidth;
|
|
164
109
|
},
|
|
165
|
-
/**
|
|
166
|
-
* #action
|
|
167
|
-
*/
|
|
168
110
|
setHeight(newHeight) {
|
|
169
111
|
self.height = Math.max(newHeight, minHeight);
|
|
170
112
|
return self.height;
|
|
171
113
|
},
|
|
172
|
-
/**
|
|
173
|
-
* #action
|
|
174
|
-
*/
|
|
175
|
-
setImportMode() {
|
|
176
|
-
self.spreadsheetView.setImportMode();
|
|
177
|
-
},
|
|
178
|
-
/**
|
|
179
|
-
* #action
|
|
180
|
-
*/
|
|
181
|
-
setDisplayMode() {
|
|
182
|
-
self.spreadsheetView.setDisplayMode();
|
|
183
|
-
},
|
|
184
|
-
/**
|
|
185
|
-
* #action
|
|
186
|
-
*/
|
|
187
114
|
setDisplayedRegions(regions) {
|
|
188
115
|
self.circularView.setDisplayedRegions(regions);
|
|
189
116
|
},
|
|
190
|
-
/**
|
|
191
|
-
* #action
|
|
192
|
-
*/
|
|
193
117
|
setOnlyDisplayRelevantRegionsInCircularView(val) {
|
|
194
118
|
self.onlyDisplayRelevantRegionsInCircularView = Boolean(val);
|
|
195
119
|
},
|
|
196
120
|
}))
|
|
197
121
|
.views(self => ({
|
|
198
|
-
/**
|
|
199
|
-
* #method
|
|
200
|
-
*/
|
|
201
122
|
menuItems() {
|
|
202
123
|
return [
|
|
203
124
|
{
|
|
204
125
|
label: 'Return to import form',
|
|
126
|
+
icon: FolderOpen_1.default,
|
|
205
127
|
onClick: () => {
|
|
206
|
-
self.
|
|
128
|
+
self.spreadsheetView.displaySpreadsheet(undefined);
|
|
207
129
|
},
|
|
208
|
-
icon: FolderOpen_1.default,
|
|
209
130
|
},
|
|
210
131
|
];
|
|
211
132
|
},
|
|
212
133
|
}))
|
|
213
134
|
.actions(self => ({
|
|
214
|
-
/**
|
|
215
|
-
* #action
|
|
216
|
-
*/
|
|
217
135
|
resizeHeight(distance) {
|
|
218
136
|
const oldHeight = self.height;
|
|
219
137
|
const newHeight = self.setHeight(self.height + distance);
|
|
220
138
|
return newHeight - oldHeight;
|
|
221
139
|
},
|
|
222
140
|
afterAttach() {
|
|
223
|
-
// synchronize subview widths
|
|
224
141
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
225
142
|
const borderWidth = 1;
|
|
226
143
|
if (self.showCircularView) {
|
|
@@ -233,53 +150,41 @@ function SvInspectorViewF(pluginManager) {
|
|
|
233
150
|
self.spreadsheetView.setWidth(self.width);
|
|
234
151
|
}
|
|
235
152
|
}, { name: 'SvInspectorView width binding' }));
|
|
236
|
-
// synchronize subview heights
|
|
237
153
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
238
154
|
self.spreadsheetView.setHeight(self.height - headerHeight);
|
|
239
155
|
self.circularView.setHeight(self.height - headerHeight - circularViewOptionsBarHeight);
|
|
240
156
|
}, { name: 'SvInspectorView height binding' }));
|
|
241
|
-
// bind circularview displayedRegions to spreadsheet assembly, mediated
|
|
242
|
-
// by the onlyRelevantRegions toggle
|
|
243
157
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(async () => {
|
|
244
|
-
const {
|
|
245
|
-
|
|
246
|
-
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
247
|
-
if (!assemblyName) {
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
const asm = await assemblyManager.waitForAssembly(assemblyName);
|
|
251
|
-
if (!asm) {
|
|
158
|
+
const { onlyDisplayRelevantRegionsInCircularView, circularView, canonicalFeatureRefNameSet, currentAssembly, } = self;
|
|
159
|
+
if (!circularView.initialized || !(currentAssembly === null || currentAssembly === void 0 ? void 0 : currentAssembly.regions)) {
|
|
252
160
|
return;
|
|
253
161
|
}
|
|
254
|
-
const { getCanonicalRefName, regions = [] } = asm;
|
|
255
162
|
if (onlyDisplayRelevantRegionsInCircularView) {
|
|
256
|
-
if (tracks.length === 1) {
|
|
163
|
+
if (circularView.tracks.length === 1) {
|
|
257
164
|
try {
|
|
258
|
-
|
|
259
|
-
const refSet = new Set(featureRefNames.map(r => getCanonicalRefName(r) || r));
|
|
260
|
-
circularView.setDisplayedRegions((0, clone_1.default)(regions.filter(r => refSet.has(r.refName))));
|
|
165
|
+
circularView.setDisplayedRegions(structuredClone(currentAssembly.regions.filter(r => canonicalFeatureRefNameSet.has(r.refName))));
|
|
261
166
|
}
|
|
262
167
|
catch (e) {
|
|
263
|
-
|
|
168
|
+
console.error(e);
|
|
169
|
+
(0, util_1.getSession)(self).notifyError(`${e}`, e);
|
|
264
170
|
}
|
|
265
171
|
}
|
|
266
172
|
}
|
|
267
173
|
else {
|
|
268
|
-
circularView.setDisplayedRegions(regions);
|
|
174
|
+
circularView.setDisplayedRegions(currentAssembly.regions);
|
|
269
175
|
}
|
|
270
176
|
}, { name: 'SvInspectorView displayed regions bind' }));
|
|
271
|
-
// bind circularview tracks to our track snapshot view
|
|
272
177
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.reaction)(() => ({
|
|
273
178
|
generatedTrackConf: self.featuresCircularTrackConfiguration,
|
|
274
179
|
assemblyName: self.assemblyName,
|
|
275
180
|
}), data => {
|
|
181
|
+
if (!data) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
276
184
|
const { assemblyName, generatedTrackConf } = data;
|
|
277
185
|
const { circularView } = self;
|
|
278
|
-
// hide any visible tracks
|
|
279
186
|
circularView.tracks.forEach(t => circularView.hideTrack(t.configuration.trackId));
|
|
280
|
-
// put our track in as the only track
|
|
281
187
|
if (assemblyName) {
|
|
282
|
-
// @ts-expect-error
|
|
283
188
|
circularView.addTrackConf(generatedTrackConf, {
|
|
284
189
|
assemblyName,
|
|
285
190
|
});
|
|
@@ -288,27 +193,11 @@ function SvInspectorViewF(pluginManager) {
|
|
|
288
193
|
name: 'SvInspectorView track configuration binding',
|
|
289
194
|
fireImmediately: true,
|
|
290
195
|
}));
|
|
291
|
-
// bind spreadsheetView row menu actions to us
|
|
292
|
-
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
293
|
-
self.spreadsheetView.setRowMenuItems(
|
|
294
|
-
// these are the MenuItem entries for the row menu actions in the
|
|
295
|
-
// spreadsheet view. these are installed into the child
|
|
296
|
-
// SpreadsheetView using an autorun below
|
|
297
|
-
[
|
|
298
|
-
{
|
|
299
|
-
label: 'Open split detail view',
|
|
300
|
-
icon: OpenInNew_1.default,
|
|
301
|
-
// @ts-expect-error
|
|
302
|
-
disabled(spreadsheetView, spreadsheet, rowNumber, row) {
|
|
303
|
-
return !(0, breakpointSplitViewFromTableRow_1.canOpenBreakpointSplitViewFromTableRow)(self, spreadsheetView, spreadsheet, row, rowNumber);
|
|
304
|
-
},
|
|
305
|
-
onClick(spreadsheetView, spreadsheet, rowNumber, row) {
|
|
306
|
-
(0, breakpointSplitViewFromTableRow_1.openBreakpointSplitViewFromTableRow)(self, spreadsheetView, spreadsheet, row, rowNumber);
|
|
307
|
-
},
|
|
308
|
-
},
|
|
309
|
-
]);
|
|
310
|
-
}));
|
|
311
196
|
},
|
|
312
|
-
}))
|
|
197
|
+
}))
|
|
198
|
+
.postProcessSnapshot(snap => {
|
|
199
|
+
const { circularView, ...rest } = snap;
|
|
200
|
+
return rest;
|
|
201
|
+
});
|
|
313
202
|
}
|
|
314
203
|
exports.default = SvInspectorViewF;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
export default class SvInspectorViewPlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
|
|
7
7
|
const types_1 = require("@jbrowse/core/util/types");
|
|
8
|
-
// icons
|
|
9
8
|
const TableChart_1 = __importDefault(require("@mui/icons-material/TableChart"));
|
|
10
|
-
// locals
|
|
11
|
-
const SvInspectorView_1 = __importDefault(require("./SvInspectorView"));
|
|
12
9
|
const LaunchSvInspectorView_1 = __importDefault(require("./LaunchSvInspectorView"));
|
|
10
|
+
const SvInspectorView_1 = __importDefault(require("./SvInspectorView"));
|
|
13
11
|
class SvInspectorViewPlugin extends Plugin_1.default {
|
|
14
12
|
constructor() {
|
|
15
13
|
super(...arguments);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function LaunchSvInspectorViewF(pluginManager: PluginManager): void;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export default function LaunchSvInspectorViewF(pluginManager) {
|
|
2
|
-
pluginManager.addToExtensionPoint('LaunchView-SvInspectorView',
|
|
3
|
-
// @ts-expect-error
|
|
4
|
-
async ({ session, assembly, uri, fileType, }) => {
|
|
2
|
+
pluginManager.addToExtensionPoint('LaunchView-SvInspectorView', async ({ session, assembly, uri, fileType, }) => {
|
|
5
3
|
var _a, _b;
|
|
6
4
|
const view = session.addView('SvInspectorView');
|
|
7
5
|
const exts = uri.split('.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SvInspectorViewModel } from '../
|
|
2
|
+
import type { SvInspectorViewModel } from '../model';
|
|
3
3
|
declare const CircularViewOptions: ({ svInspector, }: {
|
|
4
4
|
svInspector: SvInspectorViewModel;
|
|
5
5
|
}) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Checkbox, FormControlLabel, Grid } from '@mui/material';
|
|
2
3
|
import { observer } from 'mobx-react';
|
|
3
|
-
import { Grid, FormControlLabel, Checkbox } from '@mui/material';
|
|
4
4
|
import { makeStyles } from 'tss-react/mui';
|
|
5
5
|
const useStyles = makeStyles()(theme => ({
|
|
6
6
|
circularViewOptions: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ResizeHandle } from '@jbrowse/core/ui';
|
|
2
3
|
import { observer } from 'mobx-react';
|
|
3
4
|
import { makeStyles } from 'tss-react/mui';
|
|
4
|
-
import { ResizeHandle } from '@jbrowse/core/ui';
|
|
5
5
|
import CircularViewOptions from './CircularViewOptions';
|
|
6
6
|
const useStyles = makeStyles()(theme => ({
|
|
7
7
|
resizeHandleVert: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function SvInspectorViewF(pluginManager: PluginManager): void;
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
|
|
2
|
-
import ReactComponent from './components/SvInspectorView';
|
|
3
|
-
import stateModelFactory from './models/SvInspectorView';
|
|
4
2
|
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import { navToMultiLevelBreak } from '@jbrowse/sv-core';
|
|
4
|
+
import { getParent } from 'mobx-state-tree';
|
|
5
|
+
import ReactComponent from './components/SvInspectorView';
|
|
6
|
+
import stateModelFactory from './model';
|
|
7
|
+
function defaultOnChordClick(feature, chordTrack) {
|
|
8
|
+
;
|
|
9
|
+
(async () => {
|
|
10
|
+
const session = getSession(chordTrack);
|
|
11
|
+
try {
|
|
12
|
+
session.setSelection(feature);
|
|
13
|
+
const view = getContainingView(chordTrack);
|
|
14
|
+
const parentView = getParent(view);
|
|
15
|
+
const stableViewId = `${parentView.id}_spawned`;
|
|
16
|
+
await navToMultiLevelBreak({
|
|
17
|
+
assemblyName: view.assemblyNames[0],
|
|
18
|
+
session,
|
|
19
|
+
stableViewId,
|
|
20
|
+
feature,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
console.error(e);
|
|
25
|
+
session.notifyError(`${e}`, e);
|
|
26
|
+
}
|
|
27
|
+
})();
|
|
15
28
|
}
|
|
16
29
|
export default function SvInspectorViewF(pluginManager) {
|
|
17
30
|
pluginManager.jexl.addFunction('defaultOnChordClick', defaultOnChordClick);
|