@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,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 { SanitizedHTML } from '@jbrowse/core/ui';
|
|
3
4
|
import ColorPicker, { ColorPopover } from '@jbrowse/core/ui/ColorPicker';
|
|
4
5
|
import { getStr, measureGridWidth } from '@jbrowse/core/util';
|
|
@@ -27,82 +28,65 @@ function SourcesGrid({ rows, onChange, showTips, }) {
|
|
|
27
28
|
idx: 0,
|
|
28
29
|
field: null,
|
|
29
30
|
});
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
width: measureGridWidth(rows.map(r => `${r[val]}`)),
|
|
91
|
-
})),
|
|
92
|
-
], sortModel: [], onSortModelChange: args => {
|
|
93
|
-
const sort = args[0];
|
|
94
|
-
const idx = (currSort.idx + 1) % 2;
|
|
95
|
-
const field = sort.field || currSort.field;
|
|
96
|
-
setCurrSort({ idx, field });
|
|
97
|
-
onChange(field
|
|
98
|
-
? [...rows].sort((a, b) => {
|
|
99
|
-
const aa = getStr(a[field]);
|
|
100
|
-
const bb = getStr(b[field]);
|
|
101
|
-
return idx === 1
|
|
102
|
-
? aa.localeCompare(bb)
|
|
103
|
-
: bb.localeCompare(aa);
|
|
104
|
-
})
|
|
105
|
-
: rows);
|
|
106
|
-
} }))));
|
|
31
|
+
return (_jsxs("div", { children: [_jsx(Button, { disabled: !selected.length, onClick: event => {
|
|
32
|
+
setAnchorEl(event.currentTarget);
|
|
33
|
+
}, children: "Change color of selected items" }), _jsxs(Button, { onClick: () => {
|
|
34
|
+
onChange(moveUp([...rows], selected));
|
|
35
|
+
}, disabled: !selected.length, children: [_jsx(KeyboardArrowUpIcon, {}), showTips ? 'Move selected items up' : null] }), _jsxs(Button, { onClick: () => {
|
|
36
|
+
onChange(moveDown([...rows], selected));
|
|
37
|
+
}, disabled: !selected.length, children: [_jsx(KeyboardArrowDownIcon, {}), showTips ? 'Move selected items down' : null] }), _jsxs(Button, { onClick: () => {
|
|
38
|
+
onChange(moveUp([...rows], selected, rows.length));
|
|
39
|
+
}, disabled: !selected.length, children: [_jsx(KeyboardDoubleArrowUpIcon, {}), showTips ? 'Move selected items to top' : null] }), _jsxs(Button, { onClick: () => {
|
|
40
|
+
onChange(moveDown([...rows], selected, rows.length));
|
|
41
|
+
}, disabled: !selected.length, children: [_jsx(KeyboardDoubleArrowDownIcon, {}), showTips ? 'Move selected items to bottom' : null] }), _jsx(ColorPopover, { anchorEl: anchorEl, color: widgetColor, onChange: c => {
|
|
42
|
+
setWidgetColor(c);
|
|
43
|
+
selected.forEach(id => {
|
|
44
|
+
const elt = rows.find(f => f.name === id);
|
|
45
|
+
if (elt) {
|
|
46
|
+
elt.color = c;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
onChange([...rows]);
|
|
50
|
+
}, onClose: () => {
|
|
51
|
+
setAnchorEl(null);
|
|
52
|
+
} }), _jsx("div", { style: { height: 400, width: '100%' }, children: _jsx(DataGrid, { getRowId: row => row.name, checkboxSelection: true, disableRowSelectionOnClick: true, onRowSelectionModelChange: arg => {
|
|
53
|
+
setSelected(arg);
|
|
54
|
+
}, rows: rows, rowHeight: 25, columnHeaderHeight: 33, columns: [
|
|
55
|
+
{
|
|
56
|
+
field: 'color',
|
|
57
|
+
headerName: 'Color',
|
|
58
|
+
renderCell: ({ value, id }) => (_jsx(ColorPicker, { color: value || 'blue', onChange: c => {
|
|
59
|
+
const elt = rows.find(f => f.name === id);
|
|
60
|
+
if (elt) {
|
|
61
|
+
elt.color = c;
|
|
62
|
+
}
|
|
63
|
+
onChange([...rows]);
|
|
64
|
+
} })),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
field: 'name',
|
|
68
|
+
headerName: 'Name',
|
|
69
|
+
width: measureGridWidth(rows.map(r => r.name)),
|
|
70
|
+
},
|
|
71
|
+
...Object.keys(rest).map(val => ({
|
|
72
|
+
field: val,
|
|
73
|
+
renderCell: ({ value }) => (_jsx("div", { className: classes.cell, children: _jsx(SanitizedHTML, { html: getStr(value) }) })),
|
|
74
|
+
width: measureGridWidth(rows.map(r => `${r[val]}`)),
|
|
75
|
+
})),
|
|
76
|
+
], sortModel: [], onSortModelChange: args => {
|
|
77
|
+
const sort = args[0];
|
|
78
|
+
const idx = (currSort.idx + 1) % 2;
|
|
79
|
+
const field = sort.field || currSort.field;
|
|
80
|
+
setCurrSort({ idx, field });
|
|
81
|
+
onChange(field
|
|
82
|
+
? [...rows].sort((a, b) => {
|
|
83
|
+
const aa = getStr(a[field]);
|
|
84
|
+
const bb = getStr(b[field]);
|
|
85
|
+
return idx === 1
|
|
86
|
+
? aa.localeCompare(bb)
|
|
87
|
+
: bb.localeCompare(aa);
|
|
88
|
+
})
|
|
89
|
+
: rows);
|
|
90
|
+
} }) })] }));
|
|
107
91
|
}
|
|
108
92
|
export default SourcesGrid;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { TooltipContentsComponent } from '../../Tooltip';
|
|
3
2
|
import type { Source } from '../../util';
|
|
4
3
|
import type { Feature } from '@jbrowse/core/util';
|
|
@@ -14,6 +13,6 @@ declare const WiggleTooltip: (props: {
|
|
|
14
13
|
clientMouseCoord: Coord;
|
|
15
14
|
clientRect?: DOMRect;
|
|
16
15
|
TooltipContents?: TooltipContentsComponent;
|
|
17
|
-
}) =>
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
17
|
export default WiggleTooltip;
|
|
19
18
|
export { default as Tooltip } from '../../Tooltip';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { observer } from 'mobx-react';
|
|
3
4
|
import Tooltip from '../../Tooltip';
|
|
4
5
|
import { toP } from '../../util';
|
|
5
6
|
const en = (n) => n.toLocaleString('en-US');
|
|
6
|
-
const TooltipContents =
|
|
7
|
+
const TooltipContents = forwardRef(function TooltipContents2({ model, feature }, ref) {
|
|
7
8
|
const start = feature.get('start');
|
|
8
9
|
const end = feature.get('end');
|
|
9
10
|
const refName = feature.get('refName');
|
|
@@ -12,27 +13,12 @@ const TooltipContents = React.forwardRef(function TooltipContents2({ model, feat
|
|
|
12
13
|
const source = feature.get('source');
|
|
13
14
|
const summary = feature.get('summary');
|
|
14
15
|
const obj = Object.fromEntries(model.sources.map(ent => [ent.name, ent]));
|
|
15
|
-
return (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
sources ? (React.createElement("table", null,
|
|
19
|
-
React.createElement("thead", null,
|
|
20
|
-
React.createElement("tr", null,
|
|
21
|
-
React.createElement("th", null, "color"),
|
|
22
|
-
React.createElement("th", null, "source"),
|
|
23
|
-
React.createElement("th", null, "score"))),
|
|
24
|
-
React.createElement("tbody", null, Object.entries(sources).map(([source, data]) => (React.createElement("tr", { key: source },
|
|
25
|
-
React.createElement("td", { style: { background: obj[source].color } }, " "),
|
|
26
|
-
React.createElement("td", null, source),
|
|
27
|
-
React.createElement("td", null, toP(data.score)))))))) : (React.createElement("span", null,
|
|
28
|
-
source,
|
|
29
|
-
' ',
|
|
30
|
-
summary
|
|
31
|
-
? `min:${toP(feature.get('minScore'))} avg:${toP(feature.get('score'))} max:${toP(feature.get('maxScore'))}`
|
|
32
|
-
: toP(feature.get('score'))))));
|
|
16
|
+
return (_jsxs("div", { ref: ref, children: [[refName, coord].filter(f => !!f).join(':'), _jsx("br", {}), sources ? (_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "color" }), _jsx("th", { children: "source" }), _jsx("th", { children: "score" })] }) }), _jsx("tbody", { children: Object.entries(sources).map(([source, data]) => (_jsxs("tr", { children: [_jsx("td", { style: { background: obj[source].color }, children: " " }), _jsx("td", { children: source }), _jsx("td", { children: toP(data.score) })] }, source))) })] })) : (_jsxs("span", { children: [source, ' ', summary
|
|
17
|
+
? `min:${toP(feature.get('minScore'))} avg:${toP(feature.get('score'))} max:${toP(feature.get('maxScore'))}`
|
|
18
|
+
: toP(feature.get('score'))] }))] }));
|
|
33
19
|
});
|
|
34
20
|
const WiggleTooltip = observer((props) => {
|
|
35
|
-
return
|
|
21
|
+
return _jsx(Tooltip, { useClientY: true, TooltipContents: TooltipContents, ...props });
|
|
36
22
|
});
|
|
37
23
|
export default WiggleTooltip;
|
|
38
24
|
export { default as Tooltip } from '../../Tooltip';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { WiggleDisplayModel } from '../model';
|
|
3
2
|
declare const MultiLinearWiggleDisplayComponent: (props: {
|
|
4
3
|
model: WiggleDisplayModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default MultiLinearWiggleDisplayComponent;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import YScaleBars from './YScaleBars';
|
|
5
5
|
const MultiLinearWiggleDisplayComponent = observer(function (props) {
|
|
6
6
|
const { model } = props;
|
|
7
|
-
return (
|
|
8
|
-
React.createElement(BaseLinearDisplayComponent, { ...props }),
|
|
9
|
-
React.createElement(YScaleBars, { model: model })));
|
|
7
|
+
return (_jsxs("div", { children: [_jsx(BaseLinearDisplayComponent, { ...props }), _jsx(YScaleBars, { model: model })] }));
|
|
10
8
|
});
|
|
11
9
|
export default MultiLinearWiggleDisplayComponent;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { WiggleDisplayModel } from '../model';
|
|
3
2
|
export declare const YScaleBars: (props: {
|
|
4
3
|
model: WiggleDisplayModel;
|
|
5
4
|
orientation?: string;
|
|
6
5
|
exportSVG?: boolean;
|
|
7
|
-
}) =>
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
7
|
export default YScaleBars;
|
|
@@ -1,42 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getContainingView
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getContainingView } from '@jbrowse/core/util';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { getOffset } from './util';
|
|
7
|
-
import YScaleBar from '../../shared/YScaleBar';
|
|
4
|
+
import FullHeightScaleBar from './FullHeightScaleBar';
|
|
5
|
+
import IndividualScaleBars from './IndividualScaleBars';
|
|
8
6
|
const Wrapper = observer(function ({ children, model, exportSVG, }) {
|
|
9
7
|
const { height } = model;
|
|
10
|
-
return exportSVG ? (children) : (
|
|
8
|
+
return exportSVG ? (children) : (_jsx("svg", { style: {
|
|
11
9
|
position: 'absolute',
|
|
12
10
|
top: 0,
|
|
13
11
|
left: 0,
|
|
14
12
|
pointerEvents: 'none',
|
|
15
13
|
height,
|
|
16
14
|
width: getContainingView(model).width,
|
|
17
|
-
}
|
|
15
|
+
}, children: children }));
|
|
18
16
|
});
|
|
19
17
|
export const YScaleBars = observer(function (props) {
|
|
20
18
|
const { model, orientation, exportSVG } = props;
|
|
21
|
-
const { stats,
|
|
22
|
-
|
|
23
|
-
const canDisplayLabel = rowHeight > 11;
|
|
24
|
-
const { width: viewWidth } = getContainingView(model);
|
|
25
|
-
const minWidth = 20;
|
|
26
|
-
const ready = stats && sources;
|
|
27
|
-
if (!ready) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const labelWidth = Math.max(...sources
|
|
31
|
-
.map(s => measureText(s.name, svgFontSize))
|
|
32
|
-
.map(width => (canDisplayLabel ? width : minWidth)));
|
|
33
|
-
return (React.createElement(Wrapper, { ...props }, needsFullHeightScalebar ? (React.createElement(React.Fragment, null,
|
|
34
|
-
React.createElement("g", { transform: `translate(${!exportSVG ? getOffset(model) : 0},0)` },
|
|
35
|
-
React.createElement(YScaleBar, { model: model, orientation: orientation })),
|
|
36
|
-
React.createElement("g", { transform: `translate(${viewWidth - labelWidth - 100},0)` },
|
|
37
|
-
React.createElement(ColorLegend, { exportSVG: exportSVG, model: model, rowHeight: 12, labelWidth: labelWidth })))) : (React.createElement(React.Fragment, null,
|
|
38
|
-
React.createElement(ColorLegend, { exportSVG: exportSVG, model: model, rowHeight: model.rowHeight, labelWidth: labelWidth }),
|
|
39
|
-
rowHeightTooSmallForScalebar || needsCustomLegend ? (React.createElement(ScoreLegend, { ...props })) : (sources.map((_source, idx) => (React.createElement("g", { transform: `translate(0 ${rowHeight * idx})`, key: `${JSON.stringify(ticks)}-${idx}` },
|
|
40
|
-
React.createElement(YScaleBar, { model: model, orientation: orientation })))))))));
|
|
19
|
+
const { stats, needsFullHeightScalebar, sources } = model;
|
|
20
|
+
return stats && sources ? (_jsx(Wrapper, { ...props, children: needsFullHeightScalebar ? (_jsx(FullHeightScaleBar, { model: model, orientation: orientation, exportSVG: exportSVG })) : (_jsx(IndividualScaleBars, { model: model, orientation: orientation, exportSVG: exportSVG })) })) : null;
|
|
41
21
|
});
|
|
42
22
|
export default YScaleBars;
|
|
@@ -4,7 +4,7 @@ import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
|
4
4
|
import type { AnyReactComponentType, Feature } from '@jbrowse/core/util';
|
|
5
5
|
import type { ExportSvgDisplayOptions } from '@jbrowse/plugin-linear-genome-view';
|
|
6
6
|
import type { Instance } from 'mobx-state-tree';
|
|
7
|
-
export declare function stateModelFactory(
|
|
7
|
+
export declare function stateModelFactory(_pluginManager: PluginManager, configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
8
8
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
9
9
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
10
10
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -39,7 +39,7 @@ export declare function stateModelFactory(pluginManager: PluginManager, configSc
|
|
|
39
39
|
status?: string;
|
|
40
40
|
reactElement?: React.ReactElement;
|
|
41
41
|
};
|
|
42
|
-
}) => import("react").JSX.Element | undefined;
|
|
42
|
+
}) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
43
43
|
renderProps: any;
|
|
44
44
|
} & {
|
|
45
45
|
doReload(): void;
|
|
@@ -192,13 +192,13 @@ export declare function stateModelFactory(pluginManager: PluginManager, configSc
|
|
|
192
192
|
} & {
|
|
193
193
|
readonly statsReadyAndRegionNotTooLarge: boolean;
|
|
194
194
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
195
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
195
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
196
196
|
} & {
|
|
197
197
|
featureIdUnderMouse: undefined | string;
|
|
198
198
|
contextMenuFeature: undefined | Feature;
|
|
199
199
|
} & {
|
|
200
|
-
readonly DisplayMessageComponent:
|
|
201
|
-
readonly blockType: "
|
|
200
|
+
readonly DisplayMessageComponent: undefined | React.FC<any>;
|
|
201
|
+
readonly blockType: "staticBlocks" | "dynamicBlocks";
|
|
202
202
|
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
203
203
|
} & {
|
|
204
204
|
readonly renderDelay: number;
|
|
@@ -225,7 +225,7 @@ export declare function stateModelFactory(pluginManager: PluginManager, configSc
|
|
|
225
225
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
226
226
|
renderProps(): any;
|
|
227
227
|
} & {
|
|
228
|
-
renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
228
|
+
renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
229
229
|
afterAttach(): void;
|
|
230
230
|
} & {
|
|
231
231
|
message: undefined | string;
|
|
@@ -366,6 +366,9 @@ export declare function stateModelFactory(pluginManager: PluginManager, configSc
|
|
|
366
366
|
readonly colors: string[];
|
|
367
367
|
readonly quantitativeStatsRelevantToCurrentZoom: boolean;
|
|
368
368
|
} & {
|
|
369
|
+
readonly legendFontSize: number;
|
|
370
|
+
readonly canDisplayLegendLabels: boolean;
|
|
371
|
+
readonly labelWidth: number;
|
|
369
372
|
renderProps(): any;
|
|
370
373
|
readonly hasResolution: boolean;
|
|
371
374
|
readonly hasGlobalStats: boolean;
|
|
@@ -417,7 +420,7 @@ export declare function stateModelFactory(pluginManager: PluginManager, configSc
|
|
|
417
420
|
})[];
|
|
418
421
|
} & {
|
|
419
422
|
afterAttach(): void;
|
|
420
|
-
renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
423
|
+
renderSvg(opts: ExportSvgDisplayOptions): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
421
424
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
422
425
|
export type WiggleDisplayStateModel = ReturnType<typeof stateModelFactory>;
|
|
423
426
|
export type WiggleDisplayModel = Instance<WiggleDisplayStateModel>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { getConf } from '@jbrowse/core/configuration';
|
|
3
3
|
import { set1 as colors } from '@jbrowse/core/ui/colors';
|
|
4
|
-
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
4
|
+
import { getContainingView, getSession, max, measureText, } from '@jbrowse/core/util';
|
|
5
5
|
import { stopStopToken } from '@jbrowse/core/util/stopToken';
|
|
6
6
|
import deepEqual from 'fast-deep-equal';
|
|
7
7
|
import { isAlive, types } from 'mobx-state-tree';
|
|
@@ -18,7 +18,7 @@ const rendererTypes = new Map([
|
|
|
18
18
|
['multiline', 'MultiLineRenderer'],
|
|
19
19
|
['multirowline', 'MultiRowLineRenderer'],
|
|
20
20
|
]);
|
|
21
|
-
export function stateModelFactory(
|
|
21
|
+
export function stateModelFactory(_pluginManager, configSchema) {
|
|
22
22
|
return types
|
|
23
23
|
.compose('MultiLinearWiggleDisplay', SharedWiggleMixin(configSchema), types.model({
|
|
24
24
|
type: types.literal('MultiLinearWiggleDisplay'),
|
|
@@ -178,6 +178,18 @@ export function stateModelFactory(pluginManager, configSchema) {
|
|
|
178
178
|
};
|
|
179
179
|
})
|
|
180
180
|
.views(self => ({
|
|
181
|
+
get legendFontSize() {
|
|
182
|
+
return Math.min(self.rowHeight, 12);
|
|
183
|
+
},
|
|
184
|
+
get canDisplayLegendLabels() {
|
|
185
|
+
return self.rowHeight > 11;
|
|
186
|
+
},
|
|
187
|
+
get labelWidth() {
|
|
188
|
+
var _a;
|
|
189
|
+
const minWidth = 20;
|
|
190
|
+
return max(((_a = self.sources) === null || _a === void 0 ? void 0 : _a.map(s => measureText(s.name, this.legendFontSize)).map(width => (this.canDisplayLegendLabels ? width : minWidth))) ||
|
|
191
|
+
[]);
|
|
192
|
+
},
|
|
181
193
|
renderProps() {
|
|
182
194
|
const superProps = self.adapterProps();
|
|
183
195
|
return {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { WiggleDisplayModel } from './model';
|
|
3
2
|
import type { ExportSvgDisplayOptions } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
-
export declare function renderSvg(self: WiggleDisplayModel, opts: ExportSvgDisplayOptions, superRenderSvg: (opts: ExportSvgDisplayOptions) => Promise<React.ReactNode>): Promise<
|
|
3
|
+
export declare function renderSvg(self: WiggleDisplayModel, opts: ExportSvgDisplayOptions, superRenderSvg: (opts: ExportSvgDisplayOptions) => Promise<React.ReactNode>): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getContainingView } from '@jbrowse/core/util';
|
|
3
3
|
import { when } from 'mobx';
|
|
4
4
|
import YScaleBars from './components/YScaleBars';
|
|
5
5
|
export async function renderSvg(self, opts, superRenderSvg) {
|
|
6
6
|
await when(() => !!self.stats && !!self.regionCannotBeRenderedText);
|
|
7
7
|
const { offsetPx } = getContainingView(self);
|
|
8
|
-
return (
|
|
9
|
-
React.createElement("g", null, await superRenderSvg(opts)),
|
|
10
|
-
React.createElement("g", { transform: `translate(${Math.max(-offsetPx, 0)})` },
|
|
11
|
-
React.createElement(YScaleBars, { model: self, orientation: "left", exportSVG: true }))));
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx("g", { children: await superRenderSvg(opts) }), _jsx("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: _jsx(YScaleBars, { model: self, orientation: "left", exportSVG: true }) })] }));
|
|
12
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function randomColor(str: string): string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { groupBy } from '@jbrowse/core/util';
|
|
2
2
|
import WiggleBaseRenderer from '../WiggleBaseRenderer';
|
|
3
|
-
import { drawLine } from '../drawLine';
|
|
4
3
|
export default class MultiRowLineRenderer extends WiggleBaseRenderer {
|
|
5
4
|
async draw(ctx, props) {
|
|
6
5
|
const { bpPerPx, sources, regions, features } = props;
|
|
@@ -8,6 +7,7 @@ export default class MultiRowLineRenderer extends WiggleBaseRenderer {
|
|
|
8
7
|
const groups = groupBy(features.values(), f => f.get('source'));
|
|
9
8
|
const height = props.height / sources.length;
|
|
10
9
|
const width = (region.end - region.start) / bpPerPx;
|
|
10
|
+
const { drawLine } = await import('../drawLine');
|
|
11
11
|
let feats = [];
|
|
12
12
|
ctx.save();
|
|
13
13
|
sources.forEach(source => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { groupBy } from '@jbrowse/core/util';
|
|
2
2
|
import WiggleBaseRenderer from '../WiggleBaseRenderer';
|
|
3
|
-
import { drawXY } from '../drawXY';
|
|
4
3
|
export default class MultiXYPlotRenderer extends WiggleBaseRenderer {
|
|
5
4
|
async draw(ctx, props) {
|
|
6
5
|
const { bpPerPx, sources, regions, features } = props;
|
|
@@ -8,6 +7,7 @@ export default class MultiXYPlotRenderer extends WiggleBaseRenderer {
|
|
|
8
7
|
const groups = groupBy(features.values(), f => f.get('source'));
|
|
9
8
|
const height = props.height / sources.length;
|
|
10
9
|
const width = (region.end - region.start) / bpPerPx;
|
|
10
|
+
const { drawXY } = await import('../drawXY');
|
|
11
11
|
let feats = [];
|
|
12
12
|
ctx.save();
|
|
13
13
|
sources.forEach(source => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AddTrackModel } from '@jbrowse/plugin-data-management';
|
|
3
|
-
|
|
2
|
+
declare const MultiWiggleAddTrackWorkflow: ({ model, }: {
|
|
4
3
|
model: AddTrackModel;
|
|
5
|
-
})
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default MultiWiggleAddTrackWorkflow;
|