@genome-spy/core 0.43.3 → 0.44.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/bundle/index.es.js +5525 -5259
- package/dist/bundle/index.js +153 -104
- package/dist/schema.json +412 -43
- package/dist/src/data/sources/lazy/axisTickSource.d.ts +1 -1
- package/dist/src/data/sources/lazy/axisTickSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/axisTickSource.js +2 -2
- package/dist/src/data/sources/lazy/bigWigSource.d.ts +6 -0
- package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigWigSource.js +3 -5
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts +1 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.js +1 -1
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts +7 -12
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +33 -29
- package/dist/src/data/transforms/filterScoredLabels.js +1 -1
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/encoder/encoder.js +16 -6
- package/dist/src/genomeSpy.d.ts +1 -0
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +108 -6
- package/dist/src/gl/glslScaleGenerator.d.ts +23 -3
- package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
- package/dist/src/gl/glslScaleGenerator.js +137 -42
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +5 -7
- package/dist/src/marks/link.common.glsl.js +2 -0
- package/dist/src/marks/link.d.ts.map +1 -1
- package/dist/src/marks/link.js +19 -9
- package/dist/src/marks/link.vertex.glsl.js +1 -1
- package/dist/src/marks/mark.d.ts +19 -17
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +181 -120
- package/dist/src/marks/point.common.glsl.js +1 -1
- package/dist/src/marks/rect.common.glsl.js +2 -0
- package/dist/src/marks/rect.d.ts.map +1 -1
- package/dist/src/marks/rect.js +12 -12
- package/dist/src/marks/rect.vertex.glsl.js +1 -1
- package/dist/src/marks/rule.common.glsl.js +1 -1
- package/dist/src/marks/rule.js +2 -2
- package/dist/src/marks/text.common.glsl.js +1 -1
- package/dist/src/marks/text.js +2 -2
- package/dist/src/paramBroker.d.ts +19 -3
- package/dist/src/paramBroker.d.ts.map +1 -1
- package/dist/src/paramBroker.js +18 -2
- package/dist/src/spec/channel.d.ts +4 -3
- package/dist/src/spec/mark.d.ts +17 -25
- package/dist/src/spec/parameter.d.ts +123 -0
- package/dist/src/spec/root.d.ts +9 -0
- package/dist/src/spec/scale.d.ts +2 -1
- package/dist/src/spec/view.d.ts +1 -1
- package/dist/src/types/scaleResolutionApi.d.ts +7 -3
- package/dist/src/utils/expression.d.ts +2 -2
- package/dist/src/utils/expression.d.ts.map +1 -1
- package/dist/src/utils/expression.js +3 -3
- package/dist/src/view/axisView.js +3 -3
- package/dist/src/view/scaleResolution.d.ts +8 -18
- package/dist/src/view/scaleResolution.d.ts.map +1 -1
- package/dist/src/view/scaleResolution.js +220 -126
- package/dist/src/view/scaleResolution.test.js +7 -7
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +10 -3
- package/dist/src/view/view.js +2 -2
- package/package.json +2 -2
package/dist/src/paramBroker.js
CHANGED
|
@@ -12,6 +12,8 @@ import createFunction from "./utils/expression.js";
|
|
|
12
12
|
* - Calling observers when a parameter changes
|
|
13
13
|
* - Somehow saving parameter "state" (in bookmarks)
|
|
14
14
|
* - Maybe something else
|
|
15
|
+
*
|
|
16
|
+
* @typedef {import("./utils/expression.js").ExpressionFunction & { addListener: (listener: () => void) => void, invalidate: () => void}} ExprRefFunction
|
|
15
17
|
*/
|
|
16
18
|
export default class ParamBroker {
|
|
17
19
|
/** @type {Map<string, any>} */
|
|
@@ -72,7 +74,7 @@ export default class ParamBroker {
|
|
|
72
74
|
* @param {string} expr
|
|
73
75
|
*/
|
|
74
76
|
createExpression(expr) {
|
|
75
|
-
/** @type {
|
|
77
|
+
/** @type {ExprRefFunction} */
|
|
76
78
|
const fn = /** @type {any} */ (createFunction(expr, this.#proxy));
|
|
77
79
|
|
|
78
80
|
for (const g of fn.globals) {
|
|
@@ -83,6 +85,9 @@ export default class ParamBroker {
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
// Keep track of them so that they can be detached later
|
|
89
|
+
const myListeners = new Set();
|
|
90
|
+
|
|
86
91
|
/**
|
|
87
92
|
*
|
|
88
93
|
* @param {() => void} listener
|
|
@@ -92,10 +97,21 @@ export default class ParamBroker {
|
|
|
92
97
|
const listeners = this.#paramListeners.get(g) ?? new Set();
|
|
93
98
|
this.#paramListeners.set(g, listeners);
|
|
94
99
|
listeners.add(listener);
|
|
100
|
+
myListeners.add(listener);
|
|
95
101
|
}
|
|
96
102
|
};
|
|
97
103
|
|
|
98
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Detach listeners. This must be called if the expression is no longer used.
|
|
106
|
+
*/
|
|
107
|
+
fn.invalidate = () => {
|
|
108
|
+
for (const g of fn.globals) {
|
|
109
|
+
const listeners = this.#paramListeners.get(g);
|
|
110
|
+
for (const listener of myListeners) {
|
|
111
|
+
listeners.delete(listener);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
99
115
|
|
|
100
116
|
return fn;
|
|
101
117
|
}
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
* BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { ExprRef } from "./parameter.js";
|
|
11
12
|
import { Scale } from "./scale.js";
|
|
12
13
|
import { GenomeAxis } from "./axis.js";
|
|
13
14
|
|
|
14
15
|
export type Scalar = string | number | boolean;
|
|
15
|
-
export type Value = Scalar | null;
|
|
16
|
+
export type Value = Scalar | ExprRef | null;
|
|
16
17
|
|
|
17
18
|
export type FieldName = string;
|
|
18
19
|
export type Field = FieldName;
|
|
@@ -149,7 +150,7 @@ export interface ValueDefBase<V extends Value = Scalar> {
|
|
|
149
150
|
/**
|
|
150
151
|
* A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).
|
|
151
152
|
*/
|
|
152
|
-
value: V;
|
|
153
|
+
value: V | ExprRef;
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
export type ValueDef<V extends Value = Scalar> = ValueDefBase<V> & TitleMixins;
|
|
@@ -158,7 +159,7 @@ export interface DatumDefBase {
|
|
|
158
159
|
/**
|
|
159
160
|
* A constant value in data domain.
|
|
160
161
|
*/
|
|
161
|
-
datum?: Scalar;
|
|
162
|
+
datum?: Scalar | ExprRef;
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
export type DatumDef = DatumDefBase & TitleMixins;
|
package/dist/src/spec/mark.d.ts
CHANGED
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
import { Scalar } from "./channel.js";
|
|
2
|
+
import { ExprRef } from "./parameter.js";
|
|
2
3
|
import { Align, Baseline, FontStyle, FontWeight } from "./font.js";
|
|
3
4
|
import { Tooltip } from "./tooltip.js";
|
|
4
5
|
|
|
5
|
-
// TODO: This may not be the best place for this type.
|
|
6
|
-
// Also, this is now similar to the ExprDef type in channel.d.ts
|
|
7
|
-
export interface ExprRef {
|
|
8
|
-
/**
|
|
9
|
-
* The expression string.
|
|
10
|
-
*/
|
|
11
|
-
expr: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
6
|
export type MarkType = "rect" | "point" | "rule" | "text" | "link";
|
|
15
7
|
|
|
16
8
|
export interface FillAndStrokeProps {
|
|
17
9
|
/** The fill color */
|
|
18
|
-
fill?: string;
|
|
10
|
+
fill?: string | ExprRef;
|
|
19
11
|
|
|
20
12
|
/** The fill opacity. Value between [0, 1]. */
|
|
21
|
-
fillOpacity?: number;
|
|
13
|
+
fillOpacity?: number | ExprRef;
|
|
22
14
|
|
|
23
15
|
/** The stroke color */
|
|
24
|
-
stroke?: string;
|
|
16
|
+
stroke?: string | ExprRef;
|
|
25
17
|
|
|
26
18
|
/** The stroke opacity. Value between [0, 1]. */
|
|
27
|
-
strokeOpacity?: number;
|
|
19
|
+
strokeOpacity?: number | ExprRef;
|
|
28
20
|
}
|
|
29
21
|
|
|
30
22
|
export interface SecondaryPositionProps {
|
|
31
|
-
x2?: number;
|
|
32
|
-
y2?: number;
|
|
23
|
+
x2?: number | ExprRef;
|
|
24
|
+
y2?: number | ExprRef;
|
|
33
25
|
}
|
|
34
26
|
|
|
35
27
|
export interface AngleProps {
|
|
@@ -38,7 +30,7 @@ export interface AngleProps {
|
|
|
38
30
|
*
|
|
39
31
|
* **Default value:** `0`
|
|
40
32
|
*/
|
|
41
|
-
angle?: number;
|
|
33
|
+
angle?: number | ExprRef;
|
|
42
34
|
}
|
|
43
35
|
|
|
44
36
|
/**
|
|
@@ -177,7 +169,7 @@ export interface TextProps
|
|
|
177
169
|
*
|
|
178
170
|
* **Default value:** `11`
|
|
179
171
|
*/
|
|
180
|
-
size?: number;
|
|
172
|
+
size?: number | ExprRef;
|
|
181
173
|
|
|
182
174
|
/**
|
|
183
175
|
* The font typeface. GenomeSpy uses [SDF](https://github.com/Chlumsky/msdfgen)
|
|
@@ -414,7 +406,7 @@ export interface LinkProps extends SecondaryPositionProps {
|
|
|
414
406
|
}
|
|
415
407
|
|
|
416
408
|
// TODO: Mark-specific configs
|
|
417
|
-
export interface
|
|
409
|
+
export interface MarkProps
|
|
418
410
|
extends PointProps,
|
|
419
411
|
RectProps,
|
|
420
412
|
TextProps,
|
|
@@ -422,11 +414,11 @@ export interface MarkConfig
|
|
|
422
414
|
LinkProps,
|
|
423
415
|
FillAndStrokeProps {
|
|
424
416
|
// Channels.
|
|
425
|
-
x?: number;
|
|
426
|
-
y?: number;
|
|
427
|
-
color?: string;
|
|
428
|
-
opacity?: number;
|
|
429
|
-
size?: number;
|
|
417
|
+
x?: number | ExprRef;
|
|
418
|
+
y?: number | ExprRef;
|
|
419
|
+
color?: string | ExprRef;
|
|
420
|
+
opacity?: number | ExprRef;
|
|
421
|
+
size?: number | ExprRef;
|
|
430
422
|
|
|
431
423
|
/**
|
|
432
424
|
* Whether the `color` represents the `fill` color (`true`) or the `stroke` color (`false`).
|
|
@@ -463,7 +455,7 @@ export interface MarkConfig
|
|
|
463
455
|
/**
|
|
464
456
|
* The stroke width in pixels.
|
|
465
457
|
*/
|
|
466
|
-
strokeWidth?: number;
|
|
458
|
+
strokeWidth?: number | ExprRef;
|
|
467
459
|
|
|
468
460
|
/**
|
|
469
461
|
* Minimum size for WebGL buffers (number of data items).
|
|
@@ -474,6 +466,6 @@ export interface MarkConfig
|
|
|
474
466
|
minBufferSize?: number;
|
|
475
467
|
}
|
|
476
468
|
|
|
477
|
-
export interface MarkConfigAndType extends
|
|
469
|
+
export interface MarkConfigAndType extends MarkProps {
|
|
478
470
|
type: MarkType;
|
|
479
471
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export interface ExprRef {
|
|
2
|
+
/**
|
|
3
|
+
* The expression string.
|
|
4
|
+
*/
|
|
5
|
+
expr: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Adapted from: https://github.com/vega/vega-lite/blob/main/src/parameter.ts
|
|
9
|
+
|
|
10
|
+
export interface VariableParameter {
|
|
11
|
+
/**
|
|
12
|
+
* A unique name for the variable parameter. Parameter names should be valid
|
|
13
|
+
* JavaScript identifiers: they should contain only alphanumeric characters
|
|
14
|
+
* (or "$", or "_") and may not start with a digit. Reserved keywords that
|
|
15
|
+
* may not be used as parameter names are: "datum".
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.
|
|
21
|
+
*
|
|
22
|
+
* __Default value:__ `undefined`
|
|
23
|
+
*/
|
|
24
|
+
value?: any;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Binds the parameter to an external input element such as a slider, selection list or radio button group.
|
|
28
|
+
*/
|
|
29
|
+
bind?: Binding;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ----------------------------------------------------------------------------
|
|
33
|
+
// Adapted from: https://github.com/vega/vega/blob/main/packages/vega-typings/types/spec/bind.d.ts
|
|
34
|
+
|
|
35
|
+
export type Element = string;
|
|
36
|
+
|
|
37
|
+
export interface BindBase {
|
|
38
|
+
/**
|
|
39
|
+
* An optional CSS selector string indicating the parent element to which
|
|
40
|
+
* the input element should be added. By default, all input elements are
|
|
41
|
+
* added within the parent container of the Vega view.
|
|
42
|
+
*/
|
|
43
|
+
element?: Element;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* If defined, delays event handling until the specified milliseconds have
|
|
47
|
+
* elapsed since the last event was fired.
|
|
48
|
+
*/
|
|
49
|
+
debounce?: number;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* By default, the parameter name is used to label input elements.
|
|
53
|
+
* This `name` property can be used instead to specify a custom
|
|
54
|
+
* label for the bound parameter.
|
|
55
|
+
*/
|
|
56
|
+
name?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface BindCheckbox extends BindBase {
|
|
60
|
+
input: "checkbox";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface BindRadioSelect extends BindBase {
|
|
64
|
+
input: "radio" | "select";
|
|
65
|
+
/**
|
|
66
|
+
* An array of options to select from.
|
|
67
|
+
*/
|
|
68
|
+
options: any[];
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* An array of label strings to represent the `options` values. If
|
|
72
|
+
* unspecified, the `options` value will be coerced to a string and
|
|
73
|
+
* used as the label.
|
|
74
|
+
*/
|
|
75
|
+
labels?: string[];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface BindRange extends BindBase {
|
|
79
|
+
input: "range";
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Sets the minimum slider value. Defaults to the smaller of the signal value and `0`.
|
|
83
|
+
*/
|
|
84
|
+
min?: number;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Sets the maximum slider value. Defaults to the larger of the signal value and `100`.
|
|
88
|
+
*/
|
|
89
|
+
max?: number;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Sets the minimum slider increment. If undefined, the step size will be
|
|
93
|
+
* automatically determined based on the `min` and `max` values.
|
|
94
|
+
*/
|
|
95
|
+
step?: number;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface BindDirect {
|
|
99
|
+
/**
|
|
100
|
+
* An input element that exposes a _value_ property and supports the
|
|
101
|
+
* [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)
|
|
102
|
+
* interface, or a CSS selector string to such an element. When the element
|
|
103
|
+
* updates and dispatches an event, the _value_ property will be used as the
|
|
104
|
+
* new, bound signal value. When the signal updates independent of the
|
|
105
|
+
* element, the _value_ property will be set to the signal value and a new
|
|
106
|
+
* event will be dispatched on the element.
|
|
107
|
+
*/
|
|
108
|
+
element: Element | EventTarget;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The event (default `"input"`) to listen for to track changes on the
|
|
112
|
+
* external element.
|
|
113
|
+
*/
|
|
114
|
+
event?: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* If defined, delays event handling until the specified milliseconds have
|
|
118
|
+
* elapsed since the last event was fired.
|
|
119
|
+
*/
|
|
120
|
+
debounce?: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type Binding = BindCheckbox | BindRadioSelect | BindRange;
|
package/dist/src/spec/root.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GenomeConfig } from "./genome.js";
|
|
2
|
+
import { VariableParameter } from "./parameter.js";
|
|
2
3
|
import { ViewSpec } from "./view.js";
|
|
3
4
|
|
|
4
5
|
interface RootConfig {
|
|
@@ -13,6 +14,14 @@ interface RootConfig {
|
|
|
13
14
|
*/
|
|
14
15
|
background?: string;
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Dynamic variables that parameterize a visualization.
|
|
19
|
+
*
|
|
20
|
+
* For now, these are only supported in mark properties, i.e.,
|
|
21
|
+
* they are not supported in the filter and formula transforms (yet).
|
|
22
|
+
*/
|
|
23
|
+
params?: VariableParameter[];
|
|
24
|
+
|
|
16
25
|
/**
|
|
17
26
|
* https://vega.github.io/vega-lite/docs/data.html#datasets
|
|
18
27
|
*/
|
package/dist/src/spec/scale.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { ChromosomalLocus } from "./genome.js";
|
|
12
|
+
import { ExprRef } from "./parameter.js";
|
|
12
13
|
|
|
13
14
|
export type ScaleType =
|
|
14
15
|
| "null"
|
|
@@ -94,7 +95,7 @@ export interface Scale {
|
|
|
94
95
|
*
|
|
95
96
|
* 2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be customized via the view's corresponding [size](https://vega.github.io/vega-lite/docs/size.html) (`width` and `height`).
|
|
96
97
|
*/
|
|
97
|
-
range?: number[] | string[] | string;
|
|
98
|
+
range?: number[] | string[] | string | ExprRef[];
|
|
98
99
|
|
|
99
100
|
// ordinal
|
|
100
101
|
|
package/dist/src/spec/view.d.ts
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
PrimaryPositionalChannel,
|
|
8
8
|
} from "./channel.js";
|
|
9
9
|
import {
|
|
10
|
-
ExprRef,
|
|
11
10
|
FillAndStrokeProps,
|
|
12
11
|
MarkConfigAndType,
|
|
13
12
|
MarkType,
|
|
14
13
|
RectProps,
|
|
15
14
|
} from "./mark.js";
|
|
15
|
+
import { ExprRef } from "./parameter.js";
|
|
16
16
|
import { Title } from "./title.js";
|
|
17
17
|
import { SampleSpec } from "./sampleView.js";
|
|
18
18
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ComplexDomain, NumericDomain } from "../spec/scale.js";
|
|
2
2
|
import ScaleResolution from "../view/scaleResolution.js";
|
|
3
3
|
|
|
4
|
+
export type ScaleResolutionEventType = "domain" | "range";
|
|
4
5
|
export interface ScaleResolutionEvent {
|
|
5
|
-
type:
|
|
6
|
+
type: ScaleResolutionEventType;
|
|
6
7
|
|
|
7
8
|
scaleResolution: ScaleResolution;
|
|
8
9
|
}
|
|
@@ -13,10 +14,13 @@ export type ScaleResolutionListener = (event: ScaleResolutionEvent) => void;
|
|
|
13
14
|
* A public API for ScaleResolution
|
|
14
15
|
*/
|
|
15
16
|
export interface ScaleResolutionApi {
|
|
16
|
-
addEventListener(
|
|
17
|
+
addEventListener(
|
|
18
|
+
type: ScaleResolutionEventType,
|
|
19
|
+
listener: ScaleResolutionListener
|
|
20
|
+
): void;
|
|
17
21
|
|
|
18
22
|
removeEventListener(
|
|
19
|
-
type:
|
|
23
|
+
type: ScaleResolutionEventType,
|
|
20
24
|
listener: ScaleResolutionListener
|
|
21
25
|
): void;
|
|
22
26
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @prop { string[] } globals
|
|
5
5
|
* @prop { string } code
|
|
6
6
|
*
|
|
7
|
-
* @typedef { ((
|
|
7
|
+
* @typedef { ((datum: object) => any) & ExpressionProps } ExpressionFunction
|
|
8
8
|
*
|
|
9
9
|
* @param {string} expr
|
|
10
10
|
* @returns {ExpressionFunction}
|
|
@@ -15,5 +15,5 @@ export type ExpressionProps = {
|
|
|
15
15
|
globals: string[];
|
|
16
16
|
code: string;
|
|
17
17
|
};
|
|
18
|
-
export type ExpressionFunction = ((
|
|
18
|
+
export type ExpressionFunction = ((datum: object) => any) & ExpressionProps;
|
|
19
19
|
//# sourceMappingURL=expression.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/utils/expression.js"],"names":[],"mappings":"AAyDA;;;;;;;;;;GAUG;AACH,6CAHW,MAAM,sBACJ,kBAAkB,CAyB9B;;YAhCU,MAAM,EAAE;aACR,MAAM,EAAE;UACR,MAAM;;
|
|
1
|
+
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/utils/expression.js"],"names":[],"mappings":"AAyDA;;;;;;;;;;GAUG;AACH,6CAHW,MAAM,sBACJ,kBAAkB,CAyB9B;;YAhCU,MAAM,EAAE;aACR,MAAM,EAAE;UACR,MAAM;;0CAEM,MAAM,KAAK,GAAG"}
|
|
@@ -61,7 +61,7 @@ const cg = codegenExpression({
|
|
|
61
61
|
* @prop { string[] } globals
|
|
62
62
|
* @prop { string } code
|
|
63
63
|
*
|
|
64
|
-
* @typedef { ((
|
|
64
|
+
* @typedef { ((datum: object) => any) & ExpressionProps } ExpressionFunction
|
|
65
65
|
*
|
|
66
66
|
* @param {string} expr
|
|
67
67
|
* @returns {ExpressionFunction}
|
|
@@ -79,8 +79,8 @@ export default function createFunction(expr, globalObject = {}) {
|
|
|
79
79
|
).bind(functionContext);
|
|
80
80
|
|
|
81
81
|
/** @type { ExpressionFunction } */
|
|
82
|
-
const exprFunction = /** @param {object}
|
|
83
|
-
fn(
|
|
82
|
+
const exprFunction = /** @param {object} datum */ (datum) =>
|
|
83
|
+
fn(datum, globalObject);
|
|
84
84
|
exprFunction.fields = generatedCode.fields;
|
|
85
85
|
exprFunction.globals = generatedCode.globals;
|
|
86
86
|
exprFunction.code = generatedCode.code;
|
|
@@ -459,7 +459,7 @@ export function createGenomeAxis(axisProps, type) {
|
|
|
459
459
|
* @return {import("../spec/view.js").UnitSpec}
|
|
460
460
|
*/
|
|
461
461
|
const createChromosomeLabels = () => {
|
|
462
|
-
/** @type {Partial<import("../spec/mark.js").
|
|
462
|
+
/** @type {Partial<import("../spec/mark.js").MarkProps>} */
|
|
463
463
|
let chromLabelMarkProps;
|
|
464
464
|
switch (ap.orient) {
|
|
465
465
|
case "top":
|
|
@@ -594,7 +594,7 @@ export function createGenomeAxis(axisProps, type) {
|
|
|
594
594
|
if (axisProps.chromLabels) {
|
|
595
595
|
chromLayerSpec.layer.push(createChromosomeLabels());
|
|
596
596
|
|
|
597
|
-
/** @type {import("../spec/mark.js").
|
|
597
|
+
/** @type {import("../spec/mark.js").MarkProps} */
|
|
598
598
|
let labelMarkSpec;
|
|
599
599
|
|
|
600
600
|
// TODO: Simplify the following mess
|
|
@@ -608,7 +608,7 @@ export function createGenomeAxis(axisProps, type) {
|
|
|
608
608
|
/** @type {import("../spec/view.js").UnitSpec} */ view
|
|
609
609
|
) => {
|
|
610
610
|
labelMarkSpec =
|
|
611
|
-
/** @type {import("../spec/mark.js").
|
|
611
|
+
/** @type {import("../spec/mark.js").MarkProps} */ (
|
|
612
612
|
view.mark
|
|
613
613
|
);
|
|
614
614
|
}
|
|
@@ -45,15 +45,15 @@ export default class ScaleResolution implements ScaleResolutionApi {
|
|
|
45
45
|
* e.g., zoomed. The call is synchronous and happens before the views
|
|
46
46
|
* are rendered.
|
|
47
47
|
*
|
|
48
|
-
* @param {
|
|
48
|
+
* @param {ScaleResolutionEventType} type
|
|
49
49
|
* @param {ScaleResolutionListener} listener function
|
|
50
50
|
*/
|
|
51
|
-
addEventListener(type: "
|
|
51
|
+
addEventListener(type: import("../types/scaleResolutionApi.js").ScaleResolutionEventType, listener: import("../types/scaleResolutionApi.js").ScaleResolutionListener): void;
|
|
52
52
|
/**
|
|
53
|
-
* @param {
|
|
53
|
+
* @param {ScaleResolutionEventType} type
|
|
54
54
|
* @param {ScaleResolutionListener} listener function
|
|
55
55
|
*/
|
|
56
|
-
removeEventListener(type: "
|
|
56
|
+
removeEventListener(type: import("../types/scaleResolutionApi.js").ScaleResolutionEventType, listener: import("../types/scaleResolutionApi.js").ScaleResolutionListener): void;
|
|
57
57
|
/**
|
|
58
58
|
* Add a view to this resolution.
|
|
59
59
|
* N.B. This is expected to be called in depth-first order
|
|
@@ -62,18 +62,6 @@ export default class ScaleResolution implements ScaleResolutionApi {
|
|
|
62
62
|
* @param {ChannelWithScale} channel
|
|
63
63
|
*/
|
|
64
64
|
pushUnitView(view: import("./unitView.js").default, channel: import("../spec/channel.js").ChannelWithScale): void;
|
|
65
|
-
/**
|
|
66
|
-
* Returns true if the domain has been defined explicitly, i.e. not extracted from the data.
|
|
67
|
-
*/
|
|
68
|
-
isExplicitDomain(): boolean;
|
|
69
|
-
isDomainInitialized(): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Returns the merged scale properties supplemented with inferred properties
|
|
72
|
-
* and domain.
|
|
73
|
-
*
|
|
74
|
-
* @returns {import("../spec/scale.js").Scale}
|
|
75
|
-
*/
|
|
76
|
-
getScaleProps(): import("../spec/scale.js").Scale;
|
|
77
65
|
/**
|
|
78
66
|
* Unions the configured domains of all participating views.
|
|
79
67
|
*
|
|
@@ -91,9 +79,11 @@ export default class ScaleResolution implements ScaleResolutionApi {
|
|
|
91
79
|
*/
|
|
92
80
|
reconfigure(): void;
|
|
93
81
|
/**
|
|
94
|
-
* @returns {
|
|
82
|
+
* @returns {ScaleWithProps}
|
|
95
83
|
*/
|
|
96
|
-
|
|
84
|
+
get scale(): import("../types/encoder.js").VegaScale & {
|
|
85
|
+
props: import("../spec/scale.js").Scale;
|
|
86
|
+
};
|
|
97
87
|
getDomain(): any[];
|
|
98
88
|
/**
|
|
99
89
|
* @returns {NumericDomain | ComplexDomain}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaleResolution.d.ts","sourceRoot":"","sources":["../../../src/view/scaleResolution.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaleResolution.d.ts","sourceRoot":"","sources":["../../../src/view/scaleResolution.js"],"names":[],"mappings":"AAy6BA;;;;;;;;;;GAUG;AACH,6CAFW,OAAO,WAAW,EAAE,OAAO,GAAG,OAAO,WAAW,EAAE,OAAO,EAAE,QA4BrE;AAh6BD,0CAA2C;AAC3C,gCAAiC;AACjC,gCAAiC;AACjC,4BAA6B;AAC7B,4BAA6B;AAE7B;;;;GAIG;AACH;;;;;;;GAOG;AACH;IAyCI;;OAEG;IACH,2DASC;IARG,8CAAsB;IACtB,oDAAoD;IACpD,SADW,gBAAgB,EAAE,CACZ;IACjB,+DAA+D;IAC/D,MADW,MAAM,CACD;IAEhB,iEAAiE;IACjE,MADW,MAAM,CACI;IAOzB;;;;;;;OAOG;IACH,4KAEC;IAED;;;OAGG;IACH,+KAEC;IAcD;;;;;;OAMG;IACH,kHA0BC;IAkLD;;;;OAIG;IACH,qEAMC;IAED;;;;OAIG;IACH,+DAQC;IAED;;OAEG;IACH,oBAyCC;IAED;;OAEG;IACH;eA3WkC,OAAO,kBAAkB,EAAE,KAAK;MAkZjE;IAED,mBAEC;IAED;;OAEG;IACH,oBAFa,mFAA6B,CAOzC;IAED;;;;OAIG;IACH,oBAKC;IAED;;OAEG;IACH,sBAGC;IAUD;;;;;;;OAOG;IACH,kBALW,MAAM,eACN,MAAM,OACN,MAAM,GACJ,OAAO,CAwEnB;IAED;;;;;;OAMG;IACH,eAJW,mFAA6B,aAC7B,OAAO,GAAG,MAAM,iBAgD1B;IAED;;;;OAIG;IACH,qBAcC;IAED;;;;;OAKG;IACH,uBAOC;IA8DD;;;OAGG;IACH,aAFa,OAAO,qBAAqB,EAAE,OAAO,CAajD;IAID;;;;;OAKG;IACH,uBAFW,MAAM,yDAUhB;IAED;;OAEG;IACH,iBAFW,MAAM,yDAKhB;IAED;;;OAGG;IACH,6EAFa,MAAM,CAQlB;IAED;;;OAGG;IACH,mHAFa,MAAM,EAAE,CAOpB;;CA6BJ;wIA5xBY;IAAC,IAAI,EAAE,OAAO,eAAe,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAC"}
|