@jbrowse/wiggle-core 5.0.0-beta.13 → 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.
Files changed (40) hide show
  1. package/README.md +8 -7
  2. package/esm/ResolutionStepper.js +1 -1
  3. package/esm/ScoreAxisWidget/ReferenceLines.d.ts +1 -1
  4. package/esm/ScoreAxisWidget/ReferenceLines.js +1 -1
  5. package/esm/ScoreAxisWidget/ResetAxisButton.d.ts +3 -2
  6. package/esm/ScoreAxisWidget/ResetAxisButton.js +4 -2
  7. package/esm/ScoreAxisWidget/ScoreAxisWidget.js +1 -1
  8. package/esm/ScoreAxisWidget/Section.d.ts +3 -2
  9. package/esm/ScoreAxisWidget/Section.js +4 -2
  10. package/esm/ScorePlotChrome.d.ts +8 -8
  11. package/esm/ScorePlotChrome.js +16 -8
  12. package/esm/ScoreScaleMixin.d.ts +2 -9
  13. package/esm/ScoreScaleMixin.js +2 -16
  14. package/esm/WiggleScoreConfigMixin.d.ts +5 -22
  15. package/esm/WiggleScoreConfigMixin.js +5 -25
  16. package/esm/{ScoreFieldConfigMixin.d.ts → YFieldConfigMixin.d.ts} +11 -15
  17. package/esm/YFieldConfigMixin.js +25 -0
  18. package/esm/autoscale.d.ts +10 -9
  19. package/esm/autoscale.js +21 -25
  20. package/esm/chrome.d.ts +1 -2
  21. package/esm/chrome.js +1 -1
  22. package/esm/dataTypes.d.ts +2 -0
  23. package/esm/index.d.ts +5 -6
  24. package/esm/index.js +4 -5
  25. package/esm/pointSizeMenu.d.ts +12 -24
  26. package/esm/pointSizeMenu.js +9 -20
  27. package/esm/renderingBackendTypes.d.ts +1 -0
  28. package/esm/renderingBackendTypes.js +1 -1
  29. package/esm/scale.d.ts +5 -4
  30. package/esm/scale.js +5 -9
  31. package/esm/valueScaleConfigSchema.d.ts +76 -1
  32. package/esm/valueScaleConfigSchema.js +49 -11
  33. package/esm/yFieldConfigSchemaFields.d.ts +10 -0
  34. package/esm/yFieldConfigSchemaFields.js +8 -0
  35. package/package.json +8 -8
  36. package/esm/ScoreFieldConfigMixin.js +0 -25
  37. package/esm/rowLabelOffset.d.ts +0 -8
  38. package/esm/rowLabelOffset.js +0 -16
  39. package/esm/scoreFieldConfigSchemaFields.d.ts +0 -10
  40. package/esm/scoreFieldConfigSchemaFields.js +0 -8
package/README.md CHANGED
@@ -33,7 +33,7 @@ under `zero`.
33
33
 
34
34
  ```js
35
35
  // type signature
36
- (quantile: number, summaryScoreMode: string, visibleEntries: { data: FeatureArrays; visStart: number; visEnd: number; }[], zero: boolean) => [number, number] | undefined
36
+ (quantile: number, aggregate: string, visibleEntries: { data: FeatureArrays; visStart: number; visEnd: number; }[], zero: boolean, extent?: string) => [number, number] | undefined
37
37
  ```
38
38
 
