@jbrowse/plugin-dotplot-view 2.17.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ComparativeRenderer/index.d.ts +3 -8
- package/dist/ComparativeRenderer/index.js +3 -8
- package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
- package/dist/DotplotDisplay/components/DotplotDisplay.js +7 -12
- package/dist/DotplotDisplay/index.d.ts +1 -7
- package/dist/DotplotDisplay/index.js +2 -12
- package/dist/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
- package/dist/DotplotDisplay/renderDotplotBlock.js +3 -9
- package/dist/DotplotDisplay/stateModelFactory.d.ts +8 -45
- package/dist/DotplotDisplay/stateModelFactory.js +57 -100
- package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js +13 -14
- package/dist/DotplotReadVsRef/index.d.ts +1 -1
- package/dist/DotplotReadVsRef/index.js +0 -2
- package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
- package/dist/DotplotRenderer/ComparativeRenderRpc.js +3 -8
- package/dist/DotplotRenderer/DotplotRenderer.d.ts +8 -7
- package/dist/DotplotRenderer/DotplotRenderer.js +18 -9
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
- package/dist/DotplotRenderer/components/DotplotRendering.js +2 -5
- package/dist/DotplotRenderer/configSchema.d.ts +0 -21
- package/dist/DotplotRenderer/configSchema.js +2 -27
- package/dist/DotplotRenderer/drawDotplot.d.ts +3 -3
- package/dist/DotplotRenderer/drawDotplot.js +3 -6
- package/dist/DotplotRenderer/index.d.ts +1 -1
- package/dist/DotplotRenderer/index.js +1 -1
- package/dist/DotplotView/1dview.d.ts +2 -77
- package/dist/DotplotView/1dview.js +4 -33
- package/dist/DotplotView/components/Axes.d.ts +5 -6
- package/dist/DotplotView/components/Axes.js +26 -40
- package/dist/DotplotView/components/CursorIcon.d.ts +3 -4
- package/dist/DotplotView/components/CursorIcon.js +3 -5
- package/dist/DotplotView/components/DotplotControls.d.ts +2 -3
- package/dist/DotplotView/components/DotplotControls.js +94 -97
- package/dist/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
- package/dist/DotplotView/components/DotplotTooltipClick.js +3 -7
- package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
- package/dist/DotplotView/components/DotplotTooltipMouseover.js +4 -8
- package/dist/DotplotView/components/DotplotView.d.ts +2 -3
- package/dist/DotplotView/components/DotplotView.js +80 -92
- package/dist/DotplotView/components/DotplotWarnings.d.ts +2 -3
- package/dist/DotplotView/components/DotplotWarnings.js +26 -21
- package/dist/DotplotView/components/ExportSvgDialog.d.ts +2 -3
- package/dist/DotplotView/components/ExportSvgDialog.js +32 -67
- package/dist/DotplotView/components/Grid.d.ts +3 -4
- package/dist/DotplotView/components/Grid.js +19 -32
- package/dist/DotplotView/components/Header.d.ts +2 -3
- package/dist/DotplotView/components/Header.js +4 -23
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +129 -0
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -48
- package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
- package/dist/DotplotView/components/ImportForm/TrackSelector.js +23 -0
- package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
- package/dist/DotplotView/components/ImportForm/getAdapter.js +68 -0
- package/dist/DotplotView/components/ImportForm/index.d.ts +3 -4
- package/dist/DotplotView/components/ImportForm/index.js +47 -97
- package/dist/DotplotView/components/ImportForm/util.js +1 -3
- package/dist/DotplotView/components/PanButtons.d.ts +2 -3
- package/dist/DotplotView/components/PanButtons.js +17 -36
- package/dist/DotplotView/components/WarningDialog.d.ts +7 -7
- package/dist/DotplotView/components/WarningDialog.js +12 -15
- package/dist/DotplotView/components/util.d.ts +2 -7
- package/dist/DotplotView/components/util.js +0 -5
- package/dist/DotplotView/index.d.ts +1 -1
- package/dist/DotplotView/index.js +17 -8
- package/dist/DotplotView/model.d.ts +11 -133
- package/dist/DotplotView/model.js +46 -222
- package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/DotplotView/svgcomponents/SVGBackground.js +3 -6
- package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
- package/dist/DotplotView/types.d.ts +12 -0
- package/dist/DotplotView/types.js +2 -0
- package/dist/LaunchDotplotView.d.ts +1 -1
- package/dist/LaunchDotplotView.js +1 -4
- package/dist/ServerSideRenderedBlockContent.d.ts +2 -2
- package/dist/ServerSideRenderedBlockContent.js +11 -37
- package/dist/ServerSideSyntenyRendering.d.ts +1 -6
- package/dist/ServerSideSyntenyRendering.js +4 -26
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -6
- package/dist/util.d.ts +1 -1
- package/esm/ComparativeRenderer/index.d.ts +3 -8
- package/esm/ComparativeRenderer/index.js +3 -8
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
- package/esm/DotplotDisplay/components/DotplotDisplay.js +7 -9
- package/esm/DotplotDisplay/index.d.ts +1 -7
- package/esm/DotplotDisplay/index.js +2 -12
- package/esm/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
- package/esm/DotplotDisplay/renderDotplotBlock.js +3 -6
- package/esm/DotplotDisplay/stateModelFactory.d.ts +8 -45
- package/esm/DotplotDisplay/stateModelFactory.js +58 -101
- package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js +15 -16
- package/esm/DotplotReadVsRef/index.d.ts +1 -1
- package/esm/DotplotReadVsRef/index.js +0 -2
- package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
- package/esm/DotplotRenderer/ComparativeRenderRpc.js +3 -8
- package/esm/DotplotRenderer/DotplotRenderer.d.ts +8 -7
- package/esm/DotplotRenderer/DotplotRenderer.js +1 -2
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
- package/esm/DotplotRenderer/components/DotplotRendering.js +2 -2
- package/esm/DotplotRenderer/configSchema.d.ts +0 -21
- package/esm/DotplotRenderer/configSchema.js +2 -27
- package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
- package/esm/DotplotRenderer/drawDotplot.js +4 -7
- package/esm/DotplotRenderer/index.d.ts +1 -1
- package/esm/DotplotRenderer/index.js +1 -1
- package/esm/DotplotView/1dview.d.ts +2 -77
- package/esm/DotplotView/1dview.js +4 -33
- package/esm/DotplotView/components/Axes.d.ts +5 -6
- package/esm/DotplotView/components/Axes.js +26 -37
- package/esm/DotplotView/components/CursorIcon.d.ts +3 -4
- package/esm/DotplotView/components/CursorIcon.js +3 -5
- package/esm/DotplotView/components/DotplotControls.d.ts +2 -3
- package/esm/DotplotView/components/DotplotControls.js +94 -97
- package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
- package/esm/DotplotView/components/DotplotTooltipClick.js +3 -7
- package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
- package/esm/DotplotView/components/DotplotTooltipMouseover.js +4 -8
- package/esm/DotplotView/components/DotplotView.d.ts +2 -3
- package/esm/DotplotView/components/DotplotView.js +63 -85
- package/esm/DotplotView/components/DotplotWarnings.d.ts +2 -3
- package/esm/DotplotView/components/DotplotWarnings.js +9 -14
- package/esm/DotplotView/components/ExportSvgDialog.d.ts +2 -3
- package/esm/DotplotView/components/ExportSvgDialog.js +32 -44
- package/esm/DotplotView/components/Grid.d.ts +3 -4
- package/esm/DotplotView/components/Grid.js +19 -29
- package/esm/DotplotView/components/Header.d.ts +2 -3
- package/esm/DotplotView/components/Header.js +4 -23
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +124 -0
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -25
- package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
- package/esm/DotplotView/components/ImportForm/TrackSelector.js +18 -0
- package/esm/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
- package/esm/DotplotView/components/ImportForm/getAdapter.js +65 -0
- package/esm/DotplotView/components/ImportForm/index.d.ts +3 -4
- package/esm/DotplotView/components/ImportForm/index.js +48 -75
- package/esm/DotplotView/components/ImportForm/util.js +1 -3
- package/esm/DotplotView/components/PanButtons.d.ts +2 -3
- package/esm/DotplotView/components/PanButtons.js +17 -36
- package/esm/DotplotView/components/WarningDialog.d.ts +7 -7
- package/esm/DotplotView/components/WarningDialog.js +12 -12
- package/esm/DotplotView/components/util.d.ts +2 -7
- package/esm/DotplotView/components/util.js +0 -5
- package/esm/DotplotView/index.d.ts +1 -1
- package/esm/DotplotView/index.js +0 -1
- package/esm/DotplotView/model.d.ts +11 -133
- package/esm/DotplotView/model.js +30 -216
- package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/DotplotView/svgcomponents/SVGBackground.js +3 -3
- package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
- package/esm/DotplotView/types.d.ts +12 -0
- package/esm/DotplotView/types.js +1 -0
- package/esm/LaunchDotplotView.d.ts +1 -1
- package/esm/LaunchDotplotView.js +1 -4
- package/esm/ServerSideRenderedBlockContent.d.ts +2 -2
- package/esm/ServerSideRenderedBlockContent.js +11 -14
- package/esm/ServerSideSyntenyRendering.d.ts +1 -6
- package/esm/ServerSideSyntenyRendering.js +4 -3
- package/esm/index.d.ts +1 -1
- package/esm/index.js +3 -6
- package/esm/util.d.ts +1 -1
- package/package.json +2 -4
- package/dist/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
- package/dist/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -194
- package/esm/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
- package/esm/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -169
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DotplotViewModel } from '../model';
|
|
1
|
+
import type { DotplotViewModel } from '../model';
|
|
3
2
|
declare const DotplotView: ({ model }: {
|
|
4
3
|
model: DotplotViewModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default DotplotView;
|
|
@@ -1,12 +1,13 @@
|
|
|
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
|
-
import { observer } from 'mobx-react';
|
|
4
4
|
import { transaction } from 'mobx';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
5
6
|
import { makeStyles } from 'tss-react/mui';
|
|
6
|
-
import
|
|
7
|
-
import Header from './Header';
|
|
7
|
+
import { HorizontalAxis, VerticalAxis } from './Axes';
|
|
8
8
|
import Grid from './Grid';
|
|
9
|
-
import
|
|
9
|
+
import Header from './Header';
|
|
10
|
+
import ImportForm from './ImportForm';
|
|
10
11
|
const TooltipWhereClicked = lazy(() => import('./DotplotTooltipClick'));
|
|
11
12
|
const TooltipWhereMouseovered = lazy(() => import('./DotplotTooltipMouseover'));
|
|
12
13
|
const blank = { left: 0, top: 0, width: 0, height: 0 };
|
|
@@ -32,7 +33,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
32
33
|
width: '100%',
|
|
33
34
|
gridRow: '1/2',
|
|
34
35
|
gridColumn: '2/2',
|
|
35
|
-
zIndex: 100,
|
|
36
|
+
zIndex: 100,
|
|
36
37
|
'& path': {
|
|
37
38
|
cursor: 'crosshair',
|
|
38
39
|
fill: 'none',
|
|
@@ -50,18 +51,16 @@ const useStyles = makeStyles()(theme => ({
|
|
|
50
51
|
borderTop: '1px solid #fafafa',
|
|
51
52
|
},
|
|
52
53
|
}));
|
|
53
|
-
// produces offsetX/offsetY coordinates from a clientX and an element's
|
|
54
|
-
// getBoundingClientRect
|
|
55
54
|
function getOffset(coord, rect) {
|
|
56
55
|
return coord && [coord[0] - rect.left, coord[1] - rect.top];
|
|
57
56
|
}
|
|
58
57
|
const RenderedComponent = observer(({ model }) => {
|
|
59
58
|
const { classes } = useStyles();
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
}) }));
|
|
65
64
|
});
|
|
66
65
|
const DotplotViewInternal = observer(function ({ model, }) {
|
|
67
66
|
var _a, _b;
|
|
@@ -91,7 +90,6 @@ const DotplotViewInternal = observer(function ({ model, }) {
|
|
|
91
90
|
(cursorMode === 'crosshair' && ctrlKeyWasUsed);
|
|
92
91
|
const validSelect = (cursorMode === 'move' && ctrlKeyWasUsed) ||
|
|
93
92
|
(cursorMode === 'crosshair' && !ctrlKeyWasUsed);
|
|
94
|
-
// use non-React wheel handler to properly prevent body scrolling
|
|
95
93
|
useEffect(() => {
|
|
96
94
|
function onWheel(event) {
|
|
97
95
|
event.preventDefault();
|
|
@@ -160,8 +158,6 @@ const DotplotViewInternal = observer(function ({ model, }) {
|
|
|
160
158
|
window.addEventListener('keyup', globalCtrlKeyUp);
|
|
161
159
|
};
|
|
162
160
|
}, []);
|
|
163
|
-
// detect a mouseup after a mousedown was submitted, autoremoves mouseup once
|
|
164
|
-
// that single mouseup is set
|
|
165
161
|
useEffect(() => {
|
|
166
162
|
function globalMouseUp(event) {
|
|
167
163
|
if (Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 && validSelect) {
|
|
@@ -179,81 +175,63 @@ const DotplotViewInternal = observer(function ({ model, }) {
|
|
|
179
175
|
}
|
|
180
176
|
return () => { };
|
|
181
177
|
}, [validSelect, mousedown, mouseup, xdistance, ydistance]);
|
|
182
|
-
return (
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
model.zoomInToMouseCoords(mousedown, mouseup);
|
|
231
|
-
}
|
|
232
|
-
// below line is needed to prevent tooltip from sticking
|
|
233
|
-
setMouseOvered(false);
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
label: 'Open linear synteny view',
|
|
238
|
-
onClick: () => {
|
|
239
|
-
if (mousedown && mouseup) {
|
|
240
|
-
model.onDotplotView(mousedown, mouseup);
|
|
241
|
-
}
|
|
242
|
-
// below line is needed to prevent tooltip from sticking
|
|
243
|
-
setMouseOvered(false);
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
] })),
|
|
247
|
-
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 })] })] }));
|
|
248
226
|
});
|
|
249
227
|
const DotplotView = observer(function ({ model }) {
|
|
250
228
|
const { initialized, loading, error } = model;
|
|
251
229
|
if ((!initialized && !loading) || error) {
|
|
252
|
-
return
|
|
230
|
+
return _jsx(ImportForm, { model: model });
|
|
253
231
|
}
|
|
254
232
|
if (loading) {
|
|
255
|
-
return
|
|
233
|
+
return _jsx(LoadingEllipses, { variant: "h6" });
|
|
256
234
|
}
|
|
257
|
-
return
|
|
235
|
+
return _jsx(DotplotViewInternal, { model: model });
|
|
258
236
|
});
|
|
259
237
|
export default DotplotView;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DotplotViewModel } from '../model';
|
|
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,23 +1,18 @@
|
|
|
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
|
-
// lazy components
|
|
5
5
|
const WarningDialog = lazy(() => import('./WarningDialog'));
|
|
6
6
|
const DotplotWarnings = observer(function ({ model, }) {
|
|
7
7
|
const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
|
|
8
8
|
const [shown, setShown] = useState(false);
|
|
9
9
|
const [hide, setHide] = useState(false);
|
|
10
|
-
return trackWarnings.length && !hide ? (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
setShown(false);
|
|
18
|
-
} })) : null,
|
|
19
|
-
React.createElement(Button, { variant: "contained", onClick: () => {
|
|
20
|
-
setHide(true);
|
|
21
|
-
} }, "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;
|
|
22
17
|
});
|
|
23
18
|
export default DotplotWarnings;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ExportSvgOptions } from '../model';
|
|
1
|
+
import type { ExportSvgOptions } from '../model';
|
|
3
2
|
export default function ExportSvgDialog({ model, handleClose, }: {
|
|
4
3
|
model: {
|
|
5
4
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
6
5
|
};
|
|
7
6
|
handleClose: () => void;
|
|
8
|
-
}):
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
|
|
4
4
|
import { getSession, useLocalStorage } from '@jbrowse/core/util';
|
|
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 TextField2({ children, ...rest }) {
|
|
11
|
-
return (
|
|
12
|
-
React.createElement(TextField, { ...rest }, children)));
|
|
10
|
+
return (_jsx("div", { children: _jsx(TextField, { ...rest, children: children }) }));
|
|
13
11
|
}
|
|
14
12
|
function useSvgLocal(key, val) {
|
|
15
13
|
return useLocalStorage(`svg-${key}`, val);
|
|
@@ -22,41 +20,31 @@ export default function ExportSvgDialog({ model, handleClose, }) {
|
|
|
22
20
|
const [error, setError] = useState();
|
|
23
21
|
const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
|
|
24
22
|
const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
|
|
25
|
-
return (
|
|
26
|
-
|
|
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
|
-
handleClose();
|
|
53
|
-
}
|
|
54
|
-
catch (e) {
|
|
55
|
-
console.error(e);
|
|
56
|
-
setError(e);
|
|
57
|
-
}
|
|
58
|
-
finally {
|
|
59
|
-
setLoading(false);
|
|
60
|
-
}
|
|
61
|
-
} }, "Submit"))));
|
|
23
|
+
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 => {
|
|
24
|
+
setFilename(event.target.value);
|
|
25
|
+
} }), session.allThemes ? (_jsx(TextField2, { select: true, label: "Theme", value: themeName, onChange: event => {
|
|
26
|
+
setThemeName(event.target.value);
|
|
27
|
+
}, 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: () => {
|
|
28
|
+
setRasterizeLayers(val => !val);
|
|
29
|
+
} }), 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: () => {
|
|
30
|
+
handleClose();
|
|
31
|
+
}, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
|
|
32
|
+
setLoading(true);
|
|
33
|
+
setError(undefined);
|
|
34
|
+
try {
|
|
35
|
+
await model.exportSvg({
|
|
36
|
+
rasterizeLayers,
|
|
37
|
+
filename,
|
|
38
|
+
themeName,
|
|
39
|
+
});
|
|
40
|
+
handleClose();
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
console.error(e);
|
|
44
|
+
setError(e);
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
setLoading(false);
|
|
48
|
+
}
|
|
49
|
+
}, children: "Submit" })] })] }));
|
|
62
50
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DotplotViewModel } from '../model';
|
|
1
|
+
import type { DotplotViewModel } from '../model';
|
|
3
2
|
export declare const GridRaw: ({ model, children, }: {
|
|
4
3
|
model: DotplotViewModel;
|
|
5
4
|
children?: React.ReactNode;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export default function Grid({ model, children, }: {
|
|
8
7
|
model: DotplotViewModel;
|
|
9
8
|
children?: React.ReactNode;
|
|
10
|
-
}):
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { observer } from 'mobx-react';
|
|
3
|
-
import { useTheme } from '@mui/material';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
2
|
import { getFillProps, getStrokeProps } from '@jbrowse/core/util';
|
|
3
|
+
import { useTheme } from '@mui/material';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
5
|
export const GridRaw = observer(function ({ model, children, }) {
|
|
6
6
|
const { viewWidth, viewHeight, hview, vview } = model;
|
|
7
7
|
const hblocks = hview.dynamicBlocks.contentBlocks;
|
|
@@ -15,39 +15,29 @@ export const GridRaw = observer(function ({ model, children, }) {
|
|
|
15
15
|
const vbottom = vblocks[0].offsetPx - vview.offsetPx;
|
|
16
16
|
const theme = useTheme();
|
|
17
17
|
const stroke = theme.palette.divider;
|
|
18
|
-
// Uses math.max/min avoid making very large SVG rect offscreen element,
|
|
19
|
-
// which can sometimes fail to draw
|
|
20
18
|
const rx = Math.max(hbottom, 0);
|
|
21
19
|
const ry = Math.max(viewHeight - vtop, 0);
|
|
22
20
|
const w = Math.min(htop - hbottom, viewWidth);
|
|
23
21
|
const h = Math.min(viewHeight - vbottom - ry, viewHeight);
|
|
24
22
|
let lastx = Number.POSITIVE_INFINITY;
|
|
25
23
|
let lasty = Number.POSITIVE_INFINITY;
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
lasty = y;
|
|
42
|
-
}
|
|
43
|
-
return render ? (React.createElement("line", { key: JSON.stringify(region), x1: 0, y1: y, x2: viewWidth, y2: y, ...getStrokeProps(stroke) })) : null;
|
|
44
|
-
}),
|
|
45
|
-
React.createElement("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...getStrokeProps(stroke) }),
|
|
46
|
-
React.createElement("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...getStrokeProps(stroke) })),
|
|
47
|
-
children));
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx("rect", { x: rx, y: ry, width: w, height: h, ...getFillProps(theme.palette.background.default) }), _jsxs("g", { children: [hblocks.map(region => {
|
|
25
|
+
const x = region.offsetPx - hview.offsetPx;
|
|
26
|
+
const render = Math.floor(x) !== Math.floor(lastx);
|
|
27
|
+
if (render) {
|
|
28
|
+
lastx = x;
|
|
29
|
+
}
|
|
30
|
+
return render ? (_jsx("line", { x1: x, y1: 0, x2: x, y2: viewHeight, ...getStrokeProps(stroke) }, JSON.stringify(region))) : null;
|
|
31
|
+
}), vblocks.map(region => {
|
|
32
|
+
const y = viewHeight - (region.offsetPx - vview.offsetPx);
|
|
33
|
+
const render = Math.floor(y) !== Math.floor(lasty);
|
|
34
|
+
if (render) {
|
|
35
|
+
lasty = y;
|
|
36
|
+
}
|
|
37
|
+
return render ? (_jsx("line", { x1: 0, y1: y, x2: viewWidth, y2: y, ...getStrokeProps(stroke) }, JSON.stringify(region))) : null;
|
|
38
|
+
}), _jsx("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...getStrokeProps(stroke) }), _jsx("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...getStrokeProps(stroke) })] }), children] }));
|
|
48
39
|
});
|
|
49
40
|
export default function Grid({ model, children, }) {
|
|
50
41
|
const { viewWidth, viewHeight } = model;
|
|
51
|
-
return (
|
|
52
|
-
React.createElement(GridRaw, { model: model }, children)));
|
|
42
|
+
return (_jsx("svg", { width: viewWidth, height: viewHeight, style: { background: 'rgba(0,0,0,0.12)' }, children: _jsx(GridRaw, { model: model, children: children }) }));
|
|
53
43
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DotplotViewModel } from '../model';
|
|
1
|
+
import type { DotplotViewModel } from '../model';
|
|
3
2
|
declare const DotplotHeader: ({ model, selection, }: {
|
|
4
3
|
model: DotplotViewModel;
|
|
5
4
|
selection?: {
|
|
6
5
|
width: number;
|
|
7
6
|
height: number;
|
|
8
7
|
};
|
|
9
|
-
}) =>
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default DotplotHeader;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getBpDisplayStr } from '@jbrowse/core/util';
|
|
2
3
|
import { Typography } from '@mui/material';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
import { makeStyles } from 'tss-react/mui';
|
|
5
|
-
import
|
|
6
|
+
import DotplotControls from './DotplotControls';
|
|
6
7
|
import DotplotWarnings from './DotplotWarnings';
|
|
7
8
|
import PanButtons from './PanButtons';
|
|
8
|
-
import DotplotControls from './DotplotControls';
|
|
9
9
|
const useStyles = makeStyles()({
|
|
10
10
|
bp: {
|
|
11
11
|
display: 'flex',
|
|
@@ -23,25 +23,6 @@ const useStyles = makeStyles()({
|
|
|
23
23
|
const DotplotHeader = observer(function ({ model, selection, }) {
|
|
24
24
|
const { classes } = useStyles();
|
|
25
25
|
const { hview, vview, showPanButtons } = model;
|
|
26
|
-
return (
|
|
27
|
-
React.createElement(DotplotControls, { model: model }),
|
|
28
|
-
React.createElement(Typography, { className: classes.bp, variant: "body2", color: "textSecondary" },
|
|
29
|
-
"x: ",
|
|
30
|
-
hview.assemblyNames.join(','),
|
|
31
|
-
" ",
|
|
32
|
-
getBpDisplayStr(hview.currBp),
|
|
33
|
-
React.createElement("br", null),
|
|
34
|
-
"y: ",
|
|
35
|
-
vview.assemblyNames.join(','),
|
|
36
|
-
" ",
|
|
37
|
-
getBpDisplayStr(vview.currBp)),
|
|
38
|
-
selection ? (React.createElement(Typography, { className: classes.bp, variant: "body2", color: "textSecondary" },
|
|
39
|
-
`width:${getBpDisplayStr(hview.bpPerPx * selection.width)}`,
|
|
40
|
-
" ",
|
|
41
|
-
React.createElement("br", null),
|
|
42
|
-
`height:${getBpDisplayStr(vview.bpPerPx * selection.height)}`)) : null,
|
|
43
|
-
React.createElement("div", { className: classes.spacer }),
|
|
44
|
-
React.createElement(DotplotWarnings, { model: model }),
|
|
45
|
-
showPanButtons ? React.createElement(PanButtons, { model: model }) : null));
|
|
26
|
+
return (_jsxs("div", { className: classes.headerBar, children: [_jsx(DotplotControls, { model: model }), _jsxs(Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: ["x: ", hview.assemblyNames.join(','), " ", getBpDisplayStr(hview.currBp), _jsx("br", {}), "y: ", vview.assemblyNames.join(','), " ", getBpDisplayStr(vview.currBp)] }), selection ? (_jsxs(Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: [`width:${getBpDisplayStr(hview.bpPerPx * selection.width)}`, " ", _jsx("br", {}), `height:${getBpDisplayStr(vview.bpPerPx * selection.height)}`] })) : null, _jsx("div", { className: classes.spacer }), _jsx(DotplotWarnings, { model: model }), showPanButtons ? _jsx(PanButtons, { model: model }) : null] }));
|
|
46
27
|
});
|
|
47
28
|
export default DotplotHeader;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DotplotViewModel } from '../../model';
|
|
2
|
+
declare const ImportSyntenyOpenCustomTrack: ({ model, assembly1, assembly2, }: {
|
|
3
|
+
model: DotplotViewModel;
|
|
4
|
+
assembly1: string;
|
|
5
|
+
assembly2: string;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ImportSyntenyOpenCustomTrack;
|