@jbrowse/plugin-dotplot-view 2.18.0 → 3.0.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/DotplotDisplay/components/DotplotDisplay.d.ts +1 -2
- package/dist/DotplotDisplay/components/DotplotDisplay.js +6 -11
- package/dist/DotplotDisplay/stateModelFactory.d.ts +1 -2
- package/dist/DotplotDisplay/stateModelFactory.js +2 -3
- package/dist/DotplotRenderer/DotplotRenderer.d.ts +3 -3
- package/dist/DotplotRenderer/DotplotRenderer.js +17 -7
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +1 -2
- package/dist/DotplotRenderer/components/DotplotRendering.js +2 -5
- package/dist/DotplotView/components/Axes.d.ts +4 -5
- package/dist/DotplotView/components/Axes.js +23 -36
- package/dist/DotplotView/components/CursorIcon.d.ts +2 -3
- package/dist/DotplotView/components/CursorIcon.js +3 -5
- package/dist/DotplotView/components/DotplotControls.d.ts +1 -2
- package/dist/DotplotView/components/DotplotControls.js +89 -91
- package/dist/DotplotView/components/DotplotTooltipClick.d.ts +1 -2
- package/dist/DotplotView/components/DotplotTooltipClick.js +2 -6
- package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -2
- package/dist/DotplotView/components/DotplotTooltipMouseover.js +3 -7
- package/dist/DotplotView/components/DotplotView.d.ts +1 -2
- package/dist/DotplotView/components/DotplotView.js +75 -80
- package/dist/DotplotView/components/DotplotWarnings.d.ts +1 -2
- package/dist/DotplotView/components/DotplotWarnings.js +26 -20
- package/dist/DotplotView/components/ExportSvgDialog.d.ts +1 -2
- package/dist/DotplotView/components/ExportSvgDialog.js +31 -64
- package/dist/DotplotView/components/Grid.d.ts +2 -3
- package/dist/DotplotView/components/Grid.js +17 -28
- package/dist/DotplotView/components/Header.d.ts +1 -2
- package/dist/DotplotView/components/Header.js +2 -21
- 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 +3 -5
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +12 -38
- 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 +2 -3
- package/dist/DotplotView/components/ImportForm/index.js +43 -92
- package/dist/DotplotView/components/PanButtons.d.ts +1 -2
- package/dist/DotplotView/components/PanButtons.js +14 -32
- package/dist/DotplotView/components/WarningDialog.d.ts +1 -2
- package/dist/DotplotView/components/WarningDialog.js +2 -9
- package/dist/DotplotView/index.js +17 -7
- package/dist/DotplotView/model.d.ts +6 -4
- package/dist/DotplotView/model.js +40 -30
- package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/DotplotView/svgcomponents/SVGBackground.js +2 -5
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js +2 -16
- package/dist/DotplotView/types.d.ts +12 -0
- package/dist/DotplotView/types.js +2 -0
- package/dist/ServerSideRenderedBlockContent.d.ts +1 -2
- package/dist/ServerSideRenderedBlockContent.js +9 -34
- package/dist/ServerSideSyntenyRendering.d.ts +1 -2
- package/dist/ServerSideSyntenyRendering.js +3 -25
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +1 -2
- package/esm/DotplotDisplay/components/DotplotDisplay.js +6 -8
- package/esm/DotplotDisplay/stateModelFactory.d.ts +1 -2
- package/esm/DotplotDisplay/stateModelFactory.js +2 -3
- package/esm/DotplotRenderer/DotplotRenderer.d.ts +3 -3
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +1 -2
- package/esm/DotplotRenderer/components/DotplotRendering.js +2 -2
- package/esm/DotplotView/components/Axes.d.ts +4 -5
- package/esm/DotplotView/components/Axes.js +23 -33
- package/esm/DotplotView/components/CursorIcon.d.ts +2 -3
- package/esm/DotplotView/components/CursorIcon.js +3 -5
- package/esm/DotplotView/components/DotplotControls.d.ts +1 -2
- package/esm/DotplotView/components/DotplotControls.js +89 -91
- package/esm/DotplotView/components/DotplotTooltipClick.d.ts +1 -2
- package/esm/DotplotView/components/DotplotTooltipClick.js +2 -6
- package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -2
- package/esm/DotplotView/components/DotplotTooltipMouseover.js +3 -7
- package/esm/DotplotView/components/DotplotView.d.ts +1 -2
- package/esm/DotplotView/components/DotplotView.js +58 -73
- package/esm/DotplotView/components/DotplotWarnings.d.ts +1 -2
- package/esm/DotplotView/components/DotplotWarnings.js +9 -13
- package/esm/DotplotView/components/ExportSvgDialog.d.ts +1 -2
- package/esm/DotplotView/components/ExportSvgDialog.js +31 -41
- package/esm/DotplotView/components/Grid.d.ts +2 -3
- package/esm/DotplotView/components/Grid.js +17 -25
- package/esm/DotplotView/components/Header.d.ts +1 -2
- package/esm/DotplotView/components/Header.js +2 -21
- 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 +3 -5
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +12 -15
- 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 +2 -3
- package/esm/DotplotView/components/ImportForm/index.js +45 -71
- package/esm/DotplotView/components/PanButtons.d.ts +1 -2
- package/esm/DotplotView/components/PanButtons.js +14 -32
- package/esm/DotplotView/components/WarningDialog.d.ts +1 -2
- package/esm/DotplotView/components/WarningDialog.js +2 -6
- package/esm/DotplotView/model.d.ts +6 -4
- package/esm/DotplotView/model.js +25 -25
- package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/DotplotView/svgcomponents/SVGBackground.js +2 -2
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js +2 -16
- package/esm/DotplotView/types.d.ts +12 -0
- package/esm/DotplotView/types.js +1 -0
- package/esm/ServerSideRenderedBlockContent.d.ts +1 -2
- package/esm/ServerSideRenderedBlockContent.js +9 -11
- package/esm/ServerSideSyntenyRendering.d.ts +1 -2
- package/esm/ServerSideSyntenyRendering.js +3 -2
- package/package.json +10 -10
- 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
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { AssemblySelector, ErrorMessage } from '@jbrowse/core/ui';
|
|
3
4
|
import { getSession, isSessionWithAddTracks } from '@jbrowse/core/util';
|
|
4
|
-
import { Button, Container, FormControl,
|
|
5
|
-
import { transaction } from 'mobx';
|
|
5
|
+
import { Button, Container, FormControl, Grid2, Paper, Typography, } from '@mui/material';
|
|
6
|
+
import { toJS, transaction } from 'mobx';
|
|
6
7
|
import { observer } from 'mobx-react';
|
|
7
8
|
import { makeStyles } from 'tss-react/mui';
|
|
8
|
-
import
|
|
9
|
-
import ImportSyntenyTrackSelector from './ImportSyntenyTrackSelector';
|
|
9
|
+
import TrackSelector from './TrackSelector';
|
|
10
10
|
const useStyles = makeStyles()(theme => ({
|
|
11
11
|
importFormContainer: {
|
|
12
12
|
padding: theme.spacing(4),
|
|
@@ -17,81 +17,55 @@ const useStyles = makeStyles()(theme => ({
|
|
|
17
17
|
margin: '0 auto',
|
|
18
18
|
},
|
|
19
19
|
}));
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
function doSubmit({ model, assembly1, assembly2, }) {
|
|
21
|
+
const session = getSession(model);
|
|
22
|
+
const { importFormSyntenyTrackSelections } = model;
|
|
23
|
+
model.setError(undefined);
|
|
24
|
+
transaction(() => {
|
|
25
|
+
if (isSessionWithAddTracks(session)) {
|
|
26
|
+
toJS(importFormSyntenyTrackSelections).map((f, idx) => {
|
|
27
|
+
var _a;
|
|
28
|
+
if (f.type === 'userOpened') {
|
|
29
|
+
session.addTrackConf(f.value);
|
|
30
|
+
model.toggleTrack((_a = f.value) === null || _a === void 0 ? void 0 : _a.trackId);
|
|
31
|
+
}
|
|
32
|
+
else if (f.type === 'preConfigured') {
|
|
33
|
+
model.showTrack(f.value, idx);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
26
36
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
React.createElement(FormLabel, { id: "group-label" }, "(Optional) Select or add a synteny track"),
|
|
31
|
-
React.createElement(RadioGroup, { row: true, value: choice, onChange: event => {
|
|
32
|
-
setChoice(event.target.value);
|
|
33
|
-
}, "aria-labelledby": "group-label" },
|
|
34
|
-
React.createElement(FormControlLabel, { value: "none", control: React.createElement(Radio, null), label: "None" }),
|
|
35
|
-
React.createElement(FormControlLabel, { value: "tracklist", control: React.createElement(Radio, null), label: "Existing track" }),
|
|
36
|
-
React.createElement(FormControlLabel, { value: "custom", control: React.createElement(Radio, null), label: "New track" }))),
|
|
37
|
-
choice === 'custom' ? (React.createElement(ImportCustomTrack, { setSessionTrackData: setSessionTrackData, sessionTrackData: sessionTrackData, assembly2: assembly2, assembly1: assembly1 })) : null,
|
|
38
|
-
choice === 'tracklist' ? (React.createElement(ImportSyntenyTrackSelector, { model: model, assembly1: assembly1, assembly2: assembly2, setShowTrackId: setShowTrackId })) : null));
|
|
37
|
+
model.showAllRegions();
|
|
38
|
+
model.setAssemblyNames(assembly2, assembly1);
|
|
39
|
+
});
|
|
39
40
|
}
|
|
40
|
-
const DotplotImportForm = observer(({ model })
|
|
41
|
+
const DotplotImportForm = observer(function ({ model, }) {
|
|
41
42
|
const { classes } = useStyles();
|
|
42
43
|
const session = getSession(model);
|
|
43
44
|
const { assemblyNames } = session;
|
|
44
45
|
const [assembly2, setAssembly2] = useState(assemblyNames[0] || '');
|
|
45
46
|
const [assembly1, setAssembly1] = useState(assemblyNames[0] || '');
|
|
46
47
|
const [error, setError] = useState();
|
|
47
|
-
const [sessionTrackData, setSessionTrackData] = useState();
|
|
48
|
-
const [showTrackId, setShowTrackId] = useState();
|
|
49
|
-
function onOpenClick() {
|
|
50
|
-
try {
|
|
51
|
-
if (!isSessionWithAddTracks(session)) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
setError(undefined);
|
|
55
|
-
model.setError(undefined);
|
|
56
|
-
transaction(() => {
|
|
57
|
-
if (sessionTrackData) {
|
|
58
|
-
session.addTrackConf(sessionTrackData);
|
|
59
|
-
model.toggleTrack(sessionTrackData.trackId);
|
|
60
|
-
}
|
|
61
|
-
else if (showTrackId) {
|
|
62
|
-
model.showTrack(showTrackId);
|
|
63
|
-
}
|
|
64
|
-
model.setViews([
|
|
65
|
-
{ bpPerPx: 0.1, offsetPx: 0 },
|
|
66
|
-
{ bpPerPx: 0.1, offsetPx: 0 },
|
|
67
|
-
]);
|
|
68
|
-
model.setAssemblyNames(assembly2, assembly1);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
72
|
-
console.error(e);
|
|
73
|
-
setError(e);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
48
|
const displayError = error || model.error;
|
|
77
|
-
return (
|
|
78
|
-
displayError ? React.createElement(ErrorMessage, { error: displayError }) : null,
|
|
79
|
-
React.createElement(Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", className: classes.assemblySelector },
|
|
80
|
-
React.createElement(Grid, { item: true },
|
|
81
|
-
React.createElement(Paper, { style: { padding: 12 } },
|
|
82
|
-
React.createElement(Typography, { style: { textAlign: 'center' } }, "Select assemblies for dotplot view"),
|
|
83
|
-
React.createElement(Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center" },
|
|
84
|
-
React.createElement(Grid, { item: true },
|
|
85
|
-
React.createElement(AssemblySelector, { selected: assembly1, onChange: val => {
|
|
86
|
-
setAssembly1(val);
|
|
87
|
-
}, session: session })),
|
|
88
|
-
React.createElement(Grid, { item: true },
|
|
89
|
-
React.createElement(AssemblySelector, { selected: assembly2, onChange: val => {
|
|
49
|
+
return (_jsxs(Container, { className: classes.importFormContainer, children: [displayError ? _jsx(ErrorMessage, { error: displayError }) : null, _jsxs(Paper, { style: { padding: 12 }, children: [_jsx(Typography, { style: { textAlign: 'center' }, children: "Select assemblies for dotplot view" }), _jsxs(Grid2, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", children: [_jsx(AssemblySelector, { helperText: "x-axis assembly", selected: assembly2, session: session, onChange: val => {
|
|
90
50
|
setAssembly2(val);
|
|
91
|
-
}, session: session
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
51
|
+
} }), _jsx(AssemblySelector, { helperText: "y-axis assembly", selected: assembly1, session: session, onChange: val => {
|
|
52
|
+
setAssembly1(val);
|
|
53
|
+
} }), _jsx(FormControl, { children: _jsx(Button, { onClick: () => {
|
|
54
|
+
;
|
|
55
|
+
(async () => {
|
|
56
|
+
try {
|
|
57
|
+
setError(undefined);
|
|
58
|
+
doSubmit({
|
|
59
|
+
assembly1,
|
|
60
|
+
assembly2,
|
|
61
|
+
model,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.error(e);
|
|
66
|
+
setError(e);
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
}, variant: "contained", color: "primary", children: "Launch" }) })] }), _jsx(TrackSelector, { assembly2: assembly2, assembly1: assembly1, model: model })] })] }));
|
|
96
70
|
});
|
|
97
71
|
export default DotplotImportForm;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import ArrowDropDown from '@mui/icons-material/ArrowDropDown';
|
|
3
3
|
import ArrowDropUp from '@mui/icons-material/ArrowDropUp';
|
|
4
4
|
import ArrowLeft from '@mui/icons-material/ArrowLeft';
|
|
@@ -25,36 +25,18 @@ const useStyles = makeStyles()({
|
|
|
25
25
|
});
|
|
26
26
|
const PanButtons = observer(function PanButtons({ model, }) {
|
|
27
27
|
const { classes } = useStyles();
|
|
28
|
-
return (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
model.hview.scroll(100);
|
|
42
|
-
} },
|
|
43
|
-
React.createElement(ArrowRight, null)),
|
|
44
|
-
React.createElement("div", null),
|
|
45
|
-
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
46
|
-
model.vview.scroll(-100);
|
|
47
|
-
} },
|
|
48
|
-
React.createElement(ArrowDropDown, null)),
|
|
49
|
-
React.createElement("div", null),
|
|
50
|
-
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
51
|
-
model.zoomIn();
|
|
52
|
-
} },
|
|
53
|
-
React.createElement(ZoomIn, null)),
|
|
54
|
-
React.createElement("div", null),
|
|
55
|
-
React.createElement(IconButton, { className: classes.icon, onClick: () => {
|
|
56
|
-
model.zoomOut();
|
|
57
|
-
} },
|
|
58
|
-
React.createElement(ZoomOut, null))));
|
|
28
|
+
return (_jsxs(Paper, { className: classes.dpad, elevation: 6, children: [_jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
|
|
29
|
+
model.vview.scroll(100);
|
|
30
|
+
}, children: _jsx(ArrowDropUp, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
|
|
31
|
+
model.hview.scroll(-100);
|
|
32
|
+
}, children: _jsx(ArrowLeft, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
|
|
33
|
+
model.hview.scroll(100);
|
|
34
|
+
}, children: _jsx(ArrowRight, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
|
|
35
|
+
model.vview.scroll(-100);
|
|
36
|
+
}, children: _jsx(ArrowDropDown, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
|
|
37
|
+
model.zoomIn();
|
|
38
|
+
}, children: _jsx(ZoomIn, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
|
|
39
|
+
model.zoomOut();
|
|
40
|
+
}, children: _jsx(ZoomOut, {}) })] }));
|
|
59
41
|
});
|
|
60
42
|
export default PanButtons;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
2
|
interface Warning {
|
|
4
3
|
message: string;
|
|
@@ -13,5 +12,5 @@ interface TrackWarning {
|
|
|
13
12
|
declare const WarningDialog: ({ trackWarnings, handleClose, }: {
|
|
14
13
|
handleClose: () => void;
|
|
15
14
|
trackWarnings: TrackWarning[];
|
|
16
|
-
}) =>
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
16
|
export default WarningDialog;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getConf } from '@jbrowse/core/configuration';
|
|
3
3
|
import { Dialog } from '@jbrowse/core/ui';
|
|
4
4
|
import { measureGridWidth } from '@jbrowse/core/util';
|
|
@@ -32,10 +32,6 @@ const WarningDialog = observer(function WarningDialog({ trackWarnings, handleClo
|
|
|
32
32
|
{ field: 'message', width: measureGridWidth(rows.map(r => r.message)) },
|
|
33
33
|
{ field: 'effect', width: measureGridWidth(rows.map(r => r.effect)) },
|
|
34
34
|
];
|
|
35
|
-
return (
|
|
36
|
-
React.createElement(DialogContent, { className: classes.content },
|
|
37
|
-
React.createElement(DialogContentText, null, "Found warnings while rendering the dotplot. This is often due to out-of-bound features that may indicate the wrong assemblies are being used. Check that the query and target are configured correctly, and that the right assemblies are being compared."),
|
|
38
|
-
React.createElement("div", { style: { height: 600, width: '100%', overflow: 'auto' } },
|
|
39
|
-
React.createElement(DataGrid, { rows: rows, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, disableColumnMenu: true })))));
|
|
35
|
+
return (_jsx(Dialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Dotplot rendered with warnings", children: _jsxs(DialogContent, { className: classes.content, children: [_jsx(DialogContentText, { children: "Found warnings while rendering the dotplot. This is often due to out-of-bound features that may indicate the wrong assemblies are being used. Check that the query and target are configured correctly, and that the right assemblies are being compared." }), _jsx("div", { style: { height: 600, width: '100%', overflow: 'auto' }, children: _jsx(DataGrid, { rows: rows, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, disableColumnMenu: true }) })] }) }));
|
|
40
36
|
});
|
|
41
37
|
export default WarningDialog;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
|
|
3
|
+
import type { ImportFormSyntenyTrack } from './types';
|
|
3
4
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
4
5
|
import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
5
6
|
import type { Instance, SnapshotIn } from 'mobx-state-tree';
|
|
@@ -214,6 +215,11 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
214
215
|
wheelMode: string;
|
|
215
216
|
borderX: number;
|
|
216
217
|
borderY: number;
|
|
218
|
+
importFormSyntenyTrackSelections: import("mobx").IObservableArray<ImportFormSyntenyTrack>;
|
|
219
|
+
} & {
|
|
220
|
+
importFormRemoveRow(idx: number): void;
|
|
221
|
+
clearImportFormSyntenyTracks(): void;
|
|
222
|
+
setImportFormSyntenyTrack(arg: number, val: ImportFormSyntenyTrack): void;
|
|
217
223
|
} & {
|
|
218
224
|
readonly width: number;
|
|
219
225
|
} & {
|
|
@@ -410,14 +416,10 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
410
416
|
} & {
|
|
411
417
|
menuItems(): ({
|
|
412
418
|
label: string;
|
|
413
|
-
onClick: () => void;
|
|
414
419
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
415
420
|
muiName: string;
|
|
416
421
|
};
|
|
417
|
-
} | {
|
|
418
|
-
label: string;
|
|
419
422
|
onClick: () => void;
|
|
420
|
-
icon?: undefined;
|
|
421
423
|
} | {
|
|
422
424
|
label: string;
|
|
423
425
|
onClick: () => import("@jbrowse/core/util").Widget;
|
package/esm/DotplotView/model.js
CHANGED
|
@@ -2,13 +2,13 @@ import { lazy } from 'react';
|
|
|
2
2
|
import { getConf } from '@jbrowse/core/configuration';
|
|
3
3
|
import BaseViewModel from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
4
4
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
|
|
5
|
-
import { getSession, getTickDisplayStr, isSessionModelWithWidgets, localStorageGetItem, max, measureText, minmax, } from '@jbrowse/core/util';
|
|
5
|
+
import { getSession, getTickDisplayStr, isSessionModelWithWidgets, localStorageGetBoolean, localStorageGetItem, max, measureText, minmax, } from '@jbrowse/core/util';
|
|
6
6
|
import { getParentRenderProps } from '@jbrowse/core/util/tracks';
|
|
7
7
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
8
8
|
import FolderOpenIcon from '@mui/icons-material/FolderOpen';
|
|
9
9
|
import PhotoCameraIcon from '@mui/icons-material/PhotoCamera';
|
|
10
10
|
import { saveAs } from 'file-saver';
|
|
11
|
-
import { autorun, transaction } from 'mobx';
|
|
11
|
+
import { autorun, observable, transaction } from 'mobx';
|
|
12
12
|
import { addDisposer, cast, getParent, getRoot, getSnapshot, resolveIdentifier, types, } from 'mobx-state-tree';
|
|
13
13
|
import { Dotplot1DView, DotplotHView, DotplotVView } from './1dview';
|
|
14
14
|
import { getBlockLabelKeysToHide, makeTicks } from './components/util';
|
|
@@ -48,10 +48,22 @@ export default function stateModelFactory(pm) {
|
|
|
48
48
|
volatileWidth: undefined,
|
|
49
49
|
volatileError: undefined,
|
|
50
50
|
cursorMode: localStorageGetItem('dotplot-cursorMode') || 'crosshair',
|
|
51
|
-
showPanButtons:
|
|
51
|
+
showPanButtons: localStorageGetBoolean('dotplot-showPanbuttons', true),
|
|
52
52
|
wheelMode: localStorageGetItem('dotplot-wheelMode') || 'zoom',
|
|
53
53
|
borderX: 100,
|
|
54
54
|
borderY: 100,
|
|
55
|
+
importFormSyntenyTrackSelections: observable.array(),
|
|
56
|
+
}))
|
|
57
|
+
.actions(self => ({
|
|
58
|
+
importFormRemoveRow(idx) {
|
|
59
|
+
self.importFormSyntenyTrackSelections.splice(idx, 1);
|
|
60
|
+
},
|
|
61
|
+
clearImportFormSyntenyTracks() {
|
|
62
|
+
self.importFormSyntenyTrackSelections.clear();
|
|
63
|
+
},
|
|
64
|
+
setImportFormSyntenyTrack(arg, val) {
|
|
65
|
+
self.importFormSyntenyTrackSelections[arg] = val;
|
|
66
|
+
},
|
|
55
67
|
}))
|
|
56
68
|
.views(self => ({
|
|
57
69
|
get width() {
|
|
@@ -309,7 +321,7 @@ export default function stateModelFactory(pm) {
|
|
|
309
321
|
beforeDestroy() {
|
|
310
322
|
var _a;
|
|
311
323
|
const session = getSession(self);
|
|
312
|
-
for (const name
|
|
324
|
+
for (const name of self.assemblyNames) {
|
|
313
325
|
(_a = session.removeTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, name);
|
|
314
326
|
}
|
|
315
327
|
},
|
|
@@ -389,31 +401,16 @@ export default function stateModelFactory(pm) {
|
|
|
389
401
|
return [
|
|
390
402
|
{
|
|
391
403
|
label: 'Return to import form',
|
|
404
|
+
icon: FolderOpenIcon,
|
|
392
405
|
onClick: () => {
|
|
393
406
|
getSession(self).queueDialog(handleClose => [
|
|
394
407
|
ReturnToImportFormDialog,
|
|
395
|
-
{
|
|
408
|
+
{
|
|
409
|
+
model: self,
|
|
410
|
+
handleClose,
|
|
411
|
+
},
|
|
396
412
|
]);
|
|
397
413
|
},
|
|
398
|
-
icon: FolderOpenIcon,
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
label: 'Square view - same bp per pixel',
|
|
402
|
-
onClick: () => {
|
|
403
|
-
self.squareView();
|
|
404
|
-
},
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
label: 'Rectangular view - same total bp',
|
|
408
|
-
onClick: () => {
|
|
409
|
-
self.squareView();
|
|
410
|
-
},
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
label: 'Show all regions',
|
|
414
|
-
onClick: () => {
|
|
415
|
-
self.showAllRegions();
|
|
416
|
-
},
|
|
417
414
|
},
|
|
418
415
|
{
|
|
419
416
|
label: 'Export SVG',
|
|
@@ -421,7 +418,10 @@ export default function stateModelFactory(pm) {
|
|
|
421
418
|
onClick: () => {
|
|
422
419
|
getSession(self).queueDialog(handleClose => [
|
|
423
420
|
ExportSvgDialog,
|
|
424
|
-
{
|
|
421
|
+
{
|
|
422
|
+
model: self,
|
|
423
|
+
handleClose,
|
|
424
|
+
},
|
|
425
425
|
]);
|
|
426
426
|
},
|
|
427
427
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { stripAlpha } from '@jbrowse/core/util';
|
|
3
3
|
import { useTheme } from '@mui/material';
|
|
4
4
|
export default function SVGBackground({ width, height, }) {
|
|
5
5
|
const theme = useTheme();
|
|
6
|
-
return (
|
|
6
|
+
return (_jsx("rect", { x: 0, y: 0, width: width, height: height, fill: stripAlpha(theme.palette.background.default) }));
|
|
7
7
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
3
3
|
import { getSession, renderToStaticMarkup } from '@jbrowse/core/util';
|
|
4
4
|
import { ThemeProvider } from '@mui/material';
|
|
5
5
|
import { when } from 'mobx';
|
|
6
|
-
import { getRoot } from 'mobx-state-tree';
|
|
7
6
|
import SVGBackground from './SVGBackground';
|
|
8
7
|
import { HorizontalAxisRaw, VerticalAxisRaw } from '../components/Axes';
|
|
9
8
|
import { GridRaw } from '../components/Grid';
|
|
@@ -11,7 +10,6 @@ export async function renderToSvg(model, opts) {
|
|
|
11
10
|
var _a;
|
|
12
11
|
await when(() => model.initialized);
|
|
13
12
|
const { themeName = 'default', Wrapper = ({ children }) => children } = opts;
|
|
14
|
-
const { createRootFn } = getRoot(model);
|
|
15
13
|
const session = getSession(model);
|
|
16
14
|
const theme = (_a = session.allThemes) === null || _a === void 0 ? void 0 : _a.call(session)[themeName];
|
|
17
15
|
const { width, borderX, viewWidth, viewHeight, tracks, height } = model;
|
|
@@ -22,17 +20,5 @@ export async function renderToSvg(model, opts) {
|
|
|
22
20
|
return { track, result: await display.renderSvg({ ...opts, theme }) };
|
|
23
21
|
}));
|
|
24
22
|
const w = width + shift * 2;
|
|
25
|
-
return renderToStaticMarkup(
|
|
26
|
-
React.createElement(Wrapper, null,
|
|
27
|
-
React.createElement("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w, height].toString() },
|
|
28
|
-
React.createElement(SVGBackground, { width: w, height: height }),
|
|
29
|
-
React.createElement(VerticalAxisRaw, { model: model }),
|
|
30
|
-
React.createElement("g", { transform: `translate(${borderX} 0)` },
|
|
31
|
-
React.createElement(GridRaw, { model: model }),
|
|
32
|
-
React.createElement("defs", null,
|
|
33
|
-
React.createElement("clipPath", { id: "clip-ruler" },
|
|
34
|
-
React.createElement("rect", { x: 0, y: 0, width: viewWidth, height: viewHeight }))),
|
|
35
|
-
React.createElement("g", { clipPath: "url(#clip-ruler)" }, displayResults.map(({ result }, i) => (React.createElement("g", { key: i }, result))))),
|
|
36
|
-
React.createElement("g", { transform: `translate(${borderX} ${viewHeight})` },
|
|
37
|
-
React.createElement(HorizontalAxisRaw, { model: model }))))), createRootFn);
|
|
23
|
+
return renderToStaticMarkup(_jsx(ThemeProvider, { theme: createJBrowseTheme(theme), children: _jsx(Wrapper, { children: _jsxs("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w, height].toString(), children: [_jsx(SVGBackground, { width: w, height: height }), _jsx(VerticalAxisRaw, { model: model }), _jsxs("g", { transform: `translate(${borderX} 0)`, children: [_jsx(GridRaw, { model: model }), _jsx("defs", { children: _jsx("clipPath", { id: "clip-ruler", children: _jsx("rect", { x: 0, y: 0, width: viewWidth, height: viewHeight }) }) }), _jsx("g", { clipPath: "url(#clip-ruler)", children: displayResults.map(({ result }, i) => (_jsx("g", { children: result }, i))) })] }), _jsx("g", { transform: `translate(${borderX} ${viewHeight})`, children: _jsx(HorizontalAxisRaw, { model: model }) })] }) }) }));
|
|
38
24
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
+
import type { SnapshotIn } from 'mobx-state-tree';
|
|
3
|
+
export type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
4
|
+
export type ImportFormSyntenyTrack = {
|
|
5
|
+
type: 'preConfigured';
|
|
6
|
+
value: string;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'userOpened';
|
|
9
|
+
value: Conf;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'none';
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
declare const ServerSideRenderedDotplotContent: ({ model, style, }: {
|
|
4
3
|
model: {
|
|
5
4
|
error?: unknown;
|
|
@@ -9,5 +8,5 @@ declare const ServerSideRenderedDotplotContent: ({ model, style, }: {
|
|
|
9
8
|
reactElement?: React.ReactElement;
|
|
10
9
|
};
|
|
11
10
|
style: CSSProperties;
|
|
12
|
-
}) =>
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
12
|
export default ServerSideRenderedDotplotContent;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
4
|
import { Typography } from '@mui/material';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
@@ -34,31 +35,28 @@ function LoadingMessage() {
|
|
|
34
35
|
clearTimeout(timeout);
|
|
35
36
|
};
|
|
36
37
|
}, []);
|
|
37
|
-
return shown ? (
|
|
38
|
-
React.createElement(LoadingEllipses, null))) : null;
|
|
38
|
+
return shown ? (_jsx("div", { className: classes.loading, children: _jsx(LoadingEllipses, {}) })) : null;
|
|
39
39
|
}
|
|
40
40
|
function BlockMessage({ messageText }) {
|
|
41
41
|
const { classes } = useStyles();
|
|
42
|
-
return (
|
|
43
|
-
React.createElement(Typography, null, messageText)));
|
|
42
|
+
return (_jsx("div", { className: classes.blockMessage, children: _jsx(Typography, { children: messageText }) }));
|
|
44
43
|
}
|
|
45
44
|
function BlockError({ error }) {
|
|
46
45
|
const { classes } = useStyles();
|
|
47
|
-
return (
|
|
48
|
-
React.createElement(Typography, null, `${error}`)));
|
|
46
|
+
return (_jsx("div", { className: classes.blockError, children: _jsx(Typography, { children: `${error}` }) }));
|
|
49
47
|
}
|
|
50
48
|
const ServerSideRenderedDotplotContent = observer(function ({ model, style, }) {
|
|
51
49
|
if (model.error) {
|
|
52
|
-
return
|
|
50
|
+
return _jsx(BlockError, { error: model.error, "data-testid": "reload_button" });
|
|
53
51
|
}
|
|
54
52
|
else if (model.message) {
|
|
55
|
-
return
|
|
53
|
+
return _jsx(BlockMessage, { messageText: model.message });
|
|
56
54
|
}
|
|
57
55
|
else if (!model.filled) {
|
|
58
|
-
return
|
|
56
|
+
return _jsx(LoadingMessage, {});
|
|
59
57
|
}
|
|
60
58
|
else if (model.shouldDisplay) {
|
|
61
|
-
return
|
|
59
|
+
return _jsx("div", { style: style, children: model.reactElement });
|
|
62
60
|
}
|
|
63
61
|
return null;
|
|
64
62
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
interface ModelType {
|
|
3
2
|
imageData: string;
|
|
4
3
|
style: Record<string, string>;
|
|
@@ -10,5 +9,5 @@ interface ModelType {
|
|
|
10
9
|
}
|
|
11
10
|
declare const ServerSideSyntenyRendering: ({ model, }: {
|
|
12
11
|
model: ModelType;
|
|
13
|
-
}) =>
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export default ServerSideSyntenyRendering;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
3
|
import { drawImageOntoCanvasContext } from '@jbrowse/core/util/offscreenCanvasPonyfill';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
const ServerSideSyntenyRendering = observer(function ({ model, }) {
|
|
@@ -15,6 +16,6 @@ const ServerSideSyntenyRendering = observer(function ({ model, }) {
|
|
|
15
16
|
drawImageOntoCanvasContext(imageData, context);
|
|
16
17
|
setDone(true);
|
|
17
18
|
}, [imageData]);
|
|
18
|
-
return (
|
|
19
|
+
return (_jsx("canvas", { "data-testid": `prerendered_canvas${done ? '_done' : ''}`, ref: featureCanvas, width: width * highResolutionScaling, height: height * highResolutionScaling, style: { width, height, ...style } }));
|
|
19
20
|
});
|
|
20
21
|
export default ServerSideSyntenyRendering;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-dotplot-view",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "JBrowse 2 dotplot view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@jbrowse/core": "^3.0.1",
|
|
40
|
+
"@jbrowse/plugin-alignments": "^3.0.1",
|
|
39
41
|
"@mui/icons-material": "^6.0.0",
|
|
42
|
+
"@mui/material": "^6.0.0",
|
|
40
43
|
"@mui/x-data-grid": "^7.0.0",
|
|
41
44
|
"@types/file-saver": "^2.0.1",
|
|
42
|
-
"file-saver": "^2.0.0"
|
|
43
|
-
},
|
|
44
|
-
"peerDependencies": {
|
|
45
|
-
"@jbrowse/core": "^2.0.0",
|
|
46
|
-
"@jbrowse/plugin-alignments": "^2.0.0",
|
|
47
|
-
"@mui/material": "^6.0.0",
|
|
45
|
+
"file-saver": "^2.0.0",
|
|
48
46
|
"mobx": "^6.0.0",
|
|
49
47
|
"mobx-react": "^9.0.0",
|
|
50
48
|
"mobx-state-tree": "^5.0.0",
|
|
51
|
-
"react": ">=16.8.0",
|
|
52
|
-
"react-dom": ">=16.8.0",
|
|
53
49
|
"rxjs": "^7.0.0",
|
|
54
50
|
"tss-react": "^4.0.0"
|
|
55
51
|
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"react": ">=18.0.0",
|
|
54
|
+
"react-dom": ">=18.0.0"
|
|
55
|
+
},
|
|
56
56
|
"distModule": "esm/index.js",
|
|
57
57
|
"srcModule": "src/index.ts",
|
|
58
58
|
"module": "esm/index.js",
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "aa2f1d1a89d2361c7fd1a93fe29506fa4554f5cc"
|
|
63
63
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
-
import type { SnapshotIn } from 'mobx-state-tree';
|
|
4
|
-
type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
5
|
-
declare const ImportCustomTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
|
|
6
|
-
sessionTrackData: Conf;
|
|
7
|
-
assembly1: string;
|
|
8
|
-
assembly2: string;
|
|
9
|
-
setSessionTrackData: (arg: Conf) => void;
|
|
10
|
-
}) => React.JSX.Element;
|
|
11
|
-
export default ImportCustomTrack;
|