@jbrowse/plugin-wiggle 2.6.2 → 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/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +0 -1
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js +0 -3
- package/dist/MultiDensityRenderer/MultiDensityRenderer.js +1 -1
- package/dist/MultiLinearWiggleDisplay/components/ColorLegend.d.ts +9 -0
- package/dist/MultiLinearWiggleDisplay/components/ColorLegend.js +28 -0
- package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +3 -4
- package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.js +3 -3
- package/dist/MultiLinearWiggleDisplay/components/RectBg.d.ts +9 -0
- package/dist/MultiLinearWiggleDisplay/components/RectBg.js +11 -0
- package/dist/MultiLinearWiggleDisplay/components/ScoreLegend.d.ts +6 -0
- package/dist/MultiLinearWiggleDisplay/components/ScoreLegend.js +22 -0
- 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 -8
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +4 -92
- package/dist/MultiLinearWiggleDisplay/components/YScaleBars.d.ts +8 -0
- package/dist/MultiLinearWiggleDisplay/components/YScaleBars.js +53 -0
- package/dist/MultiLinearWiggleDisplay/components/util.d.ts +2 -0
- package/dist/MultiLinearWiggleDisplay/components/util.js +16 -5
- package/dist/MultiLinearWiggleDisplay/models/renderSvg.js +2 -2
- package/dist/MultiRowLineRenderer/MultiRowLineRenderer.js +1 -1
- package/dist/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +1 -26
- 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/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +0 -1
- package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.js +0 -1
- package/esm/MultiDensityRenderer/MultiDensityRenderer.js +1 -1
- package/esm/MultiLinearWiggleDisplay/components/ColorLegend.d.ts +9 -0
- package/esm/MultiLinearWiggleDisplay/components/ColorLegend.js +23 -0
- package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +3 -4
- package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.js +3 -3
- package/esm/MultiLinearWiggleDisplay/components/RectBg.d.ts +9 -0
- package/esm/MultiLinearWiggleDisplay/components/RectBg.js +6 -0
- package/esm/MultiLinearWiggleDisplay/components/ScoreLegend.d.ts +6 -0
- package/esm/MultiLinearWiggleDisplay/components/ScoreLegend.js +17 -0
- 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 -8
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.js +5 -91
- package/esm/MultiLinearWiggleDisplay/components/YScaleBars.d.ts +8 -0
- package/esm/MultiLinearWiggleDisplay/components/YScaleBars.js +47 -0
- package/esm/MultiLinearWiggleDisplay/components/util.d.ts +2 -0
- package/esm/MultiLinearWiggleDisplay/components/util.js +14 -4
- package/esm/MultiLinearWiggleDisplay/models/renderSvg.js +2 -2
- package/esm/MultiRowLineRenderer/MultiRowLineRenderer.js +1 -1
- package/esm/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +1 -3
- 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
|
@@ -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;
|
|
@@ -23,17 +23,20 @@ export default function (pm) {
|
|
|
23
23
|
];
|
|
24
24
|
const now = +Date.now();
|
|
25
25
|
const trackId = `multitrack-${now}-sessionTrack`;
|
|
26
|
-
getSession(model)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
const session = getSession(model);
|
|
27
|
+
if (isSessionWithAddTracks(session)) {
|
|
28
|
+
session.addTrackConf({
|
|
29
|
+
type: 'MultiQuantitativeTrack',
|
|
30
|
+
trackId,
|
|
31
|
+
name: arg.name,
|
|
32
|
+
assemblyNames,
|
|
33
|
+
adapter: {
|
|
34
|
+
type: 'MultiWiggleAdapter',
|
|
35
|
+
subadapters,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
model.view.showTrack(trackId);
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
getSession(model).queueDialog(handleClose => [
|
|
39
42
|
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;
|
|
@@ -3,7 +3,7 @@ import { observer } from 'mobx-react';
|
|
|
3
3
|
import { Button, DialogContent, DialogActions, FormControlLabel, Radio, Typography, } from '@mui/material';
|
|
4
4
|
import { Dialog } from '@jbrowse/core/ui';
|
|
5
5
|
import { ColorPicker } from '@jbrowse/core/ui/ColorPicker';
|
|
6
|
-
function SetColorDialog({ model, handleClose, }) {
|
|
6
|
+
const SetColorDialog = observer(function SetColorDialog({ model, handleClose, }) {
|
|
7
7
|
const [posneg, setPosNeg] = useState(false);
|
|
8
8
|
return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Set color" },
|
|
9
9
|
React.createElement(DialogContent, null,
|
|
@@ -30,5 +30,5 @@ function SetColorDialog({ model, handleClose, }) {
|
|
|
30
30
|
model.setColor(undefined);
|
|
31
31
|
}, color: "secondary", variant: "contained" }, "Restore default"),
|
|
32
32
|
React.createElement(Button, { variant: "contained", color: "primary", type: "submit", onClick: () => handleClose() }, "Submit"))));
|
|
33
|
-
}
|
|
34
|
-
export default
|
|
33
|
+
});
|
|
34
|
+
export default SetColorDialog;
|
|
@@ -4,7 +4,7 @@ import { observer } from 'mobx-react';
|
|
|
4
4
|
import Tooltip from '../../Tooltip';
|
|
5
5
|
import { toP } from '../../util';
|
|
6
6
|
const en = (n) => n.toLocaleString('en-US');
|
|
7
|
-
const TooltipContents = React.forwardRef(function ({ feature }, ref) {
|
|
7
|
+
const TooltipContents = React.forwardRef(function TooltipContents2({ feature }, ref) {
|
|
8
8
|
const start = feature.get('start');
|
|
9
9
|
const end = feature.get('end');
|
|
10
10
|
const name = feature.get('refName');
|
|
@@ -7,7 +7,7 @@ export default class MultiXYPlotRenderer extends WiggleBaseRenderer {
|
|
|
7
7
|
const { bpPerPx, sources, regions, features } = props;
|
|
8
8
|
const [region] = regions;
|
|
9
9
|
const groups = groupBy([...features.values()], f => f.get('source'));
|
|
10
|
-
const height = props.height /
|
|
10
|
+
const height = props.height / sources.length;
|
|
11
11
|
const width = (region.end - region.start) / bpPerPx;
|
|
12
12
|
let feats = [];
|
|
13
13
|
ctx.save();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WiggleDisplayModel } from '../models/model';
|
|
3
|
+
declare const ColorLegend: ({ model, rowHeight, labelWidth, exportSVG, }: {
|
|
4
|
+
model: WiggleDisplayModel;
|
|
5
|
+
rowHeight: number;
|
|
6
|
+
labelWidth: number;
|
|
7
|
+
exportSVG?: boolean | undefined;
|
|
8
|
+
}) => React.JSX.Element | null;
|
|
9
|
+
export default ColorLegend;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import RectBg from './RectBg';
|
|
4
|
+
const ColorLegend = observer(function ({ model, rowHeight, labelWidth, exportSVG, }) {
|
|
5
|
+
const { needsCustomLegend, needsScalebar, needsFullHeightScalebar, rowHeightTooSmallForScalebar, renderColorBoxes, sources, } = model;
|
|
6
|
+
const svgFontSize = Math.min(rowHeight, 12);
|
|
7
|
+
const canDisplayLabel = rowHeight > 11;
|
|
8
|
+
const colorBoxWidth = renderColorBoxes ? 15 : 0;
|
|
9
|
+
const legendWidth = labelWidth + colorBoxWidth + 5;
|
|
10
|
+
const svgOffset = exportSVG ? 10 : 0;
|
|
11
|
+
const extraOffset = svgOffset || (needsScalebar && !rowHeightTooSmallForScalebar ? 50 : 0);
|
|
12
|
+
return sources ? (React.createElement(React.Fragment, null,
|
|
13
|
+
/* 0.25 for hanging letters like g */
|
|
14
|
+
needsFullHeightScalebar ? (React.createElement(RectBg, { y: 0, x: extraOffset, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null,
|
|
15
|
+
sources.map((source, idx) => {
|
|
16
|
+
const boxHeight = Math.min(20, rowHeight);
|
|
17
|
+
return (React.createElement(React.Fragment, { key: `${source.name}-${idx}` },
|
|
18
|
+
needsFullHeightScalebar ? null : (React.createElement(RectBg, { y: idx * rowHeight + 1, x: extraOffset, width: legendWidth, height: boxHeight })),
|
|
19
|
+
source.color ? (React.createElement(RectBg, { y: idx * rowHeight + 1, x: extraOffset, width: colorBoxWidth, height: needsCustomLegend ? rowHeight : boxHeight, color: source.color })) : null,
|
|
20
|
+
canDisplayLabel ? (React.createElement("text", { y: idx * rowHeight + 13, x: extraOffset + colorBoxWidth + 2, fontSize: svgFontSize }, source.name)) : null));
|
|
21
|
+
}))) : null;
|
|
22
|
+
});
|
|
23
|
+
export default ColorLegend;
|
|
@@ -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;
|
|
@@ -18,7 +18,7 @@ function PaperComponent(props) {
|
|
|
18
18
|
return (React.createElement(Draggable, { handle: "#draggable-dialog-title", cancel: '[class*="MuiDialogContent-root"]' },
|
|
19
19
|
React.createElement(Paper, { ...props })));
|
|
20
20
|
}
|
|
21
|
-
function DraggableDialog(props) {
|
|
21
|
+
const DraggableDialog = observer(function DraggableDialog(props) {
|
|
22
22
|
const { classes } = useStyles();
|
|
23
23
|
const { title, children, onClose } = props;
|
|
24
24
|
return (React.createElement(Dialog, { ...props, PaperComponent: PaperComponent, "aria-labelledby": "draggable-dialog-title" // this area is important for the draggable functionality
|
|
@@ -33,5 +33,5 @@ function DraggableDialog(props) {
|
|
|
33
33
|
React.createElement(CloseIcon, null))) : null),
|
|
34
34
|
React.createElement(Divider, null),
|
|
35
35
|
children)));
|
|
36
|
-
}
|
|
37
|
-
export default
|
|
36
|
+
});
|
|
37
|
+
export default DraggableDialog;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { measureText, getContainingView } from '@jbrowse/core/util';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import RectBg from './RectBg';
|
|
5
|
+
const ScoreLegend = observer(({ model }) => {
|
|
6
|
+
const { ticks, scaleType } = model;
|
|
7
|
+
const { width } = getContainingView(model);
|
|
8
|
+
const legend = `[${ticks === null || ticks === void 0 ? void 0 : ticks.values[0]}-${ticks === null || ticks === void 0 ? void 0 : ticks.values[1]}]` +
|
|
9
|
+
(scaleType === 'log' ? ' (log scale)' : '');
|
|
10
|
+
const len = measureText(legend, 14);
|
|
11
|
+
const padding = 25;
|
|
12
|
+
const xpos = width - len - padding;
|
|
13
|
+
return (React.createElement(React.Fragment, null,
|
|
14
|
+
React.createElement(RectBg, { y: 0, x: xpos, width: len + 6, height: 16 }),
|
|
15
|
+
React.createElement("text", { y: 13, x: xpos }, legend)));
|
|
16
|
+
});
|
|
17
|
+
export default ScoreLegend;
|
|
@@ -18,6 +18,11 @@ const useStyles = makeStyles()({
|
|
|
18
18
|
content: {
|
|
19
19
|
minWidth: 800,
|
|
20
20
|
},
|
|
21
|
+
cell: {
|
|
22
|
+
whiteSpace: 'nowrap',
|
|
23
|
+
overflow: 'hidden',
|
|
24
|
+
textOverflow: 'ellipsis',
|
|
25
|
+
},
|
|
21
26
|
});
|
|
22
27
|
export default function SetColorDialog({ model, handleClose, }) {
|
|
23
28
|
const { classes } = useStyles();
|
|
@@ -54,6 +59,7 @@ export default function SetColorDialog({ model, handleClose, }) {
|
|
|
54
59
|
} }, "Submit"))));
|
|
55
60
|
}
|
|
56
61
|
function SourcesGrid({ rows, onChange, showTips, }) {
|
|
62
|
+
const { classes } = useStyles();
|
|
57
63
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
58
64
|
const [selected, setSelected] = useState([]);
|
|
59
65
|
// @ts-expect-error
|
|
@@ -114,7 +120,7 @@ function SourcesGrid({ rows, onChange, showTips, }) {
|
|
|
114
120
|
sortingOrder: [null],
|
|
115
121
|
renderCell: (params) => {
|
|
116
122
|
const { value } = params;
|
|
117
|
-
return isUriLocation(value) ? (React.createElement(UriLink, { value: value })) : (getStr(value));
|
|
123
|
+
return (React.createElement("div", { className: classes.cell }, isUriLocation(value) ? (React.createElement(UriLink, { value: value })) : (React.createElement(React.Fragment, null, getStr(value)))));
|
|
118
124
|
},
|
|
119
125
|
// @ts-ignore
|
|
120
126
|
width: 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: {
|
|
@@ -4,7 +4,7 @@ import { observer } from 'mobx-react';
|
|
|
4
4
|
import { toP } from '../../util';
|
|
5
5
|
import Tooltip from '../../Tooltip';
|
|
6
6
|
const en = (n) => n.toLocaleString('en-US');
|
|
7
|
-
const TooltipContents = React.forwardRef(({ model, feature }, ref)
|
|
7
|
+
const TooltipContents = React.forwardRef(function TooltipContents2({ model, feature }, ref) {
|
|
8
8
|
const start = feature.get('start');
|
|
9
9
|
const end = feature.get('end');
|
|
10
10
|
const refName = feature.get('refName');
|