@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
|
@@ -15,18 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const react_1 = require("react");
|
|
30
41
|
const ui_1 = require("@jbrowse/core/ui");
|
|
31
42
|
const mobx_1 = require("mobx");
|
|
32
43
|
const mobx_react_1 = require("mobx-react");
|
|
@@ -83,11 +94,11 @@ function getOffset(coord, rect) {
|
|
|
83
94
|
}
|
|
84
95
|
const RenderedComponent = (0, mobx_react_1.observer)(({ model }) => {
|
|
85
96
|
const { classes } = useStyles();
|
|
86
|
-
return (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: classes.overlay, children: model.tracks.map(track => {
|
|
98
|
+
const [display] = track.displays;
|
|
99
|
+
const { RenderingComponent } = display;
|
|
100
|
+
return RenderingComponent ? ((0, jsx_runtime_1.jsx)(RenderingComponent, { model: display }, track.configuration.trackId)) : null;
|
|
101
|
+
}) }));
|
|
91
102
|
});
|
|
92
103
|
const DotplotViewInternal = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
93
104
|
var _a, _b;
|
|
@@ -202,79 +213,63 @@ const DotplotViewInternal = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
202
213
|
}
|
|
203
214
|
return () => { };
|
|
204
215
|
}, [validSelect, mousedown, mouseup, xdistance, ydistance]);
|
|
205
|
-
return (
|
|
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
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
model.zoomInToMouseCoords(mousedown, mouseup);
|
|
254
|
-
}
|
|
255
|
-
setMouseOvered(false);
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
label: 'Open linear synteny view',
|
|
260
|
-
onClick: () => {
|
|
261
|
-
if (mousedown && mouseup) {
|
|
262
|
-
model.onDotplotView(mousedown, mouseup);
|
|
263
|
-
}
|
|
264
|
-
setMouseOvered(false);
|
|
265
|
-
},
|
|
266
|
-
},
|
|
267
|
-
] })),
|
|
268
|
-
react_1.default.createElement(ui_1.ResizeHandle, { onDrag: n => model.setHeight(model.height + n), className: classes.resizeHandle }))));
|
|
216
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Header_1.default, { model: model, selection: !validSelect || !(mousedown && mouserect)
|
|
217
|
+
? undefined
|
|
218
|
+
: {
|
|
219
|
+
width: Math.abs(xdistance),
|
|
220
|
+
height: Math.abs(ydistance),
|
|
221
|
+
} }), (0, jsx_runtime_1.jsxs)("div", { ref: root, className: classes.root, onMouseLeave: () => {
|
|
222
|
+
setMouseOvered(false);
|
|
223
|
+
}, onMouseEnter: () => {
|
|
224
|
+
setMouseOvered(true);
|
|
225
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: classes.container, children: [(0, jsx_runtime_1.jsx)(Axes_1.VerticalAxis, { model: model }), (0, jsx_runtime_1.jsx)(Axes_1.HorizontalAxis, { model: model }), (0, jsx_runtime_1.jsxs)("div", { ref: ref, className: classes.content, children: [mouseOvered && validSelect ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(TooltipWhereMouseovered, { model: model, mouserect: mouserect, mouserectClient: mouserectClient, xdistance: xdistance }) })) : null, validSelect ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(TooltipWhereClicked, { model: model, mousedown: mousedown, mousedownClient: mousedownClient, xdistance: xdistance, ydistance: ydistance }) })) : null, (0, jsx_runtime_1.jsx)("div", { style: { cursor: ctrlKeyDown ? 'pointer' : cursorMode }, onMouseDown: event => {
|
|
226
|
+
if (event.button === 0) {
|
|
227
|
+
const { clientX, clientY } = event;
|
|
228
|
+
setMouseDownClient([clientX, clientY]);
|
|
229
|
+
setMouseCurrClient([clientX, clientY]);
|
|
230
|
+
setCtrlKeyWasUsed(ctrlKeyDown);
|
|
231
|
+
}
|
|
232
|
+
}, children: (0, jsx_runtime_1.jsx)(Grid_1.default, { model: model, children: validSelect && mousedown && mouserect ? ((0, jsx_runtime_1.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 }) }), (0, jsx_runtime_1.jsx)("div", { className: classes.spacer })] }), (0, jsx_runtime_1.jsx)(RenderedComponent, { model: model }), (0, jsx_runtime_1.jsx)(ui_1.Menu, { open: Boolean(mouseup), onMenuItemClick: (_, callback) => {
|
|
233
|
+
callback();
|
|
234
|
+
setMouseUpClient(undefined);
|
|
235
|
+
setMouseDownClient(undefined);
|
|
236
|
+
}, onClose: () => {
|
|
237
|
+
setMouseUpClient(undefined);
|
|
238
|
+
setMouseDownClient(undefined);
|
|
239
|
+
}, anchorReference: "anchorPosition", anchorPosition: mouseupClient
|
|
240
|
+
? {
|
|
241
|
+
top: mouseupClient[1] + 50,
|
|
242
|
+
left: mouseupClient[0] + 50,
|
|
243
|
+
}
|
|
244
|
+
: undefined, style: { zIndex: 10000 }, menuItems: [
|
|
245
|
+
{
|
|
246
|
+
label: 'Zoom in',
|
|
247
|
+
onClick: () => {
|
|
248
|
+
if (mousedown && mouseup) {
|
|
249
|
+
model.zoomInToMouseCoords(mousedown, mouseup);
|
|
250
|
+
}
|
|
251
|
+
setMouseOvered(false);
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
label: 'Open linear synteny view',
|
|
256
|
+
onClick: () => {
|
|
257
|
+
if (mousedown && mouseup) {
|
|
258
|
+
model.onDotplotView(mousedown, mouseup);
|
|
259
|
+
}
|
|
260
|
+
setMouseOvered(false);
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
] })] }), (0, jsx_runtime_1.jsx)(ui_1.ResizeHandle, { onDrag: n => model.setHeight(model.height + n), className: classes.resizeHandle })] })] }));
|
|
269
264
|
});
|
|
270
265
|
const DotplotView = (0, mobx_react_1.observer)(function ({ model }) {
|
|
271
266
|
const { initialized, loading, error } = model;
|
|
272
267
|
if ((!initialized && !loading) || error) {
|
|
273
|
-
return
|
|
268
|
+
return (0, jsx_runtime_1.jsx)(ImportForm_1.default, { model: model });
|
|
274
269
|
}
|
|
275
270
|
if (loading) {
|
|
276
|
-
return
|
|
271
|
+
return (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { variant: "h6" });
|
|
277
272
|
}
|
|
278
|
-
return
|
|
273
|
+
return (0, jsx_runtime_1.jsx)(DotplotViewInternal, { model: model });
|
|
279
274
|
});
|
|
280
275
|
exports.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;
|
|
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const
|
|
36
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
37
|
+
const react_1 = require("react");
|
|
27
38
|
const material_1 = require("@mui/material");
|
|
28
39
|
const mobx_react_1 = require("mobx-react");
|
|
29
40
|
const WarningDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./WarningDialog'))));
|
|
@@ -31,17 +42,12 @@ const DotplotWarnings = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
31
42
|
const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
|
|
32
43
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
33
44
|
const [hide, setHide] = (0, react_1.useState)(false);
|
|
34
|
-
return trackWarnings.length && !hide ? (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
setShown(false);
|
|
42
|
-
} })) : null,
|
|
43
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
|
|
44
|
-
setHide(true);
|
|
45
|
-
} }, "Dismiss"))) : null;
|
|
45
|
+
return trackWarnings.length && !hide ? ((0, jsx_runtime_1.jsxs)(material_1.Alert, { severity: "warning", children: ["Warnings during render", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
|
|
46
|
+
setShown(true);
|
|
47
|
+
}, children: "More info" }), shown ? ((0, jsx_runtime_1.jsx)(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => {
|
|
48
|
+
setShown(false);
|
|
49
|
+
} })) : null, (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
50
|
+
setHide(true);
|
|
51
|
+
}, children: "Dismiss" })] })) : null;
|
|
46
52
|
});
|
|
47
53
|
exports.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;
|
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.default = ExportSvgDialog;
|
|
27
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
28
6
|
const ui_1 = require("@jbrowse/core/ui");
|
|
29
7
|
const util_1 = require("@jbrowse/core/util");
|
|
30
8
|
const material_1 = require("@mui/material");
|
|
31
9
|
function LoadingMessage() {
|
|
32
|
-
return (
|
|
33
|
-
react_1.default.createElement(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }),
|
|
34
|
-
react_1.default.createElement(material_1.Typography, { display: "inline" }, "Creating SVG")));
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { display: "inline", children: "Creating SVG" })] }));
|
|
35
11
|
}
|
|
36
12
|
function TextField2({ children, ...rest }) {
|
|
37
|
-
return (
|
|
38
|
-
react_1.default.createElement(material_1.TextField, { ...rest }, children)));
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { ...rest, children: children }) }));
|
|
39
14
|
}
|
|
40
15
|
function useSvgLocal(key, val) {
|
|
41
16
|
return (0, util_1.useLocalStorage)(`svg-${key}`, val);
|
|
@@ -48,39 +23,31 @@ function ExportSvgDialog({ model, handleClose, }) {
|
|
|
48
23
|
const [error, setError] = (0, react_1.useState)();
|
|
49
24
|
const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
|
|
50
25
|
const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
|
|
51
|
-
return (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
catch (e) {
|
|
79
|
-
console.error(e);
|
|
80
|
-
setError(e);
|
|
81
|
-
}
|
|
82
|
-
finally {
|
|
83
|
-
setLoading(false);
|
|
84
|
-
}
|
|
85
|
-
} }, "Submit"))));
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : loading ? ((0, jsx_runtime_1.jsx)(LoadingMessage, {})) : null, (0, jsx_runtime_1.jsx)(TextField2, { helperText: "filename", value: filename, onChange: event => {
|
|
27
|
+
setFilename(event.target.value);
|
|
28
|
+
} }), session.allThemes ? ((0, jsx_runtime_1.jsx)(TextField2, { select: true, label: "Theme", value: themeName, onChange: event => {
|
|
29
|
+
setThemeName(event.target.value);
|
|
30
|
+
}, children: Object.entries(session.allThemes()).map(([key, val]) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, offscreenCanvas ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: rasterizeLayers, onChange: () => {
|
|
31
|
+
setRasterizeLayers(val => !val);
|
|
32
|
+
} }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
33
|
+
handleClose();
|
|
34
|
+
}, children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
|
|
35
|
+
setLoading(true);
|
|
36
|
+
setError(undefined);
|
|
37
|
+
try {
|
|
38
|
+
await model.exportSvg({
|
|
39
|
+
rasterizeLayers,
|
|
40
|
+
filename,
|
|
41
|
+
themeName,
|
|
42
|
+
});
|
|
43
|
+
handleClose();
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
console.error(e);
|
|
47
|
+
setError(e);
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
setLoading(false);
|
|
51
|
+
}
|
|
52
|
+
}, children: "Submit" })] })] }));
|
|
86
53
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
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,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.GridRaw = void 0;
|
|
7
4
|
exports.default = Grid;
|
|
8
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
6
|
const util_1 = require("@jbrowse/core/util");
|
|
10
7
|
const material_1 = require("@mui/material");
|
|
11
8
|
const mobx_react_1 = require("mobx-react");
|
|
@@ -28,31 +25,23 @@ exports.GridRaw = (0, mobx_react_1.observer)(function ({ model, children, }) {
|
|
|
28
25
|
const h = Math.min(viewHeight - vbottom - ry, viewHeight);
|
|
29
26
|
let lastx = Number.POSITIVE_INFINITY;
|
|
30
27
|
let lasty = Number.POSITIVE_INFINITY;
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
lasty = y;
|
|
47
|
-
}
|
|
48
|
-
return render ? (react_1.default.createElement("line", { key: JSON.stringify(region), x1: 0, y1: y, x2: viewWidth, y2: y, ...(0, util_1.getStrokeProps)(stroke) })) : null;
|
|
49
|
-
}),
|
|
50
|
-
react_1.default.createElement("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...(0, util_1.getStrokeProps)(stroke) }),
|
|
51
|
-
react_1.default.createElement("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...(0, util_1.getStrokeProps)(stroke) })),
|
|
52
|
-
children));
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: rx, y: ry, width: w, height: h, ...(0, util_1.getFillProps)(theme.palette.background.default) }), (0, jsx_runtime_1.jsxs)("g", { children: [hblocks.map(region => {
|
|
29
|
+
const x = region.offsetPx - hview.offsetPx;
|
|
30
|
+
const render = Math.floor(x) !== Math.floor(lastx);
|
|
31
|
+
if (render) {
|
|
32
|
+
lastx = x;
|
|
33
|
+
}
|
|
34
|
+
return render ? ((0, jsx_runtime_1.jsx)("line", { x1: x, y1: 0, x2: x, y2: viewHeight, ...(0, util_1.getStrokeProps)(stroke) }, JSON.stringify(region))) : null;
|
|
35
|
+
}), vblocks.map(region => {
|
|
36
|
+
const y = viewHeight - (region.offsetPx - vview.offsetPx);
|
|
37
|
+
const render = Math.floor(y) !== Math.floor(lasty);
|
|
38
|
+
if (render) {
|
|
39
|
+
lasty = y;
|
|
40
|
+
}
|
|
41
|
+
return render ? ((0, jsx_runtime_1.jsx)("line", { x1: 0, y1: y, x2: viewWidth, y2: y, ...(0, util_1.getStrokeProps)(stroke) }, JSON.stringify(region))) : null;
|
|
42
|
+
}), (0, jsx_runtime_1.jsx)("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...(0, util_1.getStrokeProps)(stroke) }), (0, jsx_runtime_1.jsx)("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...(0, util_1.getStrokeProps)(stroke) })] }), children] }));
|
|
53
43
|
});
|
|
54
44
|
function Grid({ model, children, }) {
|
|
55
45
|
const { viewWidth, viewHeight } = model;
|
|
56
|
-
return (
|
|
57
|
-
react_1.default.createElement(exports.GridRaw, { model: model }, children)));
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: viewWidth, height: viewHeight, style: { background: 'rgba(0,0,0,0.12)' }, children: (0, jsx_runtime_1.jsx)(exports.GridRaw, { model: model, children: children }) }));
|
|
58
47
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { DotplotViewModel } from '../model';
|
|
3
2
|
declare const DotplotHeader: ({ model, selection, }: {
|
|
4
3
|
model: DotplotViewModel;
|
|
@@ -6,5 +5,5 @@ declare const DotplotHeader: ({ model, selection, }: {
|
|
|
6
5
|
width: number;
|
|
7
6
|
height: number;
|
|
8
7
|
};
|
|
9
|
-
}) =>
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default DotplotHeader;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const util_1 = require("@jbrowse/core/util");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
9
|
const mobx_react_1 = require("mobx-react");
|
|
@@ -28,25 +28,6 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
28
28
|
const DotplotHeader = (0, mobx_react_1.observer)(function ({ model, selection, }) {
|
|
29
29
|
const { classes } = useStyles();
|
|
30
30
|
const { hview, vview, showPanButtons } = model;
|
|
31
|
-
return (
|
|
32
|
-
react_1.default.createElement(DotplotControls_1.default, { model: model }),
|
|
33
|
-
react_1.default.createElement(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary" },
|
|
34
|
-
"x: ",
|
|
35
|
-
hview.assemblyNames.join(','),
|
|
36
|
-
" ",
|
|
37
|
-
(0, util_1.getBpDisplayStr)(hview.currBp),
|
|
38
|
-
react_1.default.createElement("br", null),
|
|
39
|
-
"y: ",
|
|
40
|
-
vview.assemblyNames.join(','),
|
|
41
|
-
" ",
|
|
42
|
-
(0, util_1.getBpDisplayStr)(vview.currBp)),
|
|
43
|
-
selection ? (react_1.default.createElement(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary" },
|
|
44
|
-
`width:${(0, util_1.getBpDisplayStr)(hview.bpPerPx * selection.width)}`,
|
|
45
|
-
" ",
|
|
46
|
-
react_1.default.createElement("br", null),
|
|
47
|
-
`height:${(0, util_1.getBpDisplayStr)(vview.bpPerPx * selection.height)}`)) : null,
|
|
48
|
-
react_1.default.createElement("div", { className: classes.spacer }),
|
|
49
|
-
react_1.default.createElement(DotplotWarnings_1.default, { model: model }),
|
|
50
|
-
showPanButtons ? react_1.default.createElement(PanButtons_1.default, { model: model }) : null));
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.headerBar, children: [(0, jsx_runtime_1.jsx)(DotplotControls_1.default, { model: model }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: ["x: ", hview.assemblyNames.join(','), " ", (0, util_1.getBpDisplayStr)(hview.currBp), (0, jsx_runtime_1.jsx)("br", {}), "y: ", vview.assemblyNames.join(','), " ", (0, util_1.getBpDisplayStr)(vview.currBp)] }), selection ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: [`width:${(0, util_1.getBpDisplayStr)(hview.bpPerPx * selection.width)}`, " ", (0, jsx_runtime_1.jsx)("br", {}), `height:${(0, util_1.getBpDisplayStr)(vview.bpPerPx * selection.height)}`] })) : null, (0, jsx_runtime_1.jsx)("div", { className: classes.spacer }), (0, jsx_runtime_1.jsx)(DotplotWarnings_1.default, { model: model }), showPanButtons ? (0, jsx_runtime_1.jsx)(PanButtons_1.default, { model: model }) : null] }));
|
|
51
32
|
});
|
|
52
33
|
exports.default = DotplotHeader;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DotplotViewModel } from '../../model';
|
|
2
|
+
declare const ImportSyntenyOpenCustomTrack: ({ model, assembly1, assembly2, }: {
|
|
3
|
+
model: DotplotViewModel;
|
|
4
|
+
assembly1: string;
|
|
5
|
+
assembly2: string;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ImportSyntenyOpenCustomTrack;
|