39
39
  [Source code](https://github.com/GMOD/jbrowse-components/blob/main/packages/wiggle-core/src/autoscale.ts)
@@ -101,12 +101,12 @@ against, so there is nothing to call a hole.
101
101
 
102
102
  ### getEffectiveScores
103
103
 
104
- Per-feature scalar score array for a summary mode: the min/max summary array for
104
+ Per-feature scalar score array for an aggregate: the min/max summary array for
105
105
  `'min'`/`'max'`, otherwise the average score.
106
106
 
107
107
  ```js
108
108
  // type signature
109
- (data: { featureScores: Float32Array<…>; featureMinScores: Float32Array<ArrayBufferLike>; featureMaxScores: Float32Array<...>; }, summaryScoreMode: string) => Float32Array<...>
109
+ (data: { featureScores: Float32Array<ArrayBufferLike>; featureMinScores: Float32Array<ArrayBufferLike>; featureMaxScores: Float32Array<ArrayBufferLike>; }, aggregate: string) => Float32Array<ArrayBufferLike>
110
110
  ```
111
111
 
112
112
  [Source code](https://github.com/GMOD/jbrowse-components/blob/main/packages/wiggle-core/src/autoscale.ts)
@@ -114,10 +114,11 @@ Per-feature scalar score array for a summary mode: the min/max summary array for
114
114
  ### getNiceDomain
115
115
 
116
116
  Rounds a domain to "nice" endpoints. `zero` reaches a linear or symlog domain to
117
- 0 (`scales.y.zero`, ADR-182); a log domain has no 0 and floors at 1 instead. An
117
+ 0 (`scales.y.zero`, ADR-182); a log domain has no 0, so a min at or below it
118
+ floors to a positive value and a positive min stays where the data put it. An
118
119
  end given an explicit `bounds` value keeps that value exactly — only an
119
120
  autoscaled end is rounded. A log scale's floor still outranks a bound it cannot
120
- hold.
121
+ hold, which the `log-floor` rule reports.
121
122
 
122
123
  The result never descends and never collapses: a bound that would put `min`
123
124
  above `max` widens the other end instead, and one value in view widens away from
@@ -125,7 +126,7 @@ itself, so no consumer has to guess what a backwards or a flat domain means.
125
126
 
126
127
  ```js
127
128
  // type signature
128
- ({…}: { scaleType: string; domain: readonly [number, number]; bounds: readonly [number | undefined, number | undefined]; zero: boolean; }) => [number, number]
129
+ ({ scaleType, domain, bounds, zero, }: { scaleType: string; domain: readonly [number, number]; bounds: readonly [number | undefined, number | undefined]; zero: boolean; }) => [number, number]
129
130
  ```
130
131
 
131
132
  [Source code](https://github.com/GMOD/jbrowse-components/blob/main/packages/wiggle-core/src/scale.ts)
@@ -208,7 +209,7 @@ differently, and the alignments coverage band does.
208
209
 
209
210
  ```js
210
211
  // type signature
211
- ({…}: { rules: readonly ValueScaleRule[]; domain: [number, number] | undefined; box: { yTop: number; yBottom: number; }; normalize: (score: number) => number; }) => ScoreRuleMark[]
212
+ ({ rules, domain, box, normalize, }: { rules: readonly ValueScaleRule[]; domain: [number, number] | undefined; box: { yTop: number; yBottom: number; }; normalize: (score: number) => number; }) => ScoreRuleMark[]
212
213
  ```
213
214
 
214
215
  [Source code](https://github.com/GMOD/jbrowse-components/blob/main/packages/wiggle-core/src/scoreRuleMarks.ts)
@@ -40,7 +40,7 @@ const ResolutionStepper = observer(function ResolutionStepper({ getState, onFine
40
40
  // A "Resolution" submenu whose single row is the inline stepper, so it sits
41
41
  // alongside the other track-menu submenus but keeps the menu open while
42
42
  // stepping. Callers own the label formatting, step bounds, and step actions;
43
- // `trailingItems` follow the stepper (wiggle's summary score mode, which reads
43
+ // `trailingItems` follow the stepper (wiggle's aggregate, which reads
44
44
  // the same bins).
45
45
  export function makeResolutionSubMenuItem(opts) {
46
46
  const { getState, onFiner, onCoarser, onReset, icon, resetTitle, trailingItems = [], } = opts;
@@ -1,7 +1,7 @@
1
1
  import type { ScoreAxisDisplay } from './types.ts';
2
2
  /**
3
3
  * `scales.y.rules`, one row per line: its value on the plot's own scale, its
4
- * label and its colour, an empty colour taking the display's. The lines
4
+ * label and its color, an empty color taking the display's. The lines
5
5
  * redraw as soon as every row reads; a half-typed row waits.
6
6
  */
7
7
  declare const _default: ({ display, }: {
@@ -23,7 +23,7 @@ function ruleOf(row) {
23
23
  }
24
24
  /**
25
25
  * `scales.y.rules`, one row per line: its value on the plot's own scale, its
26
- * label and its colour, an empty colour taking the display's. The lines
26
+ * label and its color, an empty color taking the display's. The lines
27
27
  * redraw as soon as every row reads; a half-typed row waits.
28
28
  */
29
29
  export default observer(function ReferenceLines({ display, }) {
@@ -1,6 +1,7 @@
1
1
  import type { ScoreAxisDisplay } from './types.ts';
2
2
  export declare function resetAxis(display: ScoreAxisDisplay): void;
3
- export default function ResetAxisButton({ display, onReset, }: {
3
+ declare const ResetAxisButton: ({ display, onReset, }: {
4
4
  display: ScoreAxisDisplay;
5
5
  onReset: () => void;
6
- }): import("react").JSX.Element;
6
+ }) => import("react").JSX.Element;
7
+ export default ResetAxisButton;
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { setConf } from '@jbrowse/core/configuration';
3
3
  import { baseDisplayConfig } from '@jbrowse/core/util/baseDisplayConfig';
4
4
  import { Button } from '@mui/material';
5
+ import { observer } from 'mobx-react';
5
6
  import { writeThrough } from './writeThrough.js';
6
7
  // Back to what the config.json says, or to what a session-owned track was
7
8
  // added with, so an admin's declared axis survives a reset; slots the base
@@ -12,9 +13,10 @@ export function resetAxis(display) {
12
13
  setConf(display.configuration, ['scales', 'y'], base?.y ?? {});
13
14
  });
14
15
  }
15
- export default function ResetAxisButton({ display, onReset, }) {
16
+ const ResetAxisButton = observer(function ResetAxisButton({ display, onReset, }) {
16
17
  return (_jsx("div", { children: _jsx(Button, { variant: "outlined", size: "small", onClick: () => {
17
18
  resetAxis(display);
18
19
  onReset();
19
20
  }, children: "Reset to defaults" }) }));
20
- }
21
+ });
22
+ export default ResetAxisButton;
@@ -23,7 +23,7 @@ const SCALE_TYPE_LABELS = {
23
23
  log: 'Log',
24
24
  symlog: 'Symlog',
25
25
  };
26
- // A density plot maps score to colour and rules no band, so it has no 0 to
26
+ // A density plot maps score to color and rules no band, so it has no 0 to
27
27
  // include and no lines to draw across it.
28
28
  function rulesABand(display) {
29
29
  return display.scoreRulesDrawn === true;
@@ -1,5 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
- export default function Section({ title, children, }: {
2
+ declare const Section: ({ title, children, }: {
3
3
  title: string;
4
4
  children: ReactNode;
5
- }): import("react").JSX.Element;
5
+ }) => import("react").JSX.Element;
6
+ export default Section;
@@ -1,13 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
3
  import { Typography } from '@mui/material';
4
+ import { observer } from 'mobx-react';
4
5
  const useStyles = makeStyles()(theme => ({
5
6
  section: {
6
7
  display: 'grid',
7
8
  gap: theme.spacing(0.5),
8
9
  },
9
10
  }));
10
- export default function Section({ title, children, }) {
11
+ const Section = observer(function Section({ title, children, }) {
11
12
  const { classes } = useStyles();
12
13
  return (_jsxs("div", { className: classes.section, children: [_jsx(Typography, { variant: "subtitle2", children: title }), children] }));
13
- }
14
+ });
15
+ export default Section;
@@ -9,14 +9,12 @@ interface PlotBox {
9
9
  yTop: number;
10
10
  plotHeight: number;
11
11
  }
12
- interface ContextMenuView {
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: Hit;
17
+ hit: ContextHit;
20
18
  }) => void;
21
19
  clearHoveredFeature: () => void;
22
20
  }
@@ -29,18 +27,20 @@ export type ScorePlotChromeModel<Hit, TRegion, TState extends FrameDimensions> =
29
27
  /**
30
28
  * The on-screen chrome of a display drawing a mark list on a score axis: the
31
29
  * canvas in the axis plot box, hover and click resolved through `findHit`, the
32
- * pointer-following `tooltip`, and the right-click menu where `contextMenu`
33
- * names the model that owns it. `findHit` takes y from the plot's own top.
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).
34
34
  */
35
- export declare const ScorePlotChrome: <Hit, TRegion, TState extends FrameDimensions>({ model, marks, testid, plotGeometry, findHit, tooltip, overlay, indicators, contextMenu, }: {
35
+ export declare const ScorePlotChrome: <Hit, TRegion, TState extends FrameDimensions, ContextHit = Hit>({ model, marks, testid, plotGeometry, findHit, findContextHit, tooltip, overlay, indicators, }: {
36
36
  model: ScorePlotChromeModel<Hit, TRegion, TState>;
37
37
  marks: readonly Mark<TRegion, TState>[];
38
38
  testid: string;
39
39
  plotGeometry?: PlotBox;
40
40
  findHit: (x: number, y: number) => Hit | undefined;
41
+ findContextHit?: (x: number, y: number) => ContextHit | undefined;
41
42
  tooltip: (mouseState: MouseState | undefined) => ReactNode;
42
43
  overlay?: (plotGeometry: PlotBox) => ReactNode;
43
44
  indicators?: () => ReactNode;
44
- contextMenu?: ScorePlotContextMenuHost<Hit>;
45
45
  }) => import("react").JSX.Element;
46
46
  export {};
@@ -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 { DisplayContextMenu, openContextMenuFromEvent, } from '@jbrowse/display-kit/DisplayContextMenu';
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 `contextMenu`
14
- * names the model that owns it. `findHit` takes y from the plot's own top.
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, contextMenu, }) {
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 = hitAt(x, y);
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, { model: model, canvasRef: canvasRef, mouseTracker: mouseTracker, width: width, plotGeometry: box, tooltip: tooltip, overlay: overlay, indicators: indicators, contextMenu: contextMenu })) }));
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({ model, canvasRef, mouseTracker, width, plotGeometry, tooltip, overlay, indicators, contextMenu, }) {
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, { scrollableHeight: model.scrollableHeight, children: indicators() })) : null, contextMenu ? _jsx(DisplayContextMenu, { model: contextMenu }) : null] }));
54
+ } }), overlay?.(plotGeometry), _jsx(PointerLayer, { mouseTracker: mouseTracker, children: tooltip }), indicators ? (_jsx(BottomRightIndicators, { scrollableHeight: model.scrollableHeight, children: indicators() })) : null] }));
47
55
  });
