@jbrowse/plugin-linear-comparative-view 3.3.0 → 3.5.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/LinearComparativeView/components/HeaderSearchBoxes.js +1 -1
- package/dist/LinearComparativeView/model.d.ts +12 -10
- 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 +15 -28
- package/dist/LinearSyntenyView/model.js +14 -1
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +2 -1
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +1 -1
- package/dist/LinearSyntenyView/types.d.ts +17 -0
- package/dist/SyntenyFeatureDetail/Formatter.d.ts +3 -0
- package/dist/SyntenyFeatureDetail/Formatter.js +23 -0
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +3 -1
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +7 -7
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +7 -3
- package/dist/SyntenyFeatureDetail/types.d.ts +1 -1
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +2 -2
- package/esm/LinearComparativeView/model.d.ts +12 -10
- 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 +15 -28
- package/esm/LinearSyntenyView/model.js +14 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +2 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +1 -1
- package/esm/LinearSyntenyView/types.d.ts +17 -0
- package/esm/SyntenyFeatureDetail/Formatter.d.ts +3 -0
- package/esm/SyntenyFeatureDetail/Formatter.js +17 -0
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +3 -1
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +7 -7
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +7 -3
- package/esm/SyntenyFeatureDetail/types.d.ts +1 -1
- package/package.json +5 -5
|
@@ -19,6 +19,6 @@ const useStyles = (0, mui_1.makeStyles)()(() => ({
|
|
|
19
19
|
const HeaderSearchBoxes = (0, mobx_react_1.observer)(function ({ view, }) {
|
|
20
20
|
const { classes } = useStyles();
|
|
21
21
|
const { assemblyNames, 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: [assemblyNames.join(','), " ", (0, util_1.
|
|
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: [assemblyNames.join(','), " ", (0, util_1.getBpDisplayStr)(coarseTotalBp)] })] }));
|
|
23
23
|
});
|
|
24
24
|
exports.default = HeaderSearchBoxes;
|
|
@@ -77,7 +77,8 @@ 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 isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
81
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
81
82
|
readonly rubberbandTop: number;
|
|
82
83
|
readonly pinnedTracksTop: number;
|
|
83
84
|
} & {
|
|
@@ -188,13 +189,13 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
188
189
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
189
190
|
} & {
|
|
190
191
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
191
|
-
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
192
|
+
navToLocString(input: string, optAssemblyName?: string, grow?: number): Promise<void>;
|
|
192
193
|
navToSearchString({ input, assembly, }: {
|
|
193
194
|
input: string;
|
|
194
195
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
195
196
|
}): Promise<void>;
|
|
196
|
-
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string): Promise<void>;
|
|
197
|
-
navToLocations(
|
|
197
|
+
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string, grow?: number): Promise<void>;
|
|
198
|
+
navToLocations(regions: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string, grow?: number): Promise<void>;
|
|
198
199
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
199
200
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
200
201
|
} & {
|
|
@@ -262,9 +263,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
262
263
|
displayName: string | undefined;
|
|
263
264
|
tracks: any[];
|
|
264
265
|
minimized: boolean;
|
|
265
|
-
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
266
266
|
offsetPx: number;
|
|
267
267
|
bpPerPx: number;
|
|
268
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
268
269
|
hideHeader: boolean;
|
|
269
270
|
hideHeaderOverview: boolean;
|
|
270
271
|
hideNoTracksActive: boolean;
|
|
@@ -392,7 +393,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
392
393
|
readonly width: number;
|
|
393
394
|
readonly interRegionPaddingWidth: number;
|
|
394
395
|
readonly assemblyNames: string[];
|
|
395
|
-
readonly
|
|
396
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
397
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
396
398
|
readonly rubberbandTop: number;
|
|
397
399
|
readonly pinnedTracksTop: number;
|
|
398
400
|
} & {
|
|
@@ -503,13 +505,13 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
503
505
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
504
506
|
} & {
|
|
505
507
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
506
|
-
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
508
|
+
navToLocString(input: string, optAssemblyName?: string, grow?: number): Promise<void>;
|
|
507
509
|
navToSearchString({ input, assembly, }: {
|
|
508
510
|
input: string;
|
|
509
511
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
510
512
|
}): Promise<void>;
|
|
511
|
-
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string): Promise<void>;
|
|
512
|
-
navToLocations(
|
|
513
|
+
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string, grow?: number): Promise<void>;
|
|
514
|
+
navToLocations(regions: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string, grow?: number): Promise<void>;
|
|
513
515
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
514
516
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
515
517
|
} & {
|
|
@@ -577,9 +579,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
577
579
|
displayName: string | undefined;
|
|
578
580
|
tracks: any[];
|
|
579
581
|
minimized: boolean;
|
|
580
|
-
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
581
582
|
offsetPx: number;
|
|
582
583
|
bpPerPx: number;
|
|
584
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
583
585
|
hideHeader: boolean;
|
|
584
586
|
hideHeaderOverview: boolean;
|
|
585
587
|
hideNoTracksActive: boolean;
|
|
@@ -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,8 @@ 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 isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
81
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
98
82
|
readonly rubberbandTop: number;
|
|
99
83
|
readonly pinnedTracksTop: number;
|
|
100
84
|
} & {
|
|
@@ -205,13 +189,13 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
205
189
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
206
190
|
} & {
|
|
207
191
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
208
|
-
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
192
|
+
navToLocString(input: string, optAssemblyName?: string, grow?: number): Promise<void>;
|
|
209
193
|
navToSearchString({ input, assembly, }: {
|
|
210
194
|
input: string;
|
|
211
195
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
212
196
|
}): Promise<void>;
|
|
213
|
-
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string): Promise<void>;
|
|
214
|
-
navToLocations(
|
|
197
|
+
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string, grow?: number): Promise<void>;
|
|
198
|
+
navToLocations(regions: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string, grow?: number): Promise<void>;
|
|
215
199
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
216
200
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
217
201
|
} & {
|
|
@@ -279,9 +263,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
279
263
|
displayName: string | undefined;
|
|
280
264
|
tracks: any[];
|
|
281
265
|
minimized: boolean;
|
|
282
|
-
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
283
266
|
offsetPx: number;
|
|
284
267
|
bpPerPx: number;
|
|
268
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
285
269
|
hideHeader: boolean;
|
|
286
270
|
hideHeaderOverview: boolean;
|
|
287
271
|
hideNoTracksActive: boolean;
|
|
@@ -298,6 +282,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
298
282
|
} & {
|
|
299
283
|
type: import("mobx-state-tree").ISimpleType<"LinearSyntenyView">;
|
|
300
284
|
drawCIGAR: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
285
|
+
drawCIGARMatchesOnly: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
301
286
|
drawCurves: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
302
287
|
}, {
|
|
303
288
|
width: number;
|
|
@@ -346,6 +331,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
346
331
|
setImportFormSyntenyTrack(arg: number, val: ImportFormSyntenyTrack): void;
|
|
347
332
|
setDrawCurves(arg: boolean): void;
|
|
348
333
|
setDrawCIGAR(arg: boolean): void;
|
|
334
|
+
setDrawCIGARMatchesOnly(arg: boolean): void;
|
|
349
335
|
showAllRegions(): void;
|
|
350
336
|
} & {
|
|
351
337
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
@@ -476,7 +462,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
476
462
|
readonly width: number;
|
|
477
463
|
readonly interRegionPaddingWidth: number;
|
|
478
464
|
readonly assemblyNames: string[];
|
|
479
|
-
readonly
|
|
465
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
466
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
480
467
|
readonly rubberbandTop: number;
|
|
481
468
|
readonly pinnedTracksTop: number;
|
|
482
469
|
} & {
|
|
@@ -587,13 +574,13 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
587
574
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
588
575
|
} & {
|
|
589
576
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
590
|
-
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
577
|
+
navToLocString(input: string, optAssemblyName?: string, grow?: number): Promise<void>;
|
|
591
578
|
navToSearchString({ input, assembly, }: {
|
|
592
579
|
input: string;
|
|
593
580
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
594
581
|
}): Promise<void>;
|
|
595
|
-
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string): Promise<void>;
|
|
596
|
-
navToLocations(
|
|
582
|
+
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string, grow?: number): Promise<void>;
|
|
583
|
+
navToLocations(regions: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string, grow?: number): Promise<void>;
|
|
597
584
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
598
585
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
599
586
|
} & {
|
|
@@ -661,9 +648,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
661
648
|
displayName: string | undefined;
|
|
662
649
|
tracks: any[];
|
|
663
650
|
minimized: boolean;
|
|
664
|
-
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
665
651
|
offsetPx: number;
|
|
666
652
|
bpPerPx: number;
|
|
653
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
667
654
|
hideHeader: boolean;
|
|
668
655
|
hideHeaderOverview: boolean;
|
|
669
656
|
hideNoTracksActive: boolean;
|
|
@@ -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>;
|
|
@@ -73,7 +73,7 @@ async function renderToSvg(model, opts) {
|
|
|
73
73
|
const rendering = renderings[i - 1];
|
|
74
74
|
const height = heights[i];
|
|
75
75
|
const levelHeight = level.height || 0;
|
|
76
|
-
RenderList.push((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0 ${currOffset})`, children: [levelHeight ? ((0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `synclip-${i}`, children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: width, height: levelHeight }) }) })) : null, (0, jsx_runtime_1.jsx)("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize})`, clipPath: `url(#synclip-${i})`, children: rendering === null || rendering === void 0 ? void 0 : rendering.map((r, i) => (
|
|
76
|
+
RenderList.push((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0 ${currOffset})`, children: [levelHeight ? ((0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `synclip-${i}`, children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: width, height: levelHeight }) }) })) : null, (0, jsx_runtime_1.jsx)("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize})`, clipPath: `url(#synclip-${i})`, children: rendering === null || rendering === void 0 ? void 0 : rendering.map((r, i) => (0, jsx_runtime_1.jsx)(util_1.ReactRendering, { rendering: r }, i)) }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(0 ${levelHeight})`, children: (0, jsx_runtime_1.jsx)(SVGLinearGenomeView_1.default, { rulerHeight: rulerHeight, shift: shift, trackLabelOffset: trackLabelOffset, textHeight: textHeight, trackLabels: trackLabels, displayResults: displayResults[i], view: view, fontSize: fontSize }, view.id) })] }, view.id));
|
|
77
77
|
currOffset += height + fontSize + rulerHeight + levelHeight;
|
|
78
78
|
}
|
|
79
79
|
return (0, util_1.renderToStaticMarkup)((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsxs)("svg", { width: width, height: totalHeightSvg, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w + shift * 2, totalHeightSvg].toString(), children: [(0, jsx_runtime_1.jsx)(SVGBackground_1.default, { width: w, height: totalHeightSvg, shift: shift }), RenderList] }) }) }));
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = Formatter;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
10
|
+
function Formatter({ value }) {
|
|
11
|
+
const [show, setShow] = (0, react_1.useState)(false);
|
|
12
|
+
const [copied, setCopied] = (0, react_1.useState)(false);
|
|
13
|
+
const display = String(value);
|
|
14
|
+
return display.length > 100 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => {
|
|
15
|
+
(0, copy_to_clipboard_1.default)(display);
|
|
16
|
+
setCopied(true);
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
setCopied(false);
|
|
19
|
+
}, 700);
|
|
20
|
+
}, children: copied ? 'Copied to clipboard' : 'Copy' }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => {
|
|
21
|
+
setShow(val => !val);
|
|
22
|
+
}, children: show ? 'Show less' : 'Show more' }), (0, jsx_runtime_1.jsx)("div", { children: show ? display : `${display.slice(0, 100)}...` })] })) : ((0, jsx_runtime_1.jsx)("div", { children: display }));
|
|
23
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { SyntenyFeatureDetailModel } from './types';
|
|
2
|
-
|
|
2
|
+
import type { SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
3
|
+
declare const LinkToSyntenyView: ({ model, feat, }: {
|
|
3
4
|
model: SyntenyFeatureDetailModel;
|
|
5
|
+
feat: SimpleFeatureSerialized;
|
|
4
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
export default LinkToSyntenyView;
|
|
@@ -39,19 +39,19 @@ const util_1 = require("@jbrowse/core/util");
|
|
|
39
39
|
const material_1 = require("@mui/material");
|
|
40
40
|
const mobx_react_1 = require("mobx-react");
|
|
41
41
|
const LaunchSyntenyViewDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('../LGVSyntenyDisplay/components/LaunchSyntenyViewDialog'))));
|
|
42
|
-
const LinkToSyntenyView = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
43
|
-
const {
|
|
42
|
+
const LinkToSyntenyView = (0, mobx_react_1.observer)(function ({ model, feat, }) {
|
|
43
|
+
const { view, level, trackId } = model;
|
|
44
44
|
return ((0, jsx_runtime_1.jsxs)("ul", { children: [view.type === 'LinearSyntenyView' ? ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "#", onClick: event => {
|
|
45
45
|
var _a, _b;
|
|
46
46
|
event.preventDefault();
|
|
47
47
|
const { views } = view;
|
|
48
48
|
if (level !== undefined) {
|
|
49
|
-
(_a = views[level]) === null || _a === void 0 ? void 0 : _a.navTo(
|
|
50
|
-
(_b = views[level + 1]) === null || _b === void 0 ? void 0 : _b.navTo(
|
|
49
|
+
(_a = views[level]) === null || _a === void 0 ? void 0 : _a.navTo(feat);
|
|
50
|
+
(_b = views[level + 1]) === null || _b === void 0 ? void 0 : _b.navTo(feat.mate);
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
const f1 =
|
|
54
|
-
const f2 =
|
|
53
|
+
const f1 = feat;
|
|
54
|
+
const f2 = feat.mate;
|
|
55
55
|
const r1 = f1.assemblyName;
|
|
56
56
|
const r2 = f2.assemblyName;
|
|
57
57
|
const v1 = views.find(view => view.assemblyNames[0] === r1);
|
|
@@ -71,7 +71,7 @@ const LinkToSyntenyView = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
71
71
|
}
|
|
72
72
|
}, children: "Center view on this feature" }) })) : null, (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: "#", onClick: event => {
|
|
73
73
|
event.preventDefault();
|
|
74
|
-
const feature = new util_1.SimpleFeature(
|
|
74
|
+
const feature = new util_1.SimpleFeature(feat);
|
|
75
75
|
const session = (0, util_1.getSession)(model);
|
|
76
76
|
session.queueDialog(handleClose => [
|
|
77
77
|
LaunchSyntenyViewDialog,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SyntenyFeatureDetailModel } from './types';
|
|
2
|
-
declare const SyntenyFeatureDetail: (
|
|
2
|
+
declare const SyntenyFeatureDetail: (props: {
|
|
3
3
|
model: SyntenyFeatureDetailModel;
|
|
4
4
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default SyntenyFeatureDetail;
|
|
@@ -4,12 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const BaseFeatureDetail_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail"));
|
|
8
7
|
const BaseCard_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard"));
|
|
8
|
+
const FeatureDetails_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails"));
|
|
9
9
|
const material_1 = require("@mui/material");
|
|
10
10
|
const mobx_react_1 = require("mobx-react");
|
|
11
|
+
const Formatter_1 = __importDefault(require("./Formatter"));
|
|
11
12
|
const LinkToSyntenyView_1 = __importDefault(require("./LinkToSyntenyView"));
|
|
12
|
-
const SyntenyFeatureDetail = (0, mobx_react_1.observer)(function (
|
|
13
|
-
|
|
13
|
+
const SyntenyFeatureDetail = (0, mobx_react_1.observer)(function (props) {
|
|
14
|
+
const { model } = props;
|
|
15
|
+
const { featureData } = model;
|
|
16
|
+
const feat = structuredClone(featureData);
|
|
17
|
+
return feat ? ((0, jsx_runtime_1.jsxs)(material_1.Paper, { children: [(0, jsx_runtime_1.jsx)(FeatureDetails_1.default, { ...props, feature: feat, formatter: value => (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: value }) }), (0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: "Link to view", children: (0, jsx_runtime_1.jsx)(LinkToSyntenyView_1.default, { model: model, feat: feat }) })] })) : ((0, jsx_runtime_1.jsx)("div", { children: "No feature loaded, may not be available after page refresh because it was too large for localStorage" }));
|
|
14
18
|
});
|
|
15
19
|
exports.default = SyntenyFeatureDetail;
|
|
@@ -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';
|
|
@@ -17,6 +17,6 @@ const useStyles = makeStyles()(() => ({
|
|
|
17
17
|
const HeaderSearchBoxes = observer(function ({ view, }) {
|
|
18
18
|
const { classes } = useStyles();
|
|
19
19
|
const { assemblyNames, 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: [assemblyNames.join(','), " ",
|
|
20
|
+
return (_jsxs("span", { className: classes.searchBox, children: [_jsx(SearchBox, { model: view, showHelp: false }), _jsxs(Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [assemblyNames.join(','), " ", getBpDisplayStr(coarseTotalBp)] })] }));
|
|
21
21
|
});
|
|
22
22
|
export default HeaderSearchBoxes;
|
|
@@ -77,7 +77,8 @@ 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 isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
81
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
81
82
|
readonly rubberbandTop: number;
|
|
82
83
|
readonly pinnedTracksTop: number;
|
|
83
84
|
} & {
|
|
@@ -188,13 +189,13 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
188
189
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
189
190
|
} & {
|
|
190
191
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
191
|
-
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
192
|
+
navToLocString(input: string, optAssemblyName?: string, grow?: number): Promise<void>;
|
|
192
193
|
navToSearchString({ input, assembly, }: {
|
|
193
194
|
input: string;
|
|
194
195
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
195
196
|
}): Promise<void>;
|
|
196
|
-
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string): Promise<void>;
|
|
197
|
-
navToLocations(
|
|
197
|
+
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string, grow?: number): Promise<void>;
|
|
198
|
+
navToLocations(regions: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string, grow?: number): Promise<void>;
|
|
198
199
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
199
200
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
200
201
|
} & {
|
|
@@ -262,9 +263,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
262
263
|
displayName: string | undefined;
|
|
263
264
|
tracks: any[];
|
|
264
265
|
minimized: boolean;
|
|
265
|
-
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
266
266
|
offsetPx: number;
|
|
267
267
|
bpPerPx: number;
|
|
268
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
268
269
|
hideHeader: boolean;
|
|
269
270
|
hideHeaderOverview: boolean;
|
|
270
271
|
hideNoTracksActive: boolean;
|
|
@@ -392,7 +393,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
392
393
|
readonly width: number;
|
|
393
394
|
readonly interRegionPaddingWidth: number;
|
|
394
395
|
readonly assemblyNames: string[];
|
|
395
|
-
readonly
|
|
396
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
397
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
396
398
|
readonly rubberbandTop: number;
|
|
397
399
|
readonly pinnedTracksTop: number;
|
|
398
400
|
} & {
|
|
@@ -503,13 +505,13 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
503
505
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
504
506
|
} & {
|
|
505
507
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
506
|
-
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
508
|
+
navToLocString(input: string, optAssemblyName?: string, grow?: number): Promise<void>;
|
|
507
509
|
navToSearchString({ input, assembly, }: {
|
|
508
510
|
input: string;
|
|
509
511
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
510
512
|
}): Promise<void>;
|
|
511
|
-
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string): Promise<void>;
|
|
512
|
-
navToLocations(
|
|
513
|
+
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string, grow?: number): Promise<void>;
|
|
514
|
+
navToLocations(regions: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string, grow?: number): Promise<void>;
|
|
513
515
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
514
516
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
515
517
|
} & {
|
|
@@ -577,9 +579,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
577
579
|
displayName: string | undefined;
|
|
578
580
|
tracks: any[];
|
|
579
581
|
minimized: boolean;
|
|
580
|
-
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
581
582
|
offsetPx: number;
|
|
582
583
|
bpPerPx: number;
|
|
584
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
583
585
|
hideHeader: boolean;
|
|
584
586
|
hideHeaderOverview: boolean;
|
|
585
587
|
hideNoTracksActive: boolean;
|
|
@@ -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,8 @@ 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 isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
81
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
98
82
|
readonly rubberbandTop: number;
|
|
99
83
|
readonly pinnedTracksTop: number;
|
|
100
84
|
} & {
|
|
@@ -205,13 +189,13 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
205
189
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
206
190
|
} & {
|
|
207
191
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
208
|
-
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
192
|
+
navToLocString(input: string, optAssemblyName?: string, grow?: number): Promise<void>;
|
|
209
193
|
navToSearchString({ input, assembly, }: {
|
|
210
194
|
input: string;
|
|
211
195
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
212
196
|
}): Promise<void>;
|
|
213
|
-
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string): Promise<void>;
|
|
214
|
-
navToLocations(
|
|
197
|
+
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string, grow?: number): Promise<void>;
|
|
198
|
+
navToLocations(regions: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string, grow?: number): Promise<void>;
|
|
215
199
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
216
200
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
217
201
|
} & {
|
|
@@ -279,9 +263,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
279
263
|
displayName: string | undefined;
|
|
280
264
|
tracks: any[];
|
|
281
265
|
minimized: boolean;
|
|
282
|
-
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
283
266
|
offsetPx: number;
|
|
284
267
|
bpPerPx: number;
|
|
268
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
285
269
|
hideHeader: boolean;
|
|
286
270
|
hideHeaderOverview: boolean;
|
|
287
271
|
hideNoTracksActive: boolean;
|
|
@@ -298,6 +282,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
298
282
|
} & {
|
|
299
283
|
type: import("mobx-state-tree").ISimpleType<"LinearSyntenyView">;
|
|
300
284
|
drawCIGAR: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
285
|
+
drawCIGARMatchesOnly: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
301
286
|
drawCurves: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
302
287
|
}, {
|
|
303
288
|
width: number;
|
|
@@ -346,6 +331,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
346
331
|
setImportFormSyntenyTrack(arg: number, val: ImportFormSyntenyTrack): void;
|
|
347
332
|
setDrawCurves(arg: boolean): void;
|
|
348
333
|
setDrawCIGAR(arg: boolean): void;
|
|
334
|
+
setDrawCIGARMatchesOnly(arg: boolean): void;
|
|
349
335
|
showAllRegions(): void;
|
|
350
336
|
} & {
|
|
351
337
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
@@ -476,7 +462,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
476
462
|
readonly width: number;
|
|
477
463
|
readonly interRegionPaddingWidth: number;
|
|
478
464
|
readonly assemblyNames: string[];
|
|
479
|
-
readonly
|
|
465
|
+
readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
|
|
466
|
+
readonly stickyViewHeaders: boolean | undefined;
|
|
480
467
|
readonly rubberbandTop: number;
|
|
481
468
|
readonly pinnedTracksTop: number;
|
|
482
469
|
} & {
|
|
@@ -587,13 +574,13 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
587
574
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
588
575
|
} & {
|
|
589
576
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
590
|
-
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
577
|
+
navToLocString(input: string, optAssemblyName?: string, grow?: number): Promise<void>;
|
|
591
578
|
navToSearchString({ input, assembly, }: {
|
|
592
579
|
input: string;
|
|
593
580
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
594
581
|
}): Promise<void>;
|
|
595
|
-
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string): Promise<void>;
|
|
596
|
-
navToLocations(
|
|
582
|
+
navToLocation(parsedLocString: import("@jbrowse/core/util").ParsedLocString, assemblyName?: string, grow?: number): Promise<void>;
|
|
583
|
+
navToLocations(regions: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string, grow?: number): Promise<void>;
|
|
597
584
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
598
585
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
599
586
|
} & {
|
|
@@ -661,9 +648,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
661
648
|
displayName: string | undefined;
|
|
662
649
|
tracks: any[];
|
|
663
650
|
minimized: boolean;
|
|
664
|
-
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
665
651
|
offsetPx: number;
|
|
666
652
|
bpPerPx: number;
|
|
653
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
667
654
|
hideHeader: boolean;
|
|
668
655
|
hideHeaderOverview: boolean;
|
|
669
656
|
hideNoTracksActive: boolean;
|
|
@@ -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>;
|
|
@@ -67,7 +67,7 @@ export async function renderToSvg(model, opts) {
|
|
|
67
67
|
const rendering = renderings[i - 1];
|
|
68
68
|
const height = heights[i];
|
|
69
69
|
const levelHeight = level.height || 0;
|
|
70
|
-
RenderList.push(_jsxs("g", { transform: `translate(0 ${currOffset})`, children: [levelHeight ? (_jsx("defs", { children: _jsx("clipPath", { id: `synclip-${i}`, children: _jsx("rect", { x: 0, y: 0, width: width, height: levelHeight }) }) })) : null, _jsx("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize})`, clipPath: `url(#synclip-${i})`, children: rendering === null || rendering === void 0 ? void 0 : rendering.map((r, i) =>
|
|
70
|
+
RenderList.push(_jsxs("g", { transform: `translate(0 ${currOffset})`, children: [levelHeight ? (_jsx("defs", { children: _jsx("clipPath", { id: `synclip-${i}`, children: _jsx("rect", { x: 0, y: 0, width: width, height: levelHeight }) }) })) : null, _jsx("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize})`, clipPath: `url(#synclip-${i})`, children: rendering === null || rendering === void 0 ? void 0 : rendering.map((r, i) => _jsx(ReactRendering, { rendering: r }, i)) }), _jsx("g", { transform: `translate(0 ${levelHeight})`, children: _jsx(SVGLinearGenomeView, { rulerHeight: rulerHeight, shift: shift, trackLabelOffset: trackLabelOffset, textHeight: textHeight, trackLabels: trackLabels, displayResults: displayResults[i], view: view, fontSize: fontSize }, view.id) })] }, view.id));
|
|
71
71
|
currOffset += height + fontSize + rulerHeight + levelHeight;
|
|
72
72
|
}
|
|
73
73
|
return renderToStaticMarkup(_jsx(ThemeProvider, { theme: theme, children: _jsx(Wrapper, { children: _jsxs("svg", { width: width, height: totalHeightSvg, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w + shift * 2, totalHeightSvg].toString(), children: [_jsx(SVGBackground, { width: w, height: totalHeightSvg, shift: shift }), RenderList] }) }) }));
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import copy from 'copy-to-clipboard';
|
|
4
|
+
export default function Formatter({ value }) {
|
|
5
|
+
const [show, setShow] = useState(false);
|
|
6
|
+
const [copied, setCopied] = useState(false);
|
|
7
|
+
const display = String(value);
|
|
8
|
+
return display.length > 100 ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: () => {
|
|
9
|
+
copy(display);
|
|
10
|
+
setCopied(true);
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
setCopied(false);
|
|
13
|
+
}, 700);
|
|
14
|
+
}, children: copied ? 'Copied to clipboard' : 'Copy' }), _jsx("button", { type: "button", onClick: () => {
|
|
15
|
+
setShow(val => !val);
|
|
16
|
+
}, children: show ? 'Show less' : 'Show more' }), _jsx("div", { children: show ? display : `${display.slice(0, 100)}...` })] })) : (_jsx("div", { children: display }));
|
|
17
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { SyntenyFeatureDetailModel } from './types';
|
|
2
|
-
|
|
2
|
+
import type { SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
3
|
+
declare const LinkToSyntenyView: ({ model, feat, }: {
|
|
3
4
|
model: SyntenyFeatureDetailModel;
|
|
5
|
+
feat: SimpleFeatureSerialized;
|
|
4
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
export default LinkToSyntenyView;
|
|
@@ -4,19 +4,19 @@ import { SimpleFeature, assembleLocString, getSession, } from '@jbrowse/core/uti
|
|
|
4
4
|
import { Link } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
6
|
const LaunchSyntenyViewDialog = lazy(() => import('../LGVSyntenyDisplay/components/LaunchSyntenyViewDialog'));
|
|
7
|
-
const LinkToSyntenyView = observer(function ({ model, }) {
|
|
8
|
-
const {
|
|
7
|
+
const LinkToSyntenyView = observer(function ({ model, feat, }) {
|
|
8
|
+
const { view, level, trackId } = model;
|
|
9
9
|
return (_jsxs("ul", { children: [view.type === 'LinearSyntenyView' ? (_jsx("li", { children: _jsx(Link, { href: "#", onClick: event => {
|
|
10
10
|
var _a, _b;
|
|
11
11
|
event.preventDefault();
|
|
12
12
|
const { views } = view;
|
|
13
13
|
if (level !== undefined) {
|
|
14
|
-
(_a = views[level]) === null || _a === void 0 ? void 0 : _a.navTo(
|
|
15
|
-
(_b = views[level + 1]) === null || _b === void 0 ? void 0 : _b.navTo(
|
|
14
|
+
(_a = views[level]) === null || _a === void 0 ? void 0 : _a.navTo(feat);
|
|
15
|
+
(_b = views[level + 1]) === null || _b === void 0 ? void 0 : _b.navTo(feat.mate);
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
18
|
-
const f1 =
|
|
19
|
-
const f2 =
|
|
18
|
+
const f1 = feat;
|
|
19
|
+
const f2 = feat.mate;
|
|
20
20
|
const r1 = f1.assemblyName;
|
|
21
21
|
const r2 = f2.assemblyName;
|
|
22
22
|
const v1 = views.find(view => view.assemblyNames[0] === r1);
|
|
@@ -36,7 +36,7 @@ const LinkToSyntenyView = observer(function ({ model, }) {
|
|
|
36
36
|
}
|
|
37
37
|
}, children: "Center view on this feature" }) })) : null, _jsx("li", { children: _jsx(Link, { href: "#", onClick: event => {
|
|
38
38
|
event.preventDefault();
|
|
39
|
-
const feature = new SimpleFeature(
|
|
39
|
+
const feature = new SimpleFeature(feat);
|
|
40
40
|
const session = getSession(model);
|
|
41
41
|
session.queueDialog(handleClose => [
|
|
42
42
|
LaunchSyntenyViewDialog,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SyntenyFeatureDetailModel } from './types';
|
|
2
|
-
declare const SyntenyFeatureDetail: (
|
|
2
|
+
declare const SyntenyFeatureDetail: (props: {
|
|
3
3
|
model: SyntenyFeatureDetailModel;
|
|
4
4
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default SyntenyFeatureDetail;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import BaseFeatureDetail from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
|
|
3
2
|
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard';
|
|
3
|
+
import FeatureDetails from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails';
|
|
4
4
|
import { Paper } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
+
import Formatter from './Formatter';
|
|
6
7
|
import LinkToSyntenyView from './LinkToSyntenyView';
|
|
7
|
-
const SyntenyFeatureDetail = observer(function (
|
|
8
|
-
|
|
8
|
+
const SyntenyFeatureDetail = observer(function (props) {
|
|
9
|
+
const { model } = props;
|
|
10
|
+
const { featureData } = model;
|
|
11
|
+
const feat = structuredClone(featureData);
|
|
12
|
+
return feat ? (_jsxs(Paper, { children: [_jsx(FeatureDetails, { ...props, feature: feat, formatter: value => _jsx(Formatter, { value: value }) }), _jsx(BaseCard, { title: "Link to view", children: _jsx(LinkToSyntenyView, { model: model, feat: feat }) })] })) : (_jsx("div", { children: "No feature loaded, may not be available after page refresh because it was too large for localStorage" }));
|
|
9
13
|
});
|
|
10
14
|
export default SyntenyFeatureDetail;
|
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.0",
|
|
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.0",
|
|
40
|
+
"@jbrowse/plugin-alignments": "^3.5.0",
|
|
41
|
+
"@jbrowse/plugin-linear-genome-view": "^3.5.0",
|
|
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": "8a8aa0aab2229dece106a5715a767e649e2fe92b"
|
|
63
63
|
}
|