@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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getFillProps, getStrokeProps, getTickDisplayStr, } from '@jbrowse/core/util';
|
|
3
3
|
import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
|
|
4
4
|
import { useTheme } from '@mui/material';
|
|
@@ -23,8 +23,7 @@ const useStyles = makeStyles()(() => ({
|
|
|
23
23
|
export const HorizontalAxis = observer(function ({ model, }) {
|
|
24
24
|
const { viewWidth, borderY } = model;
|
|
25
25
|
const { classes } = useStyles();
|
|
26
|
-
return (
|
|
27
|
-
React.createElement(HorizontalAxisRaw, { model: model })));
|
|
26
|
+
return (_jsx("svg", { width: viewWidth, height: borderY, className: classes.htext, children: _jsx(HorizontalAxisRaw, { model: model }) }));
|
|
28
27
|
});
|
|
29
28
|
export const HorizontalAxisRaw = observer(function ({ model, }) {
|
|
30
29
|
const { viewWidth, borderX, borderY, hview, htextRotation, hticks } = model;
|
|
@@ -51,26 +50,21 @@ export const HorizontalAxisRaw = observer(function ({ model, }) {
|
|
|
51
50
|
})
|
|
52
51
|
.filter(f => f[1] !== undefined)
|
|
53
52
|
.map(f => [f[0], f[1] - offsetPx]);
|
|
54
|
-
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
ticks
|
|
65
|
-
.filter(t => t[0].type === 'major')
|
|
66
|
-
.map(([tick, x]) => x > 10 && x < width ? (React.createElement("text", { x: x - 7, y: 0, transform: `rotate(${htextRotation},${x},0)`, key: `text-${JSON.stringify(tick)}`, fontSize: 11, dominantBaseline: "middle", textAnchor: "end", ...getFillProps(theme.palette.text.primary) }, getTickDisplayStr(tick.base + 1, bpPerPx))) : null),
|
|
67
|
-
React.createElement("text", { y: borderY - 12, x: (viewWidth - borderX) / 2, textAnchor: "middle", fontSize: 11, dominantBaseline: "hanging", ...getFillProps(theme.palette.text.primary) }, hview.assemblyNames.join(','))));
|
|
53
|
+
return (_jsxs(_Fragment, { children: [dblocks
|
|
54
|
+
.filter(region => !hide.has(region.key))
|
|
55
|
+
.map(region => {
|
|
56
|
+
const x = region.offsetPx;
|
|
57
|
+
const y = 0;
|
|
58
|
+
const xoff = Math.floor(x - hview.offsetPx);
|
|
59
|
+
return (_jsx("text", { transform: `rotate(${htextRotation},${xoff},${y})`, x: xoff, y: y + 1, fontSize: 11, dominantBaseline: "hanging", textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: region.refName }, JSON.stringify(region)));
|
|
60
|
+
}), ticks.map(([tick, x]) => x > 0 && x < width ? (_jsx("line", { x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, ...getFillProps(theme.palette.text.primary) }, `line-${JSON.stringify(tick)}`)) : null), ticks
|
|
61
|
+
.filter(t => t[0].type === 'major')
|
|
62
|
+
.map(([tick, x]) => x > 10 && x < width ? (_jsx("text", { x: x - 7, y: 0, transform: `rotate(${htextRotation},${x},0)`, fontSize: 11, dominantBaseline: "middle", textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: getTickDisplayStr(tick.base + 1, bpPerPx) }, `text-${JSON.stringify(tick)}`)) : null), _jsx("text", { y: borderY - 12, x: (viewWidth - borderX) / 2, textAnchor: "middle", fontSize: 11, dominantBaseline: "hanging", ...getFillProps(theme.palette.text.primary), children: hview.assemblyNames.join(',') })] }));
|
|
68
63
|
});
|
|
69
64
|
export const VerticalAxis = observer(function ({ model, }) {
|
|
70
65
|
const { borderX, viewHeight } = model;
|
|
71
66
|
const { classes } = useStyles();
|
|
72
|
-
return (
|
|
73
|
-
React.createElement(VerticalAxisRaw, { model: model })));
|
|
67
|
+
return (_jsx("svg", { className: classes.vtext, width: borderX, height: viewHeight, children: _jsx(VerticalAxisRaw, { model: model }) }));
|
|
74
68
|
});
|
|
75
69
|
export const VerticalAxisRaw = observer(function ({ model, }) {
|
|
76
70
|
const { viewHeight, borderX, borderY, vview, vtextRotation, vticks } = model;
|
|
@@ -97,18 +91,14 @@ export const VerticalAxisRaw = observer(function ({ model, }) {
|
|
|
97
91
|
})
|
|
98
92
|
.filter(f => f[1] !== undefined)
|
|
99
93
|
.map(f => [f[0], f[1] - offsetPx]);
|
|
100
|
-
return (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
ticks
|
|
111
|
-
.filter(t => t[0].type === 'major')
|
|
112
|
-
.map(([tick, y]) => y > 10 && y < viewHeight ? (React.createElement("text", { y: viewHeight - y - 3, x: borderX - 7, key: `text-${JSON.stringify(tick)}`, textAnchor: "end", dominantBaseline: "hanging", fontSize: 11, ...getFillProps(theme.palette.text.primary) }, getTickDisplayStr(tick.base + 1, bpPerPx))) : null),
|
|
113
|
-
React.createElement("text", { y: (viewHeight - borderY) / 2, x: 12, transform: `rotate(-90,12,${(viewHeight - borderY) / 2})`, textAnchor: "middle", fontSize: 11, ...getFillProps(theme.palette.text.primary) }, vview.assemblyNames.join(','))));
|
|
94
|
+
return (_jsxs(_Fragment, { children: [dblocks
|
|
95
|
+
.filter(region => !hide.has(region.key))
|
|
96
|
+
.map(region => {
|
|
97
|
+
const y = region.offsetPx;
|
|
98
|
+
const x = borderX;
|
|
99
|
+
const yoff = Math.floor(viewHeight - y + offsetPx);
|
|
100
|
+
return (_jsx("text", { transform: `rotate(${vtextRotation},${x},${y})`, x: x, y: yoff, fontSize: 11, textAnchor: "end", ...getFillProps(theme.palette.text.primary), children: region.refName }, JSON.stringify(region)));
|
|
101
|
+
}), ticks.map(([tick, y]) => y > 0 ? (_jsx("line", { y1: viewHeight - y, y2: viewHeight - y, x1: borderX, x2: borderX - (tick.type === 'major' ? 6 : 4), strokeWidth: 1, ...getStrokeProps(theme.palette.grey[400]) }, `line-${JSON.stringify(tick)}`)) : null), ticks
|
|
102
|
+
.filter(t => t[0].type === 'major')
|
|
103
|
+
.map(([tick, y]) => y > 10 && y < viewHeight ? (_jsx("text", { y: viewHeight - y - 3, x: borderX - 7, textAnchor: "end", dominantBaseline: "hanging", fontSize: 11, ...getFillProps(theme.palette.text.primary), children: getTickDisplayStr(tick.base + 1, bpPerPx) }, `text-${JSON.stringify(tick)}`)) : null), _jsx("text", { y: (viewHeight - borderY) / 2, x: 12, transform: `rotate(-90,12,${(viewHeight - borderY) / 2})`, textAnchor: "middle", fontSize: 11, ...getFillProps(theme.palette.text.primary), children: vview.assemblyNames.join(',') })] }));
|
|
114
104
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { SvgIconProps } from '@mui/material/SvgIcon';
|
|
3
|
-
export declare function CursorMove(props: SvgIconProps):
|
|
4
|
-
export declare function CursorMouse(props: SvgIconProps):
|
|
2
|
+
export declare function CursorMove(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function CursorMouse(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/SvgIcon';
|
|
3
3
|
export function CursorMove(props) {
|
|
4
|
-
return (
|
|
5
|
-
React.createElement("path", { fill: "currentColor", d: "M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z" })));
|
|
4
|
+
return (_jsx(SvgIcon, { ...props, children: _jsx("path", { fill: "currentColor", d: "M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z" }) }));
|
|
6
5
|
}
|
|
7
6
|
export function CursorMouse(props) {
|
|
8
|
-
return (
|
|
9
|
-
React.createElement("path", { fill: "currentColor", d: "M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z" })));
|
|
7
|
+
return (_jsx(SvgIcon, { ...props, children: _jsx("path", { fill: "currentColor", d: "M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z" }) }));
|
|
10
8
|
}
|
|
@@ -1,112 +1,110 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
3
3
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
|
|
4
|
+
import CropDinIcon from '@mui/icons-material/CropDin';
|
|
5
|
+
import CropLandscapeIcon from '@mui/icons-material/CropLandscape';
|
|
4
6
|
import MoreVert from '@mui/icons-material/MoreVert';
|
|
7
|
+
import SettingsOverscanIcon from '@mui/icons-material/SettingsOverscan';
|
|
5
8
|
import ZoomIn from '@mui/icons-material/ZoomIn';
|
|
6
9
|
import ZoomOut from '@mui/icons-material/ZoomOut';
|
|
7
10
|
import { IconButton } from '@mui/material';
|
|
8
11
|
import { observer } from 'mobx-react';
|
|
9
12
|
import { CursorMouse, CursorMove } from './CursorIcon';
|
|
10
13
|
const DotplotControls = observer(function ({ model, }) {
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
React.createElement(CascadingMenuButton, { menuItems: [
|
|
23
|
-
{
|
|
24
|
-
onClick: () => {
|
|
25
|
-
model.squareView();
|
|
14
|
+
return (_jsxs("div", { children: [_jsx(IconButton, { onClick: () => {
|
|
15
|
+
model.zoomOut();
|
|
16
|
+
}, children: _jsx(ZoomOut, {}) }), _jsx(IconButton, { onClick: () => {
|
|
17
|
+
model.zoomIn();
|
|
18
|
+
}, children: _jsx(ZoomIn, {}) }), _jsx(IconButton, { onClick: () => model.activateTrackSelector(), title: "Open track selector", children: _jsx(TrackSelectorIcon, {}) }), _jsx(CascadingMenuButton, { menuItems: [
|
|
19
|
+
{
|
|
20
|
+
label: 'Square view - same bp per pixel',
|
|
21
|
+
icon: CropDinIcon,
|
|
22
|
+
onClick: () => {
|
|
23
|
+
model.squareView();
|
|
24
|
+
},
|
|
26
25
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
{
|
|
27
|
+
label: 'Rectangular view - same total bp',
|
|
28
|
+
icon: CropLandscapeIcon,
|
|
29
|
+
onClick: () => {
|
|
30
|
+
model.squareViewProportional();
|
|
31
|
+
},
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
{
|
|
34
|
+
label: 'Show all regions',
|
|
35
|
+
icon: SettingsOverscanIcon,
|
|
36
|
+
onClick: () => {
|
|
37
|
+
model.showAllRegions();
|
|
38
|
+
},
|
|
38
39
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
{
|
|
41
|
+
type: 'checkbox',
|
|
42
|
+
label: 'Draw CIGAR',
|
|
43
|
+
checked: model.drawCigar,
|
|
44
|
+
onClick: () => {
|
|
45
|
+
model.setDrawCigar(!model.drawCigar);
|
|
46
|
+
},
|
|
44
47
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
{
|
|
49
|
+
label: 'Show pan buttons',
|
|
50
|
+
type: 'checkbox',
|
|
51
|
+
checked: model.showPanButtons,
|
|
52
|
+
onClick: () => {
|
|
53
|
+
model.setShowPanButtons(!model.showPanButtons);
|
|
54
|
+
},
|
|
52
55
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
{
|
|
57
|
+
label: 'Click and drag mode',
|
|
58
|
+
subMenu: [
|
|
59
|
+
{
|
|
60
|
+
label: 'Pan by default, select region when ctrl/cmd key is held',
|
|
61
|
+
icon: CursorMove,
|
|
62
|
+
type: 'radio',
|
|
63
|
+
checked: model.cursorMode === 'move',
|
|
64
|
+
onClick: () => {
|
|
65
|
+
model.setCursorMode('move');
|
|
66
|
+
},
|
|
63
67
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
{
|
|
69
|
+
label: 'Select region by default, pan when ctrl/cmd key is held',
|
|
70
|
+
icon: CursorMouse,
|
|
71
|
+
type: 'radio',
|
|
72
|
+
checked: model.cursorMode === 'crosshair',
|
|
73
|
+
onClick: () => {
|
|
74
|
+
model.setCursorMode('crosshair');
|
|
75
|
+
},
|
|
72
76
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
model.setWheelMode('pan');
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'Wheel scroll mode',
|
|
81
|
+
subMenu: [
|
|
82
|
+
{
|
|
83
|
+
label: 'Pans view',
|
|
84
|
+
type: 'radio',
|
|
85
|
+
checked: model.wheelMode === 'pan',
|
|
86
|
+
onClick: () => {
|
|
87
|
+
model.setWheelMode('pan');
|
|
88
|
+
},
|
|
86
89
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
{
|
|
91
|
+
label: 'Zooms view',
|
|
92
|
+
type: 'radio',
|
|
93
|
+
checked: model.wheelMode === 'zoom',
|
|
94
|
+
onClick: () => {
|
|
95
|
+
model.setWheelMode('zoom');
|
|
96
|
+
},
|
|
94
97
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
{
|
|
99
|
+
label: 'Disable',
|
|
100
|
+
type: 'radio',
|
|
101
|
+
checked: model.wheelMode === 'none',
|
|
102
|
+
onClick: () => {
|
|
103
|
+
model.setWheelMode('none');
|
|
104
|
+
},
|
|
102
105
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
},
|
|
109
|
-
] },
|
|
110
|
-
React.createElement(MoreVert, null))));
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
], children: _jsx(MoreVert, {}) })] }));
|
|
111
109
|
});
|
|
112
110
|
export default DotplotControls;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { DotplotViewModel } from '../model';
|
|
3
2
|
type Coord = [number, number] | undefined;
|
|
4
3
|
export declare const DotplotTooltipClick: ({ model, mousedown, mousedownClient, xdistance, ydistance, }: {
|
|
@@ -7,5 +6,5 @@ export declare const DotplotTooltipClick: ({ model, mousedown, mousedownClient,
|
|
|
7
6
|
mousedownClient: Coord;
|
|
8
7
|
xdistance: number;
|
|
9
8
|
ydistance: number;
|
|
10
|
-
}) =>
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
10
|
export default DotplotTooltipClick;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { locstr } from './util';
|
|
@@ -6,10 +6,6 @@ export const DotplotTooltipClick = observer(function ({ model, mousedown, moused
|
|
|
6
6
|
const { hview, vview, viewHeight } = model;
|
|
7
7
|
const x = ((mousedownClient === null || mousedownClient === void 0 ? void 0 : mousedownClient[0]) || 0) - (xdistance < 0 ? 0 : 0);
|
|
8
8
|
const y = ((mousedownClient === null || mousedownClient === void 0 ? void 0 : mousedownClient[1]) || 0) - (ydistance < 0 ? 0 : 0);
|
|
9
|
-
return mousedown && Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 ? (
|
|
10
|
-
`x - ${locstr(mousedown[0], hview)}`,
|
|
11
|
-
React.createElement("br", null),
|
|
12
|
-
`y - ${locstr(viewHeight - mousedown[1], vview)}`,
|
|
13
|
-
React.createElement("br", null))) : null;
|
|
9
|
+
return mousedown && Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 ? (_jsxs(BaseTooltip, { placement: xdistance < 0 ? 'right' : 'left', clientPoint: { x, y }, children: [`x - ${locstr(mousedown[0], hview)}`, _jsx("br", {}), `y - ${locstr(viewHeight - mousedown[1], vview)}`, _jsx("br", {})] })) : null;
|
|
14
10
|
});
|
|
15
11
|
export default DotplotTooltipClick;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { DotplotViewModel } from '../model';
|
|
3
2
|
type Coord = [number, number] | undefined;
|
|
4
3
|
declare const DotplotTooltipMouseover: ({ model, mouserect, mouserectClient, xdistance, }: {
|
|
@@ -6,5 +5,5 @@ declare const DotplotTooltipMouseover: ({ model, mouserect, mouserectClient, xdi
|
|
|
6
5
|
mouserect: Coord;
|
|
7
6
|
mouserectClient: Coord;
|
|
8
7
|
xdistance: number;
|
|
9
|
-
}) =>
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
9
|
export default DotplotTooltipMouseover;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { locstr } from './util';
|
|
5
5
|
const DotplotTooltipMouseover = observer(function ({ model, mouserect, mouserectClient, xdistance, }) {
|
|
6
6
|
const { hview, vview, viewHeight } = model;
|
|
7
|
-
return mouserect ? (
|
|
7
|
+
return mouserect ? (_jsxs(BaseTooltip, { placement: xdistance < 0 ? 'left' : 'right', clientPoint: mouserectClient
|
|
8
8
|
? { x: mouserectClient[0], y: mouserectClient[1] }
|
|
9
|
-
: undefined },
|
|
10
|
-
`x - ${locstr(mouserect[0], hview)}`,
|
|
11
|
-
React.createElement("br", null),
|
|
12
|
-
`y - ${locstr(viewHeight - mouserect[1], vview)}`,
|
|
13
|
-
React.createElement("br", null))) : null;
|
|
9
|
+
: undefined, children: [`x - ${locstr(mouserect[0], hview)}`, _jsx("br", {}), `y - ${locstr(viewHeight - mouserect[1], vview)}`, _jsx("br", {})] })) : null;
|
|
14
10
|
});
|
|
15
11
|
export default DotplotTooltipMouseover;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, lazy, useEffect, useRef, useState } from 'react';
|
|
2
3
|
import { LoadingEllipses, Menu, ResizeHandle } from '@jbrowse/core/ui';
|
|
3
4
|
import { transaction } from 'mobx';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
@@ -55,11 +56,11 @@ function getOffset(coord, rect) {
|
|
|
55
56
|
}
|
|
56
57
|
const RenderedComponent = observer(({ model }) => {
|
|
57
58
|
const { classes } = useStyles();
|
|
58
|
-
return (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
return (_jsx("div", { className: classes.overlay, children: model.tracks.map(track => {
|
|
60
|
+
const [display] = track.displays;
|
|
61
|
+
const { RenderingComponent } = display;
|
|
62
|
+
return RenderingComponent ? (_jsx(RenderingComponent, { model: display }, track.configuration.trackId)) : null;
|
|
63
|
+
}) }));
|
|
63
64
|
});
|
|
64
65
|
const DotplotViewInternal = observer(function ({ model, }) {
|
|
65
66
|
var _a, _b;
|
|
@@ -174,79 +175,63 @@ const DotplotViewInternal = observer(function ({ model, }) {
|
|
|
174
175
|
}
|
|
175
176
|
return () => { };
|
|
176
177
|
}, [validSelect, mousedown, mouseup, xdistance, ydistance]);
|
|
177
|
-
return (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
model.zoomInToMouseCoords(mousedown, mouseup);
|
|
226
|
-
}
|
|
227
|
-
setMouseOvered(false);
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
label: 'Open linear synteny view',
|
|
232
|
-
onClick: () => {
|
|
233
|
-
if (mousedown && mouseup) {
|
|
234
|
-
model.onDotplotView(mousedown, mouseup);
|
|
235
|
-
}
|
|
236
|
-
setMouseOvered(false);
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
] })),
|
|
240
|
-
React.createElement(ResizeHandle, { onDrag: n => model.setHeight(model.height + n), className: classes.resizeHandle }))));
|
|
178
|
+
return (_jsxs("div", { children: [_jsx(Header, { model: model, selection: !validSelect || !(mousedown && mouserect)
|
|
179
|
+
? undefined
|
|
180
|
+
: {
|
|
181
|
+
width: Math.abs(xdistance),
|
|
182
|
+
height: Math.abs(ydistance),
|
|
183
|
+
} }), _jsxs("div", { ref: root, className: classes.root, onMouseLeave: () => {
|
|
184
|
+
setMouseOvered(false);
|
|
185
|
+
}, onMouseEnter: () => {
|
|
186
|
+
setMouseOvered(true);
|
|
187
|
+
}, children: [_jsxs("div", { className: classes.container, children: [_jsx(VerticalAxis, { model: model }), _jsx(HorizontalAxis, { model: model }), _jsxs("div", { ref: ref, className: classes.content, children: [mouseOvered && validSelect ? (_jsx(Suspense, { fallback: null, children: _jsx(TooltipWhereMouseovered, { model: model, mouserect: mouserect, mouserectClient: mouserectClient, xdistance: xdistance }) })) : null, validSelect ? (_jsx(Suspense, { fallback: null, children: _jsx(TooltipWhereClicked, { model: model, mousedown: mousedown, mousedownClient: mousedownClient, xdistance: xdistance, ydistance: ydistance }) })) : null, _jsx("div", { style: { cursor: ctrlKeyDown ? 'pointer' : cursorMode }, onMouseDown: event => {
|
|
188
|
+
if (event.button === 0) {
|
|
189
|
+
const { clientX, clientY } = event;
|
|
190
|
+
setMouseDownClient([clientX, clientY]);
|
|
191
|
+
setMouseCurrClient([clientX, clientY]);
|
|
192
|
+
setCtrlKeyWasUsed(ctrlKeyDown);
|
|
193
|
+
}
|
|
194
|
+
}, children: _jsx(Grid, { model: model, children: validSelect && mousedown && mouserect ? (_jsx("rect", { fill: "rgba(255,0,0,0.3)", x: Math.min(mouserect[0], mousedown[0]), y: Math.min(mouserect[1], mousedown[1]), width: Math.abs(xdistance), height: Math.abs(ydistance) })) : null }) }), _jsx("div", { className: classes.spacer })] }), _jsx(RenderedComponent, { model: model }), _jsx(Menu, { open: Boolean(mouseup), onMenuItemClick: (_, callback) => {
|
|
195
|
+
callback();
|
|
196
|
+
setMouseUpClient(undefined);
|
|
197
|
+
setMouseDownClient(undefined);
|
|
198
|
+
}, onClose: () => {
|
|
199
|
+
setMouseUpClient(undefined);
|
|
200
|
+
setMouseDownClient(undefined);
|
|
201
|
+
}, anchorReference: "anchorPosition", anchorPosition: mouseupClient
|
|
202
|
+
? {
|
|
203
|
+
top: mouseupClient[1] + 50,
|
|
204
|
+
left: mouseupClient[0] + 50,
|
|
205
|
+
}
|
|
206
|
+
: undefined, style: { zIndex: 10000 }, menuItems: [
|
|
207
|
+
{
|
|
208
|
+
label: 'Zoom in',
|
|
209
|
+
onClick: () => {
|
|
210
|
+
if (mousedown && mouseup) {
|
|
211
|
+
model.zoomInToMouseCoords(mousedown, mouseup);
|
|
212
|
+
}
|
|
213
|
+
setMouseOvered(false);
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
label: 'Open linear synteny view',
|
|
218
|
+
onClick: () => {
|
|
219
|
+
if (mousedown && mouseup) {
|
|
220
|
+
model.onDotplotView(mousedown, mouseup);
|
|
221
|
+
}
|
|
222
|
+
setMouseOvered(false);
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
] })] }), _jsx(ResizeHandle, { onDrag: n => model.setHeight(model.height + n), className: classes.resizeHandle })] })] }));
|
|
241
226
|
});
|
|
242
227
|
const DotplotView = observer(function ({ model }) {
|
|
243
228
|
const { initialized, loading, error } = model;
|
|
244
229
|
if ((!initialized && !loading) || error) {
|
|
245
|
-
return
|
|
230
|
+
return _jsx(ImportForm, { model: model });
|
|
246
231
|
}
|
|
247
232
|
if (loading) {
|
|
248
|
-
return
|
|
233
|
+
return _jsx(LoadingEllipses, { variant: "h6" });
|
|
249
234
|
}
|
|
250
|
-
return
|
|
235
|
+
return _jsx(DotplotViewInternal, { model: model });
|
|
251
236
|
});
|
|
252
237
|
export default DotplotView;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { DotplotViewModel } from '../model';
|
|
3
2
|
declare const DotplotWarnings: ({ model, }: {
|
|
4
3
|
model: DotplotViewModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
5
|
export default DotplotWarnings;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { lazy, useState } from 'react';
|
|
2
3
|
import { Alert, Button } from '@mui/material';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
const WarningDialog = lazy(() => import('./WarningDialog'));
|
|
@@ -6,17 +7,12 @@ const DotplotWarnings = observer(function ({ model, }) {
|
|
|
6
7
|
const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
|
|
7
8
|
const [shown, setShown] = useState(false);
|
|
8
9
|
const [hide, setHide] = useState(false);
|
|
9
|
-
return trackWarnings.length && !hide ? (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
setShown(false);
|
|
17
|
-
} })) : null,
|
|
18
|
-
React.createElement(Button, { variant: "contained", onClick: () => {
|
|
19
|
-
setHide(true);
|
|
20
|
-
} }, "Dismiss"))) : null;
|
|
10
|
+
return trackWarnings.length && !hide ? (_jsxs(Alert, { severity: "warning", children: ["Warnings during render", ' ', _jsx(Button, { onClick: () => {
|
|
11
|
+
setShown(true);
|
|
12
|
+
}, children: "More info" }), shown ? (_jsx(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => {
|
|
13
|
+
setShown(false);
|
|
14
|
+
} })) : null, _jsx(Button, { variant: "contained", onClick: () => {
|
|
15
|
+
setHide(true);
|
|
16
|
+
}, children: "Dismiss" })] })) : null;
|
|
21
17
|
});
|
|
22
18
|
export default DotplotWarnings;
|
|
@@ -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;
|