@jbrowse/plugin-linear-comparative-view 3.4.0 → 3.5.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/LGVSyntenyDisplay/model.d.ts +5 -8
- package/dist/LinearComparativeDisplay/stateModelFactory.js +2 -2
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +2 -2
- package/dist/LinearComparativeView/model.d.ts +6 -2
- package/dist/LinearSyntenyDisplay/drawSynteny.js +13 -4
- package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +7 -6
- package/dist/LinearSyntenyView/components/TextField2.d.ts +2 -0
- package/dist/LinearSyntenyView/components/TextField2.js +8 -0
- package/dist/LinearSyntenyView/model.d.ts +9 -20
- package/dist/LinearSyntenyView/model.js +14 -1
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +2 -1
- package/dist/LinearSyntenyView/types.d.ts +17 -0
- package/esm/LGVSyntenyDisplay/model.d.ts +5 -8
- package/esm/LinearComparativeDisplay/stateModelFactory.js +2 -2
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +3 -3
- package/esm/LinearComparativeView/model.d.ts +6 -2
- package/esm/LinearSyntenyDisplay/drawSynteny.js +13 -4
- package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +2 -4
- package/esm/LinearSyntenyView/components/TextField2.d.ts +2 -0
- package/esm/LinearSyntenyView/components/TextField2.js +5 -0
- package/esm/LinearSyntenyView/model.d.ts +9 -20
- package/esm/LinearSyntenyView/model.js +14 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +2 -1
- package/esm/LinearSyntenyView/types.d.ts +17 -0
- package/package.json +5 -5
|
@@ -192,6 +192,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
192
192
|
readonly renderDelay: number;
|
|
193
193
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
194
194
|
readonly selectedFeatureId: string | undefined;
|
|
195
|
+
copyInfoToClipboard(feature: Feature): void;
|
|
195
196
|
} & {
|
|
196
197
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
197
198
|
readonly featureUnderMouse: Feature | undefined;
|
|
@@ -201,7 +202,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
201
202
|
} & {
|
|
202
203
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
203
204
|
deleteBlock(key: string): void;
|
|
204
|
-
selectFeature(feature: Feature):
|
|
205
|
+
selectFeature(feature: Feature): void;
|
|
205
206
|
navToFeature(feature: Feature): void;
|
|
206
207
|
clearFeatureSelection(): void;
|
|
207
208
|
setFeatureIdUnderMouse(feature?: string): void;
|
|
@@ -234,12 +235,12 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
234
235
|
updateColorTagMap(uniqueTag: string[]): void;
|
|
235
236
|
setFeatureUnderMouse(feat?: Feature): void;
|
|
236
237
|
selectFeature(feature: Feature): void;
|
|
237
|
-
copyFeatureToClipboard(feature: Feature): void;
|
|
238
238
|
setConfig(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): void;
|
|
239
239
|
setFilterBy(filter: import("@jbrowse/plugin-alignments/src/shared/types").FilterBy): void;
|
|
240
240
|
setJexlFilters(filters: string[]): void;
|
|
241
241
|
setHideSmallIndels(arg: boolean): void;
|
|
242
242
|
} & {
|
|
243
|
+
copyFeatureToClipboard(feature: Feature): void;
|
|
243
244
|
readonly rendererConfig: {
|
|
244
245
|
[x: string]: any;
|
|
245
246
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -259,17 +260,13 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
259
260
|
readonly filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
|
|
260
261
|
} & {
|
|
261
262
|
readonly rendererTypeName: string;
|
|
262
|
-
contextMenuItems():
|
|
263
|
+
contextMenuItems(): {
|
|
263
264
|
label: string;
|
|
264
265
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
265
266
|
muiName: string;
|
|
266
267
|
};
|
|
267
268
|
onClick: () => void;
|
|
268
|
-
}
|
|
269
|
-
label: string;
|
|
270
|
-
icon: typeof import("@jbrowse/core/ui/Icons").ContentCopy;
|
|
271
|
-
onClick: () => void;
|
|
272
|
-
})[];
|
|
269
|
+
}[];
|
|
273
270
|
readonly DisplayBlurb: ({ model, }: {
|
|
274
271
|
model: {
|
|
275
272
|
sortedBy?: import("@jbrowse/plugin-alignments/src/shared/types").SortedBy;
|
|
@@ -125,11 +125,11 @@ async function renderBlockEffect(props) {
|
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
127
|
const { rpcManager, renderProps } = props;
|
|
128
|
-
const { adapterConfig, level } = renderProps;
|
|
128
|
+
const { sessionId, adapterConfig, level } = renderProps;
|
|
129
129
|
const view = renderProps.view.views[level];
|
|
130
130
|
const features = (await rpcManager.call('getFeats', 'CoreGetFeatures', {
|
|
131
131
|
regions: view.staticBlocks.contentBlocks,
|
|
132
|
-
sessionId
|
|
132
|
+
sessionId,
|
|
133
133
|
adapterConfig,
|
|
134
134
|
}));
|
|
135
135
|
return {
|
|
@@ -18,7 +18,7 @@ const useStyles = (0, mui_1.makeStyles)()(() => ({
|
|
|
18
18
|
}));
|
|
19
19
|
const HeaderSearchBoxes = (0, mobx_react_1.observer)(function ({ view, }) {
|
|
20
20
|
const { classes } = useStyles();
|
|
21
|
-
const {
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)("span", { className: classes.searchBox, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.SearchBox, { model: view, showHelp: false }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [
|
|
21
|
+
const { assemblyDisplayNames, coarseTotalBp } = view;
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: classes.searchBox, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.SearchBox, { model: view, showHelp: false }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [assemblyDisplayNames.join(','), " ", (0, util_1.getBpDisplayStr)(coarseTotalBp)] })] }));
|
|
23
23
|
});
|
|
24
24
|
exports.default = HeaderSearchBoxes;
|
|
@@ -77,7 +77,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
77
77
|
readonly width: number;
|
|
78
78
|
readonly interRegionPaddingWidth: number;
|
|
79
79
|
readonly assemblyNames: string[];
|
|
80
|
-
readonly
|
|
80
|
+
readonly assemblyDisplayNames: string[];
|
|
81
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
82
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
81
83
|
readonly rubberbandTop: number;
|
|
82
84
|
readonly pinnedTracksTop: number;
|
|
83
85
|
} & {
|
|
@@ -392,7 +394,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
392
394
|
readonly width: number;
|
|
393
395
|
readonly interRegionPaddingWidth: number;
|
|
394
396
|
readonly assemblyNames: string[];
|
|
395
|
-
readonly
|
|
397
|
+
readonly assemblyDisplayNames: string[];
|
|
398
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
399
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
396
400
|
readonly rubberbandTop: number;
|
|
397
401
|
readonly pinnedTracksTop: number;
|
|
398
402
|
} & {
|
|
@@ -31,6 +31,7 @@ function drawRef(model, ctx1, ctx3) {
|
|
|
31
31
|
const view = (0, util_1.getContainingView)(model);
|
|
32
32
|
const drawCurves = view.drawCurves;
|
|
33
33
|
const drawCIGAR = view.drawCIGAR;
|
|
34
|
+
const drawCIGARMatchesOnly = view.drawCIGARMatchesOnly;
|
|
34
35
|
const { level, height, featPositions } = model;
|
|
35
36
|
const width = view.width;
|
|
36
37
|
const bpPerPxs = view.views.map(v => v.bpPerPx);
|
|
@@ -123,11 +124,19 @@ function drawRef(model, ctx1, ctx3) {
|
|
|
123
124
|
continuingFlag = true;
|
|
124
125
|
}
|
|
125
126
|
else {
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
const letter = (continuingFlag && d1 > 1) || d2 > 1 ? op : 'M';
|
|
128
|
+
ctx1.fillStyle = colorMap[letter];
|
|
128
129
|
continuingFlag = false;
|
|
129
|
-
(
|
|
130
|
-
|
|
130
|
+
if (drawCIGARMatchesOnly) {
|
|
131
|
+
if (letter === 'M') {
|
|
132
|
+
(0, util_2.draw)(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
|
|
133
|
+
ctx1.fill();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
(0, util_2.draw)(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
|
|
138
|
+
ctx1.fill();
|
|
139
|
+
}
|
|
131
140
|
if (ctx3) {
|
|
132
141
|
ctx3.fillStyle = makeColor(idx);
|
|
133
142
|
(0, util_2.draw)(ctx3, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.default = ExportSvgDialog;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -6,15 +9,13 @@ const react_1 = require("react");
|
|
|
6
9
|
const ui_1 = require("@jbrowse/core/ui");
|
|
7
10
|
const util_1 = require("@jbrowse/core/util");
|
|
8
11
|
const material_1 = require("@mui/material");
|
|
12
|
+
const TextField2_1 = __importDefault(require("./TextField2"));
|
|
9
13
|
function LoadingMessage() {
|
|
10
14
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { display: "inline", children: "Creating SVG" })] }));
|
|
11
15
|
}
|
|
12
16
|
function useSvgLocal(key, val) {
|
|
13
17
|
return (0, util_1.useLocalStorage)(`svg-${key}`, val);
|
|
14
18
|
}
|
|
15
|
-
function TextField2({ children, ...rest }) {
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { ...rest, children: children }) }));
|
|
17
|
-
}
|
|
18
19
|
function ExportSvgDialog({ model, handleClose, }) {
|
|
19
20
|
const session = (0, util_1.getSession)(model);
|
|
20
21
|
const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
|
|
@@ -24,11 +25,11 @@ function ExportSvgDialog({ model, handleClose, }) {
|
|
|
24
25
|
const [trackLabels, setTrackLabels] = useSvgLocal('tracklabels', 'offset');
|
|
25
26
|
const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
|
|
26
27
|
const [error, setError] = (0, react_1.useState)();
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : loading ? ((0, jsx_runtime_1.jsx)(LoadingMessage, {})) : null, (0, jsx_runtime_1.jsx)(
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : loading ? ((0, jsx_runtime_1.jsx)(LoadingMessage, {})) : null, (0, jsx_runtime_1.jsx)(TextField2_1.default, { helperText: "filename", value: filename, onChange: event => {
|
|
28
29
|
setFilename(event.target.value);
|
|
29
|
-
} }), (0, jsx_runtime_1.jsxs)(
|
|
30
|
+
} }), (0, jsx_runtime_1.jsxs)(TextField2_1.default, { select: true, label: "Track label positioning", variant: "outlined", value: trackLabels, style: { width: 150 }, onChange: event => {
|
|
30
31
|
setTrackLabels(event.target.value);
|
|
31
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "offset", children: "Offset" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "overlay", children: "Overlay" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "left", children: "Left" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "none", children: "None" })] }), (0, jsx_runtime_1.jsx)("br", {}), session.allThemes ? ((0, jsx_runtime_1.jsx)(
|
|
32
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "offset", children: "Offset" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "overlay", children: "Overlay" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "left", children: "Left" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "none", children: "None" })] }), (0, jsx_runtime_1.jsx)("br", {}), session.allThemes ? ((0, jsx_runtime_1.jsx)(TextField2_1.default, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
|
|
32
33
|
setThemeName(event.target.value);
|
|
33
34
|
}, children: Object.entries(session.allThemes()).map(([key, val]) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, offscreenCanvas ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: rasterizeLayers, onChange: () => {
|
|
34
35
|
setRasterizeLayers(val => !val);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = TextField2;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
function TextField2({ children, ...rest }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { ...rest, children: children }) }));
|
|
8
|
+
}
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import { Curves } from './components/Icons';
|
|
3
|
-
import type { ImportFormSyntenyTrack } from './types';
|
|
2
|
+
import type { ExportSvgOptions, ImportFormSyntenyTrack } from './types';
|
|
4
3
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
5
4
|
import type { Instance } from 'mobx-state-tree';
|
|
6
|
-
export interface ExportSvgOptions {
|
|
7
|
-
rasterizeLayers?: boolean;
|
|
8
|
-
scale?: number;
|
|
9
|
-
filename?: string;
|
|
10
|
-
Wrapper?: React.FC<{
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}>;
|
|
13
|
-
fontSize?: number;
|
|
14
|
-
rulerHeight?: number;
|
|
15
|
-
textHeight?: number;
|
|
16
|
-
paddingHeight?: number;
|
|
17
|
-
headerHeight?: number;
|
|
18
|
-
cytobandHeight?: number;
|
|
19
|
-
themeName?: string;
|
|
20
|
-
trackLabels?: string;
|
|
21
|
-
}
|
|
22
5
|
export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
23
6
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
24
7
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -94,7 +77,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
94
77
|
readonly width: number;
|
|
95
78
|
readonly interRegionPaddingWidth: number;
|
|
96
79
|
readonly assemblyNames: string[];
|
|
97
|
-
readonly
|
|
80
|
+
readonly assemblyDisplayNames: string[];
|
|
81
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
82
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
98
83
|
readonly rubberbandTop: number;
|
|
99
84
|
readonly pinnedTracksTop: number;
|
|
100
85
|
} & {
|
|
@@ -298,6 +283,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
298
283
|
} & {
|
|
299
284
|
type: import("mobx-state-tree").ISimpleType<"LinearSyntenyView">;
|
|
300
285
|
drawCIGAR: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
286
|
+
drawCIGARMatchesOnly: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
301
287
|
drawCurves: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
302
288
|
}, {
|
|
303
289
|
width: number;
|
|
@@ -346,6 +332,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
346
332
|
setImportFormSyntenyTrack(arg: number, val: ImportFormSyntenyTrack): void;
|
|
347
333
|
setDrawCurves(arg: boolean): void;
|
|
348
334
|
setDrawCIGAR(arg: boolean): void;
|
|
335
|
+
setDrawCIGARMatchesOnly(arg: boolean): void;
|
|
349
336
|
showAllRegions(): void;
|
|
350
337
|
} & {
|
|
351
338
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
@@ -476,7 +463,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
476
463
|
readonly width: number;
|
|
477
464
|
readonly interRegionPaddingWidth: number;
|
|
478
465
|
readonly assemblyNames: string[];
|
|
479
|
-
readonly
|
|
466
|
+
readonly assemblyDisplayNames: string[];
|
|
467
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
468
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
480
469
|
readonly rubberbandTop: number;
|
|
481
470
|
readonly pinnedTracksTop: number;
|
|
482
471
|
} & {
|
|
@@ -54,6 +54,7 @@ function stateModelFactory(pluginManager) {
|
|
|
54
54
|
.compose('LinearSyntenyView', (0, model_1.default)(pluginManager), mobx_state_tree_1.types.model({
|
|
55
55
|
type: mobx_state_tree_1.types.literal('LinearSyntenyView'),
|
|
56
56
|
drawCIGAR: true,
|
|
57
|
+
drawCIGARMatchesOnly: false,
|
|
57
58
|
drawCurves: false,
|
|
58
59
|
}))
|
|
59
60
|
.volatile(() => ({
|
|
@@ -75,6 +76,9 @@ function stateModelFactory(pluginManager) {
|
|
|
75
76
|
setDrawCIGAR(arg) {
|
|
76
77
|
self.drawCIGAR = arg;
|
|
77
78
|
},
|
|
79
|
+
setDrawCIGARMatchesOnly(arg) {
|
|
80
|
+
self.drawCIGARMatchesOnly = arg;
|
|
81
|
+
},
|
|
78
82
|
showAllRegions() {
|
|
79
83
|
(0, mobx_1.transaction)(() => {
|
|
80
84
|
for (const view of self.views) {
|
|
@@ -114,11 +118,20 @@ function stateModelFactory(pluginManager) {
|
|
|
114
118
|
label: 'Draw CIGAR',
|
|
115
119
|
checked: self.drawCIGAR,
|
|
116
120
|
type: 'checkbox',
|
|
117
|
-
description: '
|
|
121
|
+
description: 'If disabled, only draws the broad scale CIGAR match',
|
|
118
122
|
onClick: () => {
|
|
119
123
|
self.setDrawCIGAR(!self.drawCIGAR);
|
|
120
124
|
},
|
|
121
125
|
},
|
|
126
|
+
{
|
|
127
|
+
label: 'Draw only CIGAR matches',
|
|
128
|
+
checked: self.drawCIGARMatchesOnly,
|
|
129
|
+
type: 'checkbox',
|
|
130
|
+
description: 'If enabled, it hides the insertions and deletions in the CIGAR strings, helps with divergent',
|
|
131
|
+
onClick: () => {
|
|
132
|
+
self.setDrawCIGARMatchesOnly(!self.drawCIGARMatchesOnly);
|
|
133
|
+
},
|
|
134
|
+
},
|
|
122
135
|
{
|
|
123
136
|
label: 'Link views',
|
|
124
137
|
type: 'checkbox',
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinearSyntenyViewModel } from '../model';
|
|
2
|
+
import type { ExportSvgOptions } from '../types';
|
|
2
3
|
export declare function renderToSvg(model: LinearSyntenyViewModel, opts: ExportSvgOptions): Promise<string>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
3
|
import type { SnapshotIn } from 'mobx-state-tree';
|
|
3
4
|
export type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
@@ -10,3 +11,19 @@ export type ImportFormSyntenyTrack = {
|
|
|
10
11
|
} | {
|
|
11
12
|
type: 'none';
|
|
12
13
|
};
|
|
14
|
+
export interface ExportSvgOptions {
|
|
15
|
+
rasterizeLayers?: boolean;
|
|
16
|
+
scale?: number;
|
|
17
|
+
filename?: string;
|
|
18
|
+
Wrapper?: React.FC<{
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}>;
|
|
21
|
+
fontSize?: number;
|
|
22
|
+
rulerHeight?: number;
|
|
23
|
+
textHeight?: number;
|
|
24
|
+
paddingHeight?: number;
|
|
25
|
+
headerHeight?: number;
|
|
26
|
+
cytobandHeight?: number;
|
|
27
|
+
themeName?: string;
|
|
28
|
+
trackLabels?: string;
|
|
29
|
+
}
|
|
@@ -192,6 +192,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
192
192
|
readonly renderDelay: number;
|
|
193
193
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
194
194
|
readonly selectedFeatureId: string | undefined;
|
|
195
|
+
copyInfoToClipboard(feature: Feature): void;
|
|
195
196
|
} & {
|
|
196
197
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
197
198
|
readonly featureUnderMouse: Feature | undefined;
|
|
@@ -201,7 +202,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
201
202
|
} & {
|
|
202
203
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
203
204
|
deleteBlock(key: string): void;
|
|
204
|
-
selectFeature(feature: Feature):
|
|
205
|
+
selectFeature(feature: Feature): void;
|
|
205
206
|
navToFeature(feature: Feature): void;
|
|
206
207
|
clearFeatureSelection(): void;
|
|
207
208
|
setFeatureIdUnderMouse(feature?: string): void;
|
|
@@ -234,12 +235,12 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
234
235
|
updateColorTagMap(uniqueTag: string[]): void;
|
|
235
236
|
setFeatureUnderMouse(feat?: Feature): void;
|
|
236
237
|
selectFeature(feature: Feature): void;
|
|
237
|
-
copyFeatureToClipboard(feature: Feature): void;
|
|
238
238
|
setConfig(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): void;
|
|
239
239
|
setFilterBy(filter: import("@jbrowse/plugin-alignments/src/shared/types").FilterBy): void;
|
|
240
240
|
setJexlFilters(filters: string[]): void;
|
|
241
241
|
setHideSmallIndels(arg: boolean): void;
|
|
242
242
|
} & {
|
|
243
|
+
copyFeatureToClipboard(feature: Feature): void;
|
|
243
244
|
readonly rendererConfig: {
|
|
244
245
|
[x: string]: any;
|
|
245
246
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -259,17 +260,13 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
259
260
|
readonly filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
|
|
260
261
|
} & {
|
|
261
262
|
readonly rendererTypeName: string;
|
|
262
|
-
contextMenuItems():
|
|
263
|
+
contextMenuItems(): {
|
|
263
264
|
label: string;
|
|
264
265
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
265
266
|
muiName: string;
|
|
266
267
|
};
|
|
267
268
|
onClick: () => void;
|
|
268
|
-
}
|
|
269
|
-
label: string;
|
|
270
|
-
icon: typeof import("@jbrowse/core/ui/Icons").ContentCopy;
|
|
271
|
-
onClick: () => void;
|
|
272
|
-
})[];
|
|
269
|
+
}[];
|
|
273
270
|
readonly DisplayBlurb: ({ model, }: {
|
|
274
271
|
model: {
|
|
275
272
|
sortedBy?: import("@jbrowse/plugin-alignments/src/shared/types").SortedBy;
|
|
@@ -123,11 +123,11 @@ async function renderBlockEffect(props) {
|
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
const { rpcManager, renderProps } = props;
|
|
126
|
-
const { adapterConfig, level } = renderProps;
|
|
126
|
+
const { sessionId, adapterConfig, level } = renderProps;
|
|
127
127
|
const view = renderProps.view.views[level];
|
|
128
128
|
const features = (await rpcManager.call('getFeats', 'CoreGetFeatures', {
|
|
129
129
|
regions: view.staticBlocks.contentBlocks,
|
|
130
|
-
sessionId
|
|
130
|
+
sessionId,
|
|
131
131
|
adapterConfig,
|
|
132
132
|
}));
|
|
133
133
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { getBpDisplayStr } from '@jbrowse/core/util';
|
|
3
3
|
import { SearchBox } from '@jbrowse/plugin-linear-genome-view';
|
|
4
4
|
import { Typography } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
@@ -16,7 +16,7 @@ const useStyles = makeStyles()(() => ({
|
|
|
16
16
|
}));
|
|
17
17
|
const HeaderSearchBoxes = observer(function ({ view, }) {
|
|
18
18
|
const { classes } = useStyles();
|
|
19
|
-
const {
|
|
20
|
-
return (_jsxs("span", { className: classes.searchBox, children: [_jsx(SearchBox, { model: view, showHelp: false }), _jsxs(Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [
|
|
19
|
+
const { assemblyDisplayNames, coarseTotalBp } = view;
|
|
20
|
+
return (_jsxs("span", { className: classes.searchBox, children: [_jsx(SearchBox, { model: view, showHelp: false }), _jsxs(Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [assemblyDisplayNames.join(','), " ", getBpDisplayStr(coarseTotalBp)] })] }));
|
|
21
21
|
});
|
|
22
22
|
export default HeaderSearchBoxes;
|
|
@@ -77,7 +77,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
77
77
|
readonly width: number;
|
|
78
78
|
readonly interRegionPaddingWidth: number;
|
|
79
79
|
readonly assemblyNames: string[];
|
|
80
|
-
readonly
|
|
80
|
+
readonly assemblyDisplayNames: string[];
|
|
81
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
82
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
81
83
|
readonly rubberbandTop: number;
|
|
82
84
|
readonly pinnedTracksTop: number;
|
|
83
85
|
} & {
|
|
@@ -392,7 +394,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
392
394
|
readonly width: number;
|
|
393
395
|
readonly interRegionPaddingWidth: number;
|
|
394
396
|
readonly assemblyNames: string[];
|
|
395
|
-
readonly
|
|
397
|
+
readonly assemblyDisplayNames: string[];
|
|
398
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
399
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
396
400
|
readonly rubberbandTop: number;
|
|
397
401
|
readonly pinnedTracksTop: number;
|
|
398
402
|
} & {
|
|
@@ -25,6 +25,7 @@ export function drawRef(model, ctx1, ctx3) {
|
|
|
25
25
|
const view = getContainingView(model);
|
|
26
26
|
const drawCurves = view.drawCurves;
|
|
27
27
|
const drawCIGAR = view.drawCIGAR;
|
|
28
|
+
const drawCIGARMatchesOnly = view.drawCIGARMatchesOnly;
|
|
28
29
|
const { level, height, featPositions } = model;
|
|
29
30
|
const width = view.width;
|
|
30
31
|
const bpPerPxs = view.views.map(v => v.bpPerPx);
|
|
@@ -117,11 +118,19 @@ export function drawRef(model, ctx1, ctx3) {
|
|
|
117
118
|
continuingFlag = true;
|
|
118
119
|
}
|
|
119
120
|
else {
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
const letter = (continuingFlag && d1 > 1) || d2 > 1 ? op : 'M';
|
|
122
|
+
ctx1.fillStyle = colorMap[letter];
|
|
122
123
|
continuingFlag = false;
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
if (drawCIGARMatchesOnly) {
|
|
125
|
+
if (letter === 'M') {
|
|
126
|
+
draw(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
|
|
127
|
+
ctx1.fill();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
draw(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
|
|
132
|
+
ctx1.fill();
|
|
133
|
+
}
|
|
125
134
|
if (ctx3) {
|
|
126
135
|
ctx3.fillStyle = makeColor(idx);
|
|
127
136
|
draw(ctx3, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
|
|
@@ -2,16 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
|
|
4
4
|
import { getSession, useLocalStorage } from '@jbrowse/core/util';
|
|
5
|
-
import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem,
|
|
5
|
+
import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, Typography, } from '@mui/material';
|
|
6
|
+
import TextField2 from './TextField2';
|
|
6
7
|
function LoadingMessage() {
|
|
7
8
|
return (_jsxs("div", { children: [_jsx(CircularProgress, { size: 20, style: { marginRight: 20 } }), _jsx(Typography, { display: "inline", children: "Creating SVG" })] }));
|
|
8
9
|
}
|
|
9
10
|
function useSvgLocal(key, val) {
|
|
10
11
|
return useLocalStorage(`svg-${key}`, val);
|
|
11
12
|
}
|
|
12
|
-
function TextField2({ children, ...rest }) {
|
|
13
|
-
return (_jsx("div", { children: _jsx(TextField, { ...rest, children: children }) }));
|
|
14
|
-
}
|
|
15
13
|
export default function ExportSvgDialog({ model, handleClose, }) {
|
|
16
14
|
const session = getSession(model);
|
|
17
15
|
const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import { Curves } from './components/Icons';
|
|
3
|
-
import type { ImportFormSyntenyTrack } from './types';
|
|
2
|
+
import type { ExportSvgOptions, ImportFormSyntenyTrack } from './types';
|
|
4
3
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
5
4
|
import type { Instance } from 'mobx-state-tree';
|
|
6
|
-
export interface ExportSvgOptions {
|
|
7
|
-
rasterizeLayers?: boolean;
|
|
8
|
-
scale?: number;
|
|
9
|
-
filename?: string;
|
|
10
|
-
Wrapper?: React.FC<{
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}>;
|
|
13
|
-
fontSize?: number;
|
|
14
|
-
rulerHeight?: number;
|
|
15
|
-
textHeight?: number;
|
|
16
|
-
paddingHeight?: number;
|
|
17
|
-
headerHeight?: number;
|
|
18
|
-
cytobandHeight?: number;
|
|
19
|
-
themeName?: string;
|
|
20
|
-
trackLabels?: string;
|
|
21
|
-
}
|
|
22
5
|
export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
23
6
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
24
7
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -94,7 +77,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
94
77
|
readonly width: number;
|
|
95
78
|
readonly interRegionPaddingWidth: number;
|
|
96
79
|
readonly assemblyNames: string[];
|
|
97
|
-
readonly
|
|
80
|
+
readonly assemblyDisplayNames: string[];
|
|
81
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
82
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
98
83
|
readonly rubberbandTop: number;
|
|
99
84
|
readonly pinnedTracksTop: number;
|
|
100
85
|
} & {
|
|
@@ -298,6 +283,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
298
283
|
} & {
|
|
299
284
|
type: import("mobx-state-tree").ISimpleType<"LinearSyntenyView">;
|
|
300
285
|
drawCIGAR: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
286
|
+
drawCIGARMatchesOnly: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
301
287
|
drawCurves: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
302
288
|
}, {
|
|
303
289
|
width: number;
|
|
@@ -346,6 +332,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
346
332
|
setImportFormSyntenyTrack(arg: number, val: ImportFormSyntenyTrack): void;
|
|
347
333
|
setDrawCurves(arg: boolean): void;
|
|
348
334
|
setDrawCIGAR(arg: boolean): void;
|
|
335
|
+
setDrawCIGARMatchesOnly(arg: boolean): void;
|
|
349
336
|
showAllRegions(): void;
|
|
350
337
|
} & {
|
|
351
338
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
@@ -476,7 +463,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
476
463
|
readonly width: number;
|
|
477
464
|
readonly interRegionPaddingWidth: number;
|
|
478
465
|
readonly assemblyNames: string[];
|
|
479
|
-
readonly
|
|
466
|
+
readonly assemblyDisplayNames: string[];
|
|
467
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
468
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
480
469
|
readonly rubberbandTop: number;
|
|
481
470
|
readonly pinnedTracksTop: number;
|
|
482
471
|
} & {
|
|
@@ -15,6 +15,7 @@ export default function stateModelFactory(pluginManager) {
|
|
|
15
15
|
.compose('LinearSyntenyView', baseModel(pluginManager), types.model({
|
|
16
16
|
type: types.literal('LinearSyntenyView'),
|
|
17
17
|
drawCIGAR: true,
|
|
18
|
+
drawCIGARMatchesOnly: false,
|
|
18
19
|
drawCurves: false,
|
|
19
20
|
}))
|
|
20
21
|
.volatile(() => ({
|
|
@@ -36,6 +37,9 @@ export default function stateModelFactory(pluginManager) {
|
|
|
36
37
|
setDrawCIGAR(arg) {
|
|
37
38
|
self.drawCIGAR = arg;
|
|
38
39
|
},
|
|
40
|
+
setDrawCIGARMatchesOnly(arg) {
|
|
41
|
+
self.drawCIGARMatchesOnly = arg;
|
|
42
|
+
},
|
|
39
43
|
showAllRegions() {
|
|
40
44
|
transaction(() => {
|
|
41
45
|
for (const view of self.views) {
|
|
@@ -75,11 +79,20 @@ export default function stateModelFactory(pluginManager) {
|
|
|
75
79
|
label: 'Draw CIGAR',
|
|
76
80
|
checked: self.drawCIGAR,
|
|
77
81
|
type: 'checkbox',
|
|
78
|
-
description: '
|
|
82
|
+
description: 'If disabled, only draws the broad scale CIGAR match',
|
|
79
83
|
onClick: () => {
|
|
80
84
|
self.setDrawCIGAR(!self.drawCIGAR);
|
|
81
85
|
},
|
|
82
86
|
},
|
|
87
|
+
{
|
|
88
|
+
label: 'Draw only CIGAR matches',
|
|
89
|
+
checked: self.drawCIGARMatchesOnly,
|
|
90
|
+
type: 'checkbox',
|
|
91
|
+
description: 'If enabled, it hides the insertions and deletions in the CIGAR strings, helps with divergent',
|
|
92
|
+
onClick: () => {
|
|
93
|
+
self.setDrawCIGARMatchesOnly(!self.drawCIGARMatchesOnly);
|
|
94
|
+
},
|
|
95
|
+
},
|
|
83
96
|
{
|
|
84
97
|
label: 'Link views',
|
|
85
98
|
type: 'checkbox',
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinearSyntenyViewModel } from '../model';
|
|
2
|
+
import type { ExportSvgOptions } from '../types';
|
|
2
3
|
export declare function renderToSvg(model: LinearSyntenyViewModel, opts: ExportSvgOptions): Promise<string>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
3
|
import type { SnapshotIn } from 'mobx-state-tree';
|
|
3
4
|
export type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
@@ -10,3 +11,19 @@ export type ImportFormSyntenyTrack = {
|
|
|
10
11
|
} | {
|
|
11
12
|
type: 'none';
|
|
12
13
|
};
|
|
14
|
+
export interface ExportSvgOptions {
|
|
15
|
+
rasterizeLayers?: boolean;
|
|
16
|
+
scale?: number;
|
|
17
|
+
filename?: string;
|
|
18
|
+
Wrapper?: React.FC<{
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}>;
|
|
21
|
+
fontSize?: number;
|
|
22
|
+
rulerHeight?: number;
|
|
23
|
+
textHeight?: number;
|
|
24
|
+
paddingHeight?: number;
|
|
25
|
+
headerHeight?: number;
|
|
26
|
+
cytobandHeight?: number;
|
|
27
|
+
themeName?: string;
|
|
28
|
+
trackLabels?: string;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-comparative-view",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "JBrowse 2 linear comparative view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@jbrowse/core": "^3.
|
|
40
|
-
"@jbrowse/plugin-alignments": "^3.
|
|
41
|
-
"@jbrowse/plugin-linear-genome-view": "^3.
|
|
39
|
+
"@jbrowse/core": "^3.5.1",
|
|
40
|
+
"@jbrowse/plugin-alignments": "^3.5.1",
|
|
41
|
+
"@jbrowse/plugin-linear-genome-view": "^3.5.1",
|
|
42
42
|
"@mui/icons-material": "^7.0.0",
|
|
43
43
|
"@mui/material": "^7.0.0",
|
|
44
44
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "cb8859da9d838ad2594964777c5c54f385d98f5e"
|
|
63
63
|
}
|