@@ -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.
@@ -120,8 +113,8 @@ export declare function ScoreScaleMixin(): import("@jbrowse/mobx-state-tree").IM
120
113
  * #getter
121
114
  * Whether this display draws `scales.y.rules`, which is whether the
122
115
  * Y axis panel offers Include 0 and the reference lines: a scale it places y through
123
- * rules a band for them to cross, which a density plot's colour-mapped
124
- * rows and a colour ramp do not.
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
  /**
@@ -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';
@@ -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.
@@ -132,8 +118,8 @@ export function ScoreScaleMixin() {
132
118
  * #getter
133
119
  * Whether this display draws `scales.y.rules`, which is whether the
134
120
  * Y axis panel offers Include 0 and the reference lines: a scale it places y through
135
- * rules a band for them to cross, which a density plot's colour-mapped
136
- * rows and a colour ramp do not.
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
- } & typeof wiggleScoreConfigExtraSlots>;
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`) and the scatter point size. A
21
- * display plotting one configured field composes `ScoreFieldConfigMixin`,
22
- * which adds `scoreField`.
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 colour and has no axis to start at 0, so
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`) and the scatter point size. A
15
- * display plotting one configured field composes `ScoreFieldConfigMixin`,
16
- * which adds `scoreField`.
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(self => ({
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 colour and has no axis to start at 0, so
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 { ScoreFieldConfigModel } from './scoreFieldConfigSchemaFields.ts';
2
- export interface ScoreFieldConfigHost {
3
- configuration: ScoreFieldConfigModel;
1
+ import type { YFieldConfigModel } from './yFieldConfigSchemaFields.ts';
2
+ export interface YFieldConfigHost {
3
+ configuration: YFieldConfigModel;
4
4
  }
5
5
  /**
6
- * #stateModel ScoreFieldConfigMixin
6
+ * #stateModel YFieldConfigMixin
7
7
  * #category display
8
8
  *
9
- * `WiggleScoreConfigMixin` plus `scoreField`, for a display that plots one
10
- * configured feature field and so declares `scoreFieldConfigSchemaFields`:
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 ScoreFieldConfigMixin(): import("@jbrowse/mobx-state-tree").IModelType<Omit<{}, never>, {
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 score axis, `score` by
68
- * default. A fetch input: every composing display carries it in its
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 scoreField: string;
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
+ }
@@ -48,21 +48,21 @@ export interface ScoreSpan {
48
48
  row?: Uint32Array;
49
49
  drawnKeys?: Uint8Array;
50
50
  }
51
- /** The wiggle packer's arrays as a span, under a summary mode. */
52
- export declare function datasetSpan({ data, visStart, visEnd }: Dataset, summaryScoreMode: string): ScoreSpan;
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 a summary mode: the min/max summary array
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
- }, summaryScoreMode: string): Float32Array<ArrayBufferLike>;
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(summaryScoreMode: string, datasets: Dataset[]): ScoreStats | undefined;
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
@@ -79,11 +79,12 @@ export declare function autoscaleDomainFromSpans({ stats, quantile, zero, spans,
79
79
  spans: ScoreSpan[];
80
80
  }): [number, number];
