@jbrowse/plugin-wiggle 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/BigWigAdapter/index.js +17 -7
- package/dist/CreateMultiWiggleExtension/ConfirmDialog.d.ts +1 -2
- package/dist/CreateMultiWiggleExtension/ConfirmDialog.js +12 -47
- package/dist/CreateMultiWiggleExtension/index.js +17 -7
- package/dist/DensityRenderer/DensityRenderer.js +35 -2
- package/dist/GuessAdapter/index.d.ts +2 -0
- package/dist/GuessAdapter/index.js +25 -0
- package/dist/LinePlotRenderer/LinePlotRenderer.js +35 -2
- package/dist/LinearWiggleDisplay/components/SetColorDialog.d.ts +1 -2
- package/dist/LinearWiggleDisplay/components/SetColorDialog.js +21 -57
- package/dist/LinearWiggleDisplay/components/Tooltip.d.ts +1 -2
- package/dist/LinearWiggleDisplay/components/Tooltip.js +5 -17
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -2
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js +9 -12
- package/dist/LinearWiggleDisplay/index.js +17 -7
- package/dist/LinearWiggleDisplay/model.d.ts +31 -8
- package/dist/LinearWiggleDisplay/model.js +37 -20
- package/dist/LinearWiggleDisplay/renderSvg.d.ts +1 -2
- package/dist/LinearWiggleDisplay/renderSvg.js +2 -5
- package/dist/MultiDensityRenderer/MultiDensityRenderer.js +38 -3
- package/dist/MultiLineRenderer/MultiLineRenderer.js +35 -2
- package/dist/MultiLinearWiggleDisplay/components/ColorLegend.d.ts +2 -4
- package/dist/MultiLinearWiggleDisplay/components/ColorLegend.js +5 -14
- package/dist/MultiLinearWiggleDisplay/components/FullHeightScaleBar.d.ts +7 -0
- package/dist/MultiLinearWiggleDisplay/components/FullHeightScaleBar.js +17 -0
- package/dist/MultiLinearWiggleDisplay/components/IndividualScaleBars.d.ts +7 -0
- package/dist/MultiLinearWiggleDisplay/components/IndividualScaleBars.js +15 -0
- package/dist/MultiLinearWiggleDisplay/components/LegendItem.d.ts +11 -0
- package/dist/MultiLinearWiggleDisplay/components/LegendItem.js +19 -0
- package/dist/MultiLinearWiggleDisplay/components/RectBg.d.ts +1 -2
- package/dist/MultiLinearWiggleDisplay/components/RectBg.js +2 -5
- package/dist/MultiLinearWiggleDisplay/components/ScoreLegend.d.ts +1 -2
- package/dist/MultiLinearWiggleDisplay/components/ScoreLegend.js +2 -4
- package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.d.ts +1 -2
- package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.js +18 -55
- package/dist/MultiLinearWiggleDisplay/components/SourcesGrid.d.ts +1 -2
- package/dist/MultiLinearWiggleDisplay/components/SourcesGrid.js +79 -85
- package/dist/MultiLinearWiggleDisplay/components/Tooltip.d.ts +1 -2
- package/dist/MultiLinearWiggleDisplay/components/Tooltip.js +7 -21
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -2
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +2 -4
- package/dist/MultiLinearWiggleDisplay/components/YScaleBars.d.ts +1 -2
- package/dist/MultiLinearWiggleDisplay/components/YScaleBars.js +7 -27
- package/dist/MultiLinearWiggleDisplay/index.js +17 -7
- package/dist/MultiLinearWiggleDisplay/model.d.ts +10 -7
- package/dist/MultiLinearWiggleDisplay/model.js +30 -8
- package/dist/MultiLinearWiggleDisplay/renderSvg.d.ts +1 -2
- package/dist/MultiLinearWiggleDisplay/renderSvg.js +2 -5
- package/dist/MultiLinearWiggleDisplay/util.d.ts +1 -0
- package/dist/MultiLinearWiggleDisplay/util.js +10 -0
- package/dist/MultiRowLineRenderer/MultiRowLineRenderer.js +35 -2
- package/dist/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +35 -2
- package/dist/MultiWiggleAdapter/index.js +17 -7
- package/dist/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.d.ts +3 -3
- package/dist/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.js +61 -100
- package/dist/MultiWiggleAddTrackWorkflow/index.js +17 -7
- package/dist/MultiWiggleRendering.d.ts +1 -2
- package/dist/MultiWiggleRendering.js +4 -27
- package/dist/MultiXYPlotRenderer/MultiXYPlotRenderer.js +35 -2
- package/dist/Tooltip.d.ts +1 -2
- package/dist/Tooltip.js +6 -32
- package/dist/WiggleBaseRenderer.d.ts +3 -3
- package/dist/WiggleRendering.d.ts +1 -2
- package/dist/WiggleRendering.js +4 -27
- package/dist/XYPlotRenderer/XYPlotRenderer.js +35 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +19 -34
- package/dist/shared/SetMinMaxDialog.d.ts +1 -2
- package/dist/shared/SetMinMaxDialog.js +11 -41
- package/dist/shared/SharedWiggleMixin.d.ts +6 -6
- package/dist/shared/SharedWiggleMixin.js +17 -7
- package/dist/shared/YScaleBar.d.ts +1 -2
- package/dist/shared/YScaleBar.js +2 -5
- package/esm/CreateMultiWiggleExtension/ConfirmDialog.d.ts +1 -2
- package/esm/CreateMultiWiggleExtension/ConfirmDialog.js +12 -24
- package/esm/DensityRenderer/DensityRenderer.js +1 -1
- package/esm/GuessAdapter/index.d.ts +2 -0
- package/esm/GuessAdapter/index.js +22 -0
- package/esm/LinePlotRenderer/LinePlotRenderer.js +1 -1
- package/esm/LinearWiggleDisplay/components/SetColorDialog.d.ts +1 -2
- package/esm/LinearWiggleDisplay/components/SetColorDialog.js +21 -34
- package/esm/LinearWiggleDisplay/components/Tooltip.d.ts +1 -2
- package/esm/LinearWiggleDisplay/components/Tooltip.js +5 -17
- package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -2
- package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.js +9 -12
- package/esm/LinearWiggleDisplay/model.d.ts +31 -8
- package/esm/LinearWiggleDisplay/model.js +20 -13
- package/esm/LinearWiggleDisplay/renderSvg.d.ts +1 -2
- package/esm/LinearWiggleDisplay/renderSvg.js +2 -5
- package/esm/MultiDensityRenderer/MultiDensityRenderer.js +4 -2
- package/esm/MultiLineRenderer/MultiLineRenderer.js +1 -1
- package/esm/MultiLinearWiggleDisplay/components/ColorLegend.d.ts +2 -4
- package/esm/MultiLinearWiggleDisplay/components/ColorLegend.js +5 -14
- package/esm/MultiLinearWiggleDisplay/components/FullHeightScaleBar.d.ts +7 -0
- package/esm/MultiLinearWiggleDisplay/components/FullHeightScaleBar.js +12 -0
- package/esm/MultiLinearWiggleDisplay/components/IndividualScaleBars.d.ts +7 -0
- package/esm/MultiLinearWiggleDisplay/components/IndividualScaleBars.js +10 -0
- package/esm/MultiLinearWiggleDisplay/components/LegendItem.d.ts +11 -0
- package/esm/MultiLinearWiggleDisplay/components/LegendItem.js +14 -0
- package/esm/MultiLinearWiggleDisplay/components/RectBg.d.ts +1 -2
- package/esm/MultiLinearWiggleDisplay/components/RectBg.js +2 -2
- package/esm/MultiLinearWiggleDisplay/components/ScoreLegend.d.ts +1 -2
- package/esm/MultiLinearWiggleDisplay/components/ScoreLegend.js +2 -4
- package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.d.ts +1 -2
- package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.js +18 -32
- package/esm/MultiLinearWiggleDisplay/components/SourcesGrid.d.ts +1 -2
- package/esm/MultiLinearWiggleDisplay/components/SourcesGrid.js +62 -78
- package/esm/MultiLinearWiggleDisplay/components/Tooltip.d.ts +1 -2
- package/esm/MultiLinearWiggleDisplay/components/Tooltip.js +7 -21
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -2
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +2 -4
- package/esm/MultiLinearWiggleDisplay/components/YScaleBars.d.ts +1 -2
- package/esm/MultiLinearWiggleDisplay/components/YScaleBars.js +8 -28
- package/esm/MultiLinearWiggleDisplay/model.d.ts +10 -7
- package/esm/MultiLinearWiggleDisplay/model.js +14 -2
- package/esm/MultiLinearWiggleDisplay/renderSvg.d.ts +1 -2
- package/esm/MultiLinearWiggleDisplay/renderSvg.js +2 -5
- package/esm/MultiLinearWiggleDisplay/util.d.ts +1 -0
- package/esm/MultiLinearWiggleDisplay/util.js +7 -0
- package/esm/MultiRowLineRenderer/MultiRowLineRenderer.js +1 -1
- package/esm/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +1 -1
- package/esm/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.d.ts +3 -3
- package/esm/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.js +61 -76
- package/esm/MultiWiggleRendering.d.ts +1 -2
- package/esm/MultiWiggleRendering.js +4 -4
- package/esm/MultiXYPlotRenderer/MultiXYPlotRenderer.js +1 -1
- package/esm/Tooltip.d.ts +1 -2
- package/esm/Tooltip.js +6 -9
- package/esm/WiggleBaseRenderer.d.ts +3 -3
- package/esm/WiggleRendering.d.ts +1 -2
- package/esm/WiggleRendering.js +4 -4
- package/esm/XYPlotRenderer/XYPlotRenderer.js +1 -1
- package/esm/index.d.ts +3 -3
- package/esm/index.js +2 -27
- package/esm/shared/SetMinMaxDialog.d.ts +1 -2
- package/esm/shared/SetMinMaxDialog.js +11 -18
- package/esm/shared/SharedWiggleMixin.d.ts +6 -6
- package/esm/shared/YScaleBar.d.ts +1 -2
- package/esm/shared/YScaleBar.js +2 -2
- package/package.json +12 -13
- package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +0 -6
- package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.js +0 -62
- package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +0 -6
- package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.js +0 -34
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { getSession, isElectron, isSessionModelWithWidgets, isSessionWithAddTracks, } from '@jbrowse/core/util';
|
|
3
4
|
import { storeBlobLocation } from '@jbrowse/core/util/tracks';
|
|
4
5
|
import { Button, Paper, TextField } from '@mui/material';
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
5
7
|
import { makeStyles } from 'tss-react/mui';
|
|
6
8
|
const useStyles = makeStyles()(theme => ({
|
|
7
9
|
paper: {
|
|
@@ -23,81 +25,64 @@ function makeFileLocation(file) {
|
|
|
23
25
|
}
|
|
24
26
|
: storeBlobLocation({ blob: file });
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
function doSubmit({ trackName, val, model, }) {
|
|
29
|
+
var _a;
|
|
30
|
+
const session = getSession(model);
|
|
31
|
+
try {
|
|
32
|
+
const trackId = [
|
|
33
|
+
`${trackName.toLowerCase().replaceAll(' ', '_')}-${Date.now()}`,
|
|
34
|
+
session.adminMode ? '' : '-sessionTrack',
|
|
35
|
+
].join('');
|
|
36
|
+
let bigWigs;
|
|
37
|
+
try {
|
|
38
|
+
bigWigs = JSON.parse(val);
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
bigWigs = val
|
|
42
|
+
.split(/\n|\r\n|\r/)
|
|
43
|
+
.map(f => f.trim())
|
|
44
|
+
.filter(f => !!f);
|
|
45
|
+
}
|
|
46
|
+
const obj = typeof bigWigs[0] === 'string' ? { bigWigs } : { subadapters: bigWigs };
|
|
47
|
+
if (isSessionWithAddTracks(session)) {
|
|
48
|
+
session.addTrackConf({
|
|
49
|
+
trackId,
|
|
50
|
+
type: 'MultiQuantitativeTrack',
|
|
51
|
+
name: trackName,
|
|
52
|
+
assemblyNames: [model.assembly],
|
|
53
|
+
adapter: {
|
|
54
|
+
type: 'MultiWiggleAdapter',
|
|
55
|
+
...obj,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
(_a = model.view) === null || _a === void 0 ? void 0 : _a.showTrack(trackId);
|
|
59
|
+
}
|
|
60
|
+
model.clearData();
|
|
61
|
+
if (isSessionModelWithWidgets(session)) {
|
|
62
|
+
session.hideWidget(model);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
console.error(e);
|
|
67
|
+
session.notifyError(`${e}`, e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const MultiWiggleAddTrackWorkflow = observer(function ({ model, }) {
|
|
27
71
|
const { classes } = useStyles();
|
|
28
72
|
const [val, setVal] = useState('');
|
|
29
73
|
const [trackName, setTrackName] = useState(`MultiWiggle${+Date.now()}`);
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
setVal(JSON.stringify(res, null, 2));
|
|
46
|
-
} })),
|
|
47
|
-
React.createElement(TextField, { value: trackName, helperText: "Track name", onChange: event => {
|
|
48
|
-
setTrackName(event.target.value);
|
|
49
|
-
} }),
|
|
50
|
-
React.createElement(Button, { variant: "contained", className: classes.submit, onClick: () => {
|
|
51
|
-
var _a;
|
|
52
|
-
const session = getSession(model);
|
|
53
|
-
try {
|
|
54
|
-
const trackId = [
|
|
55
|
-
`${trackName.toLowerCase().replaceAll(' ', '_')}-${Date.now()}`,
|
|
56
|
-
session.adminMode ? '' : '-sessionTrack',
|
|
57
|
-
].join('');
|
|
58
|
-
let bigWigs;
|
|
59
|
-
try {
|
|
60
|
-
bigWigs = JSON.parse(val);
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
bigWigs = val
|
|
64
|
-
.split(/\n|\r\n|\r/)
|
|
65
|
-
.map(f => f.trim())
|
|
66
|
-
.filter(f => !!f);
|
|
67
|
-
}
|
|
68
|
-
const obj = typeof bigWigs[0] === 'string'
|
|
69
|
-
? { bigWigs }
|
|
70
|
-
: { subadapters: bigWigs };
|
|
71
|
-
if (isSessionWithAddTracks(session)) {
|
|
72
|
-
session.addTrackConf({
|
|
73
|
-
trackId,
|
|
74
|
-
type: 'MultiQuantitativeTrack',
|
|
75
|
-
name: trackName,
|
|
76
|
-
assemblyNames: [model.assembly],
|
|
77
|
-
adapter: {
|
|
78
|
-
type: 'MultiWiggleAdapter',
|
|
79
|
-
...obj,
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
(_a = model.view) === null || _a === void 0 ? void 0 : _a.showTrack(trackId);
|
|
83
|
-
}
|
|
84
|
-
model.clearData();
|
|
85
|
-
if (isSessionModelWithWidgets(session)) {
|
|
86
|
-
session.hideWidget(model);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
console.error(e);
|
|
91
|
-
session.notifyError(`${e}`, e);
|
|
92
|
-
}
|
|
93
|
-
} }, "Submit"),
|
|
94
|
-
React.createElement("p", null, "Additional notes: "),
|
|
95
|
-
React.createElement("ul", null,
|
|
96
|
-
React.createElement("li", null,
|
|
97
|
-
"The list of bigwig files in the text box can be a list of URLs, or a list of elements like",
|
|
98
|
-
' ',
|
|
99
|
-
React.createElement("code", null, `[{"type":"BigWigAdapter","bigWigLocation":{"uri":"http://host/file.bw"}, "color":"green","source":"name for subtrack"}]`),
|
|
100
|
-
' ',
|
|
101
|
-
"to apply e.g. the color attribute to the view"),
|
|
102
|
-
React.createElement("li", null, "Adding local files will update the textbox with JSON contents that are ready to submit with the \"Submit\" button"))));
|
|
103
|
-
}
|
|
74
|
+
return (_jsxs(Paper, { className: classes.paper, children: [_jsxs("ul", { children: [_jsx("li", { children: "Enter list of URLs for bigwig files in the textbox" }), _jsx("li", { children: "Or, use the button below the text box to select files from your computer" })] }), _jsx(TextField, { multiline: true, fullWidth: true, rows: 10, value: val, placeholder: "Paste list of URLs here, or use file selector below", variant: "outlined", onChange: event => {
|
|
75
|
+
setVal(event.target.value);
|
|
76
|
+
} }), _jsxs(Button, { variant: "outlined", component: "label", children: ["Choose Files from your computer", _jsx("input", { type: "file", hidden: true, multiple: true, onChange: ({ target }) => {
|
|
77
|
+
setVal(JSON.stringify([...(target.files || [])].map(file => ({
|
|
78
|
+
type: 'BigWigAdapter',
|
|
79
|
+
bigWigLocation: makeFileLocation(file),
|
|
80
|
+
source: file.name,
|
|
81
|
+
})), null, 2));
|
|
82
|
+
} })] }), _jsx(TextField, { value: trackName, helperText: "Track name", onChange: event => {
|
|
83
|
+
setTrackName(event.target.value);
|
|
84
|
+
} }), _jsx(Button, { variant: "contained", className: classes.submit, onClick: () => {
|
|
85
|
+
doSubmit({ trackName, val, model });
|
|
86
|
+
}, children: "Submit" }), _jsx("p", { children: "Additional notes: " }), _jsxs("ul", { children: [_jsxs("li", { children: ["The list of bigwig files in the text box can be a list of URLs, or a list of elements like", ' ', _jsx("code", { children: `[{"type":"BigWigAdapter","bigWigLocation":{"uri":"http://host/file.bw"}, "color":"green","source":"name for subtrack"}]` }), ' ', "to apply e.g. the color attribute to the view"] }), _jsx("li", { children: "Adding local files will update the textbox with JSON contents that are ready to submit with the \"Submit\" button" })] })] }));
|
|
87
|
+
});
|
|
88
|
+
export default MultiWiggleAddTrackWorkflow;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { Source } from './util';
|
|
3
2
|
import type { Feature } from '@jbrowse/core/util';
|
|
4
3
|
import type { Region } from '@jbrowse/core/util/types';
|
|
@@ -16,5 +15,5 @@ declare const MultiWiggleRendering: (props: {
|
|
|
16
15
|
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
17
16
|
onMouseMove?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
18
17
|
onFeatureClick?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
19
|
-
}) =>
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
19
|
export default MultiWiggleRendering;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
3
4
|
import { SimpleFeature } from '@jbrowse/core/util';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
@@ -59,7 +60,7 @@ const MultiWiggleRendering = observer(function (props) {
|
|
|
59
60
|
}
|
|
60
61
|
return featureUnderMouse;
|
|
61
62
|
}
|
|
62
|
-
return (
|
|
63
|
+
return (_jsx("div", { ref: ref, onMouseMove: event => {
|
|
63
64
|
const { clientX, clientY } = event;
|
|
64
65
|
const featureUnderMouse = getFeatureUnderMouse(clientX, clientY);
|
|
65
66
|
onMouseMove(event, featureUnderMouse);
|
|
@@ -73,7 +74,6 @@ const MultiWiggleRendering = observer(function (props) {
|
|
|
73
74
|
overflow: 'visible',
|
|
74
75
|
position: 'relative',
|
|
75
76
|
height,
|
|
76
|
-
} }
|
|
77
|
-
React.createElement(PrerenderedCanvas, { ...props })));
|
|
77
|
+
}, children: _jsx(PrerenderedCanvas, { ...props }) }));
|
|
78
78
|
});
|
|
79
79
|
export default MultiWiggleRendering;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { groupBy } from '@jbrowse/core/util';
|
|
2
2
|
import WiggleBaseRenderer from '../WiggleBaseRenderer';
|
|
3
|
-
import { drawXY } from '../drawXY';
|
|
4
3
|
import { YSCALEBAR_LABEL_OFFSET } from '../util';
|
|
5
4
|
export default class MultiXYPlotRenderer extends WiggleBaseRenderer {
|
|
6
5
|
async draw(ctx, props) {
|
|
7
6
|
const { sources, features } = props;
|
|
8
7
|
const groups = groupBy(features.values(), f => f.get('source'));
|
|
8
|
+
const { drawXY } = await import('../drawXY');
|
|
9
9
|
let feats = [];
|
|
10
10
|
for (const source of sources) {
|
|
11
11
|
const features = groups[source.name] || [];
|
package/esm/Tooltip.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { Feature } from '@jbrowse/core/util';
|
|
3
2
|
type Coord = [number, number];
|
|
4
3
|
export type TooltipContentsComponent = React.ForwardRefExoticComponent<{
|
|
@@ -15,5 +14,5 @@ declare const Tooltip: ({ model, height, clientMouseCoord, offsetMouseCoord, cli
|
|
|
15
14
|
offsetMouseCoord: Coord;
|
|
16
15
|
clientRect?: DOMRect;
|
|
17
16
|
TooltipContents: TooltipContentsComponent;
|
|
18
|
-
}) =>
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
18
|
export default Tooltip;
|
package/esm/Tooltip.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
2
3
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
import { makeStyles } from 'tss-react/mui';
|
|
@@ -20,13 +21,9 @@ const Tooltip = observer(function Tooltip({ model, height, clientMouseCoord, off
|
|
|
20
21
|
const { classes } = useStyles();
|
|
21
22
|
const x = clientMouseCoord[0] + 5;
|
|
22
23
|
const y = useClientY ? clientMouseCoord[1] : (clientRect === null || clientRect === void 0 ? void 0 : clientRect.top) || 0;
|
|
23
|
-
return featureUnderMouse ? (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
React.createElement("div", { className: classes.hoverVertical, style: {
|
|
28
|
-
left: offsetMouseCoord[0],
|
|
29
|
-
height: height - YSCALEBAR_LABEL_OFFSET * 2,
|
|
30
|
-
} }))) : null;
|
|
24
|
+
return featureUnderMouse ? (_jsxs(_Fragment, { children: [_jsx(Suspense, { fallback: null, children: _jsx(BaseTooltip, { clientPoint: { x, y }, children: _jsx(TooltipContents, { model: model, feature: featureUnderMouse }) }) }), _jsx("div", { className: classes.hoverVertical, style: {
|
|
25
|
+
left: offsetMouseCoord[0],
|
|
26
|
+
height: height - YSCALEBAR_LABEL_OFFSET * 2,
|
|
27
|
+
} })] })) : null;
|
|
31
28
|
});
|
|
32
29
|
export default Tooltip;
|
|
@@ -31,14 +31,14 @@ export default abstract class WiggleBaseRenderer extends FeatureRendererType {
|
|
|
31
31
|
width: number;
|
|
32
32
|
containsNoTransferables: boolean;
|
|
33
33
|
canvasRecordedData: any;
|
|
34
|
-
reactElement?:
|
|
34
|
+
reactElement?: React.ReactElement;
|
|
35
35
|
html?: string;
|
|
36
36
|
} | {
|
|
37
37
|
features: Map<string, Feature>;
|
|
38
38
|
height: number;
|
|
39
39
|
width: number;
|
|
40
40
|
containsNoTransferables: boolean;
|
|
41
|
-
reactElement:
|
|
41
|
+
reactElement: import("react/jsx-runtime").JSX.Element;
|
|
42
42
|
html?: string;
|
|
43
43
|
} | {
|
|
44
44
|
features: Map<string, Feature>;
|
|
@@ -46,7 +46,7 @@ export default abstract class WiggleBaseRenderer extends FeatureRendererType {
|
|
|
46
46
|
width: number;
|
|
47
47
|
containsNoTransferables: boolean;
|
|
48
48
|
imageData: any;
|
|
49
|
-
reactElement?:
|
|
49
|
+
reactElement?: React.ReactElement;
|
|
50
50
|
html?: string;
|
|
51
51
|
}>;
|
|
52
52
|
abstract draw<T extends RenderArgsDeserializedWithFeatures>(ctx: CanvasRenderingContext2D, props: T): Promise<Record<string, unknown> | undefined>;
|
package/esm/WiggleRendering.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { Feature } from '@jbrowse/core/util';
|
|
3
2
|
import type { Region } from '@jbrowse/core/util/types';
|
|
4
3
|
declare const WiggleRendering: (props: {
|
|
@@ -11,5 +10,5 @@ declare const WiggleRendering: (props: {
|
|
|
11
10
|
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
12
11
|
onMouseMove?: (event: React.MouseEvent, arg?: string) => void;
|
|
13
12
|
onFeatureClick?: (event: React.MouseEvent, arg?: string) => void;
|
|
14
|
-
}) =>
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
export default WiggleRendering;
|
package/esm/WiggleRendering.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
2
3
|
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
const WiggleRendering = observer(function (props) {
|
|
@@ -23,11 +24,10 @@ const WiggleRendering = observer(function (props) {
|
|
|
23
24
|
}
|
|
24
25
|
return featureUnderMouse;
|
|
25
26
|
}
|
|
26
|
-
return (
|
|
27
|
+
return (_jsx("div", { ref: ref, "data-testid": "wiggle-rendering-test", onMouseMove: e => { var _a; return onMouseMove === null || onMouseMove === void 0 ? void 0 : onMouseMove(e, (_a = getFeatureUnderMouse(e.clientX)) === null || _a === void 0 ? void 0 : _a.id()); }, onClick: e => { var _a; return onFeatureClick === null || onFeatureClick === void 0 ? void 0 : onFeatureClick(e, (_a = getFeatureUnderMouse(e.clientX)) === null || _a === void 0 ? void 0 : _a.id()); }, onMouseLeave: e => onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e), style: {
|
|
27
28
|
overflow: 'visible',
|
|
28
29
|
position: 'relative',
|
|
29
30
|
height,
|
|
30
|
-
} }
|
|
31
|
-
React.createElement(PrerenderedCanvas, { ...props })));
|
|
31
|
+
}, children: _jsx(PrerenderedCanvas, { ...props }) }));
|
|
32
32
|
});
|
|
33
33
|
export default WiggleRendering;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
2
|
import WiggleBaseRenderer from '../WiggleBaseRenderer';
|
|
3
|
-
import { drawXY } from '../drawXY';
|
|
4
3
|
import { YSCALEBAR_LABEL_OFFSET } from '../util';
|
|
5
4
|
export default class XYPlotRenderer extends WiggleBaseRenderer {
|
|
6
5
|
async draw(ctx, props) {
|
|
7
6
|
const { stopToken, features, config } = props;
|
|
7
|
+
const { drawXY } = await import('../drawXY');
|
|
8
8
|
const pivotValue = readConfObject(config, 'bicolorPivotValue');
|
|
9
9
|
const negColor = readConfObject(config, 'negColor');
|
|
10
10
|
const posColor = readConfObject(config, 'posColor');
|
package/esm/index.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ export default class WigglePlugin extends Plugin {
|
|
|
10
10
|
exports: {
|
|
11
11
|
LinearWiggleDisplayReactComponent: (props: {
|
|
12
12
|
model: import("./LinearWiggleDisplay/model").WiggleDisplayModel;
|
|
13
|
-
}) => import("react").JSX.Element;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
XYPlotRendererReactComponent: (props: {
|
|
15
|
-
regions: import("@jbrowse/core/util
|
|
15
|
+
regions: import("@jbrowse/core/util").Region[];
|
|
16
16
|
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
17
17
|
bpPerPx: number;
|
|
18
18
|
width: number;
|
|
@@ -21,7 +21,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
21
21
|
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
22
22
|
onMouseMove?: (event: React.MouseEvent, arg?: string) => void;
|
|
23
23
|
onFeatureClick?: (event: React.MouseEvent, arg?: string) => void;
|
|
24
|
-
}) => import("react").JSX.Element;
|
|
24
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
XYPlotRenderer: typeof XYPlotRenderer;
|
|
26
26
|
WiggleBaseRenderer: typeof WiggleBaseRenderer;
|
|
27
27
|
linearWiggleDisplayModelFactory: typeof linearWiggleDisplayModelFactory;
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import { getFileName } from '@jbrowse/core/util/tracks';
|
|
3
2
|
import BigWigAdapterF from './BigWigAdapter';
|
|
4
3
|
import CreateMultiWiggleExtensionF from './CreateMultiWiggleExtension';
|
|
5
4
|
import DensityRendererF from './DensityRenderer';
|
|
5
|
+
import GuessAdapterF from './GuessAdapter';
|
|
6
6
|
import LinePlotRendererF from './LinePlotRenderer';
|
|
7
7
|
import LinearWiggleDisplayF, { ReactComponent as LinearWiggleDisplayReactComponent, modelFactory as linearWiggleDisplayModelFactory, } from './LinearWiggleDisplay';
|
|
8
8
|
import MultiDensityRendererF from './MultiDensityRenderer';
|
|
@@ -50,32 +50,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
50
50
|
MultiRowLineRendererF(pm);
|
|
51
51
|
MultiWiggleAddTrackWorkflowF(pm);
|
|
52
52
|
CreateMultiWiggleExtensionF(pm);
|
|
53
|
-
pm
|
|
54
|
-
return (file, index, hint) => {
|
|
55
|
-
const regexGuess = /\.(bw|bigwig)$/i;
|
|
56
|
-
const adapterName = 'BigWigAdapter';
|
|
57
|
-
const fileName = getFileName(file);
|
|
58
|
-
const obj = {
|
|
59
|
-
type: adapterName,
|
|
60
|
-
bigWigLocation: file,
|
|
61
|
-
};
|
|
62
|
-
if (regexGuess.test(fileName) && !hint) {
|
|
63
|
-
return obj;
|
|
64
|
-
}
|
|
65
|
-
if (hint === adapterName) {
|
|
66
|
-
return obj;
|
|
67
|
-
}
|
|
68
|
-
return cb(file, index, hint);
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
pm.addToExtensionPoint('Core-guessTrackTypeForLocation', (trackTypeGuesser) => {
|
|
72
|
-
return (adapterName) => {
|
|
73
|
-
if (adapterName === 'BigWigAdapter') {
|
|
74
|
-
return 'QuantitativeTrack';
|
|
75
|
-
}
|
|
76
|
-
return trackTypeGuesser(adapterName);
|
|
77
|
-
};
|
|
78
|
-
});
|
|
53
|
+
GuessAdapterF(pm);
|
|
79
54
|
pm.addRpcMethod(() => new WiggleGetGlobalQuantitativeStats(pm));
|
|
80
55
|
pm.addRpcMethod(() => new WiggleGetMultiRegionQuantitativeStats(pm));
|
|
81
56
|
pm.addRpcMethod(() => new MultiWiggleGetSources(pm));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export default function SetMinMaxDialog(props: {
|
|
3
2
|
model: {
|
|
4
3
|
minScore: number;
|
|
@@ -8,4 +7,4 @@ export default function SetMinMaxDialog(props: {
|
|
|
8
7
|
setMaxScore: (arg?: number) => void;
|
|
9
8
|
};
|
|
10
9
|
handleClose: () => void;
|
|
11
|
-
}):
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { Dialog } from '@jbrowse/core/ui';
|
|
3
4
|
import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
4
5
|
export default function SetMinMaxDialog(props) {
|
|
@@ -10,21 +11,13 @@ export default function SetMinMaxDialog(props) {
|
|
|
10
11
|
? +max > +min
|
|
11
12
|
: true;
|
|
12
13
|
const logOk = scaleType === 'log' && min !== '' && !Number.isNaN(+min) ? +min > 0 : true;
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
setMax(event.target.value);
|
|
23
|
-
}, placeholder: "Enter max score" })),
|
|
24
|
-
React.createElement(DialogActions, null,
|
|
25
|
-
React.createElement(Button, { variant: "contained", color: "primary", type: "submit", style: { marginLeft: 20 }, disabled: !ok, onClick: () => {
|
|
26
|
-
model.setMinScore(min !== '' && !Number.isNaN(+min) ? +min : undefined);
|
|
27
|
-
model.setMaxScore(max !== '' && !Number.isNaN(+max) ? +max : undefined);
|
|
28
|
-
handleClose();
|
|
29
|
-
} }, "Submit"))));
|
|
14
|
+
return (_jsxs(Dialog, { open: true, onClose: handleClose, title: "Set min/max score for track", children: [_jsxs(DialogContent, { children: [_jsx(Typography, { children: "Enter min/max score: " }), !ok ? (_jsx(Typography, { color: "error", children: "Max is greater than or equal to min" })) : null, !logOk ? (_jsx(Typography, { color: "error", children: "Min score should be greater than 0 for log scale" })) : null, _jsx(TextField, { value: min, onChange: event => {
|
|
15
|
+
setMin(event.target.value);
|
|
16
|
+
}, placeholder: "Enter min score" }), _jsx(TextField, { value: max, onChange: event => {
|
|
17
|
+
setMax(event.target.value);
|
|
18
|
+
}, placeholder: "Enter max score" })] }), _jsx(DialogActions, { children: _jsx(Button, { variant: "contained", color: "primary", type: "submit", style: { marginLeft: 20 }, disabled: !ok, onClick: () => {
|
|
19
|
+
model.setMinScore(min !== '' && !Number.isNaN(+min) ? +min : undefined);
|
|
20
|
+
model.setMaxScore(max !== '' && !Number.isNaN(+max) ? +max : undefined);
|
|
21
|
+
handleClose();
|
|
22
|
+
}, children: "Submit" }) })] }));
|
|
30
23
|
}
|
|
@@ -35,7 +35,7 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
|
|
|
35
35
|
status?: string;
|
|
36
36
|
reactElement?: React.ReactElement;
|
|
37
37
|
};
|
|
38
|
-
}) => import("react").JSX.Element | undefined;
|
|
38
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
39
39
|
renderProps: any;
|
|
40
40
|
} & {
|
|
41
41
|
doReload(): void;
|
|
@@ -185,13 +185,13 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
|
|
|
185
185
|
} & {
|
|
186
186
|
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
187
187
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
188
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
188
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
189
189
|
} & {
|
|
190
190
|
featureIdUnderMouse: undefined | string;
|
|
191
191
|
contextMenuFeature: undefined | Feature;
|
|
192
192
|
} & {
|
|
193
|
-
readonly DisplayMessageComponent:
|
|
194
|
-
readonly blockType: "
|
|
193
|
+
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
194
|
+
readonly blockType: "staticBlocks" | "dynamicBlocks";
|
|
195
195
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
196
196
|
} & {
|
|
197
197
|
readonly renderDelay: number;
|
|
@@ -218,7 +218,7 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
|
|
|
218
218
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
219
219
|
renderProps(): any;
|
|
220
220
|
} & {
|
|
221
|
-
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
221
|
+
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
222
222
|
afterAttach(): void;
|
|
223
223
|
} & {
|
|
224
224
|
message: undefined | string;
|
|
@@ -352,7 +352,7 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
|
|
|
352
352
|
status?: string;
|
|
353
353
|
reactElement?: React.ReactElement;
|
|
354
354
|
};
|
|
355
|
-
}) => import("react").JSX.Element | undefined;
|
|
355
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
356
356
|
renderProps: any;
|
|
357
357
|
} & {
|
|
358
358
|
doReload(): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { axisPropsFromTickScale } from 'react-d3-axis-mod';
|
|
3
2
|
type Ticks = ReturnType<typeof axisPropsFromTickScale>;
|
|
4
3
|
declare const YScaleBar: ({ model, orientation, }: {
|
|
@@ -6,5 +5,5 @@ declare const YScaleBar: ({ model, orientation, }: {
|
|
|
6
5
|
ticks?: Ticks;
|
|
7
6
|
};
|
|
8
7
|
orientation?: string;
|
|
9
|
-
}) =>
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
9
|
export default YScaleBar;
|
package/esm/shared/YScaleBar.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTheme } from '@mui/material';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { Axis, LEFT, RIGHT } from 'react-d3-axis-mod';
|
|
5
5
|
const YScaleBar = observer(function ({ model, orientation, }) {
|
|
6
6
|
const { ticks } = model;
|
|
7
7
|
const theme = useTheme();
|
|
8
|
-
return ticks ? (
|
|
8
|
+
return ticks ? (_jsx(Axis, { ...ticks, shadow: 2, format: (n) => n, style: { orient: orientation === 'left' ? LEFT : RIGHT }, bg: theme.palette.background.default, fg: theme.palette.text.primary })) : null;
|
|
9
9
|
});
|
|
10
10
|
export default YScaleBar;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-wiggle",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "JBrowse 2 wiggle adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,32 +36,31 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@gmod/bbi": "^
|
|
39
|
+
"@gmod/bbi": "^6.0.0",
|
|
40
|
+
"@jbrowse/core": "^3.0.1",
|
|
41
|
+
"@jbrowse/plugin-data-management": "^3.0.1",
|
|
42
|
+
"@jbrowse/plugin-linear-genome-view": "^3.0.1",
|
|
40
43
|
"@mui/icons-material": "^6.0.0",
|
|
44
|
+
"@mui/material": "^6.0.0",
|
|
41
45
|
"@mui/x-charts-vendor": "^7.12.0",
|
|
42
46
|
"@mui/x-data-grid": "^7.0.0",
|
|
43
47
|
"fast-deep-equal": "^3.1.3",
|
|
44
|
-
"is-object": "^1.0.1",
|
|
45
|
-
"react-d3-axis-mod": "^0.1.9",
|
|
46
|
-
"react-draggable": "^4.4.5"
|
|
47
|
-
},
|
|
48
|
-
"peerDependencies": {
|
|
49
|
-
"@jbrowse/core": "^2.0.0",
|
|
50
|
-
"@jbrowse/plugin-data-management": "^2.0.0",
|
|
51
|
-
"@jbrowse/plugin-linear-genome-view": "^2.0.0",
|
|
52
|
-
"@mui/material": "^6.0.0",
|
|
53
48
|
"mobx": "^6.0.0",
|
|
54
49
|
"mobx-react": "^9.0.0",
|
|
55
50
|
"mobx-state-tree": "^5.0.0",
|
|
56
|
-
"react": "
|
|
51
|
+
"react-d3-axis-mod": "^0.1.9",
|
|
52
|
+
"react-draggable": "^4.4.5",
|
|
57
53
|
"rxjs": "^7.0.0",
|
|
58
54
|
"tss-react": "^4.0.0"
|
|
59
55
|
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": ">=18.0.0"
|
|
58
|
+
},
|
|
60
59
|
"publishConfig": {
|
|
61
60
|
"access": "public"
|
|
62
61
|
},
|
|
63
62
|
"distModule": "esm/index.js",
|
|
64
63
|
"srcModule": "src/index.ts",
|
|
65
64
|
"module": "esm/index.js",
|
|
66
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "aa2f1d1a89d2361c7fd1a93fe29506fa4554f5cc"
|
|
67
66
|
}
|
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
31
|
-
const material_1 = require("@mui/material");
|
|
32
|
-
const mobx_react_1 = require("mobx-react");
|
|
33
|
-
const react_draggable_1 = __importDefault(require("react-draggable"));
|
|
34
|
-
const mui_1 = require("tss-react/mui");
|
|
35
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
36
|
-
closeButton: {
|
|
37
|
-
position: 'absolute',
|
|
38
|
-
right: theme.spacing(1),
|
|
39
|
-
top: theme.spacing(1),
|
|
40
|
-
color: theme.palette.grey[500],
|
|
41
|
-
},
|
|
42
|
-
}));
|
|
43
|
-
function PaperComponent(props) {
|
|
44
|
-
const ref = (0, react_1.useRef)(null);
|
|
45
|
-
return (react_1.default.createElement(react_draggable_1.default, { nodeRef: ref, cancel: '[class*="MuiDialogContent-root"]', onStart: arg => { var _a, _b; return (_b = (_a = arg.target) === null || _a === void 0 ? void 0 : _a.className) === null || _b === void 0 ? void 0 : _b.includes('MuiDialogTitle'); } },
|
|
46
|
-
react_1.default.createElement(material_1.Paper, { ref: ref, ...props })));
|
|
47
|
-
}
|
|
48
|
-
const DraggableDialog = (0, mobx_react_1.observer)(function DraggableDialog(props) {
|
|
49
|
-
const { classes } = useStyles();
|
|
50
|
-
const { title, children, onClose } = props;
|
|
51
|
-
return (react_1.default.createElement(material_1.Dialog, { ...props, PaperComponent: PaperComponent },
|
|
52
|
-
react_1.default.createElement(material_1.ScopedCssBaseline, null,
|
|
53
|
-
react_1.default.createElement(material_1.DialogTitle, { style: { cursor: 'move' } },
|
|
54
|
-
title,
|
|
55
|
-
onClose ? (react_1.default.createElement(material_1.IconButton, { className: classes.closeButton, onClick: () => {
|
|
56
|
-
onClose();
|
|
57
|
-
} },
|
|
58
|
-
react_1.default.createElement(Close_1.default, null))) : null),
|
|
59
|
-
react_1.default.createElement(material_1.Divider, null),
|
|
60
|
-
children)));
|
|
61
|
-
});
|
|
62
|
-
exports.default = DraggableDialog;
|