@jbrowse/plugin-wiggle 2.18.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +3 -4
- 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
|
@@ -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 ColorPicker_1 = __importStar(require("@jbrowse/core/ui/ColorPicker"));
|
|
32
43
|
const util_1 = require("@jbrowse/core/util");
|
|
@@ -55,82 +66,65 @@ function SourcesGrid({ rows, onChange, showTips, }) {
|
|
|
55
66
|
idx: 0,
|
|
56
67
|
field: null,
|
|
57
68
|
});
|
|
58
|
-
return (
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
width: (0, util_1.measureGridWidth)(rows.map(r => `${r[val]}`)),
|
|
119
|
-
})),
|
|
120
|
-
], sortModel: [], onSortModelChange: args => {
|
|
121
|
-
const sort = args[0];
|
|
122
|
-
const idx = (currSort.idx + 1) % 2;
|
|
123
|
-
const field = sort.field || currSort.field;
|
|
124
|
-
setCurrSort({ idx, field });
|
|
125
|
-
onChange(field
|
|
126
|
-
? [...rows].sort((a, b) => {
|
|
127
|
-
const aa = (0, util_1.getStr)(a[field]);
|
|
128
|
-
const bb = (0, util_1.getStr)(b[field]);
|
|
129
|
-
return idx === 1
|
|
130
|
-
? aa.localeCompare(bb)
|
|
131
|
-
: bb.localeCompare(aa);
|
|
132
|
-
})
|
|
133
|
-
: rows);
|
|
134
|
-
} }))));
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { disabled: !selected.length, onClick: event => {
|
|
70
|
+
setAnchorEl(event.currentTarget);
|
|
71
|
+
}, children: "Change color of selected items" }), (0, jsx_runtime_1.jsxs)(material_1.Button, { onClick: () => {
|
|
72
|
+
onChange((0, util_2.moveUp)([...rows], selected));
|
|
73
|
+
}, disabled: !selected.length, children: [(0, jsx_runtime_1.jsx)(KeyboardArrowUp_1.default, {}), showTips ? 'Move selected items up' : null] }), (0, jsx_runtime_1.jsxs)(material_1.Button, { onClick: () => {
|
|
74
|
+
onChange((0, util_2.moveDown)([...rows], selected));
|
|
75
|
+
}, disabled: !selected.length, children: [(0, jsx_runtime_1.jsx)(KeyboardArrowDown_1.default, {}), showTips ? 'Move selected items down' : null] }), (0, jsx_runtime_1.jsxs)(material_1.Button, { onClick: () => {
|
|
76
|
+
onChange((0, util_2.moveUp)([...rows], selected, rows.length));
|
|
77
|
+
}, disabled: !selected.length, children: [(0, jsx_runtime_1.jsx)(KeyboardDoubleArrowUp_1.default, {}), showTips ? 'Move selected items to top' : null] }), (0, jsx_runtime_1.jsxs)(material_1.Button, { onClick: () => {
|
|
78
|
+
onChange((0, util_2.moveDown)([...rows], selected, rows.length));
|
|
79
|
+
}, disabled: !selected.length, children: [(0, jsx_runtime_1.jsx)(KeyboardDoubleArrowDown_1.default, {}), showTips ? 'Move selected items to bottom' : null] }), (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPopover, { anchorEl: anchorEl, color: widgetColor, onChange: c => {
|
|
80
|
+
setWidgetColor(c);
|
|
81
|
+
selected.forEach(id => {
|
|
82
|
+
const elt = rows.find(f => f.name === id);
|
|
83
|
+
if (elt) {
|
|
84
|
+
elt.color = c;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
onChange([...rows]);
|
|
88
|
+
}, onClose: () => {
|
|
89
|
+
setAnchorEl(null);
|
|
90
|
+
} }), (0, jsx_runtime_1.jsx)("div", { style: { height: 400, width: '100%' }, children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { getRowId: row => row.name, checkboxSelection: true, disableRowSelectionOnClick: true, onRowSelectionModelChange: arg => {
|
|
91
|
+
setSelected(arg);
|
|
92
|
+
}, rows: rows, rowHeight: 25, columnHeaderHeight: 33, columns: [
|
|
93
|
+
{
|
|
94
|
+
field: 'color',
|
|
95
|
+
headerName: 'Color',
|
|
96
|
+
renderCell: ({ value, id }) => ((0, jsx_runtime_1.jsx)(ColorPicker_1.default, { color: value || 'blue', onChange: c => {
|
|
97
|
+
const elt = rows.find(f => f.name === id);
|
|
98
|
+
if (elt) {
|
|
99
|
+
elt.color = c;
|
|
100
|
+
}
|
|
101
|
+
onChange([...rows]);
|
|
102
|
+
} })),
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
field: 'name',
|
|
106
|
+
headerName: 'Name',
|
|
107
|
+
width: (0, util_1.measureGridWidth)(rows.map(r => r.name)),
|
|
108
|
+
},
|
|
109
|
+
...Object.keys(rest).map(val => ({
|
|
110
|
+
field: val,
|
|
111
|
+
renderCell: ({ value }) => ((0, jsx_runtime_1.jsx)("div", { className: classes.cell, children: (0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: (0, util_1.getStr)(value) }) })),
|
|
112
|
+
width: (0, util_1.measureGridWidth)(rows.map(r => `${r[val]}`)),
|
|
113
|
+
})),
|
|
114
|
+
], sortModel: [], onSortModelChange: args => {
|
|
115
|
+
const sort = args[0];
|
|
116
|
+
const idx = (currSort.idx + 1) % 2;
|
|
117
|
+
const field = sort.field || currSort.field;
|
|
118
|
+
setCurrSort({ idx, field });
|
|
119
|
+
onChange(field
|
|
120
|
+
? [...rows].sort((a, b) => {
|
|
121
|
+
const aa = (0, util_1.getStr)(a[field]);
|
|
122
|
+
const bb = (0, util_1.getStr)(b[field]);
|
|
123
|
+
return idx === 1
|
|
124
|
+
? aa.localeCompare(bb)
|
|
125
|
+
: bb.localeCompare(aa);
|
|
126
|
+
})
|
|
127
|
+
: rows);
|
|
128
|
+
} }) })] }));
|
|
135
129
|
}
|
|
136
130
|
exports.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';
|
|
@@ -4,12 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Tooltip = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
8
9
|
const mobx_react_1 = require("mobx-react");
|
|
9
10
|
const Tooltip_1 = __importDefault(require("../../Tooltip"));
|
|
10
11
|
const util_1 = require("../../util");
|
|
11
12
|
const en = (n) => n.toLocaleString('en-US');
|
|
12
|
-
const TooltipContents = react_1.
|
|
13
|
+
const TooltipContents = (0, react_1.forwardRef)(function TooltipContents2({ model, feature }, ref) {
|
|
13
14
|
const start = feature.get('start');
|
|
14
15
|
const end = feature.get('end');
|
|
15
16
|
const refName = feature.get('refName');
|
|
@@ -18,27 +19,12 @@ const TooltipContents = react_1.default.forwardRef(function TooltipContents2({ m
|
|
|
18
19
|
const source = feature.get('source');
|
|
19
20
|
const summary = feature.get('summary');
|
|
20
21
|
const obj = Object.fromEntries(model.sources.map(ent => [ent.name, ent]));
|
|
21
|
-
return (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
sources ? (react_1.default.createElement("table", null,
|
|
25
|
-
react_1.default.createElement("thead", null,
|
|
26
|
-
react_1.default.createElement("tr", null,
|
|
27
|
-
react_1.default.createElement("th", null, "color"),
|
|
28
|
-
react_1.default.createElement("th", null, "source"),
|
|
29
|
-
react_1.default.createElement("th", null, "score"))),
|
|
30
|
-
react_1.default.createElement("tbody", null, Object.entries(sources).map(([source, data]) => (react_1.default.createElement("tr", { key: source },
|
|
31
|
-
react_1.default.createElement("td", { style: { background: obj[source].color } }, " "),
|
|
32
|
-
react_1.default.createElement("td", null, source),
|
|
33
|
-
react_1.default.createElement("td", null, (0, util_1.toP)(data.score)))))))) : (react_1.default.createElement("span", null,
|
|
34
|
-
source,
|
|
35
|
-
' ',
|
|
36
|
-
summary
|
|
37
|
-
? `min:${(0, util_1.toP)(feature.get('minScore'))} avg:${(0, util_1.toP)(feature.get('score'))} max:${(0, util_1.toP)(feature.get('maxScore'))}`
|
|
38
|
-
: (0, util_1.toP)(feature.get('score'))))));
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, children: [[refName, coord].filter(f => !!f).join(':'), (0, jsx_runtime_1.jsx)("br", {}), sources ? ((0, jsx_runtime_1.jsxs)("table", { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "color" }), (0, jsx_runtime_1.jsx)("th", { children: "source" }), (0, jsx_runtime_1.jsx)("th", { children: "score" })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: Object.entries(sources).map(([source, data]) => ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { style: { background: obj[source].color }, children: " " }), (0, jsx_runtime_1.jsx)("td", { children: source }), (0, jsx_runtime_1.jsx)("td", { children: (0, util_1.toP)(data.score) })] }, source))) })] })) : ((0, jsx_runtime_1.jsxs)("span", { children: [source, ' ', summary
|
|
23
|
+
? `min:${(0, util_1.toP)(feature.get('minScore'))} avg:${(0, util_1.toP)(feature.get('score'))} max:${(0, util_1.toP)(feature.get('maxScore'))}`
|
|
24
|
+
: (0, util_1.toP)(feature.get('score'))] }))] }));
|
|
39
25
|
});
|
|
40
26
|
const WiggleTooltip = (0, mobx_react_1.observer)((props) => {
|
|
41
|
-
return
|
|
27
|
+
return (0, jsx_runtime_1.jsx)(Tooltip_1.default, { useClientY: true, TooltipContents: TooltipContents, ...props });
|
|
42
28
|
});
|
|
43
29
|
exports.default = WiggleTooltip;
|
|
44
30
|
var Tooltip_2 = require("../../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;
|
|
@@ -3,14 +3,12 @@ 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 plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
8
8
|
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
const YScaleBars_1 = __importDefault(require("./YScaleBars"));
|
|
10
10
|
const MultiLinearWiggleDisplayComponent = (0, mobx_react_1.observer)(function (props) {
|
|
11
11
|
const { model } = props;
|
|
12
|
-
return (
|
|
13
|
-
react_1.default.createElement(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }),
|
|
14
|
-
react_1.default.createElement(YScaleBars_1.default, { model: model })));
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }), (0, jsx_runtime_1.jsx)(YScaleBars_1.default, { model: model })] }));
|
|
15
13
|
});
|
|
16
14
|
exports.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;
|
|
@@ -4,45 +4,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.YScaleBars = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const util_2 = require("./util");
|
|
13
|
-
const YScaleBar_1 = __importDefault(require("../../shared/YScaleBar"));
|
|
10
|
+
const FullHeightScaleBar_1 = __importDefault(require("./FullHeightScaleBar"));
|
|
11
|
+
const IndividualScaleBars_1 = __importDefault(require("./IndividualScaleBars"));
|
|
14
12
|
const Wrapper = (0, mobx_react_1.observer)(function ({ children, model, exportSVG, }) {
|
|
15
13
|
const { height } = model;
|
|
16
|
-
return exportSVG ? (children) : (
|
|
14
|
+
return exportSVG ? (children) : ((0, jsx_runtime_1.jsx)("svg", { style: {
|
|
17
15
|
position: 'absolute',
|
|
18
16
|
top: 0,
|
|
19
17
|
left: 0,
|
|
20
18
|
pointerEvents: 'none',
|
|
21
19
|
height,
|
|
22
20
|
width: (0, util_1.getContainingView)(model).width,
|
|
23
|
-
}
|
|
21
|
+
}, children: children }));
|
|
24
22
|
});
|
|
25
23
|
exports.YScaleBars = (0, mobx_react_1.observer)(function (props) {
|
|
26
24
|
const { model, orientation, exportSVG } = props;
|
|
27
|
-
const { stats,
|
|
28
|
-
|
|
29
|
-
const canDisplayLabel = rowHeight > 11;
|
|
30
|
-
const { width: viewWidth } = (0, util_1.getContainingView)(model);
|
|
31
|
-
const minWidth = 20;
|
|
32
|
-
const ready = stats && sources;
|
|
33
|
-
if (!ready) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
const labelWidth = Math.max(...sources
|
|
37
|
-
.map(s => (0, util_1.measureText)(s.name, svgFontSize))
|
|
38
|
-
.map(width => (canDisplayLabel ? width : minWidth)));
|
|
39
|
-
return (react_1.default.createElement(Wrapper, { ...props }, needsFullHeightScalebar ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
40
|
-
react_1.default.createElement("g", { transform: `translate(${!exportSVG ? (0, util_2.getOffset)(model) : 0},0)` },
|
|
41
|
-
react_1.default.createElement(YScaleBar_1.default, { model: model, orientation: orientation })),
|
|
42
|
-
react_1.default.createElement("g", { transform: `translate(${viewWidth - labelWidth - 100},0)` },
|
|
43
|
-
react_1.default.createElement(ColorLegend_1.default, { exportSVG: exportSVG, model: model, rowHeight: 12, labelWidth: labelWidth })))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
44
|
-
react_1.default.createElement(ColorLegend_1.default, { exportSVG: exportSVG, model: model, rowHeight: model.rowHeight, labelWidth: labelWidth }),
|
|
45
|
-
rowHeightTooSmallForScalebar || needsCustomLegend ? (react_1.default.createElement(ScoreLegend_1.default, { ...props })) : (sources.map((_source, idx) => (react_1.default.createElement("g", { transform: `translate(0 ${rowHeight * idx})`, key: `${JSON.stringify(ticks)}-${idx}` },
|
|
46
|
-
react_1.default.createElement(YScaleBar_1.default, { model: model, orientation: orientation })))))))));
|
|
25
|
+
const { stats, needsFullHeightScalebar, sources } = model;
|
|
26
|
+
return stats && sources ? ((0, jsx_runtime_1.jsx)(Wrapper, { ...props, children: needsFullHeightScalebar ? ((0, jsx_runtime_1.jsx)(FullHeightScaleBar_1.default, { model: model, orientation: orientation, exportSVG: exportSVG })) : ((0, jsx_runtime_1.jsx)(IndividualScaleBars_1.default, { model: model, orientation: orientation, exportSVG: exportSVG })) })) : null;
|
|
47
27
|
});
|
|
48
28
|
exports.default = exports.YScaleBars;
|
|
@@ -15,13 +15,23 @@ 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
|
};
|
|
@@ -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>;
|
|
@@ -15,13 +15,23 @@ 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
|
};
|
|
@@ -47,7 +57,7 @@ const rendererTypes = new Map([
|
|
|
47
57
|
['multiline', 'MultiLineRenderer'],
|
|
48
58
|
['multirowline', 'MultiRowLineRenderer'],
|
|
49
59
|
]);
|
|
50
|
-
function stateModelFactory(
|
|
60
|
+
function stateModelFactory(_pluginManager, configSchema) {
|
|
51
61
|
return mobx_state_tree_1.types
|
|
52
62
|
.compose('MultiLinearWiggleDisplay', (0, SharedWiggleMixin_1.default)(configSchema), mobx_state_tree_1.types.model({
|
|
53
63
|
type: mobx_state_tree_1.types.literal('MultiLinearWiggleDisplay'),
|
|
@@ -207,6 +217,18 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
207
217
|
};
|
|
208
218
|
})
|
|
209
219
|
.views(self => ({
|
|
220
|
+
get legendFontSize() {
|
|
221
|
+
return Math.min(self.rowHeight, 12);
|
|
222
|
+
},
|
|
223
|
+
get canDisplayLegendLabels() {
|
|
224
|
+
return self.rowHeight > 11;
|
|
225
|
+
},
|
|
226
|
+
get labelWidth() {
|
|
227
|
+
var _a;
|
|
228
|
+
const minWidth = 20;
|
|
229
|
+
return (0, util_1.max)(((_a = self.sources) === null || _a === void 0 ? void 0 : _a.map(s => (0, util_1.measureText)(s.name, this.legendFontSize)).map(width => (this.canDisplayLegendLabels ? width : minWidth))) ||
|
|
230
|
+
[]);
|
|
231
|
+
},
|
|
210
232
|
renderProps() {
|
|
211
233
|
const superProps = self.adapterProps();
|
|
212
234
|
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>;
|
|
@@ -4,15 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.renderSvg = renderSvg;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
const mobx_1 = require("mobx");
|
|
10
10
|
const YScaleBars_1 = __importDefault(require("./components/YScaleBars"));
|
|
11
11
|
async function renderSvg(self, opts, superRenderSvg) {
|
|
12
12
|
await (0, mobx_1.when)(() => !!self.stats && !!self.regionCannotBeRenderedText);
|
|
13
13
|
const { offsetPx } = (0, util_1.getContainingView)(self);
|
|
14
|
-
return (
|
|
15
|
-
react_1.default.createElement("g", null, await superRenderSvg(opts)),
|
|
16
|
-
react_1.default.createElement("g", { transform: `translate(${Math.max(-offsetPx, 0)})` },
|
|
17
|
-
react_1.default.createElement(YScaleBars_1.default, { model: self, orientation: "left", exportSVG: true }))));
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: (0, jsx_runtime_1.jsx)(YScaleBars_1.default, { model: self, orientation: "left", exportSVG: true }) })] }));
|
|
18
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function randomColor(str: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.randomColor = randomColor;
|
|
4
|
+
function randomColor(str) {
|
|
5
|
+
let sum = 0;
|
|
6
|
+
for (let i = 0; i < str.length; i++) {
|
|
7
|
+
sum += str.charCodeAt(i);
|
|
8
|
+
}
|
|
9
|
+
return `hsl(${sum * 10}, 20%, 50%)`;
|
|
10
|
+
}
|
|
@@ -1,11 +1,43 @@
|
|
|
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 () {
|
|
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
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
const util_1 = require("@jbrowse/core/util");
|
|
7
40
|
const WiggleBaseRenderer_1 = __importDefault(require("../WiggleBaseRenderer"));
|
|
8
|
-
const drawLine_1 = require("../drawLine");
|
|
9
41
|
class MultiRowLineRenderer extends WiggleBaseRenderer_1.default {
|
|
10
42
|
async draw(ctx, props) {
|
|
11
43
|
const { bpPerPx, sources, regions, features } = props;
|
|
@@ -13,10 +45,11 @@ class MultiRowLineRenderer extends WiggleBaseRenderer_1.default {
|
|
|
13
45
|
const groups = (0, util_1.groupBy)(features.values(), f => f.get('source'));
|
|
14
46
|
const height = props.height / sources.length;
|
|
15
47
|
const width = (region.end - region.start) / bpPerPx;
|
|
48
|
+
const { drawLine } = await Promise.resolve().then(() => __importStar(require('../drawLine')));
|
|
16
49
|
let feats = [];
|
|
17
50
|
ctx.save();
|
|
18
51
|
sources.forEach(source => {
|
|
19
|
-
const { reducedFeatures } =
|
|
52
|
+
const { reducedFeatures } = drawLine(ctx, {
|
|
20
53
|
...props,
|
|
21
54
|
features: groups[source.name] || [],
|
|
22
55
|
height,
|