@jbrowse/wiggle-core 5.0.0-beta.11 → 5.0.0-beta.14
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 +28 -13
- 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 +7 -0
- package/esm/ScoreAxisWidget/ResetAxisButton.js +22 -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 +6 -0
- package/esm/ScoreAxisWidget/Section.js +15 -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 +9 -8
- package/esm/ScorePlotChrome.js +16 -8
- package/esm/ScorePlotSvgFrame.d.ts +7 -12
- package/esm/ScorePlotSvgFrame.js +6 -14
- package/esm/ScoreScaleMixin.d.ts +7 -14
- package/esm/ScoreScaleMixin.js +7 -21
- package/esm/WiggleScoreConfigMixin.d.ts +5 -22
- package/esm/WiggleScoreConfigMixin.js +5 -25
- package/esm/{ScoreFieldConfigMixin.d.ts → YFieldConfigMixin.d.ts} +11 -15
- package/esm/YFieldConfigMixin.js +25 -0
- package/esm/autoscale.d.ts +20 -15
- package/esm/autoscale.js +37 -34
- package/esm/chrome.d.ts +1 -3
- package/esm/chrome.js +1 -2
- package/esm/dataTypes.d.ts +2 -1
- package/esm/index.d.ts +7 -8
- package/esm/index.js +5 -6
- package/esm/pointSizeMenu.d.ts +12 -24
- package/esm/pointSizeMenu.js +9 -20
- package/esm/renderingBackendTypes.d.ts +1 -0
- package/esm/renderingBackendTypes.js +1 -1
- package/esm/scale.d.ts +5 -4
- package/esm/scale.js +6 -10
- package/esm/scoreMenuItems.d.ts +14 -28
- package/esm/scoreMenuItems.js +35 -130
- package/esm/valueScaleConfigSchema.d.ts +80 -6
- package/esm/valueScaleConfigSchema.js +67 -27
- package/esm/yFieldConfigSchemaFields.d.ts +10 -0
- package/esm/yFieldConfigSchemaFields.js +8 -0
- package/package.json +11 -10
- package/esm/AutoscaleGroupDialog.d.ts +0 -7
- package/esm/AutoscaleGroupDialog.js +0 -26
- package/esm/ScoreFieldConfigMixin.js +0 -25
- 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/esm/rowLabelOffset.d.ts +0 -8
- package/esm/rowLabelOffset.js +0 -16
- package/esm/scoreFieldConfigSchemaFields.d.ts +0 -10
- package/esm/scoreFieldConfigSchemaFields.js +0 -8
package/esm/ScorePlotChrome.d.ts
CHANGED
|
@@ -9,37 +9,38 @@ interface PlotBox {
|
|
|
9
9
|
yTop: number;
|
|
10
10
|
plotHeight: number;
|
|
11
11
|
}
|
|
12
|
-
interface
|
|
12
|
+
export interface ScorePlotContextMenuHost<ContextHit> {
|
|
13
13
|
contextMenuInfo?: ContextMenuAnchor;
|
|
14
14
|
contextMenuItems: () => MenuItem[];
|
|
15
15
|
closeContextMenu: () => void;
|
|
16
|
-
}
|
|
17
|
-
export interface ScorePlotContextMenuHost<Hit> extends ContextMenuView {
|
|
18
16
|
openContextMenu: (info: ContextMenuAnchor & {
|
|
19
|
-
hit:
|
|
17
|
+
hit: ContextHit;
|
|
20
18
|
}) => void;
|
|
21
19
|
clearHoveredFeature: () => void;
|
|
22
20
|
}
|
|
23
21
|
export type ScorePlotChromeModel<Hit, TRegion, TState extends FrameDimensions> = ChromeModel & RenderLifecycleModel<PerRegionRenderingBackend<TRegion, TState>> & {
|
|
24
22
|
canvasWidthPx: number;
|
|
23
|
+
scrollableHeight: number;
|
|
25
24
|
setHoveredFeature: (hit?: Hit) => void;
|
|
26
25
|
selectFeature: (hit: Hit) => void;
|
|
27
26
|
};
|
|
28
27
|
/**
|
|
29
28
|
* The on-screen chrome of a display drawing a mark list on a score axis: the
|
|
30
29
|
* canvas in the axis plot box, hover and click resolved through `findHit`, the
|
|
31
|
-
* pointer-following `tooltip`, and the right-click menu where
|
|
32
|
-
*
|
|
30
|
+
* pointer-following `tooltip`, and the right-click menu where the model
|
|
31
|
+
* composes `ContextMenuMixin`. `findHit` takes y from the plot's own top.
|
|
32
|
+
* `findContextHit` is for a display whose menu is about something other than
|
|
33
|
+
* the hovered record (the wiggle's column, which exists where no bin does).
|
|
33
34
|
*/
|
|
34
|
-
export declare const ScorePlotChrome: <Hit, TRegion, TState extends FrameDimensions>({ model, marks, testid, plotGeometry, findHit, tooltip, overlay, indicators,
|
|
35
|
+
export declare const ScorePlotChrome: <Hit, TRegion, TState extends FrameDimensions, ContextHit = Hit>({ model, marks, testid, plotGeometry, findHit, findContextHit, tooltip, overlay, indicators, }: {
|
|
35
36
|
model: ScorePlotChromeModel<Hit, TRegion, TState>;
|
|
36
37
|
marks: readonly Mark<TRegion, TState>[];
|
|
37
38
|
testid: string;
|
|
38
39
|
plotGeometry?: PlotBox;
|
|
39
40
|
findHit: (x: number, y: number) => Hit | undefined;
|
|
41
|
+
findContextHit?: (x: number, y: number) => ContextHit | undefined;
|
|
40
42
|
tooltip: (mouseState: MouseState | undefined) => ReactNode;
|
|
41
43
|
overlay?: (plotGeometry: PlotBox) => ReactNode;
|
|
42
44
|
indicators?: () => ReactNode;
|
|
43
|
-
contextMenu?: ScorePlotContextMenuHost<Hit>;
|
|
44
45
|
}) => import("react").JSX.Element;
|
|
45
46
|
export {};
|
package/esm/ScorePlotChrome.js
CHANGED
|
@@ -3,21 +3,27 @@ import { useMemo } from 'react';
|
|
|
3
3
|
import { eventPoint } from '@jbrowse/core/util/eventPoint';
|
|
4
4
|
import BottomRightIndicators from '@jbrowse/display-kit/BottomRightIndicators';
|
|
5
5
|
import DisplayChrome from '@jbrowse/display-kit/DisplayChrome';
|
|
6
|
-
import {
|
|
6
|
+
import { isContextMenuHost, openContextMenuFromEvent, } from '@jbrowse/display-kit/DisplayContextMenu';
|
|
7
7
|
import { PointerLayer, axisPlotBox } from '@jbrowse/display-ui';
|
|
8
8
|
import { createMarkBackend } from '@jbrowse/render-core/marks/backend';
|
|
9
9
|
import { observer } from 'mobx-react';
|
|
10
|
+
function isScorePlotMenuHost(model) {
|
|
11
|
+
return isContextMenuHost(model) && 'openContextMenu' in model;
|
|
12
|
+
}
|
|
10
13
|
/**
|
|
11
14
|
* The on-screen chrome of a display drawing a mark list on a score axis: the
|
|
12
15
|
* canvas in the axis plot box, hover and click resolved through `findHit`, the
|
|
13
|
-
* pointer-following `tooltip`, and the right-click menu where
|
|
14
|
-
*
|
|
16
|
+
* pointer-following `tooltip`, and the right-click menu where the model
|
|
17
|
+
* composes `ContextMenuMixin`. `findHit` takes y from the plot's own top.
|
|
18
|
+
* `findContextHit` is for a display whose menu is about something other than
|
|
19
|
+
* the hovered record (the wiggle's column, which exists where no bin does).
|
|
15
20
|
*/
|
|
16
|
-
export const ScorePlotChrome = observer(function ScorePlotChrome({ model, marks, testid, plotGeometry, findHit, tooltip, overlay, indicators,
|
|
21
|
+
export const ScorePlotChrome = observer(function ScorePlotChrome({ model, marks, testid, plotGeometry, findHit, findContextHit, tooltip, overlay, indicators, }) {
|
|
17
22
|
const { height, canvasWidthPx: width } = model;
|
|
18
23
|
const box = plotGeometry ?? axisPlotBox(height);
|
|
19
24
|
const factory = useMemo(() => (canvas) => createMarkBackend(canvas, marks), [marks]);
|
|
20
25
|
const hitAt = (x, y) => findHit(x, y - box.yTop);
|
|
26
|
+
const contextMenu = isScorePlotMenuHost(model) ? model : undefined;
|
|
21
27
|
return (_jsx(DisplayChrome, { model: model, factory: factory, testid: testid, style: { width, whiteSpace: 'nowrap', textAlign: 'left' }, onPointerPosition: state => {
|
|
22
28
|
model.setHoveredFeature(state ? hitAt(state.x, state.y) : undefined);
|
|
23
29
|
}, onClick: event => {
|
|
@@ -29,19 +35,21 @@ export const ScorePlotChrome = observer(function ScorePlotChrome({ model, marks,
|
|
|
29
35
|
}, onContextMenu: contextMenu
|
|
30
36
|
? event => {
|
|
31
37
|
const { x, y } = eventPoint(event);
|
|
32
|
-
const hit =
|
|
38
|
+
const hit = findContextHit
|
|
39
|
+
? findContextHit(x, y - box.yTop)
|
|
40
|
+
: hitAt(x, y);
|
|
33
41
|
openContextMenuFromEvent(contextMenu, event, hit
|
|
34
42
|
? { clientX: event.clientX, clientY: event.clientY, hit }
|
|
35
43
|
: undefined);
|
|
36
44
|
}
|
|
37
|
-
: undefined, children: ({ canvasRef, mouseTracker }) => (_jsx(ScorePlotBody, { canvasRef: canvasRef, mouseTracker: mouseTracker, width: width, plotGeometry: box, tooltip: tooltip, overlay: overlay, indicators: indicators
|
|
45
|
+
: undefined, children: ({ canvasRef, mouseTracker }) => (_jsx(ScorePlotBody, { model: model, canvasRef: canvasRef, mouseTracker: mouseTracker, width: width, plotGeometry: box, tooltip: tooltip, overlay: overlay, indicators: indicators })) }));
|
|
38
46
|
});
|
|
39
|
-
const ScorePlotBody = observer(function ScorePlotBody({ canvasRef, mouseTracker, width, plotGeometry, tooltip, overlay, indicators,
|
|
47
|
+
const ScorePlotBody = observer(function ScorePlotBody({ model, canvasRef, mouseTracker, width, plotGeometry, tooltip, overlay, indicators, }) {
|
|
40
48
|
return (_jsxs(_Fragment, { children: [_jsx("canvas", { ref: canvasRef, style: {
|
|
41
49
|
width,
|
|
42
50
|
height: plotGeometry.plotHeight,
|
|
43
51
|
position: 'absolute',
|
|
44
52
|
left: 0,
|
|
45
53
|
top: plotGeometry.yTop,
|
|
46
|
-
} }), overlay?.(plotGeometry), _jsx(PointerLayer, { mouseTracker: mouseTracker, children: tooltip }), indicators ? (_jsx(BottomRightIndicators, { children: indicators() })) : null
|
|
54
|
+
} }), overlay?.(plotGeometry), _jsx(PointerLayer, { mouseTracker: mouseTracker, children: tooltip }), indicators ? (_jsx(BottomRightIndicators, { scrollableHeight: model.scrollableHeight, children: indicators() })) : null] }));
|
|
47
55
|
});
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { LgvSvgBodyProps } from '@jbrowse/display-kit/renderDisplaySvg';
|
|
1
|
+
import type { LgvSvgBodyProps, LgvSvgExportable } from '@jbrowse/display-kit/renderDisplaySvg';
|
|
3
2
|
import type { Mark, MarkFrame } from '@jbrowse/render-core/marks';
|
|
4
3
|
import type React from 'react';
|
|
5
|
-
export
|
|
6
|
-
id: string;
|
|
7
|
-
height: number;
|
|
8
|
-
}
|
|
4
|
+
export type ScorePlotSvgModel = LgvSvgExportable;
|
|
9
5
|
/**
|
|
10
6
|
* The SVG-export body of a display with a score axis, mounted through
|
|
11
7
|
* `renderDisplaySvg`, which draws the axis and cross-hatches. Paints `marks`
|
|
12
|
-
* over `regions` inside the plot box
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `children` draw over the plot, in the same untranslated space as the axis.
|
|
8
|
+
* over `regions` inside the plot box. `plotGeometry` defaults to the
|
|
9
|
+
* single-plot box `ScorePlotChrome` draws in; multi-wiggle stacks its rows over
|
|
10
|
+
* the full height instead. `children` draw over the plot, in the same
|
|
11
|
+
* untranslated space as the axis.
|
|
17
12
|
*/
|
|
18
|
-
export declare function ScorePlotSvgFrame<TRegion, TState extends MarkFrame>({ height, canvasWidth, renderBlocks, opts, plotGeometry, marks, regions, renderState, children, }: LgvSvgBodyProps<
|
|
13
|
+
export declare function ScorePlotSvgFrame<TRegion, TState extends MarkFrame>({ height, canvasWidth, renderBlocks, opts, plotGeometry, marks, regions, renderState, children, }: Pick<LgvSvgBodyProps<unknown>, 'height' | 'canvasWidth' | 'renderBlocks' | 'opts'> & {
|
|
19
14
|
plotGeometry?: {
|
|
20
15
|
yTop: number;
|
|
21
16
|
plotHeight: number;
|
package/esm/ScorePlotSvgFrame.js
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import MarkSvgLayer from '@jbrowse/display-kit/MarkSvgLayer';
|
|
3
3
|
import { axisPlotBox } from '@jbrowse/display-ui';
|
|
4
|
-
import { paintMarkBlocks } from '@jbrowse/render-core/marks';
|
|
5
4
|
/**
|
|
6
5
|
* The SVG-export body of a display with a score axis, mounted through
|
|
7
6
|
* `renderDisplaySvg`, which draws the axis and cross-hatches. Paints `marks`
|
|
8
|
-
* over `regions` inside the plot box
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* `children` draw over the plot, in the same untranslated space as the axis.
|
|
7
|
+
* over `regions` inside the plot box. `plotGeometry` defaults to the
|
|
8
|
+
* single-plot box `ScorePlotChrome` draws in; multi-wiggle stacks its rows over
|
|
9
|
+
* the full height instead. `children` draw over the plot, in the same
|
|
10
|
+
* untranslated space as the axis.
|
|
13
11
|
*/
|
|
14
12
|
export function ScorePlotSvgFrame({ height, canvasWidth, renderBlocks, opts, plotGeometry = axisPlotBox(height), marks, regions, renderState, children, }) {
|
|
15
13
|
const { yTop, plotHeight } = plotGeometry;
|
|
16
|
-
return (_jsxs(_Fragment, { children: [_jsx("g", { transform: `translate(0,${yTop})`, children: _jsx(
|
|
17
|
-
paintMarkBlocks(ctx, marks, regions, renderBlocks, {
|
|
18
|
-
...renderState,
|
|
19
|
-
canvasWidth,
|
|
20
|
-
canvasHeight: plotHeight,
|
|
21
|
-
});
|
|
22
|
-
} }) }), children] }));
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsx("g", { transform: `translate(0,${yTop})`, children: _jsx(MarkSvgLayer, { marks: marks, regions: regions, blocks: renderBlocks, state: renderState, width: canvasWidth, height: plotHeight, opts: opts }) }), children] }));
|
|
23
15
|
}
|
package/esm/ScoreScaleMixin.d.ts
CHANGED
|
@@ -15,15 +15,15 @@ export interface ScoreScaleHost {
|
|
|
15
15
|
/**
|
|
16
16
|
* #stateModel ScoreScaleMixin
|
|
17
17
|
* #category display
|
|
18
|
-
* #crossCuttingMixin Value scale, written in `scales.y`. `valueScaleSchema` / `scalesSchema`. Brings `ScoreAxisMixin` plus `scaleType` / `scaleZero` / `domainQuantile` / `clipQuantile` / `symlogConstant` / `manual*` and their setters, i.e. the whole `ScoreScaleModel` interface the
|
|
18
|
+
* #crossCuttingMixin Value scale, written in `scales.y`. `valueScaleSchema` / `scalesSchema`. Brings `ScoreAxisMixin` plus `scaleType` / `scaleZero` / `domainQuantile` / `clipQuantile` / `symlogConstant` / `manual*` and their setters, i.e. the whole `ScoreScaleModel` interface the Y axis row and its drawer widget consume
|
|
19
19
|
*
|
|
20
20
|
* The value scale of every quantitative display: wiggle, the alignments
|
|
21
21
|
* coverage band and the mark display, Manhattan among them, each declare
|
|
22
22
|
* `scales.y` through {@link valueScaleSchema} and compose this. It backs
|
|
23
23
|
* {@link ScoreAxisMixin}'s three overridable members off that object and adds
|
|
24
24
|
* the setters that write it, so composing this is how a display satisfies
|
|
25
|
-
* {@link ScoreScaleModel} in `scoreMenuItems.ts` — the interface the
|
|
26
|
-
*
|
|
25
|
+
* {@link ScoreScaleModel} in `scoreMenuItems.ts` — the interface the Y axis
|
|
26
|
+
* row and its drawer widget consume.
|
|
27
27
|
*
|
|
28
28
|
* Deliberately just the scale and the guides it owns. Colors, `resolution`
|
|
29
29
|
* and the autoscale *computation* stay in `WiggleScoreConfigMixin` /
|
|
@@ -68,7 +68,7 @@ export declare function ScoreScaleMixin(): import("@jbrowse/mobx-state-tree").IM
|
|
|
68
68
|
readonly domainQuantile: number;
|
|
69
69
|
/**
|
|
70
70
|
* #getter
|
|
71
|
-
* The quantile "Clip outliers"
|
|
71
|
+
* The quantile "Clip extreme outliers" fences at: the one an untick this session
|
|
72
72
|
* wrote over, else the scale's own default where that is below 1, else
|
|
73
73
|
* 0.99.
|
|
74
74
|
*/
|
|
@@ -89,13 +89,6 @@ export declare function ScoreScaleMixin(): import("@jbrowse/mobx-state-tree").IM
|
|
|
89
89
|
* The upper bound the config pins, `undefined` where it pins none.
|
|
90
90
|
*/
|
|
91
91
|
readonly manualMaxScore: number | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* #getter
|
|
94
|
-
* What `scales.y`'s ends say together that the axis cannot draw as
|
|
95
|
-
* written, as corner-notice lines, by the rule a colour ramp's ends
|
|
96
|
-
* answer to. The mark display reports them through its rule list.
|
|
97
|
-
*/
|
|
98
|
-
readonly valueScaleNotices: string[];
|
|
99
92
|
/**
|
|
100
93
|
* #getter
|
|
101
94
|
* `scales.y.autoscaleGroup`, `undefined` while it names none.
|
|
@@ -119,9 +112,9 @@ export declare function ScoreScaleMixin(): import("@jbrowse/mobx-state-tree").IM
|
|
|
119
112
|
/**
|
|
120
113
|
* #getter
|
|
121
114
|
* Whether this display draws `scales.y.rules`, which is whether the
|
|
122
|
-
*
|
|
123
|
-
* rules a band for them to cross, which a density plot's
|
|
124
|
-
* rows and a
|
|
115
|
+
* Y axis panel offers Include 0 and the reference lines: a scale it places y through
|
|
116
|
+
* rules a band for them to cross, which a density plot's color-mapped
|
|
117
|
+
* rows and a color ramp do not.
|
|
125
118
|
*/
|
|
126
119
|
readonly scoreRulesDrawn: boolean;
|
|
127
120
|
/**
|
package/esm/ScoreScaleMixin.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getConf, getSlotDefinition, readConfObject, setConf, } from '@jbrowse/core/configuration';
|
|
2
|
-
import { noticeLines, scaleEndProblems } from '@jbrowse/core/util/colorScale';
|
|
3
2
|
import { clipQuantileOf } from '@jbrowse/core/util/quantileExtent';
|
|
4
3
|
import { rulesABand } from '@jbrowse/display-ui/axisPlacement';
|
|
5
4
|
import { ScoreAxisMixin } from './ScoreAxisMixin.js';
|
|
@@ -11,15 +10,15 @@ const confNode = (self) => self;
|
|
|
11
10
|
/**
|
|
12
11
|
* #stateModel ScoreScaleMixin
|
|
13
12
|
* #category display
|
|
14
|
-
* #crossCuttingMixin Value scale, written in `scales.y`. `valueScaleSchema` / `scalesSchema`. Brings `ScoreAxisMixin` plus `scaleType` / `scaleZero` / `domainQuantile` / `clipQuantile` / `symlogConstant` / `manual*` and their setters, i.e. the whole `ScoreScaleModel` interface the
|
|
13
|
+
* #crossCuttingMixin Value scale, written in `scales.y`. `valueScaleSchema` / `scalesSchema`. Brings `ScoreAxisMixin` plus `scaleType` / `scaleZero` / `domainQuantile` / `clipQuantile` / `symlogConstant` / `manual*` and their setters, i.e. the whole `ScoreScaleModel` interface the Y axis row and its drawer widget consume
|
|
15
14
|
*
|
|
16
15
|
* The value scale of every quantitative display: wiggle, the alignments
|
|
17
16
|
* coverage band and the mark display, Manhattan among them, each declare
|
|
18
17
|
* `scales.y` through {@link valueScaleSchema} and compose this. It backs
|
|
19
18
|
* {@link ScoreAxisMixin}'s three overridable members off that object and adds
|
|
20
19
|
* the setters that write it, so composing this is how a display satisfies
|
|
21
|
-
* {@link ScoreScaleModel} in `scoreMenuItems.ts` — the interface the
|
|
22
|
-
*
|
|
20
|
+
* {@link ScoreScaleModel} in `scoreMenuItems.ts` — the interface the Y axis
|
|
21
|
+
* row and its drawer widget consume.
|
|
23
22
|
*
|
|
24
23
|
* Deliberately just the scale and the guides it owns. Colors, `resolution`
|
|
25
24
|
* and the autoscale *computation* stay in `WiggleScoreConfigMixin` /
|
|
@@ -56,7 +55,7 @@ export function ScoreScaleMixin() {
|
|
|
56
55
|
},
|
|
57
56
|
/**
|
|
58
57
|
* #getter
|
|
59
|
-
* The quantile "Clip outliers"
|
|
58
|
+
* The quantile "Clip extreme outliers" fences at: the one an untick this session
|
|
60
59
|
* wrote over, else the scale's own default where that is below 1, else
|
|
61
60
|
* 0.99.
|
|
62
61
|
*/
|
|
@@ -86,19 +85,6 @@ export function ScoreScaleMixin() {
|
|
|
86
85
|
get manualMaxScore() {
|
|
87
86
|
return getConf(confNode(self), ['scales', 'y', 'domainMax']);
|
|
88
87
|
},
|
|
89
|
-
/**
|
|
90
|
-
* #getter
|
|
91
|
-
* What `scales.y`'s ends say together that the axis cannot draw as
|
|
92
|
-
* written, as corner-notice lines, by the rule a colour ramp's ends
|
|
93
|
-
* answer to. The mark display reports them through its rule list.
|
|
94
|
-
*/
|
|
95
|
-
get valueScaleNotices() {
|
|
96
|
-
return noticeLines('scales.y', scaleEndProblems({
|
|
97
|
-
domainMin: this.manualMinScore,
|
|
98
|
-
domainMax: this.manualMaxScore,
|
|
99
|
-
domainQuantile: this.domainQuantile,
|
|
100
|
-
}));
|
|
101
|
-
},
|
|
102
88
|
/**
|
|
103
89
|
* #getter
|
|
104
90
|
* `scales.y.autoscaleGroup`, `undefined` while it names none.
|
|
@@ -131,9 +117,9 @@ export function ScoreScaleMixin() {
|
|
|
131
117
|
/**
|
|
132
118
|
* #getter
|
|
133
119
|
* Whether this display draws `scales.y.rules`, which is whether the
|
|
134
|
-
*
|
|
135
|
-
* rules a band for them to cross, which a density plot's
|
|
136
|
-
* rows and a
|
|
120
|
+
* Y axis panel offers Include 0 and the reference lines: a scale it places y through
|
|
121
|
+
* rules a band for them to cross, which a density plot's color-mapped
|
|
122
|
+
* rows and a color ramp do not.
|
|
137
123
|
*/
|
|
138
124
|
get scoreRulesDrawn() {
|
|
139
125
|
return self.valueScales.some(rulesABand);
|
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
import type { scalesSchema } from './valueScaleConfigSchema.ts';
|
|
2
2
|
import type { ConfigModelForFields } from '@jbrowse/core/configuration';
|
|
3
|
-
/** The slots its composers each declare, with their own defaults. */
|
|
4
|
-
export declare const wiggleScoreConfigExtraSlots: {
|
|
5
|
-
readonly size: {
|
|
6
|
-
readonly type: 'number';
|
|
7
|
-
readonly defaultValue: 2;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
3
|
export interface WiggleScoreConfigHost {
|
|
11
4
|
configuration: ConfigModelForFields<{
|
|
12
5
|
scales: ReturnType<typeof scalesSchema>;
|
|
13
|
-
}
|
|
6
|
+
}>;
|
|
14
7
|
}
|
|
15
8
|
/**
|
|
16
9
|
* #stateModel WiggleScoreConfigMixin
|
|
17
10
|
* #category display
|
|
18
11
|
*
|
|
19
12
|
* The score-plot config every display with a score axis shares: the axis
|
|
20
|
-
* and its guides (`ScoreScaleMixin`)
|
|
21
|
-
*
|
|
22
|
-
* which adds `
|
|
13
|
+
* and its guides (`ScoreScaleMixin`). A display plotting one configured
|
|
14
|
+
* field composes `YFieldConfigMixin`,
|
|
15
|
+
* which adds the `y` slot.
|
|
23
16
|
*/
|
|
24
17
|
export declare function WiggleScoreConfigMixin(): import("@jbrowse/mobx-state-tree").IModelType<Omit<{}, never>, {
|
|
25
18
|
readonly scaleType: string;
|
|
@@ -48,7 +41,6 @@ export declare function WiggleScoreConfigMixin(): import("@jbrowse/mobx-state-tr
|
|
|
48
41
|
readonly symlogConstant: number;
|
|
49
42
|
readonly manualMinScore: number | undefined;
|
|
50
43
|
readonly manualMaxScore: number | undefined;
|
|
51
|
-
readonly valueScaleNotices: string[];
|
|
52
44
|
readonly autoscaleGroup: string | undefined;
|
|
53
45
|
readonly scaleTitle: string;
|
|
54
46
|
readonly grid: boolean;
|
|
@@ -65,10 +57,6 @@ export declare function WiggleScoreConfigMixin(): import("@jbrowse/mobx-state-tr
|
|
|
65
57
|
setGrid(grid: boolean): void;
|
|
66
58
|
setScoreRules(rules: (number | import("@jbrowse/display-ui").ValueScaleRule)[]): void;
|
|
67
59
|
} & {
|
|
68
|
-
/**
|
|
69
|
-
* #getter
|
|
70
|
-
*/
|
|
71
|
-
readonly size: number;
|
|
72
60
|
/**
|
|
73
61
|
* #getter
|
|
74
62
|
* Whether score maps to color instead of height; a display overrides it.
|
|
@@ -77,13 +65,8 @@ export declare function WiggleScoreConfigMixin(): import("@jbrowse/mobx-state-tr
|
|
|
77
65
|
} & {
|
|
78
66
|
/**
|
|
79
67
|
* #getter
|
|
80
|
-
* A density row maps score to
|
|
68
|
+
* A density row maps score to color and has no axis to start at 0, so
|
|
81
69
|
* its domain spans the values whatever `scales.y.zero` says.
|
|
82
70
|
*/
|
|
83
71
|
readonly axisReachesZero: boolean;
|
|
84
|
-
} & {
|
|
85
|
-
/**
|
|
86
|
-
* #action
|
|
87
|
-
*/
|
|
88
|
-
setSize(val?: number): void;
|
|
89
72
|
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
import { getConf, setConf } from '@jbrowse/core/configuration';
|
|
2
1
|
import { types } from '@jbrowse/mobx-state-tree';
|
|
3
2
|
import { ScoreScaleMixin } from './ScoreScaleMixin.js';
|
|
4
|
-
/** The slots its composers each declare, with their own defaults. */
|
|
5
|
-
export const wiggleScoreConfigExtraSlots = {
|
|
6
|
-
size: { type: 'number', defaultValue: 2 },
|
|
7
|
-
};
|
|
8
|
-
const confNode = (self) => self;
|
|
9
3
|
/**
|
|
10
4
|
* #stateModel WiggleScoreConfigMixin
|
|
11
5
|
* #category display
|
|
12
6
|
*
|
|
13
7
|
* The score-plot config every display with a score axis shares: the axis
|
|
14
|
-
* and its guides (`ScoreScaleMixin`)
|
|
15
|
-
*
|
|
16
|
-
* which adds `
|
|
8
|
+
* and its guides (`ScoreScaleMixin`). A display plotting one configured
|
|
9
|
+
* field composes `YFieldConfigMixin`,
|
|
10
|
+
* which adds the `y` slot.
|
|
17
11
|
*/
|
|
18
12
|
export function WiggleScoreConfigMixin() {
|
|
19
13
|
return types
|
|
20
14
|
.compose('WiggleScoreConfigMixin', ScoreScaleMixin(), types.model({}))
|
|
21
|
-
.views(
|
|
22
|
-
/**
|
|
23
|
-
* #getter
|
|
24
|
-
*/
|
|
25
|
-
get size() {
|
|
26
|
-
return getConf(confNode(self), 'size');
|
|
27
|
-
},
|
|
15
|
+
.views(() => ({
|
|
28
16
|
/**
|
|
29
17
|
* #getter
|
|
30
18
|
* Whether score maps to color instead of height; a display overrides it.
|
|
@@ -36,19 +24,11 @@ export function WiggleScoreConfigMixin() {
|
|
|
36
24
|
.views(self => ({
|
|
37
25
|
/**
|
|
38
26
|
* #getter
|
|
39
|
-
* A density row maps score to
|
|
27
|
+
* A density row maps score to color and has no axis to start at 0, so
|
|
40
28
|
* its domain spans the values whatever `scales.y.zero` says.
|
|
41
29
|
*/
|
|
42
30
|
get axisReachesZero() {
|
|
43
31
|
return self.scaleZero && !self.isDensityMode;
|
|
44
32
|
},
|
|
45
|
-
}))
|
|
46
|
-
.actions(self => ({
|
|
47
|
-
/**
|
|
48
|
-
* #action
|
|
49
|
-
*/
|
|
50
|
-
setSize(val) {
|
|
51
|
-
setConf(confNode(self), 'size', val);
|
|
52
|
-
},
|
|
53
33
|
}));
|
|
54
34
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface
|
|
3
|
-
configuration:
|
|
1
|
+
import type { YFieldConfigModel } from './yFieldConfigSchemaFields.ts';
|
|
2
|
+
export interface YFieldConfigHost {
|
|
3
|
+
configuration: YFieldConfigModel;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* #stateModel
|
|
6
|
+
* #stateModel YFieldConfigMixin
|
|
7
7
|
* #category display
|
|
8
8
|
*
|
|
9
|
-
* `WiggleScoreConfigMixin` plus `
|
|
10
|
-
* configured feature field and so declares `
|
|
9
|
+
* `WiggleScoreConfigMixin` plus the `y` slot, for a display that plots one
|
|
10
|
+
* configured feature field and so declares `yFieldConfigSchemaFields`:
|
|
11
11
|
* the wiggle display. `LinearMarkDisplay` names a field per mark and composes
|
|
12
12
|
* the base instead.
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function YFieldConfigMixin(): import("@jbrowse/mobx-state-tree").IModelType<Omit<{}, never>, {
|
|
15
15
|
readonly scaleType: string;
|
|
16
16
|
readonly scaleZero: boolean;
|
|
17
17
|
readonly manualMinScore: number | undefined;
|
|
@@ -38,7 +38,6 @@ export declare function ScoreFieldConfigMixin(): import("@jbrowse/mobx-state-tre
|
|
|
38
38
|
readonly symlogConstant: number;
|
|
39
39
|
readonly manualMinScore: number | undefined;
|
|
40
40
|
readonly manualMaxScore: number | undefined;
|
|
41
|
-
readonly valueScaleNotices: string[];
|
|
42
41
|
readonly autoscaleGroup: string | undefined;
|
|
43
42
|
readonly scaleTitle: string;
|
|
44
43
|
readonly grid: boolean;
|
|
@@ -55,18 +54,15 @@ export declare function ScoreFieldConfigMixin(): import("@jbrowse/mobx-state-tre
|
|
|
55
54
|
setGrid(grid: boolean): void;
|
|
56
55
|
setScoreRules(rules: (number | import("@jbrowse/display-ui").ValueScaleRule)[]): void;
|
|
57
56
|
} & {
|
|
58
|
-
readonly size: number;
|
|
59
57
|
readonly isDensityMode: boolean;
|
|
60
58
|
} & {
|
|
61
59
|
readonly axisReachesZero: boolean;
|
|
62
|
-
} & {
|
|
63
|
-
setSize(val?: number): void;
|
|
64
60
|
} & {
|
|
65
61
|
/**
|
|
66
62
|
* #getter
|
|
67
|
-
* The feature field the worker plots on the
|
|
68
|
-
* default. A fetch input: every composing display carries it in
|
|
69
|
-
* `rpcProps()`, since the field is read where the features are.
|
|
63
|
+
* The feature field the worker plots on the value axis, the `y` slot,
|
|
64
|
+
* `score` by default. A fetch input: every composing display carries it in
|
|
65
|
+
* its `rpcProps()`, since the field is read where the features are.
|
|
70
66
|
*/
|
|
71
|
-
readonly
|
|
67
|
+
readonly yField: string;
|
|
72
68
|
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getConf } from '@jbrowse/core/configuration';
|
|
2
|
+
import { WiggleScoreConfigMixin } from './WiggleScoreConfigMixin.js';
|
|
3
|
+
const confNode = (self) => self;
|
|
4
|
+
/**
|
|
5
|
+
* #stateModel YFieldConfigMixin
|
|
6
|
+
* #category display
|
|
7
|
+
*
|
|
8
|
+
* `WiggleScoreConfigMixin` plus the `y` slot, for a display that plots one
|
|
9
|
+
* configured feature field and so declares `yFieldConfigSchemaFields`:
|
|
10
|
+
* the wiggle display. `LinearMarkDisplay` names a field per mark and composes
|
|
11
|
+
* the base instead.
|
|
12
|
+
*/
|
|
13
|
+
export function YFieldConfigMixin() {
|
|
14
|
+
return WiggleScoreConfigMixin().views(self => ({
|
|
15
|
+
/**
|
|
16
|
+
* #getter
|
|
17
|
+
* The feature field the worker plots on the value axis, the `y` slot,
|
|
18
|
+
* `score` by default. A fetch input: every composing display carries it in
|
|
19
|
+
* its `rpcProps()`, since the field is read where the features are.
|
|
20
|
+
*/
|
|
21
|
+
get yField() {
|
|
22
|
+
return getConf(confNode(self), 'y');
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
}
|
package/esm/autoscale.d.ts
CHANGED
|
@@ -48,48 +48,53 @@ export interface ScoreSpan {
|
|
|
48
48
|
row?: Uint32Array;
|
|
49
49
|
drawnKeys?: Uint8Array;
|
|
50
50
|
}
|
|
51
|
-
/** The wiggle packer's arrays as a span, under
|
|
52
|
-
export declare function datasetSpan({ data, visStart, visEnd }: Dataset,
|
|
51
|
+
/** The wiggle packer's arrays as a span, under an aggregate and an extent. */
|
|
52
|
+
export declare function datasetSpan({ data, visStart, visEnd }: Dataset, aggregate: string, extent: string): ScoreSpan;
|
|
53
53
|
/**
|
|
54
54
|
* #api
|
|
55
|
-
* Per-feature scalar score array for
|
|
55
|
+
* Per-feature scalar score array for an aggregate: the min/max summary array
|
|
56
56
|
* for `'min'`/`'max'`, otherwise the average score.
|
|
57
57
|
*/
|
|
58
58
|
export declare function getEffectiveScores(data: {
|
|
59
59
|
featureScores: Float32Array;
|
|
60
60
|
featureMinScores: Float32Array;
|
|
61
61
|
featureMaxScores: Float32Array;
|
|
62
|
-
},
|
|
62
|
+
}, aggregate: string): Float32Array<ArrayBufferLike>;
|
|
63
63
|
export declare function computeSpanStats(spans: ScoreSpan[]): ScoreStats | undefined;
|
|
64
64
|
/** `computeSpanStats` over the wiggle packer's datasets. */
|
|
65
|
-
export declare function computeScoreStats(
|
|
65
|
+
export declare function computeScoreStats(aggregate: string, datasets: Dataset[], extent: string): ScoreStats | undefined;
|
|
66
66
|
/**
|
|
67
67
|
* #api
|
|
68
68
|
* The domain the visible instances autoscale to: at a `quantile` of 1 their
|
|
69
|
-
* extremes, `stats`; below it `quantileExtent`'s
|
|
70
|
-
*
|
|
71
|
-
* positive, so whiskers open to their
|
|
72
|
-
* lower no top, and a window of nothing
|
|
69
|
+
* extremes, `stats`; below it those extremes fenced by `quantileExtent`'s
|
|
70
|
+
* ends (`fenceOutliers`), the bottom read off the `low`s and the top off the
|
|
71
|
+
* `high`s less the zeros where any is positive, so whiskers open to their
|
|
72
|
+
* spread, a sparse window's empty bins lower no top, and a window of nothing
|
|
73
|
+
* above 0 keeps the top it has.
|
|
73
74
|
*/
|
|
74
|
-
export declare function autoscaleDomainFromSpans({ stats, quantile, spans, }: {
|
|
75
|
+
export declare function autoscaleDomainFromSpans({ stats, quantile, zero, spans, }: {
|
|
75
76
|
stats: ScoreStats;
|
|
76
77
|
quantile: number;
|
|
78
|
+
zero: boolean;
|
|
77
79
|
spans: ScoreSpan[];
|
|
78
80
|
}): [number, number];
|
|
79
81
|
/** `autoscaleDomainFromSpans` over the wiggle packer's datasets. */
|
|
80
|
-
export declare function autoscaleDomainFromStats({ stats, quantile,
|
|
82
|
+
export declare function autoscaleDomainFromStats({ stats, quantile, zero, aggregate, extent, visibleEntries, }: {
|
|
81
83
|
stats: ScoreStats;
|
|
82
84
|
quantile: number;
|
|
83
|
-
|
|
85
|
+
zero: boolean;
|
|
86
|
+
aggregate: string;
|
|
87
|
+
extent: string;
|
|
84
88
|
visibleEntries: Dataset[];
|
|
85
89
|
}): [number, number];
|
|
86
90
|
/**
|
|
87
91
|
* #api
|
|
88
92
|
* The score domain of the visible feature arrays, following `quantile` as
|
|
89
|
-
* `scales.y.domainQuantile` says
|
|
93
|
+
* `scales.y.domainQuantile` says, its outliers fenced for an axis that
|
|
94
|
+
* reaches 0 under `zero`.
|
|
90
95
|
*/
|
|
91
|
-
export declare function computeAutoscaleDomain(quantile: number,
|
|
96
|
+
export declare function computeAutoscaleDomain(quantile: number, aggregate: string, visibleEntries: {
|
|
92
97
|
data: FeatureArrays;
|
|
93
98
|
visStart: number;
|
|
94
99
|
visEnd: number;
|
|
95
|
-
}[]): [number, number] | undefined;
|
|
100
|
+
}[], zero: boolean, extent?: string): [number, number] | undefined;
|