@jbrowse/plugin-dotplot-view 2.17.0 → 3.0.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/ComparativeRenderer/index.d.ts +3 -8
- package/dist/ComparativeRenderer/index.js +3 -8
- package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
- package/dist/DotplotDisplay/components/DotplotDisplay.js +7 -12
- package/dist/DotplotDisplay/index.d.ts +1 -7
- package/dist/DotplotDisplay/index.js +2 -12
- package/dist/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
- package/dist/DotplotDisplay/renderDotplotBlock.js +3 -9
- package/dist/DotplotDisplay/stateModelFactory.d.ts +8 -45
- package/dist/DotplotDisplay/stateModelFactory.js +57 -100
- package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js +13 -14
- package/dist/DotplotReadVsRef/index.d.ts +1 -1
- package/dist/DotplotReadVsRef/index.js +0 -2
- package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
- package/dist/DotplotRenderer/ComparativeRenderRpc.js +3 -8
- package/dist/DotplotRenderer/DotplotRenderer.d.ts +8 -7
- package/dist/DotplotRenderer/DotplotRenderer.js +18 -9
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
- package/dist/DotplotRenderer/components/DotplotRendering.js +2 -5
- package/dist/DotplotRenderer/configSchema.d.ts +0 -21
- package/dist/DotplotRenderer/configSchema.js +2 -27
- package/dist/DotplotRenderer/drawDotplot.d.ts +3 -3
- package/dist/DotplotRenderer/drawDotplot.js +3 -6
- package/dist/DotplotRenderer/index.d.ts +1 -1
- package/dist/DotplotRenderer/index.js +1 -1
- package/dist/DotplotView/1dview.d.ts +2 -77
- package/dist/DotplotView/1dview.js +4 -33
- package/dist/DotplotView/components/Axes.d.ts +5 -6
- package/dist/DotplotView/components/Axes.js +26 -40
- package/dist/DotplotView/components/CursorIcon.d.ts +3 -4
- package/dist/DotplotView/components/CursorIcon.js +3 -5
- package/dist/DotplotView/components/DotplotControls.d.ts +2 -3
- package/dist/DotplotView/components/DotplotControls.js +94 -97
- package/dist/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
- package/dist/DotplotView/components/DotplotTooltipClick.js +3 -7
- package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
- package/dist/DotplotView/components/DotplotTooltipMouseover.js +4 -8
- package/dist/DotplotView/components/DotplotView.d.ts +2 -3
- package/dist/DotplotView/components/DotplotView.js +80 -92
- package/dist/DotplotView/components/DotplotWarnings.d.ts +2 -3
- package/dist/DotplotView/components/DotplotWarnings.js +26 -21
- package/dist/DotplotView/components/ExportSvgDialog.d.ts +2 -3
- package/dist/DotplotView/components/ExportSvgDialog.js +32 -67
- package/dist/DotplotView/components/Grid.d.ts +3 -4
- package/dist/DotplotView/components/Grid.js +19 -32
- package/dist/DotplotView/components/Header.d.ts +2 -3
- package/dist/DotplotView/components/Header.js +4 -23
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +129 -0
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -48
- package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
- package/dist/DotplotView/components/ImportForm/TrackSelector.js +23 -0
- package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
- package/dist/DotplotView/components/ImportForm/getAdapter.js +68 -0
- package/dist/DotplotView/components/ImportForm/index.d.ts +3 -4
- package/dist/DotplotView/components/ImportForm/index.js +47 -97
- package/dist/DotplotView/components/ImportForm/util.js +1 -3
- package/dist/DotplotView/components/PanButtons.d.ts +2 -3
- package/dist/DotplotView/components/PanButtons.js +17 -36
- package/dist/DotplotView/components/WarningDialog.d.ts +7 -7
- package/dist/DotplotView/components/WarningDialog.js +12 -15
- package/dist/DotplotView/components/util.d.ts +2 -7
- package/dist/DotplotView/components/util.js +0 -5
- package/dist/DotplotView/index.d.ts +1 -1
- package/dist/DotplotView/index.js +17 -8
- package/dist/DotplotView/model.d.ts +11 -133
- package/dist/DotplotView/model.js +46 -222
- package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/DotplotView/svgcomponents/SVGBackground.js +3 -6
- package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
- package/dist/DotplotView/types.d.ts +12 -0
- package/dist/DotplotView/types.js +2 -0
- package/dist/LaunchDotplotView.d.ts +1 -1
- package/dist/LaunchDotplotView.js +1 -4
- package/dist/ServerSideRenderedBlockContent.d.ts +2 -2
- package/dist/ServerSideRenderedBlockContent.js +11 -37
- package/dist/ServerSideSyntenyRendering.d.ts +1 -6
- package/dist/ServerSideSyntenyRendering.js +4 -26
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -6
- package/dist/util.d.ts +1 -1
- package/esm/ComparativeRenderer/index.d.ts +3 -8
- package/esm/ComparativeRenderer/index.js +3 -8
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
- package/esm/DotplotDisplay/components/DotplotDisplay.js +7 -9
- package/esm/DotplotDisplay/index.d.ts +1 -7
- package/esm/DotplotDisplay/index.js +2 -12
- package/esm/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
- package/esm/DotplotDisplay/renderDotplotBlock.js +3 -6
- package/esm/DotplotDisplay/stateModelFactory.d.ts +8 -45
- package/esm/DotplotDisplay/stateModelFactory.js +58 -101
- package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js +15 -16
- package/esm/DotplotReadVsRef/index.d.ts +1 -1
- package/esm/DotplotReadVsRef/index.js +0 -2
- package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
- package/esm/DotplotRenderer/ComparativeRenderRpc.js +3 -8
- package/esm/DotplotRenderer/DotplotRenderer.d.ts +8 -7
- package/esm/DotplotRenderer/DotplotRenderer.js +1 -2
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
- package/esm/DotplotRenderer/components/DotplotRendering.js +2 -2
- package/esm/DotplotRenderer/configSchema.d.ts +0 -21
- package/esm/DotplotRenderer/configSchema.js +2 -27
- package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
- package/esm/DotplotRenderer/drawDotplot.js +4 -7
- package/esm/DotplotRenderer/index.d.ts +1 -1
- package/esm/DotplotRenderer/index.js +1 -1
- package/esm/DotplotView/1dview.d.ts +2 -77
- package/esm/DotplotView/1dview.js +4 -33
- package/esm/DotplotView/components/Axes.d.ts +5 -6
- package/esm/DotplotView/components/Axes.js +26 -37
- package/esm/DotplotView/components/CursorIcon.d.ts +3 -4
- package/esm/DotplotView/components/CursorIcon.js +3 -5
- package/esm/DotplotView/components/DotplotControls.d.ts +2 -3
- package/esm/DotplotView/components/DotplotControls.js +94 -97
- package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
- package/esm/DotplotView/components/DotplotTooltipClick.js +3 -7
- package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
- package/esm/DotplotView/components/DotplotTooltipMouseover.js +4 -8
- package/esm/DotplotView/components/DotplotView.d.ts +2 -3
- package/esm/DotplotView/components/DotplotView.js +63 -85
- package/esm/DotplotView/components/DotplotWarnings.d.ts +2 -3
- package/esm/DotplotView/components/DotplotWarnings.js +9 -14
- package/esm/DotplotView/components/ExportSvgDialog.d.ts +2 -3
- package/esm/DotplotView/components/ExportSvgDialog.js +32 -44
- package/esm/DotplotView/components/Grid.d.ts +3 -4
- package/esm/DotplotView/components/Grid.js +19 -29
- package/esm/DotplotView/components/Header.d.ts +2 -3
- package/esm/DotplotView/components/Header.js +4 -23
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +124 -0
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -25
- package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
- package/esm/DotplotView/components/ImportForm/TrackSelector.js +18 -0
- package/esm/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
- package/esm/DotplotView/components/ImportForm/getAdapter.js +65 -0
- package/esm/DotplotView/components/ImportForm/index.d.ts +3 -4
- package/esm/DotplotView/components/ImportForm/index.js +48 -75
- package/esm/DotplotView/components/ImportForm/util.js +1 -3
- package/esm/DotplotView/components/PanButtons.d.ts +2 -3
- package/esm/DotplotView/components/PanButtons.js +17 -36
- package/esm/DotplotView/components/WarningDialog.d.ts +7 -7
- package/esm/DotplotView/components/WarningDialog.js +12 -12
- package/esm/DotplotView/components/util.d.ts +2 -7
- package/esm/DotplotView/components/util.js +0 -5
- package/esm/DotplotView/index.d.ts +1 -1
- package/esm/DotplotView/index.js +0 -1
- package/esm/DotplotView/model.d.ts +11 -133
- package/esm/DotplotView/model.js +30 -216
- package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/DotplotView/svgcomponents/SVGBackground.js +3 -3
- package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
- package/esm/DotplotView/types.d.ts +12 -0
- package/esm/DotplotView/types.js +1 -0
- package/esm/LaunchDotplotView.d.ts +1 -1
- package/esm/LaunchDotplotView.js +1 -4
- package/esm/ServerSideRenderedBlockContent.d.ts +2 -2
- package/esm/ServerSideRenderedBlockContent.js +11 -14
- package/esm/ServerSideSyntenyRendering.d.ts +1 -6
- package/esm/ServerSideSyntenyRendering.js +4 -3
- package/esm/index.d.ts +1 -1
- package/esm/index.js +3 -6
- package/esm/util.d.ts +1 -1
- package/package.json +2 -4
- package/dist/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
- package/dist/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -194
- package/esm/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
- package/esm/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -169
|
@@ -15,34 +15,39 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const
|
|
36
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
37
|
+
const react_1 = require("react");
|
|
27
38
|
const material_1 = require("@mui/material");
|
|
28
39
|
const mobx_react_1 = require("mobx-react");
|
|
29
|
-
// lazy components
|
|
30
40
|
const WarningDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./WarningDialog'))));
|
|
31
41
|
const DotplotWarnings = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
32
42
|
const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
|
|
33
43
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
34
44
|
const [hide, setHide] = (0, react_1.useState)(false);
|
|
35
|
-
return trackWarnings.length && !hide ? (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
setShown(false);
|
|
43
|
-
} })) : null,
|
|
44
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
|
|
45
|
-
setHide(true);
|
|
46
|
-
} }, "Dismiss"))) : null;
|
|
45
|
+
return trackWarnings.length && !hide ? ((0, jsx_runtime_1.jsxs)(material_1.Alert, { severity: "warning", children: ["Warnings during render", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
|
|
46
|
+
setShown(true);
|
|
47
|
+
}, children: "More info" }), shown ? ((0, jsx_runtime_1.jsx)(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => {
|
|
48
|
+
setShown(false);
|
|
49
|
+
} })) : null, (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
50
|
+
setHide(true);
|
|
51
|
+
}, children: "Dismiss" })] })) : null;
|
|
47
52
|
});
|
|
48
53
|
exports.default = DotplotWarnings;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ExportSvgOptions } from '../model';
|
|
1
|
+
import type { ExportSvgOptions } from '../model';
|
|
3
2
|
export default function ExportSvgDialog({ model, handleClose, }: {
|
|
4
3
|
model: {
|
|
5
4
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
6
5
|
};
|
|
7
6
|
handleClose: () => void;
|
|
8
|
-
}):
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.default = ExportSvgDialog;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
29
6
|
const ui_1 = require("@jbrowse/core/ui");
|
|
30
7
|
const util_1 = require("@jbrowse/core/util");
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
31
9
|
function LoadingMessage() {
|
|
32
|
-
return (
|
|
33
|
-
react_1.default.createElement(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }),
|
|
34
|
-
react_1.default.createElement(material_1.Typography, { display: "inline" }, "Creating SVG")));
|
|
10
|
+
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" })] }));
|
|
35
11
|
}
|
|
36
12
|
function TextField2({ children, ...rest }) {
|
|
37
|
-
return (
|
|
38
|
-
react_1.default.createElement(material_1.TextField, { ...rest }, children)));
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { ...rest, children: children }) }));
|
|
39
14
|
}
|
|
40
15
|
function useSvgLocal(key, val) {
|
|
41
16
|
return (0, util_1.useLocalStorage)(`svg-${key}`, val);
|
|
@@ -48,41 +23,31 @@ function ExportSvgDialog({ model, handleClose, }) {
|
|
|
48
23
|
const [error, setError] = (0, react_1.useState)();
|
|
49
24
|
const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
|
|
50
25
|
const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
|
|
51
|
-
return (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
});
|
|
78
|
-
handleClose();
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
console.error(e);
|
|
82
|
-
setError(e);
|
|
83
|
-
}
|
|
84
|
-
finally {
|
|
85
|
-
setLoading(false);
|
|
86
|
-
}
|
|
87
|
-
} }, "Submit"))));
|
|
26
|
+
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, { helperText: "filename", value: filename, onChange: event => {
|
|
27
|
+
setFilename(event.target.value);
|
|
28
|
+
} }), session.allThemes ? ((0, jsx_runtime_1.jsx)(TextField2, { select: true, label: "Theme", value: themeName, onChange: event => {
|
|
29
|
+
setThemeName(event.target.value);
|
|
30
|
+
}, 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: () => {
|
|
31
|
+
setRasterizeLayers(val => !val);
|
|
32
|
+
} }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
33
|
+
handleClose();
|
|
34
|
+
}, children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
|
|
35
|
+
setLoading(true);
|
|
36
|
+
setError(undefined);
|
|
37
|
+
try {
|
|
38
|
+
await model.exportSvg({
|
|
39
|
+
rasterizeLayers,
|
|
40
|
+
filename,
|
|
41
|
+
themeName,
|
|
42
|
+
});
|
|
43
|
+
handleClose();
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
console.error(e);
|
|
47
|
+
setError(e);
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
setLoading(false);
|
|
51
|
+
}
|
|
52
|
+
}, children: "Submit" })] })] }));
|
|
88
53
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DotplotViewModel } from '../model';
|
|
1
|
+
import type { DotplotViewModel } from '../model';
|
|
3
2
|
export declare const GridRaw: ({ model, children, }: {
|
|
4
3
|
model: DotplotViewModel;
|
|
5
4
|
children?: React.ReactNode;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export default function Grid({ model, children, }: {
|
|
8
7
|
model: DotplotViewModel;
|
|
9
8
|
children?: React.ReactNode;
|
|
10
|
-
}):
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.GridRaw = void 0;
|
|
7
4
|
exports.default = Grid;
|
|
8
|
-
const
|
|
9
|
-
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const material_1 = require("@mui/material");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
6
|
const util_1 = require("@jbrowse/core/util");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const mobx_react_1 = require("mobx-react");
|
|
12
9
|
exports.GridRaw = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
13
10
|
const { viewWidth, viewHeight, hview, vview } = model;
|
|
14
11
|
const hblocks = hview.dynamicBlocks.contentBlocks;
|
|
@@ -22,39 +19,29 @@ exports.GridRaw = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
|
22
19
|
const vbottom = vblocks[0].offsetPx - vview.offsetPx;
|
|
23
20
|
const theme = (0, material_1.useTheme)();
|
|
24
21
|
const stroke = theme.palette.divider;
|
|
25
|
-
// Uses math.max/min avoid making very large SVG rect offscreen element,
|
|
26
|
-
// which can sometimes fail to draw
|
|
27
22
|
const rx = Math.max(hbottom, 0);
|
|
28
23
|
const ry = Math.max(viewHeight - vtop, 0);
|
|
29
24
|
const w = Math.min(htop - hbottom, viewWidth);
|
|
30
25
|
const h = Math.min(viewHeight - vbottom - ry, viewHeight);
|
|
31
26
|
let lastx = Number.POSITIVE_INFINITY;
|
|
32
27
|
let lasty = Number.POSITIVE_INFINITY;
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
lasty = y;
|
|
49
|
-
}
|
|
50
|
-
return render ? (react_1.default.createElement("line", { key: JSON.stringify(region), x1: 0, y1: y, x2: viewWidth, y2: y, ...(0, util_1.getStrokeProps)(stroke) })) : null;
|
|
51
|
-
}),
|
|
52
|
-
react_1.default.createElement("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...(0, util_1.getStrokeProps)(stroke) }),
|
|
53
|
-
react_1.default.createElement("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...(0, util_1.getStrokeProps)(stroke) })),
|
|
54
|
-
children));
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: rx, y: ry, width: w, height: h, ...(0, util_1.getFillProps)(theme.palette.background.default) }), (0, jsx_runtime_1.jsxs)("g", { children: [hblocks.map(region => {
|
|
29
|
+
const x = region.offsetPx - hview.offsetPx;
|
|
30
|
+
const render = Math.floor(x) !== Math.floor(lastx);
|
|
31
|
+
if (render) {
|
|
32
|
+
lastx = x;
|
|
33
|
+
}
|
|
34
|
+
return render ? ((0, jsx_runtime_1.jsx)("line", { x1: x, y1: 0, x2: x, y2: viewHeight, ...(0, util_1.getStrokeProps)(stroke) }, JSON.stringify(region))) : null;
|
|
35
|
+
}), vblocks.map(region => {
|
|
36
|
+
const y = viewHeight - (region.offsetPx - vview.offsetPx);
|
|
37
|
+
const render = Math.floor(y) !== Math.floor(lasty);
|
|
38
|
+
if (render) {
|
|
39
|
+
lasty = y;
|
|
40
|
+
}
|
|
41
|
+
return render ? ((0, jsx_runtime_1.jsx)("line", { x1: 0, y1: y, x2: viewWidth, y2: y, ...(0, util_1.getStrokeProps)(stroke) }, JSON.stringify(region))) : null;
|
|
42
|
+
}), (0, jsx_runtime_1.jsx)("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...(0, util_1.getStrokeProps)(stroke) }), (0, jsx_runtime_1.jsx)("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...(0, util_1.getStrokeProps)(stroke) })] }), children] }));
|
|
55
43
|
});
|
|
56
44
|
function Grid({ model, children, }) {
|
|
57
45
|
const { viewWidth, viewHeight } = model;
|
|
58
|
-
return (
|
|
59
|
-
react_1.default.createElement(exports.GridRaw, { model: model }, children)));
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: viewWidth, height: viewHeight, style: { background: 'rgba(0,0,0,0.12)' }, children: (0, jsx_runtime_1.jsx)(exports.GridRaw, { model: model, children: children }) }));
|
|
60
47
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DotplotViewModel } from '../model';
|
|
1
|
+
import type { DotplotViewModel } from '../model';
|
|
3
2
|
declare const DotplotHeader: ({ model, selection, }: {
|
|
4
3
|
model: DotplotViewModel;
|
|
5
4
|
selection?: {
|
|
6
5
|
width: number;
|
|
7
6
|
height: number;
|
|
8
7
|
};
|
|
9
|
-
}) =>
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default DotplotHeader;
|
|
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const util_1 = require("@jbrowse/core/util");
|
|
7
8
|
const material_1 = require("@mui/material");
|
|
8
9
|
const mobx_react_1 = require("mobx-react");
|
|
9
10
|
const mui_1 = require("tss-react/mui");
|
|
10
|
-
const
|
|
11
|
+
const DotplotControls_1 = __importDefault(require("./DotplotControls"));
|
|
11
12
|
const DotplotWarnings_1 = __importDefault(require("./DotplotWarnings"));
|
|
12
13
|
const PanButtons_1 = __importDefault(require("./PanButtons"));
|
|
13
|
-
const DotplotControls_1 = __importDefault(require("./DotplotControls"));
|
|
14
14
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
15
15
|
bp: {
|
|
16
16
|
display: 'flex',
|
|
@@ -28,25 +28,6 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
28
28
|
const DotplotHeader = (0, mobx_react_1.observer)(function ({ model, selection, }) {
|
|
29
29
|
const { classes } = useStyles();
|
|
30
30
|
const { hview, vview, showPanButtons } = model;
|
|
31
|
-
return (
|
|
32
|
-
react_1.default.createElement(DotplotControls_1.default, { model: model }),
|
|
33
|
-
react_1.default.createElement(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary" },
|
|
34
|
-
"x: ",
|
|
35
|
-
hview.assemblyNames.join(','),
|
|
36
|
-
" ",
|
|
37
|
-
(0, util_1.getBpDisplayStr)(hview.currBp),
|
|
38
|
-
react_1.default.createElement("br", null),
|
|
39
|
-
"y: ",
|
|
40
|
-
vview.assemblyNames.join(','),
|
|
41
|
-
" ",
|
|
42
|
-
(0, util_1.getBpDisplayStr)(vview.currBp)),
|
|
43
|
-
selection ? (react_1.default.createElement(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary" },
|
|
44
|
-
`width:${(0, util_1.getBpDisplayStr)(hview.bpPerPx * selection.width)}`,
|
|
45
|
-
" ",
|
|
46
|
-
react_1.default.createElement("br", null),
|
|
47
|
-
`height:${(0, util_1.getBpDisplayStr)(vview.bpPerPx * selection.height)}`)) : null,
|
|
48
|
-
react_1.default.createElement("div", { className: classes.spacer }),
|
|
49
|
-
react_1.default.createElement(DotplotWarnings_1.default, { model: model }),
|
|
50
|
-
showPanButtons ? react_1.default.createElement(PanButtons_1.default, { model: model }) : null));
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.headerBar, children: [(0, jsx_runtime_1.jsx)(DotplotControls_1.default, { model: model }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: ["x: ", hview.assemblyNames.join(','), " ", (0, util_1.getBpDisplayStr)(hview.currBp), (0, jsx_runtime_1.jsx)("br", {}), "y: ", vview.assemblyNames.join(','), " ", (0, util_1.getBpDisplayStr)(vview.currBp)] }), selection ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: [`width:${(0, util_1.getBpDisplayStr)(hview.bpPerPx * selection.width)}`, " ", (0, jsx_runtime_1.jsx)("br", {}), `height:${(0, util_1.getBpDisplayStr)(vview.bpPerPx * selection.height)}`] })) : null, (0, jsx_runtime_1.jsx)("div", { className: classes.spacer }), (0, jsx_runtime_1.jsx)(DotplotWarnings_1.default, { model: model }), showPanButtons ? (0, jsx_runtime_1.jsx)(PanButtons_1.default, { model: model }) : null] }));
|
|
51
32
|
});
|
|
52
33
|
exports.default = DotplotHeader;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DotplotViewModel } from '../../model';
|
|
2
|
+
declare const ImportSyntenyOpenCustomTrack: ({ model, assembly1, assembly2, }: {
|
|
3
|
+
model: DotplotViewModel;
|
|
4
|
+
assembly1: string;
|
|
5
|
+
assembly2: string;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ImportSyntenyOpenCustomTrack;
|
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
9
|
+
const Help_1 = __importDefault(require("@mui/icons-material/Help"));
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const mobx_react_1 = require("mobx-react");
|
|
12
|
+
const getAdapter_1 = require("./getAdapter");
|
|
13
|
+
const util_1 = require("./util");
|
|
14
|
+
const ImportSyntenyOpenCustomTrack = (0, mobx_react_1.observer)(function ({ model, assembly1, assembly2, }) {
|
|
15
|
+
const [swap, setSwap] = (0, react_1.useState)(false);
|
|
16
|
+
const [bed2Location, setBed2Location] = (0, react_1.useState)();
|
|
17
|
+
const [bed1Location, setBed1Location] = (0, react_1.useState)();
|
|
18
|
+
const [fileLocation, setFileLocation] = (0, react_1.useState)();
|
|
19
|
+
const [indexFileLocation, setIndexFileLocation] = (0, react_1.useState)();
|
|
20
|
+
const [value, setValue] = (0, react_1.useState)('');
|
|
21
|
+
const [error, setError] = (0, react_1.useState)();
|
|
22
|
+
const fileName = (0, util_1.getName)(fileLocation);
|
|
23
|
+
const radioOption = value || (fileName ? (0, util_1.extName)((0, util_1.stripGz)(fileName)) : '');
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
try {
|
|
26
|
+
if (fileLocation) {
|
|
27
|
+
const fn = fileName ? (0, util_1.basename)(fileName) : 'MyTrack';
|
|
28
|
+
const trackId = `${fn}-${Date.now()}-sessionTrack`;
|
|
29
|
+
setError(undefined);
|
|
30
|
+
model.setImportFormSyntenyTrack(0, {
|
|
31
|
+
type: 'userOpened',
|
|
32
|
+
value: {
|
|
33
|
+
trackId,
|
|
34
|
+
name: fn,
|
|
35
|
+
assemblyNames: [assembly2, assembly1],
|
|
36
|
+
type: 'SyntenyTrack',
|
|
37
|
+
adapter: (0, getAdapter_1.getAdapter)({
|
|
38
|
+
radioOption,
|
|
39
|
+
assembly1: swap ? assembly2 : assembly1,
|
|
40
|
+
assembly2: swap ? assembly1 : assembly2,
|
|
41
|
+
fileLocation,
|
|
42
|
+
indexFileLocation,
|
|
43
|
+
bed1Location,
|
|
44
|
+
bed2Location,
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
console.error(e);
|
|
52
|
+
setError(e);
|
|
53
|
+
}
|
|
54
|
+
}, [
|
|
55
|
+
swap,
|
|
56
|
+
model,
|
|
57
|
+
fileName,
|
|
58
|
+
assembly1,
|
|
59
|
+
assembly2,
|
|
60
|
+
bed1Location,
|
|
61
|
+
bed2Location,
|
|
62
|
+
fileLocation,
|
|
63
|
+
indexFileLocation,
|
|
64
|
+
radioOption,
|
|
65
|
+
]);
|
|
66
|
+
const helpStrings = {
|
|
67
|
+
'.paf': 'minimap2 target.fa query.fa',
|
|
68
|
+
'.pif.gz': 'minimap2 target.fa query.fa',
|
|
69
|
+
'.out': 'mashmap target.fa query.fa',
|
|
70
|
+
'.delta': 'mummer target.fa query.fa',
|
|
71
|
+
'.chain': 'e.g. queryToTarget.chain',
|
|
72
|
+
};
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { style: { padding: 12 }, children: [error ? (0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error }) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, { style: { textAlign: 'center' }, children: "Add a .paf (minimap2), .delta (Mummer), .chain (UCSC liftover), .anchors or .anchors.simple (MCScan), or .pif.gz (jbrowse CLI make-pif) file to view. These file types can also be gzipped." }), (0, jsx_runtime_1.jsx)(material_1.RadioGroup, { value: radioOption, onChange: event => {
|
|
74
|
+
setValue(event.target.value);
|
|
75
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, justifyContent: "center", children: [
|
|
76
|
+
'.paf',
|
|
77
|
+
'.delta',
|
|
78
|
+
'.out',
|
|
79
|
+
'.chain',
|
|
80
|
+
'.anchors',
|
|
81
|
+
'.anchors.simple',
|
|
82
|
+
'.pif.gz',
|
|
83
|
+
].map(extension => ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: extension, control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: extension }, extension))) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, justifyContent: "center", children: radioOption === '.paf' ||
|
|
84
|
+
radioOption === '.out' ||
|
|
85
|
+
radioOption === '.delta' ||
|
|
86
|
+
radioOption === '.chain' ||
|
|
87
|
+
radioOption === '.pif.gz' ? ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
88
|
+
display: 'flex',
|
|
89
|
+
flexDirection: 'column',
|
|
90
|
+
gap: 10,
|
|
91
|
+
}, children: [(0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${radioOption} location`, inline: true, description: "", location: fileLocation, setLocation: loc => {
|
|
92
|
+
setFileLocation(loc);
|
|
93
|
+
} }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["Verify or click swap", (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsx)("code", { children: helpStrings[radioOption] }), children: (0, jsx_runtime_1.jsx)(Help_1.default, {}) })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
94
|
+
display: 'flex',
|
|
95
|
+
gap: 20,
|
|
96
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
97
|
+
display: 'grid',
|
|
98
|
+
gridTemplateColumns: '1fr 1fr',
|
|
99
|
+
gap: 4,
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly2 : assembly1 }) }), (0, jsx_runtime_1.jsx)("div", { children: "query assembly" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly1 : assembly2 }) }), (0, jsx_runtime_1.jsx)("div", { children: "target assembly" })] }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
102
|
+
setSwap(!swap);
|
|
103
|
+
}, children: "Swap?" })] })] })] })) : value === '.anchors' || value === '.anchors.simple' ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: { margin: 20 }, children: ["Open the ", value, " and .bed files for both genome assemblies from the MCScan (Python version) pipeline", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)", children: "(more info)" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: value, location: fileLocation, setLocation: loc => {
|
|
104
|
+
setFileLocation(loc);
|
|
105
|
+
} }), (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: loc => {
|
|
106
|
+
setBed1Location(loc);
|
|
107
|
+
} }), (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => {
|
|
108
|
+
setBed2Location(loc);
|
|
109
|
+
} })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
110
|
+
margin: 'auto',
|
|
111
|
+
display: 'flex',
|
|
112
|
+
justifyContent: 'center',
|
|
113
|
+
gap: 20,
|
|
114
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
115
|
+
display: 'grid',
|
|
116
|
+
gridTemplateColumns: '1fr 1fr',
|
|
117
|
+
gap: 4,
|
|
118
|
+
alignItems: 'center',
|
|
119
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly2 : assembly1 }) }), (0, jsx_runtime_1.jsx)("div", { children: "bed1 assembly" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly1 : assembly2 }) }), (0, jsx_runtime_1.jsx)("div", { children: "bed2 assembly" })] }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
120
|
+
setSwap(!swap);
|
|
121
|
+
}, children: "Swap?" })] })] })) : value === '.pif.gz' ? ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${value} location`, description: "", location: fileLocation, setLocation: loc => {
|
|
122
|
+
setFileLocation(loc);
|
|
123
|
+
} }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${value} index location`, description: "", location: indexFileLocation, setLocation: loc => {
|
|
124
|
+
setIndexFileLocation(loc);
|
|
125
|
+
} }) })] })) : ((0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
|
|
126
|
+
setFileLocation(loc);
|
|
127
|
+
} })) })] }));
|
|
128
|
+
});
|
|
129
|
+
exports.default = ImportSyntenyOpenCustomTrack;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const Selector: ({ model, assembly1, assembly2, setShowTrackId, }: {
|
|
1
|
+
import type { DotplotViewModel } from '../../model';
|
|
2
|
+
declare const ImportSyntenyTrackSelector: ({ model, assembly1, assembly2, }: {
|
|
4
3
|
model: DotplotViewModel;
|
|
5
4
|
assembly1: string;
|
|
6
5
|
assembly2: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export default Selector;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ImportSyntenyTrackSelector;
|
|
@@ -1,44 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
29
|
-
const util_1 = require("@jbrowse/core/util");
|
|
30
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
31
5
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
32
|
-
const
|
|
33
|
-
// icons
|
|
6
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
34
7
|
const Icons_1 = require("@jbrowse/core/ui/Icons");
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
9
|
+
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const mobx_react_1 = require("mobx-react");
|
|
35
12
|
function f(track, assembly1, assembly2) {
|
|
36
13
|
const assemblyNames = (0, configuration_1.readConfObject)(track, 'assemblyNames');
|
|
37
14
|
return (assemblyNames.includes(assembly1) &&
|
|
38
15
|
assemblyNames.includes(assembly2) &&
|
|
39
16
|
track.type.includes('Synteny'));
|
|
40
17
|
}
|
|
41
|
-
const
|
|
18
|
+
const ImportSyntenyTrackSelector = (0, mobx_react_1.observer)(function ({ model, assembly1, assembly2, }) {
|
|
42
19
|
var _a;
|
|
43
20
|
const session = (0, util_1.getSession)(model);
|
|
44
21
|
const { tracks, sessionTracks } = session;
|
|
@@ -50,24 +27,16 @@ const Selector = (0, mobx_react_1.observer)(({ model, assembly1, assembly2, setS
|
|
|
50
27
|
const resetTrack = ((_a = filteredTracks[0]) === null || _a === void 0 ? void 0 : _a.trackId) || '';
|
|
51
28
|
const [value, setValue] = (0, react_1.useState)(resetTrack);
|
|
52
29
|
(0, react_1.useEffect)(() => {
|
|
53
|
-
// if assembly1/assembly2 changes, then we will want to use this effect to change
|
|
54
|
-
// the state of the useState because it otherwise gets locked to a stale value
|
|
55
30
|
setValue(resetTrack);
|
|
56
31
|
}, [resetTrack]);
|
|
57
32
|
(0, react_1.useEffect)(() => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
react_1.default.createElement("i", null, "inside"),
|
|
67
|
-
" the DotplotView, which can turn on one or more SyntenyTracks (more than one can be displayed at once). Look for the track selector icon ",
|
|
68
|
-
react_1.default.createElement(Icons_1.TrackSelector, null)),
|
|
69
|
-
filteredTracks.length ? (react_1.default.createElement(material_1.Select, { value: value, onChange: event => {
|
|
70
|
-
setValue(event.target.value);
|
|
71
|
-
} }, filteredTracks.map(track => (react_1.default.createElement(material_1.MenuItem, { key: track.trackId, value: track.trackId }, (0, tracks_1.getTrackName)(track, session)))))) : (react_1.default.createElement(ui_1.ErrorMessage, { error: `No synteny tracks found for ${assembly1},${assembly2}` }))));
|
|
33
|
+
model.setImportFormSyntenyTrack(0, {
|
|
34
|
+
type: 'preConfigured',
|
|
35
|
+
value,
|
|
36
|
+
});
|
|
37
|
+
}, [model, value]);
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { style: { padding: 12 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { children: ["Select a track from the select box below, the track will be shown when you hit \"Launch\". Note: there is a track selector ", (0, jsx_runtime_1.jsx)("i", { children: "inside" }), " the DotplotView, which can turn on one or more SyntenyTracks (more than one can be displayed at once). Look for the track selector icon", ' ', (0, jsx_runtime_1.jsx)(Icons_1.TrackSelector, {})] }), filteredTracks.length ? ((0, jsx_runtime_1.jsx)(material_1.Select, { value: value, onChange: event => {
|
|
39
|
+
setValue(event.target.value);
|
|
40
|
+
}, children: filteredTracks.map(track => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: track.trackId, children: (0, tracks_1.getTrackName)(track, session) }, track.trackId))) })) : ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: `No synteny tracks found for ${assembly1},${assembly2}` }))] }));
|
|
72
41
|
});
|
|
73
|
-
exports.default =
|
|
42
|
+
exports.default = ImportSyntenyTrackSelector;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DotplotViewModel } from '../../model';
|
|
2
|
+
declare const TrackSelector: ({ assembly1, assembly2, model, }: {
|
|
3
|
+
model: DotplotViewModel;
|
|
4
|
+
assembly1: string;
|
|
5
|
+
assembly2: string;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default TrackSelector;
|