@jbrowse/wiggle-core 5.0.0-beta.11 → 5.0.0-beta.13
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/README.md +21 -7
- package/esm/ResolutionStepper.d.ts +1 -0
- package/esm/ResolutionStepper.js +5 -2
- package/esm/ScoreAxisWidget/RangeFields.d.ts +5 -0
- package/esm/ScoreAxisWidget/RangeFields.js +70 -0
- package/esm/ScoreAxisWidget/ReferenceLines.d.ts +10 -0
- package/esm/ScoreAxisWidget/ReferenceLines.js +53 -0
- package/esm/ScoreAxisWidget/ResetAxisButton.d.ts +6 -0
- package/esm/ScoreAxisWidget/ResetAxisButton.js +20 -0
- package/esm/ScoreAxisWidget/ScoreAxisHeading.d.ts +5 -0
- package/esm/ScoreAxisWidget/ScoreAxisHeading.js +9 -0
- package/esm/ScoreAxisWidget/ScoreAxisWidget.d.ts +5 -0
- package/esm/ScoreAxisWidget/ScoreAxisWidget.js +69 -0
- package/esm/ScoreAxisWidget/Section.d.ts +5 -0
- package/esm/ScoreAxisWidget/Section.js +13 -0
- package/esm/ScoreAxisWidget/ShareAxisWith.d.ts +5 -0
- package/esm/ScoreAxisWidget/ShareAxisWith.js +32 -0
- package/esm/ScoreAxisWidget/constants.d.ts +1 -0
- package/esm/ScoreAxisWidget/constants.js +1 -0
- package/esm/ScoreAxisWidget/index.d.ts +8 -0
- package/esm/ScoreAxisWidget/index.js +22 -0
- package/esm/ScoreAxisWidget/stateModel.d.ts +30 -0
- package/esm/ScoreAxisWidget/stateModel.js +30 -0
- package/esm/ScoreAxisWidget/types.d.ts +10 -0
- package/esm/ScoreAxisWidget/types.js +1 -0
- package/esm/ScoreAxisWidget/writeThrough.d.ts +2 -0
- package/esm/ScoreAxisWidget/writeThrough.js +7 -0
- package/esm/ScorePlotChrome.d.ts +1 -0
- package/esm/ScorePlotChrome.js +3 -3
- package/esm/ScorePlotSvgFrame.d.ts +7 -12
- package/esm/ScorePlotSvgFrame.js +6 -14
- package/esm/ScoreScaleMixin.d.ts +5 -5
- package/esm/ScoreScaleMixin.js +5 -5
- package/esm/autoscale.d.ts +12 -8
- package/esm/autoscale.js +18 -11
- package/esm/chrome.d.ts +0 -1
- package/esm/chrome.js +0 -1
- package/esm/dataTypes.d.ts +0 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +1 -1
- package/esm/scale.js +1 -1
- package/esm/scoreMenuItems.d.ts +14 -28
- package/esm/scoreMenuItems.js +35 -130
- package/esm/valueScaleConfigSchema.d.ts +4 -5
- package/esm/valueScaleConfigSchema.js +21 -19
- package/package.json +8 -7
- package/esm/AutoscaleGroupDialog.d.ts +0 -7
- package/esm/AutoscaleGroupDialog.js +0 -26
- package/esm/SetMinMaxDialog.d.ts +0 -12
- package/esm/SetMinMaxDialog.js +0 -32
- package/esm/SetScoreRulesDialog.d.ts +0 -14
- package/esm/SetScoreRulesDialog.js +0 -45
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/wiggle-core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Score-axis scale, autoscale, config mixins and plot chrome shared by wiggle, Manhattan, mark and coverage displays",
|
|
6
6
|
"keywords": [
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"./chrome": "./esm/chrome.js",
|
|
27
27
|
"./constants": "./esm/constants.js",
|
|
28
28
|
"./normalize": "./esm/normalize.js",
|
|
29
|
-
"./renderingBackendTypes": "./esm/renderingBackendTypes.js"
|
|
29
|
+
"./renderingBackendTypes": "./esm/renderingBackendTypes.js",
|
|
30
|
+
"./scoreAxisWidget": "./esm/ScoreAxisWidget/index.js"
|
|
30
31
|
},
|
|
31
32
|
"files": [
|
|
32
33
|
"esm"
|
|
@@ -35,12 +36,12 @@
|
|
|
35
36
|
"@jbrowse/mobx-state-tree": "^6.7.0",
|
|
36
37
|
"@mui/icons-material": "^9.4.0",
|
|
37
38
|
"@mui/material": "^9.4.0",
|
|
38
|
-
"mobx": "^7.0.
|
|
39
|
+
"mobx": "^7.0.6",
|
|
39
40
|
"mobx-react": "^10.0.2",
|
|
40
|
-
"@jbrowse/core": "^5.0.0-beta.
|
|
41
|
-
"@jbrowse/display-
|
|
42
|
-
"@jbrowse/
|
|
43
|
-
"@jbrowse/
|
|
41
|
+
"@jbrowse/core": "^5.0.0-beta.13",
|
|
42
|
+
"@jbrowse/display-kit": "^5.0.0-beta.13",
|
|
43
|
+
"@jbrowse/render-core": "^5.0.0-beta.13",
|
|
44
|
+
"@jbrowse/display-ui": "^5.0.0-beta.13"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
46
47
|
"react": ">=19.0.0",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AutoscalePeer } from './autoscaleGroup.ts';
|
|
2
|
-
import type { IStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
3
|
-
declare const _default: ({ model, handleClose, }: {
|
|
4
|
-
model: AutoscalePeer & IStateTreeNode;
|
|
5
|
-
handleClose: () => void;
|
|
6
|
-
}) => import("react").JSX.Element;
|
|
7
|
-
export default _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { LabeledCheckbox, SubmitDialog } from '@jbrowse/core/ui';
|
|
4
|
-
import { Typography } from '@mui/material';
|
|
5
|
-
import { observer } from 'mobx-react';
|
|
6
|
-
import { autoscalePeers, autoscaleWith } from './autoscaleGroup.js';
|
|
7
|
-
export default observer(function AutoscaleGroupDialog({ model, handleClose, }) {
|
|
8
|
-
const peers = autoscalePeers(model);
|
|
9
|
-
const group = model.autoscaleGroup;
|
|
10
|
-
const [chosen, setChosen] = useState(() => new Set(group === undefined
|
|
11
|
-
? []
|
|
12
|
-
: peers.map(p => p.display).filter(d => d.autoscaleGroup === group)));
|
|
13
|
-
return (_jsxs(SubmitDialog, { open: true, title: "Autoscale with other tracks", submitText: "Apply", onCancel: handleClose, onSubmit: () => {
|
|
14
|
-
autoscaleWith(model, peers.map(p => p.display), chosen);
|
|
15
|
-
handleClose();
|
|
16
|
-
}, children: [_jsx(Typography, { color: "text.secondary", children: "The tracks ticked here share this track's axis: each end nobody pinned spans all of their data, and follows it as the view moves." }), peers.map(({ display, key, name }) => (_jsx("div", { children: _jsx(LabeledCheckbox, { checked: chosen.has(display), label: name, onChange: checked => {
|
|
17
|
-
const next = new Set(chosen);
|
|
18
|
-
if (checked) {
|
|
19
|
-
next.add(display);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
next.delete(display);
|
|
23
|
-
}
|
|
24
|
-
setChosen(next);
|
|
25
|
-
} }) }, key)))] }));
|
|
26
|
-
});
|
package/esm/SetMinMaxDialog.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const _default: (props: {
|
|
2
|
-
model: {
|
|
3
|
-
manualMinScore: number | undefined;
|
|
4
|
-
manualMaxScore: number | undefined;
|
|
5
|
-
scaleType: string;
|
|
6
|
-
setMinScore: (arg?: number) => void;
|
|
7
|
-
setMaxScore: (arg?: number) => void;
|
|
8
|
-
};
|
|
9
|
-
domain?: [number, number];
|
|
10
|
-
handleClose: () => void;
|
|
11
|
-
}) => import("react").JSX.Element;
|
|
12
|
-
export default _default;
|
package/esm/SetMinMaxDialog.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { NumberTextField, SubmitDialog } from '@jbrowse/core/ui';
|
|
4
|
-
import { Button, Typography } from '@mui/material';
|
|
5
|
-
import { observer } from 'mobx-react';
|
|
6
|
-
// The two fields open on what the config really pins, which is the mixin's
|
|
7
|
-
// `manual*` pair rather than the raw slots — the sentinel comparison is one
|
|
8
|
-
// answer per end and lives there. Submitting `undefined` writes the sentinel
|
|
9
|
-
// back, so an emptied field is how autoscale resumes.
|
|
10
|
-
export default observer(function SetMinMaxDialog(props) {
|
|
11
|
-
const { model, domain, handleClose } = props;
|
|
12
|
-
const { manualMinScore, manualMaxScore, scaleType } = model;
|
|
13
|
-
const [min, setMin] = useState(manualMinScore);
|
|
14
|
-
const [max, setMax] = useState(manualMaxScore);
|
|
15
|
-
// The fields own their text, so filling them from the button remounts them.
|
|
16
|
-
const [fill, setFill] = useState(0);
|
|
17
|
-
const rangeOk = min === undefined || max === undefined || max > min;
|
|
18
|
-
const logOk = !(scaleType === 'log' && min !== undefined && min <= 0);
|
|
19
|
-
return (_jsxs(SubmitDialog, { open: true, title: "Set min/max score for track", submitDisabled: !rangeOk || !logOk, onCancel: handleClose, onSubmit: () => {
|
|
20
|
-
model.setMinScore(min);
|
|
21
|
-
model.setMaxScore(max);
|
|
22
|
-
handleClose();
|
|
23
|
-
}, children: [_jsx(Typography, { children: "Enter min/max score, or leave a field empty to autoscale that end" }), !rangeOk ? (_jsx(Typography, { color: "error", children: "Max must be greater than min" })) : null, !logOk ? (_jsx(Typography, { color: "error", children: "Min score should be greater than 0 for log scale" })) : null, _jsx(NumberTextField, { defaultValue: min, onValueChange: setMin, placeholder: "Enter min score" }, `min-${fill}`), _jsx(NumberTextField, { defaultValue: max, onValueChange: setMax, placeholder: "Enter max score" }, `max-${fill}`), _jsxs("div", { children: [domain ? (_jsx(Button, { onClick: () => {
|
|
24
|
-
setMin(domain[0]);
|
|
25
|
-
setMax(domain[1]);
|
|
26
|
-
setFill(n => n + 1);
|
|
27
|
-
}, children: "Use current range" })) : null, _jsx(Button, { disabled: min === undefined && max === undefined, onClick: () => {
|
|
28
|
-
setMin(undefined);
|
|
29
|
-
setMax(undefined);
|
|
30
|
-
setFill(n => n + 1);
|
|
31
|
-
}, children: "Clear" })] })] }));
|
|
32
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ValueScaleRule } from '@jbrowse/display-ui';
|
|
2
|
-
/**
|
|
3
|
-
* The score menu's editor for `scales.y.rules`: one row per reference line,
|
|
4
|
-
* its value on the plot's own scale, its label and its colour. An empty colour
|
|
5
|
-
* is the display's default, and removing every row removes every line.
|
|
6
|
-
*/
|
|
7
|
-
declare const _default: ({ model, handleClose, }: {
|
|
8
|
-
model: {
|
|
9
|
-
scoreRules: ValueScaleRule[];
|
|
10
|
-
setScoreRules: (rules: ValueScaleRule[]) => void;
|
|
11
|
-
};
|
|
12
|
-
handleClose: () => void;
|
|
13
|
-
}) => import("react").JSX.Element;
|
|
14
|
-
export default _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { SubmitDialog } from '@jbrowse/core/ui';
|
|
4
|
-
import { isCssColor } from '@jbrowse/core/util/colorBits';
|
|
5
|
-
import DeleteIcon from '@mui/icons-material/Delete';
|
|
6
|
-
import { Button, IconButton, TextField, Typography } from '@mui/material';
|
|
7
|
-
import { observer } from 'mobx-react';
|
|
8
|
-
function rowOf({ value, label = '', color = '' }) {
|
|
9
|
-
return { value: String(value), label, color };
|
|
10
|
-
}
|
|
11
|
-
function valueOk({ value }) {
|
|
12
|
-
return value.trim() !== '' && Number.isFinite(Number(value));
|
|
13
|
-
}
|
|
14
|
-
function colorOk({ color }) {
|
|
15
|
-
return color.trim() === '' || isCssColor(color);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* The score menu's editor for `scales.y.rules`: one row per reference line,
|
|
19
|
-
* its value on the plot's own scale, its label and its colour. An empty colour
|
|
20
|
-
* is the display's default, and removing every row removes every line.
|
|
21
|
-
*/
|
|
22
|
-
export default observer(function SetScoreRulesDialog({ model, handleClose, }) {
|
|
23
|
-
const [rows, setRows] = useState(() => model.scoreRules.map(rowOf));
|
|
24
|
-
const setRow = (index, patch) => {
|
|
25
|
-
setRows(rows.map((row, i) => (i === index ? { ...row, ...patch } : row)));
|
|
26
|
-
};
|
|
27
|
-
return (_jsxs(SubmitDialog, { open: true, title: "Reference lines", submitDisabled: !rows.every(row => valueOk(row) && colorOk(row)), onCancel: handleClose, onSubmit: () => {
|
|
28
|
-
model.setScoreRules(rows.map(row => ({
|
|
29
|
-
value: Number(row.value),
|
|
30
|
-
...(row.label ? { label: row.label } : {}),
|
|
31
|
-
...(row.color.trim() ? { color: row.color.trim() } : {}),
|
|
32
|
-
})));
|
|
33
|
-
handleClose();
|
|
34
|
-
}, children: [_jsx(Typography, { children: "A horizontal line at each value, on the same scale as the plot" }), rows.map((row, index) => (_jsxs("div", { style: { display: 'flex', gap: 8, marginTop: 8 }, children: [_jsx(TextField, { label: "Value", value: row.value, error: !valueOk(row), onChange: event => {
|
|
35
|
-
setRow(index, { value: event.target.value });
|
|
36
|
-
} }), _jsx(TextField, { label: "Label", value: row.label, onChange: event => {
|
|
37
|
-
setRow(index, { label: event.target.value });
|
|
38
|
-
} }), _jsx(TextField, { label: "Color", value: row.color, error: !colorOk(row), onChange: event => {
|
|
39
|
-
setRow(index, { color: event.target.value });
|
|
40
|
-
} }), _jsx(IconButton, { "aria-label": "remove line", onClick: () => {
|
|
41
|
-
setRows(rows.filter((_, i) => i !== index));
|
|
42
|
-
}, children: _jsx(DeleteIcon, {}) })] }, index))), _jsx(Button, { onClick: () => {
|
|
43
|
-
setRows([...rows, { value: '', label: '', color: '' }]);
|
|
44
|
-
}, children: "Add line" })] }));
|
|
45
|
-
});
|