@jbrowse/plugin-linear-comparative-view 2.9.0 → 2.10.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/LGVSyntenyDisplay/configSchemaF.d.ts +2 -0
- package/dist/LGVSyntenyDisplay/configSchemaF.js +2 -0
- package/dist/LGVSyntenyDisplay/model.d.ts +18 -7
- package/dist/LGVSyntenyDisplay/model.js +13 -3
- package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +35 -27
- package/dist/LinearComparativeDisplay/stateModelFactory.js +2 -0
- package/dist/LinearComparativeView/model.d.ts +27 -12
- package/dist/LinearComparativeView/model.js +2 -0
- package/dist/LinearReadVsRef/index.js +26 -2
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +185 -96
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +13 -0
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +57 -0
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -3
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +19 -51
- package/dist/LinearSyntenyDisplay/model.d.ts +27 -17
- package/dist/LinearSyntenyDisplay/model.js +2 -1
- package/dist/LinearSyntenyView/model.d.ts +119 -54
- package/dist/LinearSyntenyView/model.js +8 -1
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +6 -6
- package/dist/SyntenyTrack/configSchema.js +2 -0
- package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +2 -0
- package/esm/LGVSyntenyDisplay/configSchemaF.js +2 -0
- package/esm/LGVSyntenyDisplay/model.d.ts +18 -7
- package/esm/LGVSyntenyDisplay/model.js +13 -3
- package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +35 -27
- package/esm/LinearComparativeDisplay/stateModelFactory.js +2 -0
- package/esm/LinearComparativeView/model.d.ts +27 -12
- package/esm/LinearComparativeView/model.js +2 -0
- package/esm/LinearReadVsRef/index.js +2 -1
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +186 -97
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +13 -0
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +51 -0
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -3
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +18 -30
- package/esm/LinearSyntenyDisplay/model.d.ts +27 -17
- package/esm/LinearSyntenyDisplay/model.js +2 -1
- package/esm/LinearSyntenyView/model.d.ts +119 -54
- package/esm/LinearSyntenyView/model.js +8 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +6 -6
- package/esm/SyntenyTrack/configSchema.js +2 -0
- package/package.json +4 -5
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
3
|
+
import { Menu } from '@jbrowse/core/ui';
|
|
4
|
+
export default function SyntenyContextMenu({ model, onClose, anchorEl, }) {
|
|
5
|
+
const view = getContainingView(model);
|
|
6
|
+
const { clientX, clientY, feature } = anchorEl;
|
|
7
|
+
return (React.createElement(Menu, { onMenuItemClick: (event, callback) => {
|
|
8
|
+
callback(event);
|
|
9
|
+
onClose();
|
|
10
|
+
}, anchorEl: {
|
|
11
|
+
nodeType: 1,
|
|
12
|
+
getBoundingClientRect: () => {
|
|
13
|
+
const x = clientX;
|
|
14
|
+
const y = clientY;
|
|
15
|
+
return {
|
|
16
|
+
top: y,
|
|
17
|
+
left: x,
|
|
18
|
+
bottom: y,
|
|
19
|
+
right: x,
|
|
20
|
+
width: 0,
|
|
21
|
+
height: 0,
|
|
22
|
+
x,
|
|
23
|
+
y,
|
|
24
|
+
toJSON() { },
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
}, onClose: onClose, open: Boolean(anchorEl), menuItems: [
|
|
28
|
+
{
|
|
29
|
+
label: 'Center on feature',
|
|
30
|
+
onClick: () => {
|
|
31
|
+
const { f } = feature;
|
|
32
|
+
const start = f.get('start');
|
|
33
|
+
const end = f.get('end');
|
|
34
|
+
const refName = f.get('refName');
|
|
35
|
+
const mate = f.get('mate');
|
|
36
|
+
view.views[0]
|
|
37
|
+
.navToLocString(`${refName}:${start}-${end}`)
|
|
38
|
+
.catch(e => {
|
|
39
|
+
console.error(e);
|
|
40
|
+
getSession(model).notify(`${e}`, 'error');
|
|
41
|
+
});
|
|
42
|
+
view.views[1]
|
|
43
|
+
.navToLocString(`${mate.refName}:${mate.start}-${mate.end}`)
|
|
44
|
+
.catch(e => {
|
|
45
|
+
console.error(e);
|
|
46
|
+
getSession(model).notify(`${e}`, 'error');
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
] }));
|
|
51
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
|
-
import { Portal, alpha } from '@mui/material';
|
|
3
|
+
import { Portal, useTheme, alpha } from '@mui/material';
|
|
4
4
|
import { makeStyles } from 'tss-react/mui';
|
|
5
|
-
import {
|
|
5
|
+
import { useClientPoint, useFloating, useInteractions, } from '@floating-ui/react';
|
|
6
6
|
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
7
7
|
function round(value) {
|
|
8
8
|
return Math.round(value * 1e5) / 1e5;
|
|
@@ -24,34 +24,22 @@ const useStyles = makeStyles()(theme => ({
|
|
|
24
24
|
wordWrap: 'break-word',
|
|
25
25
|
},
|
|
26
26
|
}));
|
|
27
|
-
const SyntenyTooltip = observer(function ({
|
|
28
|
-
|
|
29
|
-
const
|
|
27
|
+
const SyntenyTooltip = observer(function ({ title }) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const theme = useTheme();
|
|
30
30
|
const { classes } = useStyles();
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
toJSON() { },
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
}), [x, y, width]);
|
|
47
|
-
const { styles, attributes } = usePopper(virtElement, anchorEl);
|
|
48
|
-
return title ? (React.createElement(Portal, null,
|
|
49
|
-
React.createElement("div", { ref: ref => {
|
|
50
|
-
setWidth((ref === null || ref === void 0 ? void 0 : ref.getBoundingClientRect().width) || 0);
|
|
51
|
-
setAnchorEl(ref);
|
|
52
|
-
}, className: classes.tooltip,
|
|
53
|
-
// zIndex needed to go over widget drawer
|
|
54
|
-
style: { ...styles.popper, zIndex: 100000 }, ...attributes.popper },
|
|
31
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
32
|
+
placement: 'right',
|
|
33
|
+
});
|
|
34
|
+
const clientPoint = useClientPoint(context);
|
|
35
|
+
const { getFloatingProps } = useInteractions([clientPoint]);
|
|
36
|
+
const popperTheme = (_a = theme === null || theme === void 0 ? void 0 : theme.components) === null || _a === void 0 ? void 0 : _a.MuiPopper;
|
|
37
|
+
return title ? (React.createElement(Portal, { container: (_b = popperTheme === null || popperTheme === void 0 ? void 0 : popperTheme.defaultProps) === null || _b === void 0 ? void 0 : _b.container },
|
|
38
|
+
React.createElement("div", { className: classes.tooltip, ref: refs.setFloating, style: {
|
|
39
|
+
...floatingStyles,
|
|
40
|
+
zIndex: 100000,
|
|
41
|
+
pointerEvents: 'none',
|
|
42
|
+
}, ...getFloatingProps() },
|
|
55
43
|
React.createElement(SanitizedHTML, { html: title })))) : null;
|
|
56
44
|
});
|
|
57
45
|
export default SyntenyTooltip;
|
|
@@ -5,7 +5,7 @@ import { Feature } from '@jbrowse/core/util';
|
|
|
5
5
|
interface Pos {
|
|
6
6
|
offsetPx: number;
|
|
7
7
|
}
|
|
8
|
-
interface FeatPos {
|
|
8
|
+
export interface FeatPos {
|
|
9
9
|
p11: Pos;
|
|
10
10
|
p12: Pos;
|
|
11
11
|
p21: Pos;
|
|
@@ -15,7 +15,8 @@ interface FeatPos {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* #stateModel LinearSyntenyDisplay
|
|
18
|
-
* extends
|
|
18
|
+
* extends
|
|
19
|
+
* - [LinearComparativeDisplay](../linearcomparativedisplay)
|
|
19
20
|
*/
|
|
20
21
|
declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
21
22
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
@@ -77,17 +78,20 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
77
78
|
rendererTypeName: string;
|
|
78
79
|
error: unknown;
|
|
79
80
|
message: string | undefined;
|
|
80
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
81
|
-
* #action
|
|
82
|
-
*/
|
|
81
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
83
82
|
}> | null;
|
|
84
83
|
readonly adapterConfig: any;
|
|
85
84
|
readonly parentTrack: any;
|
|
86
|
-
renderProps(): any;
|
|
85
|
+
renderProps(): any; /**
|
|
86
|
+
* #getter
|
|
87
|
+
*/
|
|
87
88
|
readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
|
|
88
89
|
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
89
90
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
90
|
-
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
91
|
+
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[]; /**
|
|
92
|
+
* #getter
|
|
93
|
+
* used for synteny svg rendering
|
|
94
|
+
*/
|
|
91
95
|
regionCannotBeRendered(): null;
|
|
92
96
|
} & {
|
|
93
97
|
setMessage(arg?: string | undefined): void;
|
|
@@ -154,17 +158,20 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
154
158
|
rendererTypeName: string;
|
|
155
159
|
error: unknown;
|
|
156
160
|
message: string | undefined;
|
|
157
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
158
|
-
* #action
|
|
159
|
-
*/
|
|
161
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
160
162
|
}> | null;
|
|
161
163
|
readonly adapterConfig: any;
|
|
162
164
|
readonly parentTrack: any;
|
|
163
|
-
renderProps(): any;
|
|
165
|
+
renderProps(): any; /**
|
|
166
|
+
* #getter
|
|
167
|
+
*/
|
|
164
168
|
readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
|
|
165
169
|
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
166
170
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
167
|
-
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
171
|
+
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[]; /**
|
|
172
|
+
* #getter
|
|
173
|
+
* used for synteny svg rendering
|
|
174
|
+
*/
|
|
168
175
|
regionCannotBeRendered(): null;
|
|
169
176
|
} & {
|
|
170
177
|
setMessage(arg?: string | undefined): void;
|
|
@@ -226,17 +233,20 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
226
233
|
rendererTypeName: string;
|
|
227
234
|
error: unknown;
|
|
228
235
|
message: string | undefined;
|
|
229
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
230
|
-
* #action
|
|
231
|
-
*/
|
|
236
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
232
237
|
}> | null;
|
|
233
238
|
readonly adapterConfig: any;
|
|
234
239
|
readonly parentTrack: any;
|
|
235
|
-
renderProps(): any;
|
|
240
|
+
renderProps(): any; /**
|
|
241
|
+
* #getter
|
|
242
|
+
*/
|
|
236
243
|
readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
|
|
237
244
|
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
238
245
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
239
|
-
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
246
|
+
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[]; /**
|
|
247
|
+
* #getter
|
|
248
|
+
* used for synteny svg rendering
|
|
249
|
+
*/
|
|
240
250
|
regionCannotBeRendered(): null;
|
|
241
251
|
} & {
|
|
242
252
|
setMessage(arg?: string | undefined): void;
|
|
@@ -4,7 +4,8 @@ import { getConf, ConfigurationReference, } from '@jbrowse/core/configuration';
|
|
|
4
4
|
import baseModelFactory from '../LinearComparativeDisplay/stateModelFactory';
|
|
5
5
|
/**
|
|
6
6
|
* #stateModel LinearSyntenyDisplay
|
|
7
|
-
* extends
|
|
7
|
+
* extends
|
|
8
|
+
* - [LinearComparativeDisplay](../linearcomparativedisplay)
|
|
8
9
|
*/
|
|
9
10
|
function stateModelFactory(configSchema) {
|
|
10
11
|
return types
|
|
@@ -6,7 +6,9 @@ export interface ExportSvgOptions {
|
|
|
6
6
|
rasterizeLayers?: boolean;
|
|
7
7
|
scale?: number;
|
|
8
8
|
filename?: string;
|
|
9
|
-
Wrapper?: React.FC<
|
|
9
|
+
Wrapper?: React.FC<{
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}>;
|
|
10
12
|
fontSize?: number;
|
|
11
13
|
rulerHeight?: number;
|
|
12
14
|
textHeight?: number;
|
|
@@ -18,7 +20,8 @@ export interface ExportSvgOptions {
|
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* #stateModel LinearSyntenyView
|
|
21
|
-
* extends
|
|
23
|
+
* extends
|
|
24
|
+
* - [LinearComparativeView](../linearcomparativeview)
|
|
22
25
|
*/
|
|
23
26
|
export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
24
27
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
@@ -45,10 +48,14 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
45
48
|
displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
46
49
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
47
50
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
48
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
51
|
+
end: import("mobx-state-tree").ISimpleType<number>; /**
|
|
52
|
+
* #property/
|
|
53
|
+
*/
|
|
49
54
|
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
50
55
|
} & {
|
|
51
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
56
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>; /**
|
|
57
|
+
* #action
|
|
58
|
+
*/
|
|
52
59
|
}, {
|
|
53
60
|
setRefName(newRefName: string): void;
|
|
54
61
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -203,11 +210,11 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
203
210
|
} & {
|
|
204
211
|
getConf(arg: string): any;
|
|
205
212
|
} & {
|
|
206
|
-
readonly initialized: boolean;
|
|
207
|
-
|
|
208
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined; /**
|
|
209
|
-
* #property
|
|
213
|
+
readonly initialized: boolean; /**
|
|
214
|
+
* #property/
|
|
210
215
|
*/
|
|
216
|
+
readonly name: string;
|
|
217
|
+
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
211
218
|
readonly aliases: string[];
|
|
212
219
|
readonly displayName: string | undefined;
|
|
213
220
|
hasName(name: string): boolean;
|
|
@@ -237,11 +244,17 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
237
244
|
load(): Promise<void>;
|
|
238
245
|
loadPre(): Promise<void>;
|
|
239
246
|
} & {
|
|
240
|
-
getAdapterMapEntry(adapterConf:
|
|
241
|
-
|
|
247
|
+
getAdapterMapEntry(adapterConf: {
|
|
248
|
+
[x: string]: unknown;
|
|
249
|
+
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
250
|
+
getRefNameMapForAdapter(adapterConf: {
|
|
251
|
+
[x: string]: unknown;
|
|
252
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
242
253
|
[x: string]: string | undefined;
|
|
243
254
|
}>;
|
|
244
|
-
getReverseRefNameMapForAdapter(adapterConf:
|
|
255
|
+
getReverseRefNameMapForAdapter(adapterConf: {
|
|
256
|
+
[x: string]: unknown;
|
|
257
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
245
258
|
[x: string]: string | undefined;
|
|
246
259
|
}>;
|
|
247
260
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -261,11 +274,11 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
261
274
|
} & {
|
|
262
275
|
getConf(arg: string): any;
|
|
263
276
|
} & {
|
|
264
|
-
readonly initialized: boolean;
|
|
265
|
-
|
|
266
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined; /**
|
|
267
|
-
* #property
|
|
277
|
+
readonly initialized: boolean; /**
|
|
278
|
+
* #property/
|
|
268
279
|
*/
|
|
280
|
+
readonly name: string;
|
|
281
|
+
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
269
282
|
readonly aliases: string[];
|
|
270
283
|
readonly displayName: string | undefined;
|
|
271
284
|
hasName(name: string): boolean;
|
|
@@ -295,11 +308,17 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
295
308
|
load(): Promise<void>;
|
|
296
309
|
loadPre(): Promise<void>;
|
|
297
310
|
} & {
|
|
298
|
-
getAdapterMapEntry(adapterConf:
|
|
299
|
-
|
|
311
|
+
getAdapterMapEntry(adapterConf: {
|
|
312
|
+
[x: string]: unknown;
|
|
313
|
+
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
314
|
+
getRefNameMapForAdapter(adapterConf: {
|
|
315
|
+
[x: string]: unknown;
|
|
316
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
300
317
|
[x: string]: string | undefined;
|
|
301
318
|
}>;
|
|
302
|
-
getReverseRefNameMapForAdapter(adapterConf:
|
|
319
|
+
getReverseRefNameMapForAdapter(adapterConf: {
|
|
320
|
+
[x: string]: unknown;
|
|
321
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
303
322
|
[x: string]: string | undefined;
|
|
304
323
|
}>;
|
|
305
324
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -380,10 +399,14 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
380
399
|
displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
381
400
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
382
401
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
383
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
402
|
+
end: import("mobx-state-tree").ISimpleType<number>; /**
|
|
403
|
+
* #property/
|
|
404
|
+
*/
|
|
384
405
|
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
385
406
|
} & {
|
|
386
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
407
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>; /**
|
|
408
|
+
* #action
|
|
409
|
+
*/
|
|
387
410
|
}, {
|
|
388
411
|
setRefName(newRefName: string): void;
|
|
389
412
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -407,19 +430,27 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
407
430
|
displayedRegions: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IModelType<{
|
|
408
431
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
409
432
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
410
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
433
|
+
end: import("mobx-state-tree").ISimpleType<number>; /**
|
|
434
|
+
* #property/
|
|
435
|
+
*/
|
|
411
436
|
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
412
437
|
} & {
|
|
413
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
438
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>; /**
|
|
439
|
+
* #action
|
|
440
|
+
*/
|
|
414
441
|
}, {
|
|
415
442
|
setRefName(newRefName: string): void;
|
|
416
443
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
417
444
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
418
445
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
419
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
446
|
+
end: import("mobx-state-tree").ISimpleType<number>; /**
|
|
447
|
+
* #property/
|
|
448
|
+
*/
|
|
420
449
|
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
421
450
|
} & {
|
|
422
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
451
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>; /**
|
|
452
|
+
* #action
|
|
453
|
+
*/
|
|
423
454
|
}, {
|
|
424
455
|
setRefName(newRefName: string): void;
|
|
425
456
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
@@ -574,11 +605,11 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
574
605
|
} & {
|
|
575
606
|
getConf(arg: string): any;
|
|
576
607
|
} & {
|
|
577
|
-
readonly initialized: boolean;
|
|
578
|
-
|
|
579
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined; /**
|
|
580
|
-
* #property
|
|
608
|
+
readonly initialized: boolean; /**
|
|
609
|
+
* #property/
|
|
581
610
|
*/
|
|
611
|
+
readonly name: string;
|
|
612
|
+
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
582
613
|
readonly aliases: string[];
|
|
583
614
|
readonly displayName: string | undefined;
|
|
584
615
|
hasName(name: string): boolean;
|
|
@@ -608,11 +639,17 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
608
639
|
load(): Promise<void>;
|
|
609
640
|
loadPre(): Promise<void>;
|
|
610
641
|
} & {
|
|
611
|
-
getAdapterMapEntry(adapterConf:
|
|
612
|
-
|
|
642
|
+
getAdapterMapEntry(adapterConf: {
|
|
643
|
+
[x: string]: unknown;
|
|
644
|
+
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
645
|
+
getRefNameMapForAdapter(adapterConf: {
|
|
646
|
+
[x: string]: unknown;
|
|
647
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
613
648
|
[x: string]: string | undefined;
|
|
614
649
|
}>;
|
|
615
|
-
getReverseRefNameMapForAdapter(adapterConf:
|
|
650
|
+
getReverseRefNameMapForAdapter(adapterConf: {
|
|
651
|
+
[x: string]: unknown;
|
|
652
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
616
653
|
[x: string]: string | undefined;
|
|
617
654
|
}>;
|
|
618
655
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -632,11 +669,11 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
632
669
|
} & {
|
|
633
670
|
getConf(arg: string): any;
|
|
634
671
|
} & {
|
|
635
|
-
readonly initialized: boolean;
|
|
636
|
-
|
|
637
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined; /**
|
|
638
|
-
* #property
|
|
672
|
+
readonly initialized: boolean; /**
|
|
673
|
+
* #property/
|
|
639
674
|
*/
|
|
675
|
+
readonly name: string;
|
|
676
|
+
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
640
677
|
readonly aliases: string[];
|
|
641
678
|
readonly displayName: string | undefined;
|
|
642
679
|
hasName(name: string): boolean;
|
|
@@ -666,11 +703,17 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
666
703
|
load(): Promise<void>;
|
|
667
704
|
loadPre(): Promise<void>;
|
|
668
705
|
} & {
|
|
669
|
-
getAdapterMapEntry(adapterConf:
|
|
670
|
-
|
|
706
|
+
getAdapterMapEntry(adapterConf: {
|
|
707
|
+
[x: string]: unknown;
|
|
708
|
+
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
709
|
+
getRefNameMapForAdapter(adapterConf: {
|
|
710
|
+
[x: string]: unknown;
|
|
711
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
671
712
|
[x: string]: string | undefined;
|
|
672
713
|
}>;
|
|
673
|
-
getReverseRefNameMapForAdapter(adapterConf:
|
|
714
|
+
getReverseRefNameMapForAdapter(adapterConf: {
|
|
715
|
+
[x: string]: unknown;
|
|
716
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
674
717
|
[x: string]: string | undefined;
|
|
675
718
|
}>;
|
|
676
719
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -725,10 +768,14 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
725
768
|
displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
726
769
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
727
770
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
728
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
771
|
+
end: import("mobx-state-tree").ISimpleType<number>; /**
|
|
772
|
+
* #property/
|
|
773
|
+
*/
|
|
729
774
|
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
730
775
|
} & {
|
|
731
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
776
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>; /**
|
|
777
|
+
* #action
|
|
778
|
+
*/
|
|
732
779
|
}, {
|
|
733
780
|
setRefName(newRefName: string): void;
|
|
734
781
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -883,11 +930,11 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
883
930
|
} & {
|
|
884
931
|
getConf(arg: string): any;
|
|
885
932
|
} & {
|
|
886
|
-
readonly initialized: boolean;
|
|
887
|
-
|
|
888
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined; /**
|
|
889
|
-
* #property
|
|
933
|
+
readonly initialized: boolean; /**
|
|
934
|
+
* #property/
|
|
890
935
|
*/
|
|
936
|
+
readonly name: string;
|
|
937
|
+
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
891
938
|
readonly aliases: string[];
|
|
892
939
|
readonly displayName: string | undefined;
|
|
893
940
|
hasName(name: string): boolean;
|
|
@@ -917,11 +964,17 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
917
964
|
load(): Promise<void>;
|
|
918
965
|
loadPre(): Promise<void>;
|
|
919
966
|
} & {
|
|
920
|
-
getAdapterMapEntry(adapterConf:
|
|
921
|
-
|
|
967
|
+
getAdapterMapEntry(adapterConf: {
|
|
968
|
+
[x: string]: unknown;
|
|
969
|
+
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
970
|
+
getRefNameMapForAdapter(adapterConf: {
|
|
971
|
+
[x: string]: unknown;
|
|
972
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
922
973
|
[x: string]: string | undefined;
|
|
923
974
|
}>;
|
|
924
|
-
getReverseRefNameMapForAdapter(adapterConf:
|
|
975
|
+
getReverseRefNameMapForAdapter(adapterConf: {
|
|
976
|
+
[x: string]: unknown;
|
|
977
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
925
978
|
[x: string]: string | undefined;
|
|
926
979
|
}>;
|
|
927
980
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -941,11 +994,11 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
941
994
|
} & {
|
|
942
995
|
getConf(arg: string): any;
|
|
943
996
|
} & {
|
|
944
|
-
readonly initialized: boolean;
|
|
945
|
-
|
|
946
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined; /**
|
|
947
|
-
* #property
|
|
997
|
+
readonly initialized: boolean; /**
|
|
998
|
+
* #property/
|
|
948
999
|
*/
|
|
1000
|
+
readonly name: string;
|
|
1001
|
+
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
949
1002
|
readonly aliases: string[];
|
|
950
1003
|
readonly displayName: string | undefined;
|
|
951
1004
|
hasName(name: string): boolean;
|
|
@@ -975,11 +1028,17 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
975
1028
|
load(): Promise<void>;
|
|
976
1029
|
loadPre(): Promise<void>;
|
|
977
1030
|
} & {
|
|
978
|
-
getAdapterMapEntry(adapterConf:
|
|
979
|
-
|
|
1031
|
+
getAdapterMapEntry(adapterConf: {
|
|
1032
|
+
[x: string]: unknown;
|
|
1033
|
+
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
1034
|
+
getRefNameMapForAdapter(adapterConf: {
|
|
1035
|
+
[x: string]: unknown;
|
|
1036
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
980
1037
|
[x: string]: string | undefined;
|
|
981
1038
|
}>;
|
|
982
|
-
getReverseRefNameMapForAdapter(adapterConf:
|
|
1039
|
+
getReverseRefNameMapForAdapter(adapterConf: {
|
|
1040
|
+
[x: string]: unknown;
|
|
1041
|
+
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
983
1042
|
[x: string]: string | undefined;
|
|
984
1043
|
}>;
|
|
985
1044
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -1056,6 +1115,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
1056
1115
|
*/
|
|
1057
1116
|
showAllRegions(): void;
|
|
1058
1117
|
} & {
|
|
1118
|
+
/**
|
|
1119
|
+
* #action
|
|
1120
|
+
*/
|
|
1059
1121
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
1060
1122
|
} & {
|
|
1061
1123
|
/**
|
|
@@ -1105,6 +1167,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
1105
1167
|
checked?: undefined;
|
|
1106
1168
|
type?: undefined;
|
|
1107
1169
|
})[];
|
|
1170
|
+
/**
|
|
1171
|
+
* #method
|
|
1172
|
+
*/
|
|
1108
1173
|
menuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
1109
1174
|
label: string;
|
|
1110
1175
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
@@ -15,7 +15,8 @@ import baseModel from '../LinearComparativeView/model';
|
|
|
15
15
|
const ExportSvgDialog = lazy(() => import('./components/ExportSvgDialog'));
|
|
16
16
|
/**
|
|
17
17
|
* #stateModel LinearSyntenyView
|
|
18
|
-
* extends
|
|
18
|
+
* extends
|
|
19
|
+
* - [LinearComparativeView](../linearcomparativeview)
|
|
19
20
|
*/
|
|
20
21
|
export default function stateModelFactory(pluginManager) {
|
|
21
22
|
return types
|
|
@@ -56,6 +57,9 @@ export default function stateModelFactory(pluginManager) {
|
|
|
56
57
|
},
|
|
57
58
|
}))
|
|
58
59
|
.actions(self => ({
|
|
60
|
+
/**
|
|
61
|
+
* #action
|
|
62
|
+
*/
|
|
59
63
|
async exportSvg(opts) {
|
|
60
64
|
const { renderToSvg } = await import('./svgcomponents/SVGLinearSyntenyView');
|
|
61
65
|
const html = await renderToSvg(self, opts);
|
|
@@ -120,6 +124,9 @@ export default function stateModelFactory(pluginManager) {
|
|
|
120
124
|
},
|
|
121
125
|
];
|
|
122
126
|
},
|
|
127
|
+
/**
|
|
128
|
+
* #method
|
|
129
|
+
*/
|
|
123
130
|
menuItems() {
|
|
124
131
|
return [
|
|
125
132
|
...superMenuItems(),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ThemeProvider } from '@mui/material';
|
|
3
|
-
import {
|
|
3
|
+
import { getRoot } from 'mobx-state-tree';
|
|
4
4
|
import { when } from 'mobx';
|
|
5
|
-
import { getSession, getSerializedSvg, max, measureText, ReactRendering, renderToAbstractCanvas, sum, } from '@jbrowse/core/util';
|
|
5
|
+
import { getSession, getSerializedSvg, max, measureText, ReactRendering, renderToAbstractCanvas, renderToStaticMarkup, sum, } from '@jbrowse/core/util';
|
|
6
6
|
import { getTrackName } from '@jbrowse/core/util/tracks';
|
|
7
7
|
import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
8
8
|
import { SVGTracks, SVGRuler, totalHeight, } from '@jbrowse/plugin-linear-genome-view';
|
|
@@ -13,14 +13,14 @@ import { drawRef } from '../../LinearSyntenyDisplay/drawSynteny';
|
|
|
13
13
|
export async function renderToSvg(model, opts) {
|
|
14
14
|
var _a;
|
|
15
15
|
await when(() => model.initialized);
|
|
16
|
-
const { textHeight = 18, headerHeight = 30, rulerHeight = 30, fontSize = 13, trackLabels = 'offset',
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
Wrapper = ({ children }) => React.createElement(React.Fragment, null, children), themeName = 'default', } = opts;
|
|
16
|
+
const { textHeight = 18, headerHeight = 30, rulerHeight = 30, fontSize = 13, trackLabels = 'offset', Wrapper = ({ children }) => React.createElement(React.Fragment, null, children), themeName = 'default', } = opts;
|
|
19
17
|
const session = getSession(model);
|
|
20
18
|
const theme = (_a = session.allThemes) === null || _a === void 0 ? void 0 : _a.call(session)[themeName];
|
|
21
19
|
const { width, views, middleComparativeHeight: synH, tracks } = model;
|
|
22
20
|
const shift = 50;
|
|
23
21
|
const offset = headerHeight + rulerHeight;
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
const { createRootFn } = getRoot(model);
|
|
24
24
|
const heights = views.map(v => totalHeight(v.tracks, textHeight, trackLabels) + offset);
|
|
25
25
|
const totalHeightSvg = sum(heights) + synH + 100;
|
|
26
26
|
const displayResults = await Promise.all(views.map(async (view) => ({
|
|
@@ -73,5 +73,5 @@ export async function renderToSvg(model, opts) {
|
|
|
73
73
|
React.createElement("g", { transform: `translate(${trackLabelOffset})` },
|
|
74
74
|
React.createElement("text", { x: 0, fontSize: fontSize, fill: t.palette.text.primary }, views[1].assemblyNames.join(', ')),
|
|
75
75
|
React.createElement(SVGRuler, { model: displayResults[1].view, fontSize: fontSize })),
|
|
76
|
-
React.createElement(SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: displayResults[1].view, displayResults: displayResults[1].data, offset: offset, trackLabelOffset: trackLabelOffset }))))));
|
|
76
|
+
React.createElement(SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: displayResults[1].view, displayResults: displayResults[1].data, offset: offset, trackLabelOffset: trackLabelOffset }))))), createRootFn);
|
|
77
77
|
}
|