@jbrowse/plugin-wiggle 2.6.3 → 2.7.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/CreateMultiWiggleExtension/index.js +14 -11
- package/dist/LinearWiggleDisplay/components/SetColorDialog.d.ts +6 -7
- package/dist/LinearWiggleDisplay/components/SetColorDialog.js +3 -3
- package/dist/LinearWiggleDisplay/components/Tooltip.js +1 -1
- package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +3 -4
- package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.js +3 -3
- package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.js +7 -1
- package/dist/MultiLinearWiggleDisplay/components/Tooltip.d.ts +3 -2
- package/dist/MultiLinearWiggleDisplay/components/Tooltip.js +1 -1
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +2 -3
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +2 -4
- package/dist/MultiLinearWiggleDisplay/components/util.js +2 -4
- package/dist/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +0 -25
- package/dist/MultiWiggleAddTrackWidget/AddTrackWorkflow.js +16 -12
- package/dist/MultiWiggleRendering.d.ts +3 -4
- package/dist/MultiWiggleRendering.js +7 -5
- package/dist/MultiXYPlotRenderer/MultiXYPlotRenderer.js +0 -25
- package/dist/Tooltip.d.ts +5 -6
- package/dist/Tooltip.js +3 -3
- package/dist/WiggleRendering.d.ts +3 -4
- package/dist/WiggleRendering.js +3 -3
- package/dist/XYPlotRenderer/XYPlotRenderer.js +0 -25
- package/dist/drawxy.d.ts +0 -1
- package/dist/drawxy.js +17 -6
- package/dist/shared/YScaleBar.d.ts +2 -2
- package/dist/shared/YScaleBar.js +2 -1
- package/dist/shared/modelShared.d.ts +4 -1
- package/esm/CreateMultiWiggleExtension/index.js +14 -11
- package/esm/LinearWiggleDisplay/components/SetColorDialog.d.ts +6 -7
- package/esm/LinearWiggleDisplay/components/SetColorDialog.js +3 -3
- package/esm/LinearWiggleDisplay/components/Tooltip.js +1 -1
- package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +3 -4
- package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.js +3 -3
- package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.js +7 -1
- package/esm/MultiLinearWiggleDisplay/components/Tooltip.d.ts +3 -2
- package/esm/MultiLinearWiggleDisplay/components/Tooltip.js +1 -1
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +2 -3
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +2 -2
- package/esm/MultiLinearWiggleDisplay/components/util.js +2 -4
- package/esm/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +0 -2
- package/esm/MultiWiggleAddTrackWidget/AddTrackWorkflow.js +17 -13
- package/esm/MultiWiggleRendering.d.ts +3 -4
- package/esm/MultiWiggleRendering.js +7 -5
- package/esm/MultiXYPlotRenderer/MultiXYPlotRenderer.js +0 -2
- package/esm/Tooltip.d.ts +5 -6
- package/esm/Tooltip.js +3 -3
- package/esm/WiggleRendering.d.ts +3 -4
- package/esm/WiggleRendering.js +3 -3
- package/esm/XYPlotRenderer/XYPlotRenderer.js +0 -2
- package/esm/drawxy.d.ts +0 -1
- package/esm/drawxy.js +17 -6
- package/esm/shared/YScaleBar.d.ts +2 -2
- package/esm/shared/YScaleBar.js +2 -1
- package/esm/shared/modelShared.d.ts +4 -1
- package/package.json +3 -4
|
@@ -48,17 +48,20 @@ function default_1(pm) {
|
|
|
48
48
|
];
|
|
49
49
|
const now = +Date.now();
|
|
50
50
|
const trackId = `multitrack-${now}-sessionTrack`;
|
|
51
|
-
(0, util_1.getSession)(model)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
const session = (0, util_1.getSession)(model);
|
|
52
|
+
if ((0, util_1.isSessionWithAddTracks)(session)) {
|
|
53
|
+
session.addTrackConf({
|
|
54
|
+
type: 'MultiQuantitativeTrack',
|
|
55
|
+
trackId,
|
|
56
|
+
name: arg.name,
|
|
57
|
+
assemblyNames,
|
|
58
|
+
adapter: {
|
|
59
|
+
type: 'MultiWiggleAdapter',
|
|
60
|
+
subadapters,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
model.view.showTrack(trackId);
|
|
64
|
+
}
|
|
62
65
|
}
|
|
63
66
|
(0, util_1.getSession)(model).queueDialog(handleClose => [
|
|
64
67
|
ConfirmDialog,
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare const SetColorDialog: ({ model, handleClose, }: {
|
|
3
3
|
model: {
|
|
4
|
-
color?: string;
|
|
5
|
-
posColor?: string;
|
|
6
|
-
negColor?: string;
|
|
4
|
+
color?: string | undefined;
|
|
5
|
+
posColor?: string | undefined;
|
|
6
|
+
negColor?: string | undefined;
|
|
7
7
|
setColor: (arg?: string) => void;
|
|
8
8
|
setPosColor: (arg?: string) => void;
|
|
9
9
|
setNegColor: (arg?: string) => void;
|
|
10
10
|
};
|
|
11
11
|
handleClose: () => void;
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
export default _default;
|
|
12
|
+
}) => React.JSX.Element;
|
|
13
|
+
export default SetColorDialog;
|
|
@@ -28,7 +28,7 @@ const mobx_react_1 = require("mobx-react");
|
|
|
28
28
|
const material_1 = require("@mui/material");
|
|
29
29
|
const ui_1 = require("@jbrowse/core/ui");
|
|
30
30
|
const ColorPicker_1 = require("@jbrowse/core/ui/ColorPicker");
|
|
31
|
-
function SetColorDialog({ model, handleClose, }) {
|
|
31
|
+
const SetColorDialog = (0, mobx_react_1.observer)(function SetColorDialog({ model, handleClose, }) {
|
|
32
32
|
const [posneg, setPosNeg] = (0, react_1.useState)(false);
|
|
33
33
|
return (react_1.default.createElement(ui_1.Dialog, { open: true, onClose: handleClose, title: "Set color" },
|
|
34
34
|
react_1.default.createElement(material_1.DialogContent, null,
|
|
@@ -55,5 +55,5 @@ function SetColorDialog({ model, handleClose, }) {
|
|
|
55
55
|
model.setColor(undefined);
|
|
56
56
|
}, color: "secondary", variant: "contained" }, "Restore default"),
|
|
57
57
|
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", type: "submit", onClick: () => handleClose() }, "Submit"))));
|
|
58
|
-
}
|
|
59
|
-
exports.default =
|
|
58
|
+
});
|
|
59
|
+
exports.default = SetColorDialog;
|
|
@@ -10,7 +10,7 @@ const mobx_react_1 = require("mobx-react");
|
|
|
10
10
|
const Tooltip_1 = __importDefault(require("../../Tooltip"));
|
|
11
11
|
const util_1 = require("../../util");
|
|
12
12
|
const en = (n) => n.toLocaleString('en-US');
|
|
13
|
-
const TooltipContents = react_1.default.forwardRef(function ({ feature }, ref) {
|
|
13
|
+
const TooltipContents = react_1.default.forwardRef(function TooltipContents2({ feature }, ref) {
|
|
14
14
|
const start = feature.get('start');
|
|
15
15
|
const end = feature.get('end');
|
|
16
16
|
const name = feature.get('refName');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DialogProps } from '@mui/material';
|
|
3
|
-
declare
|
|
3
|
+
declare const DraggableDialog: (props: DialogProps & {
|
|
4
4
|
title: string;
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
export default _default;
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
export default DraggableDialog;
|
|
@@ -23,7 +23,7 @@ function PaperComponent(props) {
|
|
|
23
23
|
return (react_1.default.createElement(react_draggable_1.default, { handle: "#draggable-dialog-title", cancel: '[class*="MuiDialogContent-root"]' },
|
|
24
24
|
react_1.default.createElement(material_1.Paper, { ...props })));
|
|
25
25
|
}
|
|
26
|
-
function DraggableDialog(props) {
|
|
26
|
+
const DraggableDialog = (0, mobx_react_1.observer)(function DraggableDialog(props) {
|
|
27
27
|
const { classes } = useStyles();
|
|
28
28
|
const { title, children, onClose } = props;
|
|
29
29
|
return (react_1.default.createElement(material_1.Dialog, { ...props, PaperComponent: PaperComponent, "aria-labelledby": "draggable-dialog-title" // this area is important for the draggable functionality
|
|
@@ -38,5 +38,5 @@ function DraggableDialog(props) {
|
|
|
38
38
|
react_1.default.createElement(Close_1.default, null))) : null),
|
|
39
39
|
react_1.default.createElement(material_1.Divider, null),
|
|
40
40
|
children)));
|
|
41
|
-
}
|
|
42
|
-
exports.default =
|
|
41
|
+
});
|
|
42
|
+
exports.default = DraggableDialog;
|
|
@@ -46,6 +46,11 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
46
46
|
content: {
|
|
47
47
|
minWidth: 800,
|
|
48
48
|
},
|
|
49
|
+
cell: {
|
|
50
|
+
whiteSpace: 'nowrap',
|
|
51
|
+
overflow: 'hidden',
|
|
52
|
+
textOverflow: 'ellipsis',
|
|
53
|
+
},
|
|
49
54
|
});
|
|
50
55
|
function SetColorDialog({ model, handleClose, }) {
|
|
51
56
|
const { classes } = useStyles();
|
|
@@ -83,6 +88,7 @@ function SetColorDialog({ model, handleClose, }) {
|
|
|
83
88
|
}
|
|
84
89
|
exports.default = SetColorDialog;
|
|
85
90
|
function SourcesGrid({ rows, onChange, showTips, }) {
|
|
91
|
+
const { classes } = useStyles();
|
|
86
92
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
87
93
|
const [selected, setSelected] = (0, react_1.useState)([]);
|
|
88
94
|
// @ts-expect-error
|
|
@@ -143,7 +149,7 @@ function SourcesGrid({ rows, onChange, showTips, }) {
|
|
|
143
149
|
sortingOrder: [null],
|
|
144
150
|
renderCell: (params) => {
|
|
145
151
|
const { value } = params;
|
|
146
|
-
return (0, util_1.isUriLocation)(value) ? (react_1.default.createElement(UriLink_1.default, { value: value })) : ((0, util_1.getStr)(value));
|
|
152
|
+
return (react_1.default.createElement("div", { className: classes.cell }, (0, util_1.isUriLocation)(value) ? (react_1.default.createElement(UriLink_1.default, { value: value })) : (react_1.default.createElement(react_1.default.Fragment, null, (0, util_1.getStr)(value)))));
|
|
147
153
|
},
|
|
148
154
|
// @ts-ignore
|
|
149
155
|
width: (0, util_1.measureGridWidth)(rows.map(r => r[val])),
|
|
@@ -2,12 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { Feature } from '@jbrowse/core/util';
|
|
3
3
|
import { Source } from '../../util';
|
|
4
4
|
import { TooltipContentsComponent } from '../../Tooltip';
|
|
5
|
-
|
|
5
|
+
interface Props {
|
|
6
6
|
model: {
|
|
7
7
|
sources: Source[];
|
|
8
8
|
};
|
|
9
9
|
feature: Feature;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
declare const TooltipContents: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
11
12
|
type Coord = [number, number];
|
|
12
13
|
declare const WiggleTooltip: (props: {
|
|
13
14
|
model: {
|
|
@@ -10,7 +10,7 @@ const mobx_react_1 = require("mobx-react");
|
|
|
10
10
|
const util_1 = require("../../util");
|
|
11
11
|
const Tooltip_1 = __importDefault(require("../../Tooltip"));
|
|
12
12
|
const en = (n) => n.toLocaleString('en-US');
|
|
13
|
-
const TooltipContents = react_1.default.forwardRef(({ model, feature }, ref)
|
|
13
|
+
const TooltipContents = react_1.default.forwardRef(function TooltipContents2({ model, feature }, ref) {
|
|
14
14
|
const start = feature.get('start');
|
|
15
15
|
const end = feature.get('end');
|
|
16
16
|
const refName = feature.get('refName');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WiggleDisplayModel } from '../models/model';
|
|
3
|
-
declare const
|
|
3
|
+
declare const MultiLinearWiggleDisplayComponent: (props: {
|
|
4
4
|
model: WiggleDisplayModel;
|
|
5
5
|
}) => React.JSX.Element;
|
|
6
|
-
export default
|
|
7
|
-
export { default as YScaleBar } from '../../shared/YScaleBar';
|
|
6
|
+
export default MultiLinearWiggleDisplayComponent;
|
|
@@ -3,16 +3,14 @@ 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
|
-
exports.YScaleBar = void 0;
|
|
7
6
|
const react_1 = __importDefault(require("react"));
|
|
8
7
|
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
9
8
|
const mobx_react_1 = require("mobx-react");
|
|
10
9
|
const YScaleBars_1 = __importDefault(require("./YScaleBars"));
|
|
11
|
-
|
|
10
|
+
const MultiLinearWiggleDisplayComponent = (0, mobx_react_1.observer)((props) => {
|
|
12
11
|
const { model } = props;
|
|
13
12
|
return (react_1.default.createElement("div", null,
|
|
14
13
|
react_1.default.createElement(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }),
|
|
15
14
|
react_1.default.createElement(YScaleBars_1.default, { model: model })));
|
|
16
15
|
});
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(exports, "YScaleBar", { enumerable: true, get: function () { return __importDefault(YScaleBar_1).default; } });
|
|
16
|
+
exports.default = MultiLinearWiggleDisplayComponent;
|
|
@@ -8,8 +8,7 @@ function moveUp(arr, sel, by = 1) {
|
|
|
8
8
|
.map(l => arr.findIndex(v => v.name === l))
|
|
9
9
|
.sort((a, b) => a - b);
|
|
10
10
|
let lastIdx = 0;
|
|
11
|
-
for (
|
|
12
|
-
const old = idxs[i];
|
|
11
|
+
for (const old of idxs) {
|
|
13
12
|
const idx = Math.max(lastIdx, old - by);
|
|
14
13
|
if (idx >= lastIdx) {
|
|
15
14
|
arr.splice(idx, 0, arr.splice(old, 1)[0]);
|
|
@@ -24,8 +23,7 @@ function moveDown(arr, sel, by = 1) {
|
|
|
24
23
|
.map(l => arr.findIndex(v => v.name === l))
|
|
25
24
|
.sort((a, b) => b - a);
|
|
26
25
|
let lastIdx = arr.length - 1;
|
|
27
|
-
for (
|
|
28
|
-
const old = idxs[i];
|
|
26
|
+
for (const old of idxs) {
|
|
29
27
|
const idx = Math.min(lastIdx, old + by);
|
|
30
28
|
if (idx <= lastIdx) {
|
|
31
29
|
arr.splice(idx, 0, arr.splice(old, 1)[0]);
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -37,7 +14,6 @@ class MultiXYPlotRenderer extends WiggleBaseRenderer_1.default {
|
|
|
37
14
|
const groups = (0, util_1.groupBy)([...features.values()], f => f.get('source'));
|
|
38
15
|
const height = props.height / sources.length;
|
|
39
16
|
const width = (region.end - region.start) / bpPerPx;
|
|
40
|
-
const Color = await Promise.resolve().then(() => __importStar(require('color'))).then(f => f.default);
|
|
41
17
|
let feats = [];
|
|
42
18
|
ctx.save();
|
|
43
19
|
sources.forEach(source => {
|
|
@@ -50,7 +26,6 @@ class MultiXYPlotRenderer extends WiggleBaseRenderer_1.default {
|
|
|
50
26
|
features,
|
|
51
27
|
height,
|
|
52
28
|
colorCallback: () => source.color || 'blue',
|
|
53
|
-
Color,
|
|
54
29
|
});
|
|
55
30
|
ctx.strokeStyle = 'rgba(200,200,200,0.8)';
|
|
56
31
|
ctx.beginPath();
|
|
@@ -85,19 +85,23 @@ function MultiWiggleWidget({ model }) {
|
|
|
85
85
|
const obj = typeof bigWigs[0] === 'string'
|
|
86
86
|
? { bigWigs }
|
|
87
87
|
: { subadapters: bigWigs };
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
if ((0, util_1.isSessionWithAddTracks)(session)) {
|
|
89
|
+
session.addTrackConf({
|
|
90
|
+
trackId,
|
|
91
|
+
type: 'MultiQuantitativeTrack',
|
|
92
|
+
name: trackName,
|
|
93
|
+
assemblyNames: [model.assembly],
|
|
94
|
+
adapter: {
|
|
95
|
+
type: 'MultiWiggleAdapter',
|
|
96
|
+
...obj,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
(_a = model.view) === null || _a === void 0 ? void 0 : _a.showTrack(trackId);
|
|
100
|
+
}
|
|
99
101
|
model.clearData();
|
|
100
|
-
|
|
102
|
+
if ((0, util_1.isSessionModelWithWidgets)(session)) {
|
|
103
|
+
session.hideWidget(model);
|
|
104
|
+
}
|
|
101
105
|
} }, "Submit"),
|
|
102
106
|
react_1.default.createElement("p", null, "Additional notes: "),
|
|
103
107
|
react_1.default.createElement("ul", null,
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Region } from '@jbrowse/core/util/types';
|
|
3
3
|
import { Feature } from '@jbrowse/core/util';
|
|
4
4
|
import { Source } from './util';
|
|
5
|
-
declare
|
|
5
|
+
declare const MultiWiggleRendering: (props: {
|
|
6
6
|
regions: Region[];
|
|
7
7
|
features: Map<string, Feature>;
|
|
8
8
|
bpPerPx: number;
|
|
@@ -16,6 +16,5 @@ declare function WiggleRendering(props: {
|
|
|
16
16
|
displayModel: {
|
|
17
17
|
isMultiRow: boolean;
|
|
18
18
|
};
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
export default _default;
|
|
19
|
+
}) => React.JSX.Element;
|
|
20
|
+
export default MultiWiggleRendering;
|
|
@@ -27,7 +27,7 @@ const mobx_react_1 = require("mobx-react");
|
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const util_1 = require("@jbrowse/core/util");
|
|
29
29
|
const ui_1 = require("@jbrowse/core/ui");
|
|
30
|
-
function
|
|
30
|
+
const MultiWiggleRendering = (0, mobx_react_1.observer)(function (props) {
|
|
31
31
|
const { regions, features, bpPerPx, width, height, sources, onMouseLeave = () => { }, onMouseMove = () => { }, onFeatureClick = () => { }, displayModel, } = props;
|
|
32
32
|
const [region] = regions;
|
|
33
33
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -84,10 +84,12 @@ function WiggleRendering(props) {
|
|
|
84
84
|
return featureUnderMouse;
|
|
85
85
|
}
|
|
86
86
|
return (react_1.default.createElement("div", { ref: ref, onMouseMove: event => {
|
|
87
|
-
const
|
|
87
|
+
const { clientX, clientY } = event;
|
|
88
|
+
const featureUnderMouse = getFeatureUnderMouse(clientX, clientY);
|
|
88
89
|
onMouseMove(event, featureUnderMouse);
|
|
89
90
|
}, onClick: event => {
|
|
90
|
-
const
|
|
91
|
+
const { clientX, clientY } = event;
|
|
92
|
+
const featureUnderMouse = getFeatureUnderMouse(clientX, clientY);
|
|
91
93
|
onFeatureClick(event, featureUnderMouse);
|
|
92
94
|
}, onMouseLeave: event => onMouseLeave(event), style: {
|
|
93
95
|
overflow: 'visible',
|
|
@@ -95,5 +97,5 @@ function WiggleRendering(props) {
|
|
|
95
97
|
height,
|
|
96
98
|
} },
|
|
97
99
|
react_1.default.createElement(ui_1.PrerenderedCanvas, { ...props })));
|
|
98
|
-
}
|
|
99
|
-
exports.default =
|
|
100
|
+
});
|
|
101
|
+
exports.default = MultiWiggleRendering;
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -35,7 +12,6 @@ class MultiXYPlotRenderer extends WiggleBaseRenderer_1.default {
|
|
|
35
12
|
async draw(ctx, props) {
|
|
36
13
|
const { sources, features } = props;
|
|
37
14
|
const groups = (0, util_1.groupBy)([...features.values()], f => f.get('source'));
|
|
38
|
-
const Color = await Promise.resolve().then(() => __importStar(require('color'))).then(f => f.default);
|
|
39
15
|
let feats = [];
|
|
40
16
|
for (const source of sources) {
|
|
41
17
|
const features = groups[source.name];
|
|
@@ -47,7 +23,6 @@ class MultiXYPlotRenderer extends WiggleBaseRenderer_1.default {
|
|
|
47
23
|
features,
|
|
48
24
|
offset: util_2.YSCALEBAR_LABEL_OFFSET,
|
|
49
25
|
colorCallback: () => source.color || 'blue',
|
|
50
|
-
Color,
|
|
51
26
|
});
|
|
52
27
|
feats = [...feats, ...reducedFeatures];
|
|
53
28
|
}
|
package/dist/Tooltip.d.ts
CHANGED
|
@@ -5,16 +5,15 @@ export type TooltipContentsComponent = React.ForwardRefExoticComponent<{
|
|
|
5
5
|
feature: Feature;
|
|
6
6
|
model: any;
|
|
7
7
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
declare
|
|
8
|
+
declare const Tooltip: ({ model, height, clientMouseCoord, offsetMouseCoord, clientRect, TooltipContents, useClientY, }: {
|
|
9
9
|
model: {
|
|
10
10
|
featureUnderMouse: Feature;
|
|
11
11
|
};
|
|
12
|
-
useClientY?: boolean;
|
|
12
|
+
useClientY?: boolean | undefined;
|
|
13
13
|
height: number;
|
|
14
14
|
clientMouseCoord: Coord;
|
|
15
15
|
offsetMouseCoord: Coord;
|
|
16
|
-
clientRect?: DOMRect;
|
|
16
|
+
clientRect?: DOMRect | undefined;
|
|
17
17
|
TooltipContents: TooltipContentsComponent;
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
export default _default;
|
|
18
|
+
}) => React.JSX.Element | null;
|
|
19
|
+
export default Tooltip;
|
package/dist/Tooltip.js
CHANGED
|
@@ -57,7 +57,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
57
57
|
pointerEvents: 'none',
|
|
58
58
|
},
|
|
59
59
|
}));
|
|
60
|
-
function Tooltip({ model, height, clientMouseCoord, offsetMouseCoord, clientRect, TooltipContents, useClientY, }) {
|
|
60
|
+
const Tooltip = (0, mobx_react_1.observer)(function Tooltip({ model, height, clientMouseCoord, offsetMouseCoord, clientRect, TooltipContents, useClientY, }) {
|
|
61
61
|
const { featureUnderMouse } = model;
|
|
62
62
|
const [width, setWidth] = (0, react_1.useState)(0);
|
|
63
63
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
@@ -91,5 +91,5 @@ function Tooltip({ model, height, clientMouseCoord, offsetMouseCoord, clientRect
|
|
|
91
91
|
left: offsetMouseCoord[0],
|
|
92
92
|
height: height - util_1.YSCALEBAR_LABEL_OFFSET * 2,
|
|
93
93
|
} }))) : null;
|
|
94
|
-
}
|
|
95
|
-
exports.default =
|
|
94
|
+
});
|
|
95
|
+
exports.default = Tooltip;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Region } from '@jbrowse/core/util/types';
|
|
3
3
|
import { Feature } from '@jbrowse/core/util';
|
|
4
|
-
declare
|
|
4
|
+
declare const WiggleRendering: (props: {
|
|
5
5
|
regions: Region[];
|
|
6
6
|
features: Map<string, Feature>;
|
|
7
7
|
bpPerPx: number;
|
|
@@ -11,6 +11,5 @@ declare function WiggleRendering(props: {
|
|
|
11
11
|
onMouseMove: Function;
|
|
12
12
|
onFeatureClick: Function;
|
|
13
13
|
blockKey: string;
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
export default _default;
|
|
14
|
+
}) => React.JSX.Element;
|
|
15
|
+
export default WiggleRendering;
|
package/dist/WiggleRendering.js
CHANGED
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
const mobx_react_1 = require("mobx-react");
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const ui_1 = require("@jbrowse/core/ui");
|
|
29
|
-
|
|
29
|
+
const WiggleRendering = (0, mobx_react_1.observer)(function (props) {
|
|
30
30
|
const { regions, features, bpPerPx, width, height, onMouseLeave = () => { }, onMouseMove = () => { }, onFeatureClick = () => { }, } = props;
|
|
31
31
|
const [region] = regions;
|
|
32
32
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -56,5 +56,5 @@ function WiggleRendering(props) {
|
|
|
56
56
|
height,
|
|
57
57
|
} },
|
|
58
58
|
react_1.default.createElement(ui_1.PrerenderedCanvas, { ...props })));
|
|
59
|
-
}
|
|
60
|
-
exports.default =
|
|
59
|
+
});
|
|
60
|
+
exports.default = WiggleRendering;
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -39,7 +16,6 @@ class XYPlotRenderer extends WiggleBaseRenderer_1.default {
|
|
|
39
16
|
const pivotValue = (0, configuration_1.readConfObject)(config, 'bicolorPivotValue');
|
|
40
17
|
const negColor = (0, configuration_1.readConfObject)(config, 'negColor');
|
|
41
18
|
const posColor = (0, configuration_1.readConfObject)(config, 'posColor');
|
|
42
|
-
const Color = await Promise.resolve().then(() => __importStar(require('color'))).then(f => f.default);
|
|
43
19
|
return (0, drawxy_1.drawXY)(ctx, {
|
|
44
20
|
...props,
|
|
45
21
|
colorCallback: (0, configuration_1.readConfObject)(config, 'color') === '#f0f'
|
|
@@ -47,7 +23,6 @@ class XYPlotRenderer extends WiggleBaseRenderer_1.default {
|
|
|
47
23
|
: (feature, _score) => (0, configuration_1.readConfObject)(config, 'color', { feature }),
|
|
48
24
|
offset: util_1.YSCALEBAR_LABEL_OFFSET,
|
|
49
25
|
features: [...features.values()],
|
|
50
|
-
Color,
|
|
51
26
|
});
|
|
52
27
|
}
|
|
53
28
|
}
|
package/dist/drawxy.d.ts
CHANGED
package/dist/drawxy.js
CHANGED
|
@@ -2,7 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.drawDensity = exports.drawLine = exports.drawXY = void 0;
|
|
4
4
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
|
+
const colord_1 = require("@jbrowse/core/util/colord");
|
|
5
6
|
const util_1 = require("@jbrowse/core/util");
|
|
7
|
+
function lighten(color, amount) {
|
|
8
|
+
const hslColor = color.toHsl();
|
|
9
|
+
const l = hslColor.l * (1 + amount);
|
|
10
|
+
return (0, colord_1.colord)({ ...hslColor, l: (0, util_1.clamp)(l, 0, 100) });
|
|
11
|
+
}
|
|
12
|
+
function darken(color, amount) {
|
|
13
|
+
const hslColor = color.toHsl();
|
|
14
|
+
const l = hslColor.l * (1 - amount);
|
|
15
|
+
return (0, colord_1.colord)({ ...hslColor, l: (0, util_1.clamp)(l, 0, 100) });
|
|
16
|
+
}
|
|
6
17
|
// locals
|
|
7
18
|
const util_2 = require("./util");
|
|
8
19
|
// avoid drawing negative width features for SVG exports
|
|
@@ -20,10 +31,10 @@ function fillRectCtx(x, y, width, height, ctx, color) {
|
|
|
20
31
|
}
|
|
21
32
|
ctx.fillRect(x, y, width, height);
|
|
22
33
|
}
|
|
23
|
-
const fudgeFactor = 0.
|
|
34
|
+
const fudgeFactor = 0.3;
|
|
24
35
|
const clipHeight = 2;
|
|
25
36
|
function drawXY(ctx, props) {
|
|
26
|
-
const { features, bpPerPx, regions, scaleOpts, height: unadjustedHeight, config, ticks, displayCrossHatches, offset = 0, colorCallback,
|
|
37
|
+
const { features, bpPerPx, regions, scaleOpts, height: unadjustedHeight, config, ticks, displayCrossHatches, offset = 0, colorCallback, } = props;
|
|
27
38
|
const [region] = regions;
|
|
28
39
|
const width = (region.end - region.start) / bpPerPx;
|
|
29
40
|
// the adjusted height takes into account YSCALEBAR_LABEL_OFFSET from the
|
|
@@ -61,7 +72,7 @@ function drawXY(ctx, props) {
|
|
|
61
72
|
? c
|
|
62
73
|
: c === lastCol
|
|
63
74
|
? lastMix
|
|
64
|
-
: (lastMix =
|
|
75
|
+
: (lastMix = lighten((0, colord_1.colord)(c), 0.4).toHex());
|
|
65
76
|
fillRectCtx(leftPx, toY(max), w, getHeight(max), ctx, effectiveC);
|
|
66
77
|
lastCol = c;
|
|
67
78
|
}
|
|
@@ -78,8 +89,8 @@ function drawXY(ctx, props) {
|
|
|
78
89
|
const effectiveC = crossingOrigin && summary
|
|
79
90
|
? c === lastCol
|
|
80
91
|
? lastMix
|
|
81
|
-
: (lastMix =
|
|
82
|
-
.mix(
|
|
92
|
+
: (lastMix = (0, colord_1.colord)(colorCallback(feature, max))
|
|
93
|
+
.mix((0, colord_1.colord)(colorCallback(feature, min)))
|
|
83
94
|
.toString())
|
|
84
95
|
: c;
|
|
85
96
|
const w = Math.max(rightPx - leftPx + fudgeFactor, minSize);
|
|
@@ -104,7 +115,7 @@ function drawXY(ctx, props) {
|
|
|
104
115
|
? c
|
|
105
116
|
: c === lastCol
|
|
106
117
|
? lastMix
|
|
107
|
-
: (lastMix =
|
|
118
|
+
: (lastMix = darken((0, colord_1.colord)(c), 0.4).toHex());
|
|
108
119
|
fillRectCtx(leftPx, toY(min), w, getHeight(min), ctx, effectiveC);
|
|
109
120
|
lastCol = c;
|
|
110
121
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { axisPropsFromTickScale } from 'react-d3-axis-mod';
|
|
3
3
|
type Ticks = ReturnType<typeof axisPropsFromTickScale>;
|
|
4
|
-
declare const
|
|
4
|
+
declare const YScaleBar: ({ model, orientation, }: {
|
|
5
5
|
model: {
|
|
6
6
|
ticks?: Ticks;
|
|
7
7
|
};
|
|
8
8
|
orientation?: string | undefined;
|
|
9
9
|
}) => React.JSX.Element | null;
|
|
10
|
-
export default
|
|
10
|
+
export default YScaleBar;
|
package/dist/shared/YScaleBar.js
CHANGED
|
@@ -7,8 +7,9 @@ const react_1 = __importDefault(require("react"));
|
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
const react_d3_axis_mod_1 = require("react-d3-axis-mod");
|
|
10
|
-
|
|
10
|
+
const YScaleBar = (0, mobx_react_1.observer)(function ({ model, orientation, }) {
|
|
11
11
|
const { ticks } = model;
|
|
12
12
|
const theme = (0, material_1.useTheme)();
|
|
13
13
|
return ticks ? (react_1.default.createElement(react_d3_axis_mod_1.Axis, { ...ticks, shadow: 2, format: (n) => n, style: { orient: orientation === 'left' ? react_d3_axis_mod_1.LEFT : react_d3_axis_mod_1.RIGHT }, bg: theme.palette.background.default, fg: theme.palette.text.primary })) : null;
|
|
14
14
|
});
|
|
15
|
+
exports.default = YScaleBar;
|
|
@@ -247,7 +247,10 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
|
|
|
247
247
|
readonly regionTooLargeReason: string;
|
|
248
248
|
} & {
|
|
249
249
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
250
|
-
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
250
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null; /**
|
|
251
|
+
* #getter
|
|
252
|
+
* subclasses can define these, as snpcoverage track does
|
|
253
|
+
*/
|
|
251
254
|
} & {
|
|
252
255
|
featureIdUnderMouse: string | undefined;
|
|
253
256
|
contextMenuFeature: Feature | undefined;
|