@jbrowse/plugin-linear-comparative-view 2.10.3 → 2.11.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/components/LaunchSyntenyViewDialog.js +2 -1
- package/dist/LGVSyntenyDisplay/index.d.ts +1 -2
- package/dist/LGVSyntenyDisplay/index.js +3 -2
- package/dist/LaunchLinearSyntenyView.js +1 -1
- package/dist/LinearComparativeDisplay/index.d.ts +1 -2
- package/dist/LinearComparativeDisplay/index.js +3 -2
- package/dist/LinearComparativeView/components/Rubberband.d.ts +1 -1
- package/dist/LinearComparativeView/index.d.ts +1 -2
- package/dist/LinearComparativeView/index.js +3 -2
- package/dist/LinearComparativeView/model.d.ts +42 -4
- package/dist/LinearReadVsRef/index.d.ts +1 -1
- package/dist/LinearReadVsRef/index.js +2 -2
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -2
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -0
- package/dist/LinearSyntenyDisplay/index.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/index.js +3 -2
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +7 -4
- package/dist/LinearSyntenyView/index.d.ts +1 -2
- package/dist/LinearSyntenyView/index.js +3 -2
- package/dist/LinearSyntenyView/model.d.ts +105 -12
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +10 -7
- package/dist/SyntenyFeatureDetail/index.d.ts +1 -2
- package/dist/SyntenyFeatureDetail/index.js +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +2 -1
- package/esm/LGVSyntenyDisplay/index.d.ts +1 -2
- package/esm/LGVSyntenyDisplay/index.js +2 -2
- package/esm/LaunchLinearSyntenyView.js +1 -1
- package/esm/LinearComparativeDisplay/index.d.ts +1 -2
- package/esm/LinearComparativeDisplay/index.js +2 -2
- package/esm/LinearComparativeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearComparativeView/index.d.ts +1 -2
- package/esm/LinearComparativeView/index.js +2 -2
- package/esm/LinearComparativeView/model.d.ts +42 -4
- package/esm/LinearReadVsRef/index.d.ts +1 -1
- package/esm/LinearReadVsRef/index.js +1 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -2
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -0
- package/esm/LinearSyntenyDisplay/index.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/index.js +2 -2
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +7 -4
- package/esm/LinearSyntenyView/index.d.ts +1 -2
- package/esm/LinearSyntenyView/index.js +2 -2
- package/esm/LinearSyntenyView/model.d.ts +105 -12
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +11 -8
- package/esm/SyntenyFeatureDetail/index.d.ts +1 -2
- package/esm/SyntenyFeatureDetail/index.js +2 -2
- package/esm/index.d.ts +1 -1
- package/esm/index.js +3 -3
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ThemeProvider } from '@mui/material';
|
|
3
3
|
import { getRoot } from 'mobx-state-tree';
|
|
4
4
|
import { when } from 'mobx';
|
|
5
|
-
import { getSession, getSerializedSvg, max, measureText, ReactRendering, renderToAbstractCanvas, renderToStaticMarkup, sum, } from '@jbrowse/core/util';
|
|
5
|
+
import { getSession, getSerializedSvg, max, measureText, ReactRendering, renderToAbstractCanvas, renderToStaticMarkup, sum, getFillProps, } from '@jbrowse/core/util';
|
|
6
6
|
import { getTrackName } from '@jbrowse/core/util/tracks';
|
|
7
7
|
import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
8
8
|
import { SVGTracks, SVGRuler, totalHeight, } from '@jbrowse/plugin-linear-genome-view';
|
|
@@ -13,9 +13,9 @@ import { drawRef } from '../../LinearSyntenyDisplay/drawSynteny';
|
|
|
13
13
|
export async function renderToSvg(model, opts) {
|
|
14
14
|
var _a;
|
|
15
15
|
await when(() => model.initialized);
|
|
16
|
-
const { textHeight = 18, headerHeight = 30, rulerHeight = 30, fontSize = 13, trackLabels = 'offset', Wrapper = ({ children }) =>
|
|
16
|
+
const { textHeight = 18, headerHeight = 30, rulerHeight = 30, fontSize = 13, trackLabels = 'offset', Wrapper = ({ children }) => children, themeName = 'default', } = opts;
|
|
17
17
|
const session = getSession(model);
|
|
18
|
-
const
|
|
18
|
+
const themeVar = (_a = session.allThemes) === null || _a === void 0 ? void 0 : _a.call(session)[themeName];
|
|
19
19
|
const { width, views, middleComparativeHeight: synH, tracks } = model;
|
|
20
20
|
const shift = 50;
|
|
21
21
|
const offset = headerHeight + rulerHeight;
|
|
@@ -28,7 +28,10 @@ export async function renderToSvg(model, opts) {
|
|
|
28
28
|
data: await Promise.all(view.tracks.map(async (track) => {
|
|
29
29
|
const d = track.displays[0];
|
|
30
30
|
await when(() => (d.ready !== undefined ? d.ready : true));
|
|
31
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
track,
|
|
33
|
+
result: await d.renderSvg({ ...opts, theme: themeVar }),
|
|
34
|
+
};
|
|
32
35
|
})),
|
|
33
36
|
})));
|
|
34
37
|
const renderings = await Promise.all(tracks.map(async (track) => {
|
|
@@ -54,15 +57,15 @@ export async function renderToSvg(model, opts) {
|
|
|
54
57
|
const trackLabelMaxLen = max(views.flatMap(view => view.tracks.map(t => measureText(getTrackName(t.configuration, session), fontSize))), 0) + 40;
|
|
55
58
|
const trackLabelOffset = trackLabels === 'left' ? trackLabelMaxLen : 0;
|
|
56
59
|
const w = width + trackLabelOffset;
|
|
57
|
-
const
|
|
60
|
+
const theme = createJBrowseTheme(themeVar);
|
|
58
61
|
// the xlink namespace is used for rendering <image> tag
|
|
59
|
-
return renderToStaticMarkup(React.createElement(ThemeProvider, { theme:
|
|
62
|
+
return renderToStaticMarkup(React.createElement(ThemeProvider, { theme: theme },
|
|
60
63
|
React.createElement(Wrapper, null,
|
|
61
64
|
React.createElement("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() },
|
|
62
65
|
React.createElement(SVGBackground, { width: w, height: totalHeightSvg, shift: shift }),
|
|
63
66
|
React.createElement("g", { transform: `translate(${shift} ${fontSize})` },
|
|
64
67
|
React.createElement("g", { transform: `translate(${trackLabelOffset})` },
|
|
65
|
-
React.createElement("text", { x: 0, fontSize: fontSize,
|
|
68
|
+
React.createElement("text", { x: 0, fontSize: fontSize, ...getFillProps(theme.palette.text.primary) }, views[0].assemblyNames.join(', ')),
|
|
66
69
|
React.createElement(SVGRuler, { model: displayResults[0].view, fontSize: fontSize })),
|
|
67
70
|
React.createElement(SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: displayResults[0].view, displayResults: displayResults[0].data, offset: offset, trackLabelOffset: trackLabelOffset })),
|
|
68
71
|
React.createElement("defs", null,
|
|
@@ -71,7 +74,7 @@ export async function renderToSvg(model, opts) {
|
|
|
71
74
|
React.createElement("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize + heights[0]})`, clipPath: `url(#synclip)` }, renderings.map((r, i) => (React.createElement(ReactRendering, { key: i, rendering: r })))),
|
|
72
75
|
React.createElement("g", { transform: `translate(${shift} ${fontSize + heights[0] + synH})` },
|
|
73
76
|
React.createElement("g", { transform: `translate(${trackLabelOffset})` },
|
|
74
|
-
React.createElement("text", { x: 0, fontSize: fontSize,
|
|
77
|
+
React.createElement("text", { x: 0, fontSize: fontSize, ...getFillProps(theme.palette.text.primary) }, views[1].assemblyNames.join(', ')),
|
|
75
78
|
React.createElement(SVGRuler, { model: displayResults[1].view, fontSize: fontSize })),
|
|
76
79
|
React.createElement(SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: displayResults[1].view, displayResults: displayResults[1].data, offset: offset, trackLabelOffset: trackLabelOffset }))))), createRootFn);
|
|
77
80
|
}
|
|
@@ -18,7 +18,7 @@ const stateModel = types
|
|
|
18
18
|
self.featureData = undefined;
|
|
19
19
|
},
|
|
20
20
|
}));
|
|
21
|
-
export default (pluginManager)
|
|
21
|
+
export default function SyntenyFeatureWidgetF(pluginManager) {
|
|
22
22
|
pluginManager.addWidgetType(() => new WidgetType({
|
|
23
23
|
name: 'SyntenyFeatureWidget',
|
|
24
24
|
heading: 'Synteny feature details',
|
|
@@ -26,4 +26,4 @@ export default (pluginManager) => {
|
|
|
26
26
|
stateModel,
|
|
27
27
|
ReactComponent: lazy(() => import('./SyntenyFeatureDetail')),
|
|
28
28
|
}));
|
|
29
|
-
}
|
|
29
|
+
}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
2
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
-
export default class extends Plugin {
|
|
3
|
+
export default class LinearComparativeViewPlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
|
6
6
|
configure(pluginManager: PluginManager): void;
|
package/esm/index.js
CHANGED
|
@@ -9,8 +9,8 @@ import LinearSyntenyViewF from './LinearSyntenyView';
|
|
|
9
9
|
import LaunchLinearSyntenyViewF from './LaunchLinearSyntenyView';
|
|
10
10
|
import SyntenyTrackF from './SyntenyTrack';
|
|
11
11
|
import SyntenyFeatureWidgetF from './SyntenyFeatureDetail';
|
|
12
|
-
import
|
|
13
|
-
export default class extends Plugin {
|
|
12
|
+
import LinearReadVsRefMenuItemF from './LinearReadVsRef';
|
|
13
|
+
export default class LinearComparativeViewPlugin extends Plugin {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.name = 'LinearComparativeViewPlugin';
|
|
@@ -24,7 +24,7 @@ export default class extends Plugin {
|
|
|
24
24
|
LaunchLinearSyntenyViewF(pluginManager);
|
|
25
25
|
SyntenyTrackF(pluginManager);
|
|
26
26
|
SyntenyFeatureWidgetF(pluginManager);
|
|
27
|
-
|
|
27
|
+
LinearReadVsRefMenuItemF(pluginManager);
|
|
28
28
|
}
|
|
29
29
|
configure(pluginManager) {
|
|
30
30
|
if (isAbstractMenuManager(pluginManager.rootModel)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-comparative-view",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.1",
|
|
4
4
|
"description": "JBrowse 2 linear comparative view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "11b28d66d782eb06f92ccb993108bb6c3c82819e"
|
|
65
65
|
}
|