@jbrowse/plugin-linear-comparative-view 2.13.1 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +9 -3
- package/dist/LGVSyntenyDisplay/components/util.js +4 -3
- package/dist/LGVSyntenyDisplay/model.d.ts +4 -3
- package/dist/LaunchLinearSyntenyView.js +7 -3
- package/dist/LinearComparativeDisplay/configSchemaF.js +0 -1
- package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +3 -3
- package/dist/LinearComparativeDisplay/stateModelFactory.js +2 -2
- package/dist/LinearComparativeView/components/Header.js +6 -2
- package/dist/LinearComparativeView/components/Rubberband.js +9 -9
- package/dist/LinearComparativeView/model.d.ts +9 -16
- package/dist/LinearComparativeView/model.js +10 -14
- package/dist/LinearReadVsRef/LinearReadVsRef.js +6 -4
- package/dist/LinearSyntenyDisplay/afterAttach.js +2 -2
- package/dist/LinearSyntenyDisplay/components/Component.js +6 -2
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +29 -15
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +4 -1
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -6
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
- package/dist/LinearSyntenyDisplay/components/util.d.ts +3 -1
- package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
- package/dist/LinearSyntenyDisplay/drawSynteny.js +16 -8
- package/dist/LinearSyntenyDisplay/model.d.ts +9 -5
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +16 -6
- package/dist/LinearSyntenyView/components/ImportForm/ImportCustomTrack.js +14 -4
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelector.js +3 -1
- package/dist/LinearSyntenyView/components/ImportForm/index.js +15 -5
- package/dist/LinearSyntenyView/model.d.ts +9 -11
- package/dist/LinearSyntenyView/model.js +3 -1
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +9 -7
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -1
- package/dist/util.js +4 -3
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +9 -3
- package/esm/LGVSyntenyDisplay/components/util.js +4 -3
- package/esm/LGVSyntenyDisplay/model.d.ts +4 -3
- package/esm/LaunchLinearSyntenyView.js +7 -3
- package/esm/LinearComparativeDisplay/configSchemaF.js +0 -1
- package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +3 -3
- package/esm/LinearComparativeDisplay/stateModelFactory.js +2 -2
- package/esm/LinearComparativeView/components/Header.js +6 -2
- package/esm/LinearComparativeView/components/Rubberband.js +9 -9
- package/esm/LinearComparativeView/model.d.ts +9 -16
- package/esm/LinearComparativeView/model.js +11 -15
- package/esm/LinearReadVsRef/LinearReadVsRef.js +6 -4
- package/esm/LinearSyntenyDisplay/afterAttach.js +2 -2
- package/esm/LinearSyntenyDisplay/components/Component.js +6 -2
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +29 -15
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +4 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -6
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
- package/esm/LinearSyntenyDisplay/components/util.d.ts +3 -1
- package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/drawSynteny.js +16 -8
- package/esm/LinearSyntenyDisplay/model.d.ts +9 -5
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +16 -6
- package/esm/LinearSyntenyView/components/ImportForm/ImportCustomTrack.js +14 -4
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelector.js +3 -1
- package/esm/LinearSyntenyView/components/ImportForm/index.js +15 -5
- package/esm/LinearSyntenyView/model.d.ts +9 -11
- package/esm/LinearSyntenyView/model.js +3 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +9 -7
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -1
- package/esm/util.js +4 -3
- package/package.json +3 -3
|
@@ -27,7 +27,9 @@ function TrackSelector({ setSessionTrackData, setShowTrackId, sessionTrackData,
|
|
|
27
27
|
return (React.createElement(React.Fragment, null,
|
|
28
28
|
React.createElement(FormControl, null,
|
|
29
29
|
React.createElement(FormLabel, { id: "group-label" }, "(Optional) Select or add a synteny track"),
|
|
30
|
-
React.createElement(RadioGroup, { row: true, value: choice, onChange: event =>
|
|
30
|
+
React.createElement(RadioGroup, { row: true, value: choice, onChange: event => {
|
|
31
|
+
setChoice(event.target.value);
|
|
32
|
+
}, "aria-labelledby": "group-label" },
|
|
31
33
|
React.createElement(FormControlLabel, { value: "none", control: React.createElement(Radio, null), label: "None" }),
|
|
32
34
|
React.createElement(FormControlLabel, { value: "tracklist", control: React.createElement(Radio, null), label: "Existing track" }),
|
|
33
35
|
React.createElement(FormControlLabel, { value: "custom", control: React.createElement(Radio, null), label: "New track" }))),
|
|
@@ -64,8 +66,12 @@ const LinearSyntenyViewImportForm = observer(function ({ model, }) {
|
|
|
64
66
|
displayedRegions: asm.regions,
|
|
65
67
|
};
|
|
66
68
|
})));
|
|
67
|
-
model.views.forEach(view =>
|
|
68
|
-
|
|
69
|
+
model.views.forEach(view => {
|
|
70
|
+
view.setWidth(model.width);
|
|
71
|
+
});
|
|
72
|
+
model.views.forEach(view => {
|
|
73
|
+
view.showAllRegions();
|
|
74
|
+
});
|
|
69
75
|
if (sessionTrackData) {
|
|
70
76
|
session.addTrackConf(sessionTrackData);
|
|
71
77
|
model.toggleTrack(sessionTrackData.trackId);
|
|
@@ -89,9 +95,13 @@ const LinearSyntenyViewImportForm = observer(function ({ model, }) {
|
|
|
89
95
|
React.createElement("p", { style: { textAlign: 'center' } }, "Select assemblies for linear synteny view"),
|
|
90
96
|
React.createElement(Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center" },
|
|
91
97
|
React.createElement(Grid, { item: true },
|
|
92
|
-
React.createElement(AssemblySelector, { selected: assembly1, onChange: val =>
|
|
98
|
+
React.createElement(AssemblySelector, { selected: assembly1, onChange: val => {
|
|
99
|
+
setAssembly1(val);
|
|
100
|
+
}, session: session })),
|
|
93
101
|
React.createElement(Grid, { item: true },
|
|
94
|
-
React.createElement(AssemblySelector, { selected: assembly2, onChange: val =>
|
|
102
|
+
React.createElement(AssemblySelector, { selected: assembly2, onChange: val => {
|
|
103
|
+
setAssembly2(val);
|
|
104
|
+
}, session: session })),
|
|
95
105
|
React.createElement(Grid, { item: true },
|
|
96
106
|
React.createElement(FormControl, null,
|
|
97
107
|
React.createElement(Button, { onClick: onOpenClick, variant: "contained", color: "primary" }, "Launch"))))),
|
|
@@ -54,7 +54,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
54
54
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
55
55
|
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
56
56
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
57
|
-
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<
|
|
57
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>;
|
|
58
58
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
59
59
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
60
60
|
}, {
|
|
@@ -70,7 +70,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
70
70
|
minimumBlockWidth: number;
|
|
71
71
|
draggingTrackId: undefined | string;
|
|
72
72
|
volatileError: unknown;
|
|
73
|
-
afterDisplayedRegionsSetCallbacks:
|
|
73
|
+
afterDisplayedRegionsSetCallbacks: (() => void)[];
|
|
74
74
|
scaleFactor: number;
|
|
75
75
|
trackRefs: Record<string, HTMLDivElement>;
|
|
76
76
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
@@ -83,7 +83,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
83
83
|
readonly interRegionPaddingWidth: number;
|
|
84
84
|
readonly assemblyNames: string[];
|
|
85
85
|
} & {
|
|
86
|
-
scaleBarDisplayPrefix(): string;
|
|
86
|
+
scaleBarDisplayPrefix(): string | undefined;
|
|
87
87
|
MiniControlsComponent(): React.FC<any>;
|
|
88
88
|
HeaderComponent(): React.FC<any>;
|
|
89
89
|
readonly assemblyErrors: string;
|
|
@@ -98,7 +98,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
98
98
|
readonly totalBp: number;
|
|
99
99
|
readonly maxBpPerPx: number;
|
|
100
100
|
readonly minBpPerPx: number;
|
|
101
|
-
readonly error:
|
|
101
|
+
readonly error: unknown;
|
|
102
102
|
readonly maxOffset: number;
|
|
103
103
|
readonly minOffset: number;
|
|
104
104
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -122,9 +122,9 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
122
122
|
setHideHeaderOverview(b: boolean): void;
|
|
123
123
|
setHideNoTracksActive(b: boolean): void;
|
|
124
124
|
setShowGridlines(b: boolean): void;
|
|
125
|
-
addToHighlights(highlight:
|
|
126
|
-
setHighlight(highlight
|
|
127
|
-
removeHighlight(highlight:
|
|
125
|
+
addToHighlights(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType): void;
|
|
126
|
+
setHighlight(highlight?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType[]): void;
|
|
127
|
+
removeHighlight(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType): void;
|
|
128
128
|
scrollTo(offsetPx: number): number;
|
|
129
129
|
zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
|
|
130
130
|
setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, right?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): void;
|
|
@@ -139,7 +139,6 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
139
139
|
moveTrackToTop(id: string): void;
|
|
140
140
|
moveTrackToBottom(id: string): void;
|
|
141
141
|
moveTrack(movingId: string, targetId: string): void;
|
|
142
|
-
closeView(): void;
|
|
143
142
|
toggleTrack(trackId: string): boolean;
|
|
144
143
|
setTrackLabels(setting: "overlapping" | "offset" | "hidden"): void;
|
|
145
144
|
setShowCenterLine(b: boolean): void;
|
|
@@ -159,7 +158,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
159
158
|
variant?: string;
|
|
160
159
|
isLeftEndOfDisplayedRegion?: boolean;
|
|
161
160
|
}[];
|
|
162
|
-
afterDisplayedRegionsSet(cb:
|
|
161
|
+
afterDisplayedRegionsSet(cb: () => void): void;
|
|
163
162
|
horizontalScroll(distance: number): number;
|
|
164
163
|
center(): void;
|
|
165
164
|
showAllRegions(): void;
|
|
@@ -252,7 +251,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
252
251
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
253
252
|
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
254
253
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
255
|
-
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<
|
|
254
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>;
|
|
256
255
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
257
256
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
258
257
|
}>>, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -282,7 +281,6 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
282
281
|
setWidth(newWidth: number): void;
|
|
283
282
|
setViews(views: import("mobx-state-tree").SnapshotIn<import("@jbrowse/plugin-linear-genome-view").LinearGenomeViewModel>[]): void;
|
|
284
283
|
removeView(view: import("@jbrowse/plugin-linear-genome-view").LinearGenomeViewModel): void;
|
|
285
|
-
closeView(): void;
|
|
286
284
|
setMiddleComparativeHeight(n: number): number;
|
|
287
285
|
activateTrackSelector(): import("@jbrowse/core/util").Widget | undefined;
|
|
288
286
|
toggleTrack(trackId: string): boolean;
|
|
@@ -51,7 +51,9 @@ export default function stateModelFactory(pluginManager) {
|
|
|
51
51
|
*/
|
|
52
52
|
showAllRegions() {
|
|
53
53
|
transaction(() => {
|
|
54
|
-
self.views.forEach(view =>
|
|
54
|
+
self.views.forEach(view => {
|
|
55
|
+
view.showAllRegionsInAssembly();
|
|
56
|
+
});
|
|
55
57
|
});
|
|
56
58
|
},
|
|
57
59
|
}))
|
|
@@ -19,7 +19,6 @@ export async function renderToSvg(model, opts) {
|
|
|
19
19
|
const { width, views, middleComparativeHeight: synH, tracks } = model;
|
|
20
20
|
const shift = 50;
|
|
21
21
|
const offset = headerHeight + rulerHeight;
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
22
|
const { createRootFn } = getRoot(model);
|
|
24
23
|
const heights = views.map(v => totalHeight(v.tracks, textHeight, trackLabels) + offset);
|
|
25
24
|
const totalHeightSvg = sum(heights) + synH + 100;
|
|
@@ -37,11 +36,14 @@ export async function renderToSvg(model, opts) {
|
|
|
37
36
|
const renderings = await Promise.all(tracks.map(async (track) => {
|
|
38
37
|
const d = track.displays[0];
|
|
39
38
|
await when(() => (d.ready !== undefined ? d.ready : true));
|
|
40
|
-
const r = await renderToAbstractCanvas(width, synH, { exportSVG: opts }, ctx =>
|
|
39
|
+
const r = await renderToAbstractCanvas(width, synH, { exportSVG: opts }, ctx => {
|
|
40
|
+
drawRef(d, ctx);
|
|
41
|
+
return undefined;
|
|
42
|
+
});
|
|
41
43
|
if ('imageData' in r) {
|
|
42
44
|
throw new Error('found a canvas in svg export, probably a bug');
|
|
43
45
|
}
|
|
44
|
-
|
|
46
|
+
if ('canvasRecordedData' in r) {
|
|
45
47
|
return {
|
|
46
48
|
html: await getSerializedSvg({
|
|
47
49
|
...r,
|
|
@@ -50,9 +52,7 @@ export async function renderToSvg(model, opts) {
|
|
|
50
52
|
}),
|
|
51
53
|
};
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
return r;
|
|
55
|
-
}
|
|
55
|
+
return r;
|
|
56
56
|
}));
|
|
57
57
|
const trackLabelMaxLen = max(views.flatMap(view => view.tracks.map(t => measureText(getTrackName(t.configuration, session), fontSize))), 0) + 40;
|
|
58
58
|
const trackLabelOffset = trackLabels === 'left' ? trackLabelMaxLen : 0;
|
|
@@ -71,7 +71,9 @@ export async function renderToSvg(model, opts) {
|
|
|
71
71
|
React.createElement("defs", null,
|
|
72
72
|
React.createElement("clipPath", { id: 'synclip' },
|
|
73
73
|
React.createElement("rect", { x: 0, y: 0, width: width, height: synH }))),
|
|
74
|
-
React.createElement("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize + heights[0]})`, clipPath:
|
|
74
|
+
React.createElement("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize + heights[0]})`, clipPath: 'url(#synclip)' }, renderings.map((r, i) => (
|
|
75
|
+
/* biome-ignore lint/suspicious/noArrayIndexKey: */
|
|
76
|
+
React.createElement(ReactRendering, { key: i, rendering: r })))),
|
|
75
77
|
React.createElement("g", { transform: `translate(${shift} ${fontSize + heights[0] + synH})` },
|
|
76
78
|
React.createElement("g", { transform: `translate(${trackLabelOffset})` },
|
|
77
79
|
React.createElement("text", { x: 0, fontSize: fontSize, ...getFillProps(theme.palette.text.primary) }, views[1].assemblyNames.join(', ')),
|
|
@@ -16,7 +16,9 @@ function Formatter({ value }) {
|
|
|
16
16
|
setCopied(false);
|
|
17
17
|
}, 700);
|
|
18
18
|
} }, copied ? 'Copied to clipboard' : 'Copy'),
|
|
19
|
-
React.createElement("button", { type: "button", onClick: () =>
|
|
19
|
+
React.createElement("button", { type: "button", onClick: () => {
|
|
20
|
+
setShow(val => !val);
|
|
21
|
+
} }, show ? 'Show less' : 'Show more'),
|
|
20
22
|
React.createElement("div", null, show ? display : `${display.slice(0, 100)}...`)));
|
|
21
23
|
}
|
|
22
24
|
return React.createElement("div", null, display);
|
package/esm/util.js
CHANGED
|
@@ -8,10 +8,11 @@ function heightFromSpecificLevel(views, trackConfigId, level) {
|
|
|
8
8
|
.slice(0, level)
|
|
9
9
|
.map(v => v.height + 7)
|
|
10
10
|
.reduce((a, b) => a + b, 0);
|
|
11
|
+
const v = views[level];
|
|
11
12
|
return (heightUpUntilThisPoint +
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
getTrackPos(
|
|
13
|
+
v.headerHeight +
|
|
14
|
+
v.scaleBarHeight +
|
|
15
|
+
getTrackPos(v, trackConfigId) +
|
|
15
16
|
1);
|
|
16
17
|
}
|
|
17
18
|
export function getTrackPos(view, trackConfigId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-comparative-view",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"description": "JBrowse 2 linear comparative view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "npm-run-all build:*",
|
|
27
|
-
"test": "cd ../..; jest plugins/linear-comparative-view",
|
|
27
|
+
"test": "cd ../..; jest --passWithNoTests plugins/linear-comparative-view",
|
|
28
28
|
"prepublishOnly": "yarn test",
|
|
29
29
|
"prepack": "yarn build && yarn useDist",
|
|
30
30
|
"postpack": "yarn useSrc",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "9fb8231d932db40adf0a283081765431756c66ff"
|
|
65
65
|
}
|