81
81
  /** `autoscaleDomainFromSpans` over the wiggle packer's datasets. */
82
- export declare function autoscaleDomainFromStats({ stats, quantile, zero, summaryScoreMode, visibleEntries, }: {
82
+ export declare function autoscaleDomainFromStats({ stats, quantile, zero, aggregate, extent, visibleEntries, }: {
83
83
  stats: ScoreStats;
84
84
  quantile: number;
85
85
  zero: boolean;
86
- summaryScoreMode: string;
86
+ aggregate: string;
87
+ extent: string;
87
88
  visibleEntries: Dataset[];
88
89
  }): [number, number];
89
90
  /**
@@ -92,8 +93,8 @@ export declare function autoscaleDomainFromStats({ stats, quantile, zero, summar
92
93
  * `scales.y.domainQuantile` says, its outliers fenced for an axis that
93
94
  * reaches 0 under `zero`.
94
95
  */
95
- export declare function computeAutoscaleDomain(quantile: number, summaryScoreMode: string, visibleEntries: {
96
+ export declare function computeAutoscaleDomain(quantile: number, aggregate: string, visibleEntries: {
96
97
  data: FeatureArrays;
97
98
  visStart: number;
98
99
  visEnd: number;
99
- }[], zero: boolean): [number, number] | undefined;
100
+ }[], zero: boolean, extent?: string): [number, number] | undefined;