@jbrowse/plugin-linear-comparative-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/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
- package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +36 -58
- package/dist/LGVSyntenyDisplay/components/util.d.ts +9 -6
- package/dist/LGVSyntenyDisplay/components/util.js +6 -12
- package/dist/LGVSyntenyDisplay/model.d.ts +21 -7
- package/dist/LGVSyntenyDisplay/model.js +19 -8
- package/dist/LinearComparativeView/components/Header.d.ts +1 -2
- package/dist/LinearComparativeView/components/Header.js +52 -81
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +1 -2
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +2 -11
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -2
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +13 -21
- package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +1 -2
- package/dist/LinearComparativeView/components/LinearComparativeView.js +2 -5
- package/dist/LinearComparativeView/components/Rubberband.d.ts +1 -2
- package/dist/LinearComparativeView/components/Rubberband.js +20 -51
- package/dist/LinearComparativeView/components/VerticalGuide.d.ts +1 -2
- package/dist/LinearComparativeView/components/VerticalGuide.js +4 -8
- package/dist/LinearComparativeView/index.js +17 -7
- package/dist/LinearComparativeView/model.d.ts +32 -28
- package/dist/LinearComparativeView/model.js +37 -8
- package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +1 -2
- package/dist/LinearReadVsRef/LinearReadVsRef.js +5 -36
- package/dist/LinearReadVsRef/index.js +17 -7
- package/dist/LinearSyntenyDisplay/afterAttach.js +6 -3
- package/dist/LinearSyntenyDisplay/components/Component.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/Component.js +9 -32
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +89 -84
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -5
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +2 -3
- package/dist/LinearSyntenyDisplay/index.js +17 -7
- package/dist/LinearSyntenyDisplay/model.js +17 -7
- package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -2
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +34 -73
- package/dist/LinearSyntenyView/components/Icons.d.ts +2 -3
- package/dist/LinearSyntenyView/components/Icons.js +3 -8
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +130 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +39 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +22 -0
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -2
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +44 -143
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.js +43 -0
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.js +68 -0
- package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -2
- package/dist/LinearSyntenyView/components/LinearSyntenyView.js +20 -9
- package/dist/LinearSyntenyView/index.js +17 -7
- package/dist/LinearSyntenyView/model.d.ts +49 -30
- package/dist/LinearSyntenyView/model.js +57 -15
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +2 -5
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +1 -2
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +2 -10
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +4 -16
- package/dist/LinearSyntenyView/types.d.ts +12 -0
- package/dist/LinearSyntenyView/types.js +2 -0
- package/dist/LinearSyntenyViewHelper/index.js +2 -2
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +87 -0
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -79
- package/dist/SyntenyFeatureDetail/index.js +17 -7
- package/dist/SyntenyFeatureDetail/types.d.ts +9 -0
- package/dist/SyntenyFeatureDetail/types.js +2 -0
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +35 -34
- package/esm/LGVSyntenyDisplay/components/util.d.ts +9 -6
- package/esm/LGVSyntenyDisplay/components/util.js +6 -12
- package/esm/LGVSyntenyDisplay/model.d.ts +21 -7
- package/esm/LGVSyntenyDisplay/model.js +2 -1
- package/esm/LinearComparativeView/components/Header.d.ts +1 -2
- package/esm/LinearComparativeView/components/Header.js +52 -58
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.d.ts +1 -2
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +2 -8
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -2
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +13 -18
- package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +1 -2
- package/esm/LinearComparativeView/components/LinearComparativeView.js +2 -5
- package/esm/LinearComparativeView/components/Rubberband.d.ts +1 -2
- package/esm/LinearComparativeView/components/Rubberband.js +20 -28
- package/esm/LinearComparativeView/components/VerticalGuide.d.ts +1 -2
- package/esm/LinearComparativeView/components/VerticalGuide.js +4 -5
- package/esm/LinearComparativeView/model.d.ts +32 -28
- package/esm/LinearComparativeView/model.js +21 -2
- package/esm/LinearReadVsRef/LinearReadVsRef.d.ts +1 -2
- package/esm/LinearReadVsRef/LinearReadVsRef.js +5 -13
- package/esm/LinearSyntenyDisplay/afterAttach.js +6 -3
- package/esm/LinearSyntenyDisplay/components/Component.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/Component.js +9 -9
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +72 -77
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -2
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +2 -3
- package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -2
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +34 -50
- package/esm/LinearSyntenyView/components/Icons.d.ts +2 -3
- package/esm/LinearSyntenyView/components/Icons.js +3 -5
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +125 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +37 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +16 -0
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -2
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +45 -121
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.js +40 -0
- package/esm/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
- package/esm/LinearSyntenyView/components/ImportForm/getAdapter.js +65 -0
- package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -2
- package/esm/LinearSyntenyView/components/LinearSyntenyView.js +3 -2
- package/esm/LinearSyntenyView/model.d.ts +49 -30
- package/esm/LinearSyntenyView/model.js +41 -9
- package/esm/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +2 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +1 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +2 -7
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +4 -16
- package/esm/LinearSyntenyView/types.d.ts +12 -0
- package/esm/LinearSyntenyView/types.js +1 -0
- package/esm/LinearSyntenyViewHelper/index.js +2 -2
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +52 -0
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +4 -57
- package/esm/SyntenyFeatureDetail/types.d.ts +9 -0
- package/esm/SyntenyFeatureDetail/types.js +1 -0
- package/package.json +11 -11
- package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -194
- package/dist/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
- package/dist/LinearSyntenyView/components/ImportForm/Spacer.js +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -57
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -52
- package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
- package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -169
- package/esm/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
- package/esm/LinearSyntenyView/components/ImportForm/Spacer.js +0 -4
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -32
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -23
|
@@ -4,7 +4,7 @@ import { avg, getSession, isSessionModelWithWidgets } from '@jbrowse/core/util';
|
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
5
|
import FolderOpenIcon from '@mui/icons-material/FolderOpen';
|
|
6
6
|
import { autorun } from 'mobx';
|
|
7
|
-
import { addDisposer, cast, getPath, types } from 'mobx-state-tree';
|
|
7
|
+
import { addDisposer, cast, getPath, onAction, types } from 'mobx-state-tree';
|
|
8
8
|
const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
|
|
9
9
|
function stateModelFactory(pluginManager) {
|
|
10
10
|
var _a;
|
|
@@ -15,7 +15,8 @@ function stateModelFactory(pluginManager) {
|
|
|
15
15
|
type: types.literal('LinearComparativeView'),
|
|
16
16
|
trackSelectorType: 'hierarchical',
|
|
17
17
|
showIntraviewLinks: true,
|
|
18
|
-
|
|
18
|
+
linkViews: false,
|
|
19
|
+
interactiveOverlay: false,
|
|
19
20
|
levels: types.array(LinearSyntenyViewHelper),
|
|
20
21
|
views: types.array(pluginManager.getViewType('LinearGenomeView')
|
|
21
22
|
.stateModel),
|
|
@@ -40,6 +41,21 @@ function stateModelFactory(pluginManager) {
|
|
|
40
41
|
},
|
|
41
42
|
}))
|
|
42
43
|
.actions(self => ({
|
|
44
|
+
afterAttach() {
|
|
45
|
+
const actions = new Set([
|
|
46
|
+
'horizontalScroll',
|
|
47
|
+
'zoomTo',
|
|
48
|
+
'setScaleFactor',
|
|
49
|
+
]);
|
|
50
|
+
addDisposer(self, onAction(self, param => {
|
|
51
|
+
if (self.linkViews) {
|
|
52
|
+
const { name, path, args } = param;
|
|
53
|
+
if (actions.has(name) && path) {
|
|
54
|
+
this.onSubviewAction(name, path, args);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
},
|
|
43
59
|
beforeDestroy() {
|
|
44
60
|
var _a;
|
|
45
61
|
const session = getSession(self);
|
|
@@ -69,6 +85,9 @@ function stateModelFactory(pluginManager) {
|
|
|
69
85
|
l.setHeight(newHeight);
|
|
70
86
|
return l.height;
|
|
71
87
|
},
|
|
88
|
+
setLinkViews(arg) {
|
|
89
|
+
self.linkViews = arg;
|
|
90
|
+
},
|
|
72
91
|
activateTrackSelector(level) {
|
|
73
92
|
if (self.trackSelectorType === 'hierarchical') {
|
|
74
93
|
const session = getSession(self);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { Feature } from '@jbrowse/core/util';
|
|
3
2
|
export default function ReadVsRefDialog({ track, feature: preFeature, handleClose, }: {
|
|
4
3
|
feature: Feature;
|
|
5
4
|
handleClose: () => void;
|
|
6
5
|
track: any;
|
|
7
|
-
}):
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { getConf } from '@jbrowse/core/configuration';
|
|
3
4
|
import { Dialog } from '@jbrowse/core/ui';
|
|
4
5
|
import { gatherOverlaps, getContainingView, getSession, } from '@jbrowse/core/util';
|
|
@@ -231,16 +232,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
231
232
|
setError(e);
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
|
-
return (
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
React.createElement(CircularProgress, null))) : (React.createElement("div", { className: classes.root },
|
|
238
|
-
primaryFeature.get('flags') & 256 ? (React.createElement(Typography, { style: { color: 'orange' } }, "Note: You selected a secondary alignment (which generally does not have SA tags or SEQ fields) so do a full reconstruction of the alignment")) : null,
|
|
239
|
-
React.createElement(Typography, null, "Show an extra window size around each part of the split alignment. Using a larger value can allow you to see more genomic context."),
|
|
240
|
-
React.createElement(TextField, { value: windowSize, onChange: event => {
|
|
241
|
-
setWindowSize(event.target.value);
|
|
242
|
-
}, label: "Set window size" })))),
|
|
243
|
-
React.createElement(DialogActions, null,
|
|
244
|
-
React.createElement(Button, { variant: "contained", color: "secondary", onClick: handleClose }, "Cancel"),
|
|
245
|
-
React.createElement(Button, { disabled: !primaryFeature, variant: "contained", color: "primary", onClick: onSubmit }, "Submit"))));
|
|
235
|
+
return (_jsxs(Dialog, { open: true, onClose: handleClose, title: "Set window size", children: [_jsx(DialogContent, { children: error ? (_jsx(Typography, { color: "error", children: `${error}` })) : !primaryFeature ? (_jsxs("div", { children: [_jsx(Typography, { children: "To accurately perform comparison we are fetching the primary alignment. Loading primary feature..." }), _jsx(CircularProgress, {})] })) : (_jsxs("div", { className: classes.root, children: [primaryFeature.get('flags') & 256 ? (_jsx(Typography, { style: { color: 'orange' }, children: "Note: You selected a secondary alignment (which generally does not have SA tags or SEQ fields) so do a full reconstruction of the alignment" })) : null, _jsx(Typography, { children: "Show an extra window size around each part of the split alignment. Using a larger value can allow you to see more genomic context." }), _jsx(TextField, { value: windowSize, onChange: event => {
|
|
236
|
+
setWindowSize(event.target.value);
|
|
237
|
+
}, label: "Set window size" })] })) }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: handleClose, children: "Cancel" }), _jsx(Button, { disabled: !primaryFeature, variant: "contained", color: "primary", onClick: onSubmit, children: "Submit" })] })] }));
|
|
246
238
|
}
|
|
@@ -8,7 +8,8 @@ export function doAfterAttach(self) {
|
|
|
8
8
|
addDisposer(self, autorun(() => {
|
|
9
9
|
var _a, _b;
|
|
10
10
|
const view = getContainingView(self);
|
|
11
|
-
if (!view.initialized
|
|
11
|
+
if (!view.initialized ||
|
|
12
|
+
!view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const ctx1 = (_a = self.mainCanvas) === null || _a === void 0 ? void 0 : _a.getContext('2d');
|
|
@@ -24,7 +25,8 @@ export function doAfterAttach(self) {
|
|
|
24
25
|
}));
|
|
25
26
|
addDisposer(self, autorun(() => {
|
|
26
27
|
const view = getContainingView(self);
|
|
27
|
-
if (!view.initialized
|
|
28
|
+
if (!view.initialized ||
|
|
29
|
+
!view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
32
|
drawMouseoverSynteny(self);
|
|
@@ -35,7 +37,8 @@ export function doAfterAttach(self) {
|
|
|
35
37
|
bpPerPx: view.views.map(v => v.bpPerPx),
|
|
36
38
|
displayedRegions: JSON.stringify(view.views.map(v => v.displayedRegions)),
|
|
37
39
|
features: self.features,
|
|
38
|
-
initialized: view.initialized
|
|
40
|
+
initialized: view.initialized &&
|
|
41
|
+
view.views.every(a => a.displayedRegions.length > 0 && a.initialized),
|
|
39
42
|
};
|
|
40
43
|
}, ({ initialized }) => {
|
|
41
44
|
if (!initialized) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearSyntenyDisplayModel } from '../model';
|
|
3
2
|
declare const ServerSideRenderedBlockContent: ({ model, }: {
|
|
4
3
|
model: LinearSyntenyDisplayModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default ServerSideRenderedBlockContent;
|
|
@@ -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 { observer } from 'mobx-react';
|
|
4
5
|
import { makeStyles } from 'tss-react/mui';
|
|
@@ -34,27 +35,26 @@ 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
|
|
42
|
+
return _jsx("div", { className: classes.blockMessage, children: messageText });
|
|
43
43
|
}
|
|
44
44
|
function BlockError({ error }) {
|
|
45
45
|
const { classes } = useStyles();
|
|
46
|
-
return
|
|
46
|
+
return _jsx("div", { className: classes.blockError, children: `${error}` });
|
|
47
47
|
}
|
|
48
48
|
const ServerSideRenderedBlockContent = observer(function ({ model, }) {
|
|
49
49
|
if (model.error) {
|
|
50
|
-
return
|
|
50
|
+
return _jsx(BlockError, { error: model.error });
|
|
51
51
|
}
|
|
52
52
|
if (model.message) {
|
|
53
|
-
return
|
|
53
|
+
return _jsx(BlockMessage, { messageText: model.message });
|
|
54
54
|
}
|
|
55
55
|
if (!model.features) {
|
|
56
|
-
return
|
|
56
|
+
return _jsx(LoadingMessage, {});
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return _jsx(LinearSyntenyRendering, { model: model });
|
|
59
59
|
});
|
|
60
60
|
export default ServerSideRenderedBlockContent;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearSyntenyDisplayModel } from '../model';
|
|
3
2
|
declare const LinearSyntenyRendering: ({ model, }: {
|
|
4
3
|
model: LinearSyntenyDisplayModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default LinearSyntenyRendering;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { lazy, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
3
|
import { getContainingView } from '@jbrowse/core/util';
|
|
3
4
|
import { transaction } from 'mobx';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
@@ -33,14 +34,14 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
33
34
|
const width = view.width;
|
|
34
35
|
const delta = useRef(0);
|
|
35
36
|
const scheduled = useRef(false);
|
|
36
|
-
const timeout = useRef();
|
|
37
|
+
const timeout = useRef(null);
|
|
37
38
|
const [anchorEl, setAnchorEl] = useState();
|
|
38
39
|
const [tooltip, setTooltip] = useState('');
|
|
39
40
|
const [currX, setCurrX] = useState();
|
|
40
41
|
const [mouseCurrDownX, setMouseCurrDownX] = useState();
|
|
41
42
|
const [mouseInitialDownX, setMouseInitialDownX] = useState();
|
|
42
43
|
const [currY, setCurrY] = useState();
|
|
43
|
-
const mainSyntenyCanvasRefp = useRef();
|
|
44
|
+
const mainSyntenyCanvasRefp = useRef(null);
|
|
44
45
|
const mouseoverDetectionCanvasRef = useCallback((ref) => {
|
|
45
46
|
model.setMouseoverCanvasRef(ref);
|
|
46
47
|
}, [model, height, width]);
|
|
@@ -103,83 +104,77 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
103
104
|
const cigarClickMapCanvasRef = useCallback((ref) => {
|
|
104
105
|
model.setCigarClickMapCanvasRef(ref);
|
|
105
106
|
}, [model, height, width]);
|
|
106
|
-
return (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
scheduled.current = false;
|
|
107
|
+
return (_jsxs("div", { className: classes.rel, children: [_jsx("canvas", { ref: mouseoverDetectionCanvasRef, width: width, height: height, className: classes.mouseoverCanvas }), _jsx("canvas", { ref: mainSyntenyCanvasRef, onMouseMove: event => {
|
|
108
|
+
var _a;
|
|
109
|
+
if (mouseCurrDownX !== undefined) {
|
|
110
|
+
xOffset.current += mouseCurrDownX - event.clientX;
|
|
111
|
+
setMouseCurrDownX(event.clientX);
|
|
112
|
+
if (!scheduled.current) {
|
|
113
|
+
scheduled.current = true;
|
|
114
|
+
window.requestAnimationFrame(() => {
|
|
115
|
+
transaction(() => {
|
|
116
|
+
for (const v of view.views) {
|
|
117
|
+
v.horizontalScroll(xOffset.current);
|
|
118
|
+
}
|
|
119
|
+
xOffset.current = 0;
|
|
120
|
+
scheduled.current = false;
|
|
121
|
+
});
|
|
122
122
|
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
const ref1 = model.clickMapCanvas;
|
|
128
|
-
const ref2 = model.cigarClickMapCanvas;
|
|
129
|
-
if (!ref1 || !ref2) {
|
|
130
|
-
return;
|
|
123
|
+
}
|
|
131
124
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
125
|
+
else {
|
|
126
|
+
const ref1 = model.clickMapCanvas;
|
|
127
|
+
const ref2 = model.cigarClickMapCanvas;
|
|
128
|
+
if (!ref1 || !ref2) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const rect = ref1.getBoundingClientRect();
|
|
132
|
+
const ctx1 = ref1.getContext('2d');
|
|
133
|
+
const ctx2 = ref2.getContext('2d');
|
|
134
|
+
if (!ctx1 || !ctx2) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const { clientX, clientY } = event;
|
|
138
|
+
const x = clientX - rect.left;
|
|
139
|
+
const y = clientY - rect.top;
|
|
140
|
+
setCurrX(clientX);
|
|
141
|
+
setCurrY(clientY);
|
|
142
|
+
const [r1, g1, b1] = ctx1.getImageData(x, y, 1, 1).data;
|
|
143
|
+
const [r2, g2, b2] = ctx2.getImageData(x, y, 1, 1).data;
|
|
144
|
+
const unitMultiplier = Math.floor(MAX_COLOR_RANGE / model.numFeats);
|
|
145
|
+
const id = getId(r1, g1, b1, unitMultiplier);
|
|
146
|
+
model.setMouseoverId((_a = model.featPositions[id]) === null || _a === void 0 ? void 0 : _a.f.id());
|
|
147
|
+
if (id === -1) {
|
|
148
|
+
setTooltip('');
|
|
149
|
+
}
|
|
150
|
+
else if (model.featPositions[id]) {
|
|
151
|
+
const { f, cigar } = model.featPositions[id];
|
|
152
|
+
const unitMultiplier2 = Math.floor(MAX_COLOR_RANGE / cigar.length);
|
|
153
|
+
const cigarIdx = getId(r2, g2, b2, unitMultiplier2);
|
|
154
|
+
setTooltip(getTooltip({
|
|
155
|
+
feature: f,
|
|
156
|
+
cigarOp: cigar[cigarIdx],
|
|
157
|
+
cigarOpLen: cigar[cigarIdx + 1],
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
137
160
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
161
|
+
}, onMouseLeave: () => {
|
|
162
|
+
model.setMouseoverId(undefined);
|
|
163
|
+
setMouseInitialDownX(undefined);
|
|
164
|
+
setMouseCurrDownX(undefined);
|
|
165
|
+
}, onMouseDown: evt => {
|
|
166
|
+
setMouseCurrDownX(evt.clientX);
|
|
167
|
+
setMouseInitialDownX(evt.clientX);
|
|
168
|
+
}, onMouseUp: evt => {
|
|
169
|
+
setMouseCurrDownX(undefined);
|
|
170
|
+
if (mouseInitialDownX !== undefined &&
|
|
171
|
+
Math.abs(evt.clientX - mouseInitialDownX) < 5) {
|
|
172
|
+
onSynClick(evt, model);
|
|
150
173
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
feature: f,
|
|
157
|
-
cigarOp: cigar[cigarIdx],
|
|
158
|
-
cigarOpLen: cigar[cigarIdx + 1],
|
|
159
|
-
}));
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}, onMouseLeave: () => {
|
|
163
|
-
model.setMouseoverId(undefined);
|
|
164
|
-
setMouseInitialDownX(undefined);
|
|
165
|
-
setMouseCurrDownX(undefined);
|
|
166
|
-
}, onMouseDown: evt => {
|
|
167
|
-
setMouseCurrDownX(evt.clientX);
|
|
168
|
-
setMouseInitialDownX(evt.clientX);
|
|
169
|
-
}, onMouseUp: evt => {
|
|
170
|
-
setMouseCurrDownX(undefined);
|
|
171
|
-
if (mouseInitialDownX !== undefined &&
|
|
172
|
-
Math.abs(evt.clientX - mouseInitialDownX) < 5) {
|
|
173
|
-
onSynClick(evt, model);
|
|
174
|
-
}
|
|
175
|
-
}, onContextMenu: evt => {
|
|
176
|
-
onSynContextClick(evt, model, setAnchorEl);
|
|
177
|
-
}, "data-testid": "synteny_canvas", className: classes.mainCanvas, width: width, height: height }),
|
|
178
|
-
React.createElement("canvas", { ref: clickMapCanvasRef, className: classes.pix, width: width, height: height }),
|
|
179
|
-
React.createElement("canvas", { ref: cigarClickMapCanvasRef, className: classes.pix, width: width, height: height }),
|
|
180
|
-
mouseoverId && tooltip && currX && currY ? (React.createElement(SyntenyTooltip, { title: tooltip })) : null,
|
|
181
|
-
anchorEl ? (React.createElement(SyntenyContextMenu, { model: model, anchorEl: anchorEl, onClose: () => {
|
|
182
|
-
setAnchorEl(undefined);
|
|
183
|
-
} })) : null));
|
|
174
|
+
}, onContextMenu: evt => {
|
|
175
|
+
onSynContextClick(evt, model, setAnchorEl);
|
|
176
|
+
}, "data-testid": "synteny_canvas", className: classes.mainCanvas, width: width, height: height }), _jsx("canvas", { ref: clickMapCanvasRef, className: classes.pix, width: width, height: height }), _jsx("canvas", { ref: cigarClickMapCanvasRef, className: classes.pix, width: width, height: height }), mouseoverId && tooltip && currX && currY ? (_jsx(SyntenyTooltip, { title: tooltip })) : null, anchorEl ? (_jsx(SyntenyContextMenu, { model: model, anchorEl: anchorEl, onClose: () => {
|
|
177
|
+
setAnchorEl(undefined);
|
|
178
|
+
} })) : null] }));
|
|
184
179
|
});
|
|
185
180
|
export default LinearSyntenyRendering;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { LinearSyntenyDisplayModel } from '../model';
|
|
3
2
|
import type { Feature } from '@jbrowse/core/util';
|
|
4
3
|
interface ClickCoord {
|
|
@@ -12,5 +11,5 @@ export default function SyntenyContextMenu({ model, onClose, anchorEl, }: {
|
|
|
12
11
|
onClose: () => void;
|
|
13
12
|
model: LinearSyntenyDisplayModel;
|
|
14
13
|
anchorEl: ClickCoord;
|
|
15
|
-
}):
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Menu } from '@jbrowse/core/ui';
|
|
3
3
|
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
4
4
|
export default function SyntenyContextMenu({ model, onClose, anchorEl, }) {
|
|
5
5
|
const view = getContainingView(model);
|
|
6
6
|
const { clientX, clientY, feature } = anchorEl;
|
|
7
|
-
return (
|
|
7
|
+
return (_jsx(Menu, { onMenuItemClick: (event, callback) => {
|
|
8
8
|
callback(event);
|
|
9
9
|
onClose();
|
|
10
10
|
}, anchorEl: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
3
3
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
5
|
const SyntenyTooltip = observer(function ({ title }) {
|
|
6
|
-
return title ? (
|
|
7
|
-
React.createElement(SanitizedHTML, { html: title }))) : null;
|
|
6
|
+
return title ? (_jsx(BaseTooltip, { children: _jsx(SanitizedHTML, { html: title }) })) : null;
|
|
8
7
|
});
|
|
9
8
|
export default SyntenyTooltip;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
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,18 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
|
|
3
4
|
import { getSession, useLocalStorage } from '@jbrowse/core/util';
|
|
4
5
|
import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, TextField, Typography, } from '@mui/material';
|
|
5
6
|
function LoadingMessage() {
|
|
6
|
-
return (
|
|
7
|
-
React.createElement(CircularProgress, { size: 20, style: { marginRight: 20 } }),
|
|
8
|
-
React.createElement(Typography, { display: "inline" }, "Creating SVG")));
|
|
7
|
+
return (_jsxs("div", { children: [_jsx(CircularProgress, { size: 20, style: { marginRight: 20 } }), _jsx(Typography, { display: "inline", children: "Creating SVG" })] }));
|
|
9
8
|
}
|
|
10
9
|
function useSvgLocal(key, val) {
|
|
11
10
|
return useLocalStorage(`svg-${key}`, val);
|
|
12
11
|
}
|
|
13
12
|
function TextField2({ children, ...rest }) {
|
|
14
|
-
return (
|
|
15
|
-
React.createElement(TextField, { ...rest }, children)));
|
|
13
|
+
return (_jsx("div", { children: _jsx(TextField, { ...rest, children: children }) }));
|
|
16
14
|
}
|
|
17
15
|
export default function ExportSvgDialog({ model, handleClose, }) {
|
|
18
16
|
const session = getSession(model);
|
|
@@ -23,48 +21,34 @@ export default function ExportSvgDialog({ model, handleClose, }) {
|
|
|
23
21
|
const [trackLabels, setTrackLabels] = useSvgLocal('tracklabels', 'offset');
|
|
24
22
|
const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
|
|
25
23
|
const [error, setError] = useState();
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
filename,
|
|
57
|
-
themeName,
|
|
58
|
-
trackLabels,
|
|
59
|
-
});
|
|
60
|
-
handleClose();
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
console.error(e);
|
|
64
|
-
setError(e);
|
|
65
|
-
}
|
|
66
|
-
finally {
|
|
67
|
-
setLoading(false);
|
|
68
|
-
}
|
|
69
|
-
} }, "Submit"))));
|
|
24
|
+
return (_jsxs(Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [_jsxs(DialogContent, { children: [error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(LoadingMessage, {})) : null, _jsx(TextField2, { helperText: "filename", value: filename, onChange: event => {
|
|
25
|
+
setFilename(event.target.value);
|
|
26
|
+
} }), _jsxs(TextField2, { select: true, label: "Track label positioning", variant: "outlined", value: trackLabels, style: { width: 150 }, onChange: event => {
|
|
27
|
+
setTrackLabels(event.target.value);
|
|
28
|
+
}, children: [_jsx(MenuItem, { value: "offset", children: "Offset" }), _jsx(MenuItem, { value: "overlay", children: "Overlay" }), _jsx(MenuItem, { value: "left", children: "Left" }), _jsx(MenuItem, { value: "none", children: "None" })] }), _jsx("br", {}), session.allThemes ? (_jsx(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
|
|
29
|
+
setThemeName(event.target.value);
|
|
30
|
+
}, children: Object.entries(session.allThemes()).map(([key, val]) => (_jsx(MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, offscreenCanvas ? (_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: rasterizeLayers, onChange: () => {
|
|
31
|
+
setRasterizeLayers(val => !val);
|
|
32
|
+
} }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (_jsx(Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
33
|
+
handleClose();
|
|
34
|
+
}, children: "Cancel" }), _jsx(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
|
+
trackLabels,
|
|
43
|
+
});
|
|
44
|
+
handleClose();
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
console.error(e);
|
|
48
|
+
setError(e);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
setLoading(false);
|
|
52
|
+
}
|
|
53
|
+
}, children: "Submit" })] })] }));
|
|
70
54
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { SvgIconProps } from '@mui/material';
|
|
3
|
-
export declare function Curves(props: SvgIconProps):
|
|
4
|
-
export declare function StraightLines(props: SvgIconProps):
|
|
2
|
+
export declare function Curves(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function StraightLines(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SvgIcon } from '@mui/material';
|
|
3
3
|
export function Curves(props) {
|
|
4
|
-
return (
|
|
5
|
-
React.createElement("path", { fill: "currentColor", d: "M16.5,21C13.5,21 12.31,16.76 11.05,12.28C10.14,9.04 9,5 7.5,5C4.11,5 4,11.93 4,12H2C2,11.63 2.06,3 7.5,3C10.5,3 11.71,7.25 12.97,11.74C13.83,14.8 15,19 16.5,19C19.94,19 20.03,12.07 20.03,12H22.03C22.03,12.37 21.97,21 16.5,21Z" })));
|
|
4
|
+
return (_jsx(SvgIcon, { ...props, children: _jsx("path", { fill: "currentColor", d: "M16.5,21C13.5,21 12.31,16.76 11.05,12.28C10.14,9.04 9,5 7.5,5C4.11,5 4,11.93 4,12H2C2,11.63 2.06,3 7.5,3C10.5,3 11.71,7.25 12.97,11.74C13.83,14.8 15,19 16.5,19C19.94,19 20.03,12.07 20.03,12H22.03C22.03,12.37 21.97,21 16.5,21Z" }) }));
|
|
6
5
|
}
|
|
7
6
|
export function StraightLines(props) {
|
|
8
|
-
return (
|
|
9
|
-
React.createElement("path", { fill: "currentColor", d: "M22 12L17 22L7.1 6.04L4.24 12H2L7 2L16.9 17.96L19.76 12H22Z" })));
|
|
7
|
+
return (_jsx(SvgIcon, { ...props, children: _jsx("path", { fill: "currentColor", d: "M22 12L17 22L7.1 6.04L4.24 12H2L7 2L16.9 17.96L19.76 12H22Z" }) }));
|
|
10
8
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LinearSyntenyViewModel } from '../../model';
|
|
2
|
+
declare const ImportSyntenyOpenCustomTrack: ({ model, assembly1, assembly2, selectedRow, }: {
|
|
3
|
+
model: LinearSyntenyViewModel;
|
|
4
|
+
assembly1: string;
|
|
5
|
+
assembly2: string;
|
|
6
|
+
selectedRow: number;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ImportSyntenyOpenCustomTrack;
|