@genome-spy/core 0.48.2 → 0.49.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 +7226 -6923
- package/dist/bundle/index.js +121 -108
- package/dist/schema.json +838 -344
- package/dist/src/data/collector.test.d.ts +2 -0
- package/dist/src/data/collector.test.d.ts.map +1 -0
- package/dist/src/data/dataFlow.test.d.ts +2 -0
- package/dist/src/data/dataFlow.test.d.ts.map +1 -0
- package/dist/src/data/flow.test.d.ts +2 -0
- package/dist/src/data/flow.test.d.ts.map +1 -0
- package/dist/src/data/flow.test.js +19 -14
- package/dist/src/data/flowNode.test.d.ts +2 -0
- package/dist/src/data/flowNode.test.d.ts.map +1 -0
- package/dist/src/data/flowOptimizer.test.d.ts +2 -0
- package/dist/src/data/flowOptimizer.test.d.ts.map +1 -0
- package/dist/src/data/flowOptimizer.test.js +9 -10
- package/dist/src/data/formats/fasta.test.d.ts +2 -0
- package/dist/src/data/formats/fasta.test.d.ts.map +1 -0
- package/dist/src/data/sources/inlineSource.test.d.ts +2 -0
- package/dist/src/data/sources/inlineSource.test.d.ts.map +1 -0
- package/dist/src/data/sources/inlineSource.test.js +23 -16
- package/dist/src/data/sources/sequenceSource.test.d.ts +2 -0
- package/dist/src/data/sources/sequenceSource.test.d.ts.map +1 -0
- package/dist/src/data/sources/sequenceSource.test.js +59 -42
- package/dist/src/data/transforms/clone.test.d.ts +2 -0
- package/dist/src/data/transforms/clone.test.d.ts.map +1 -0
- package/dist/src/data/transforms/coverage.test.d.ts +2 -0
- package/dist/src/data/transforms/coverage.test.d.ts.map +1 -0
- package/dist/src/data/transforms/coverage.test.js +1 -1
- package/dist/src/data/transforms/filter.d.ts +10 -0
- package/dist/src/data/transforms/filter.d.ts.map +1 -1
- package/dist/src/data/transforms/filter.js +30 -1
- package/dist/src/data/transforms/filter.test.d.ts +2 -0
- package/dist/src/data/transforms/filter.test.d.ts.map +1 -0
- package/dist/src/data/transforms/flatten.test.d.ts +2 -0
- package/dist/src/data/transforms/flatten.test.d.ts.map +1 -0
- package/dist/src/data/transforms/flatten.test.js +10 -7
- package/dist/src/data/transforms/flattenDelimited.test.d.ts +2 -0
- package/dist/src/data/transforms/flattenDelimited.test.d.ts.map +1 -0
- package/dist/src/data/transforms/flattenDelimited.test.js +16 -13
- package/dist/src/data/transforms/flattenSequence.test.d.ts +2 -0
- package/dist/src/data/transforms/flattenSequence.test.d.ts.map +1 -0
- package/dist/src/data/transforms/flattenSequence.test.js +1 -1
- package/dist/src/data/transforms/formula.test.d.ts +2 -0
- package/dist/src/data/transforms/formula.test.d.ts.map +1 -0
- package/dist/src/data/transforms/formula.test.js +1 -1
- package/dist/src/data/transforms/identifier.test.d.ts +2 -0
- package/dist/src/data/transforms/identifier.test.d.ts.map +1 -0
- package/dist/src/data/transforms/pileup.test.d.ts +2 -0
- package/dist/src/data/transforms/pileup.test.d.ts.map +1 -0
- package/dist/src/data/transforms/project.test.d.ts +2 -0
- package/dist/src/data/transforms/project.test.d.ts.map +1 -0
- package/dist/src/data/transforms/project.test.js +1 -1
- package/dist/src/data/transforms/regexExtract.test.d.ts +2 -0
- package/dist/src/data/transforms/regexExtract.test.d.ts.map +1 -0
- package/dist/src/data/transforms/regexExtract.test.js +6 -3
- package/dist/src/data/transforms/regexFold.test.d.ts +2 -0
- package/dist/src/data/transforms/regexFold.test.d.ts.map +1 -0
- package/dist/src/data/transforms/sample.test.d.ts +2 -0
- package/dist/src/data/transforms/sample.test.d.ts.map +1 -0
- package/dist/src/data/transforms/stack.test.d.ts +2 -0
- package/dist/src/data/transforms/stack.test.d.ts.map +1 -0
- package/dist/src/data/transforms/stack.test.js +8 -8
- package/dist/src/encoder/accessor.d.ts +17 -14
- package/dist/src/encoder/accessor.d.ts.map +1 -1
- package/dist/src/encoder/accessor.js +127 -56
- package/dist/src/encoder/accessor.test.d.ts +2 -0
- package/dist/src/encoder/accessor.test.d.ts.map +1 -0
- package/dist/src/encoder/accessor.test.js +145 -31
- package/dist/src/encoder/encoder.d.ts +26 -13
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/encoder/encoder.js +98 -114
- package/dist/src/encoder/encoder.test.d.ts +2 -0
- package/dist/src/encoder/encoder.test.d.ts.map +1 -0
- package/dist/src/encoder/encoder.test.js +85 -82
- package/dist/src/fonts/bmFontManager.d.ts.map +1 -1
- package/dist/src/fonts/bmFontManager.js +10 -4
- package/dist/src/genome/genome.test.d.ts +2 -0
- package/dist/src/genome/genome.test.d.ts.map +1 -0
- package/dist/src/genome/scaleIndex.test.d.ts +2 -0
- package/dist/src/genome/scaleIndex.test.d.ts.map +1 -0
- package/dist/src/genome/scaleLocus.test.d.ts +2 -0
- package/dist/src/genome/scaleLocus.test.d.ts.map +1 -0
- package/dist/src/genomeSpy.d.ts +3 -2
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +15 -6
- package/dist/src/gl/dataToVertices.d.ts +6 -8
- package/dist/src/gl/dataToVertices.d.ts.map +1 -1
- package/dist/src/gl/dataToVertices.js +42 -33
- package/dist/src/gl/glslScaleGenerator.d.ts +84 -15
- package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
- package/dist/src/gl/glslScaleGenerator.js +260 -73
- package/dist/src/marks/link.common.glsl.js +1 -1
- package/dist/src/marks/link.d.ts.map +1 -1
- package/dist/src/marks/link.js +10 -0
- package/dist/src/marks/link.vertex.glsl.js +1 -1
- package/dist/src/marks/mark.d.ts +6 -9
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +212 -95
- package/dist/src/marks/point.d.ts.map +1 -1
- package/dist/src/marks/point.js +5 -1
- package/dist/src/marks/rect.d.ts.map +1 -1
- package/dist/src/marks/rect.js +9 -4
- package/dist/src/marks/rule.d.ts.map +1 -1
- package/dist/src/marks/rule.js +4 -0
- package/dist/src/marks/text.d.ts.map +1 -1
- package/dist/src/marks/text.js +5 -1
- package/dist/src/scale/scale.test.d.ts +2 -0
- package/dist/src/scale/scale.test.d.ts.map +1 -0
- package/dist/src/scale/scale.test.js +2 -0
- package/dist/src/scale/ticks.test.d.ts +2 -0
- package/dist/src/scale/ticks.test.d.ts.map +1 -0
- package/dist/src/scale/ticks.test.js +6 -0
- package/dist/src/selection/selection.d.ts +39 -0
- package/dist/src/selection/selection.d.ts.map +1 -0
- package/dist/src/selection/selection.js +78 -0
- package/dist/src/spec/channel.d.ts +137 -83
- package/dist/src/spec/mark.d.ts +9 -0
- package/dist/src/spec/parameter.d.ts +112 -3
- package/dist/src/spec/root.d.ts +0 -1
- package/dist/src/spec/transform.d.ts +19 -1
- package/dist/src/spec/view.d.ts +3 -3
- package/dist/src/tooltip/dataTooltipHandler.js +1 -1
- package/dist/src/types/encoder.d.ts +80 -26
- package/dist/src/types/rendering.d.ts +1 -0
- package/dist/src/types/selectionTypes.d.ts +44 -0
- package/dist/src/types/viewContext.d.ts +1 -4
- package/dist/src/utils/addBaseUrl.test.d.ts +2 -0
- package/dist/src/utils/addBaseUrl.test.d.ts.map +1 -0
- package/dist/src/utils/binnedIndex.test.d.ts +2 -0
- package/dist/src/utils/binnedIndex.test.d.ts.map +1 -0
- package/dist/src/utils/cloner.test.d.ts +2 -0
- package/dist/src/utils/cloner.test.d.ts.map +1 -0
- package/dist/src/utils/coalesce.test.d.ts +2 -0
- package/dist/src/utils/coalesce.test.d.ts.map +1 -0
- package/dist/src/utils/concatIterables.test.d.ts +2 -0
- package/dist/src/utils/concatIterables.test.d.ts.map +1 -0
- package/dist/src/utils/domainArray.test.d.ts +2 -0
- package/dist/src/utils/domainArray.test.d.ts.map +1 -0
- 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 +11 -2
- package/dist/src/utils/indexer.test.d.ts +2 -0
- package/dist/src/utils/indexer.test.d.ts.map +1 -0
- package/dist/src/utils/inputBinding.d.ts.map +1 -1
- package/dist/src/utils/inputBinding.js +4 -0
- package/dist/src/utils/iterateNestedMaps.test.d.ts +2 -0
- package/dist/src/utils/iterateNestedMaps.test.d.ts.map +1 -0
- package/dist/src/utils/kWayMerge.test.d.ts +2 -0
- package/dist/src/utils/kWayMerge.test.d.ts.map +1 -0
- package/dist/src/utils/mergeObjects.test.d.ts +2 -0
- package/dist/src/utils/mergeObjects.test.d.ts.map +1 -0
- package/dist/src/utils/numberExtractor.test.d.ts +2 -0
- package/dist/src/utils/numberExtractor.test.d.ts.map +1 -0
- package/dist/src/utils/propertyCacher.test.d.ts +2 -0
- package/dist/src/utils/propertyCacher.test.d.ts.map +1 -0
- package/dist/src/utils/propertyCoalescer.test.d.ts +2 -0
- package/dist/src/utils/propertyCoalescer.test.d.ts.map +1 -0
- package/dist/src/utils/propertyCoalescer.test.js +3 -0
- package/dist/src/utils/radixSort.test.d.ts +2 -0
- package/dist/src/utils/radixSort.test.d.ts.map +1 -0
- package/dist/src/utils/reservationMap.test.d.ts +2 -0
- package/dist/src/utils/reservationMap.test.d.ts.map +1 -0
- package/dist/src/utils/ringBuffer.test.d.ts +2 -0
- package/dist/src/utils/ringBuffer.test.d.ts.map +1 -0
- package/dist/src/utils/topK.test.d.ts +2 -0
- package/dist/src/utils/topK.test.d.ts.map +1 -0
- package/dist/src/utils/trees.test.d.ts +2 -0
- package/dist/src/utils/trees.test.d.ts.map +1 -0
- package/dist/src/utils/trees.test.js +8 -3
- package/dist/src/utils/variableTools.test.d.ts +2 -0
- package/dist/src/utils/variableTools.test.d.ts.map +1 -0
- package/dist/src/view/axisResolution.d.ts +19 -6
- package/dist/src/view/axisResolution.d.ts.map +1 -1
- package/dist/src/view/axisResolution.js +16 -7
- package/dist/src/view/axisResolution.test.d.ts +2 -0
- package/dist/src/view/axisResolution.test.d.ts.map +1 -0
- package/dist/src/view/axisResolution.test.js +16 -11
- package/dist/src/view/facetView.d.ts +1 -1
- package/dist/src/view/facetView.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.d.ts +1 -1
- package/dist/src/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +34 -5
- package/dist/src/view/flowBuilder.test.d.ts +2 -0
- package/dist/src/view/flowBuilder.test.d.ts.map +1 -0
- package/dist/src/view/gridView.d.ts +0 -6
- package/dist/src/view/gridView.d.ts.map +1 -1
- package/dist/src/view/layerView.d.ts +0 -6
- package/dist/src/view/layerView.d.ts.map +1 -1
- package/dist/src/view/layout/flexLayout.test.d.ts +2 -0
- package/dist/src/view/layout/flexLayout.test.d.ts.map +1 -0
- package/dist/src/view/layout/grid.test.d.ts +2 -0
- package/dist/src/view/layout/grid.test.d.ts.map +1 -0
- package/dist/src/view/layout/rectangle.test.d.ts +2 -0
- package/dist/src/view/layout/rectangle.test.d.ts.map +1 -0
- package/dist/src/view/paramMediator.d.ts +32 -5
- package/dist/src/view/paramMediator.d.ts.map +1 -1
- package/dist/src/view/paramMediator.js +97 -9
- package/dist/src/view/paramMediator.test.d.ts +2 -0
- package/dist/src/view/paramMediator.test.d.ts.map +1 -0
- package/dist/src/view/paramMediator.test.js +17 -1
- package/dist/src/view/scaleResolution.d.ts +17 -9
- package/dist/src/view/scaleResolution.d.ts.map +1 -1
- package/dist/src/view/scaleResolution.js +51 -34
- package/dist/src/view/scaleResolution.test.d.ts +2 -0
- package/dist/src/view/scaleResolution.test.d.ts.map +1 -0
- package/dist/src/view/scaleResolution.test.js +2 -0
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +15 -3
- package/dist/src/view/unitView.d.ts +5 -15
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +81 -101
- package/dist/src/view/view.d.ts +1 -1
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.test.d.ts +2 -0
- package/dist/src/view/view.test.d.ts.map +1 -0
- package/dist/src/view/view.test.js +73 -55
- package/dist/src/view/viewFactory.test.d.ts +2 -0
- package/dist/src/view/viewFactory.test.d.ts.map +1 -0
- package/dist/src/view/viewFactory.test.js +2 -2
- package/dist/src/view/zoom.js +2 -2
- package/package.json +5 -2
|
@@ -17,13 +17,31 @@ export interface IdentifierParams extends TransformParamsBase {
|
|
|
17
17
|
*/
|
|
18
18
|
as?: string;
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
20
|
+
export interface ExprFilterParams extends TransformParamsBase {
|
|
21
21
|
type: "filter";
|
|
22
22
|
|
|
23
23
|
/** An expression string. The data object is removed if the expression evaluates to false. */
|
|
24
24
|
expr: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export interface SelectionFilterParams extends TransformParamsBase {
|
|
28
|
+
type: "filter";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A selection parameter. The data object is removed if it is not part of the selection.
|
|
32
|
+
*/
|
|
33
|
+
param: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* If true, the filter retains all data objects when the selection is empty.
|
|
37
|
+
|
|
38
|
+
* **Default:** `true`
|
|
39
|
+
*/
|
|
40
|
+
empty?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type FilterParams = ExprFilterParams | SelectionFilterParams;
|
|
44
|
+
|
|
27
45
|
export interface FormulaParams extends TransformParamsBase {
|
|
28
46
|
type: "formula";
|
|
29
47
|
|
package/dist/src/spec/view.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { ExprRef } from "./parameter.js";
|
|
16
16
|
import { Title } from "./title.js";
|
|
17
17
|
import { SampleSpec } from "./sampleView.js";
|
|
18
|
-
import {
|
|
18
|
+
import { Parameter } from "./parameter.js";
|
|
19
19
|
|
|
20
20
|
export interface SizeDef {
|
|
21
21
|
/** Size in pixels */
|
|
@@ -112,7 +112,7 @@ export interface ViewSpecBase extends ResolveSpec {
|
|
|
112
112
|
/**
|
|
113
113
|
* Dynamic variables that parameterize a visualization.
|
|
114
114
|
*/
|
|
115
|
-
params?:
|
|
115
|
+
params?: Parameter[];
|
|
116
116
|
|
|
117
117
|
data?: Data;
|
|
118
118
|
transform?: TransformParams[];
|
|
@@ -255,7 +255,7 @@ export interface ImportSpec {
|
|
|
255
255
|
* Dynamic variables that parameterize a visualization. Parameters defined
|
|
256
256
|
* here override the parameters defined in the imported specification.
|
|
257
257
|
*/
|
|
258
|
-
params?:
|
|
258
|
+
params?: Parameter[] | Record<string, any>;
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
261
|
* The method to import a specification.
|
|
@@ -11,7 +11,7 @@ export default async function dataTooltipHandler(datum, mark, params) {
|
|
|
11
11
|
*/
|
|
12
12
|
const legend = (key, datum) => {
|
|
13
13
|
for (const [channel, encoder] of Object.entries(mark.encoders)) {
|
|
14
|
-
if (encoder?.
|
|
14
|
+
if (encoder?.dataAccessor?.fields.includes(key)) {
|
|
15
15
|
switch (channel) {
|
|
16
16
|
case "color":
|
|
17
17
|
case "fill":
|
|
@@ -15,57 +15,109 @@ import {
|
|
|
15
15
|
ScaleDiverging,
|
|
16
16
|
ScaleContinuousNumeric,
|
|
17
17
|
} from "d3-scale";
|
|
18
|
-
import { ChannelDef } from "../spec/channel.js";
|
|
18
|
+
import { Channel, ChannelDef, ChannelWithScale } from "../spec/channel.js";
|
|
19
19
|
import { ScaleLocus } from "../genome/scaleLocus.js";
|
|
20
20
|
import { ScaleIndex } from "../genome/scaleIndex.js";
|
|
21
21
|
import { Scalar } from "../spec/channel.js";
|
|
22
|
+
import { Datum } from "../data/flowNode.js";
|
|
23
|
+
import { ExprRefFunction } from "../view/paramMediator.js";
|
|
22
24
|
|
|
23
|
-
export interface
|
|
24
|
-
|
|
25
|
+
export interface Accessor<T = Scalar> {
|
|
26
|
+
(datum: Datum): T;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns a new accessor that returns the same value as this accessor,
|
|
30
|
+
* but typed as a number
|
|
31
|
+
*/
|
|
32
|
+
asNumberAccessor(): Accessor<number>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* True if the accessor returns the same value for all objects
|
|
36
|
+
*/
|
|
25
37
|
constant: boolean;
|
|
26
38
|
|
|
27
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* The fields that the return value is based on (if any)
|
|
41
|
+
*/
|
|
28
42
|
fields: string[];
|
|
29
|
-
}
|
|
30
43
|
|
|
31
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The channel that the accessor is based on
|
|
46
|
+
*/
|
|
47
|
+
channel: Channel;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* If the accessed data needs to be passed to a scale function
|
|
51
|
+
* before visual encoding, indicates with channel has the scale.
|
|
52
|
+
* If no scale is needed, this is undefined.
|
|
53
|
+
*/
|
|
54
|
+
scaleChannel: ChannelWithScale;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The ChannelDef that the accessor is based on
|
|
58
|
+
*/
|
|
59
|
+
channelDef: ChannelDef;
|
|
32
60
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
61
|
+
/**
|
|
62
|
+
* This accessor should be used when the predicate is true
|
|
63
|
+
*/
|
|
64
|
+
predicate: Predicate;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface Predicate extends ExprRefFunction {
|
|
68
|
+
/**
|
|
69
|
+
* The parameter the predicate is based on
|
|
70
|
+
*/
|
|
71
|
+
param?: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* If true, the predicate is true for empty selections.
|
|
75
|
+
*
|
|
76
|
+
* **Default:** `true`
|
|
77
|
+
*/
|
|
78
|
+
empty?: boolean;
|
|
79
|
+
}
|
|
36
80
|
|
|
37
|
-
|
|
38
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Wraps one or more accessors, uses an optional scale to encode the data.
|
|
83
|
+
*/
|
|
84
|
+
export interface Encoder {
|
|
85
|
+
(datum: Datum): Scalar;
|
|
39
86
|
|
|
40
|
-
|
|
87
|
+
/**
|
|
88
|
+
* True if the accessor returns the same value for all objects
|
|
89
|
+
*/
|
|
90
|
+
constant: boolean;
|
|
41
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Scale, if the encoder has one
|
|
94
|
+
*/
|
|
42
95
|
scale?: VegaScale;
|
|
43
96
|
|
|
44
|
-
|
|
97
|
+
/**
|
|
98
|
+
* An accessor, or if the ChannelDef has conditions, all the accessors.
|
|
99
|
+
*/
|
|
100
|
+
accessors: Accessor[];
|
|
45
101
|
|
|
46
|
-
/**
|
|
47
|
-
|
|
102
|
+
/**
|
|
103
|
+
* The encoded channel may have a maximum of one accessor accessing the
|
|
104
|
+
* data fields. It's this one.
|
|
105
|
+
*/
|
|
106
|
+
dataAccessor?: Accessor;
|
|
48
107
|
|
|
108
|
+
/**
|
|
109
|
+
* The ChannelDef that the encoder is based on
|
|
110
|
+
*/
|
|
49
111
|
channelDef: ChannelDef;
|
|
50
|
-
|
|
51
|
-
/** Copies metadata to the target function */
|
|
52
|
-
applyMetadata: (target: Function) => void;
|
|
53
112
|
}
|
|
54
113
|
|
|
55
|
-
export type Encoder = ((datum: object) => Scalar) & EncoderMetadata;
|
|
56
|
-
|
|
57
|
-
export type NumberEncoder = ((datum: object) => number) & EncoderMetadata;
|
|
58
|
-
|
|
59
114
|
export interface ScaleMetadata {
|
|
60
115
|
/** Scale type */
|
|
61
116
|
type: string;
|
|
62
|
-
|
|
63
|
-
/** Whether to use emulated 64 bit floating point in WebGL */
|
|
64
|
-
fp64?: boolean;
|
|
65
117
|
}
|
|
66
118
|
|
|
67
119
|
export type D3Scale =
|
|
68
|
-
| ScaleContinuousNumeric<any, any>
|
|
120
|
+
| ScaleContinuousNumeric<any, any, any>
|
|
69
121
|
| ScaleLinear<any, any>
|
|
70
122
|
| ScalePower<any, any>
|
|
71
123
|
| ScaleLogarithmic<any, any>
|
|
@@ -81,4 +133,6 @@ export type D3Scale =
|
|
|
81
133
|
| ScaleBand<any>
|
|
82
134
|
| ScalePoint<any>;
|
|
83
135
|
|
|
136
|
+
export type GenericScale = any;
|
|
137
|
+
|
|
84
138
|
export type VegaScale = (D3Scale | ScaleIndex | ScaleLocus) & ScaleMetadata;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Mark from "../marks/mark.js";
|
|
2
2
|
import { LocSize } from "../view/layout/flexLayout.js";
|
|
3
3
|
import Rectangle from "../view/layout/rectangle.js";
|
|
4
|
+
import ViewRenderingContext from "../view/renderingContext/viewRenderingContext.js";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Describes the location of a sample facet. Left is the primary pos, right is for
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Datum } from "../data/flowNode.js";
|
|
2
|
+
import { ChannelWithScale, Scalar } from "../spec/channel.js";
|
|
3
|
+
|
|
4
|
+
export interface SelectionBase {
|
|
5
|
+
type: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface RangeSelection extends SelectionBase {
|
|
9
|
+
type: "range";
|
|
10
|
+
|
|
11
|
+
fields?: string[];
|
|
12
|
+
channels?: ChannelWithScale[];
|
|
13
|
+
|
|
14
|
+
ranges: number[][];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ProjectedSelection extends SelectionBase {
|
|
18
|
+
type: "projected";
|
|
19
|
+
|
|
20
|
+
fields?: string[];
|
|
21
|
+
channels?: ChannelWithScale[];
|
|
22
|
+
|
|
23
|
+
values: Scalar[][];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SinglePointSelection extends SelectionBase {
|
|
27
|
+
type: "single";
|
|
28
|
+
|
|
29
|
+
datum: Datum;
|
|
30
|
+
uniqueId: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface MultiPointSelection extends SelectionBase {
|
|
34
|
+
type: "multi";
|
|
35
|
+
|
|
36
|
+
data: Datum[];
|
|
37
|
+
uniqueIds: Set<number>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type Selection =
|
|
41
|
+
| RangeSelection
|
|
42
|
+
| ProjectedSelection
|
|
43
|
+
| SinglePointSelection
|
|
44
|
+
| MultiPointSelection;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TemplateResult } from "lit";
|
|
2
2
|
import View, { BroadcastMessage } from "../view/view.js";
|
|
3
3
|
import DataFlow from "../data/dataFlow.js";
|
|
4
|
-
import AccessorFactory from "../encoder/accessor.js";
|
|
5
4
|
import WebGLHelper from "../gl/webGLHelper.js";
|
|
6
5
|
import Animator from "../utils/animator.js";
|
|
7
6
|
import GenomeStore from "../genome/genomeStore.js";
|
|
@@ -9,9 +8,8 @@ import BmFontManager from "../fonts/bmFontManager.js";
|
|
|
9
8
|
import Mark from "../marks/mark.js";
|
|
10
9
|
import { Datum } from "../data/flowNode.js";
|
|
11
10
|
import { ImportSpec, ViewSpec } from "../spec/view.js";
|
|
12
|
-
import ContainerView from "
|
|
11
|
+
import ContainerView from "../view/containerView.js";
|
|
13
12
|
import { BroadcastEventType } from "../genomeSpy.js";
|
|
14
|
-
import ParamMediator from "../view/paramMediator.js";
|
|
15
13
|
|
|
16
14
|
export interface Hover {
|
|
17
15
|
mark: Mark;
|
|
@@ -25,7 +23,6 @@ export type DataLoadingStatus = "loading" | "complete" | "error";
|
|
|
25
23
|
*/
|
|
26
24
|
export default interface ViewContext {
|
|
27
25
|
dataFlow: DataFlow<View>;
|
|
28
|
-
accessorFactory: AccessorFactory;
|
|
29
26
|
glHelper: WebGLHelper;
|
|
30
27
|
animator: Animator;
|
|
31
28
|
genomeStore?: GenomeStore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addBaseUrl.test.d.ts","sourceRoot":"","sources":["../../../src/utils/addBaseUrl.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binnedIndex.test.d.ts","sourceRoot":"","sources":["../../../src/utils/binnedIndex.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloner.test.d.ts","sourceRoot":"","sources":["../../../src/utils/cloner.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coalesce.test.d.ts","sourceRoot":"","sources":["../../../src/utils/coalesce.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concatIterables.test.d.ts","sourceRoot":"","sources":["../../../src/utils/concatIterables.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domainArray.test.d.ts","sourceRoot":"","sources":["../../../src/utils/domainArray.test.js"],"names":[],"mappings":""}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @prop { string[] } globals
|
|
5
5
|
* @prop { string } code
|
|
6
6
|
*
|
|
7
|
-
* @typedef { ((datum?:
|
|
7
|
+
* @typedef { ((datum?: import("../data/flowNode.js").Datum) => 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 = ((datum?:
|
|
18
|
+
export type ExpressionFunction = ((datum?: import("../data/flowNode.js").Datum) => 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":"
|
|
1
|
+
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/utils/expression.js"],"names":[],"mappings":"AA2DA;;;;;;;;;;GAUG;AACH,6CAHW,MAAM,sBACJ,kBAAkB,CAgC9B;;YAvCU,MAAM,EAAE;aACR,MAAM,EAAE;UACR,MAAM;;2CAEO,OAAO,qBAAqB,EAAE,KAAK,KAAK,GAAG"}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import smoothstep from "./smoothstep.js";
|
|
12
12
|
import clamp from "./clamp.js";
|
|
13
13
|
import linearstep from "./linearstep.js";
|
|
14
|
+
import { selectionTest } from "../selection/selection.js";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Some bits are adapted from https://github.com/vega/vega/blob/main/packages/vega-functions/src/codegen.js
|
|
@@ -33,6 +34,7 @@ const functionContext = {
|
|
|
33
34
|
lerp,
|
|
34
35
|
linearstep,
|
|
35
36
|
smoothstep,
|
|
37
|
+
selectionTest,
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
/**
|
|
@@ -61,7 +63,7 @@ const cg = codegenExpression({
|
|
|
61
63
|
* @prop { string[] } globals
|
|
62
64
|
* @prop { string } code
|
|
63
65
|
*
|
|
64
|
-
* @typedef { ((datum?:
|
|
66
|
+
* @typedef { ((datum?: import("../data/flowNode.js").Datum) => any) & ExpressionProps } ExpressionFunction
|
|
65
67
|
*
|
|
66
68
|
* @param {string} expr
|
|
67
69
|
* @returns {ExpressionFunction}
|
|
@@ -75,7 +77,14 @@ export default function createFunction(expr, globalObject = {}) {
|
|
|
75
77
|
const fn = Function(
|
|
76
78
|
"datum",
|
|
77
79
|
"globalObject",
|
|
78
|
-
`"use strict";
|
|
80
|
+
`"use strict";
|
|
81
|
+
try {
|
|
82
|
+
return (${generatedCode.code});
|
|
83
|
+
} catch (e) {
|
|
84
|
+
throw new Error("Error evaluating expression: " + ${JSON.stringify(
|
|
85
|
+
expr
|
|
86
|
+
)} + ", " + e.message, e);
|
|
87
|
+
}`
|
|
79
88
|
).bind(functionContext);
|
|
80
89
|
|
|
81
90
|
/** @type { ExpressionFunction } */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexer.test.d.ts","sourceRoot":"","sources":["../../../src/utils/indexer.test.js"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputBinding.d.ts","sourceRoot":"","sources":["../../../src/utils/inputBinding.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inputBinding.d.ts","sourceRoot":"","sources":["../../../src/utils/inputBinding.js"],"names":[],"mappings":"AAKA;;GAEG;AACH,sDAFW,OAAO,0BAA0B,EAAE,OAAO,8CAwIpD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import { debounce } from "./debounce.js";
|
|
3
3
|
import { tickStep } from "d3-array";
|
|
4
|
+
import { isVariableParameter } from "../view/paramMediator.js";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @param {import("../view/paramMediator.js").default} mediator
|
|
@@ -12,6 +13,9 @@ export default function createBindingInputs(mediator) {
|
|
|
12
13
|
const inputs = [];
|
|
13
14
|
|
|
14
15
|
for (const param of mediator.paramConfigs.values()) {
|
|
16
|
+
if (!isVariableParameter(param)) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
15
19
|
const bind = param.bind;
|
|
16
20
|
if (!bind || !("input" in bind)) {
|
|
17
21
|
continue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterateNestedMaps.test.d.ts","sourceRoot":"","sources":["../../../src/utils/iterateNestedMaps.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kWayMerge.test.d.ts","sourceRoot":"","sources":["../../../src/utils/kWayMerge.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeObjects.test.d.ts","sourceRoot":"","sources":["../../../src/utils/mergeObjects.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numberExtractor.test.d.ts","sourceRoot":"","sources":["../../../src/utils/numberExtractor.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertyCacher.test.d.ts","sourceRoot":"","sources":["../../../src/utils/propertyCacher.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertyCoalescer.test.d.ts","sourceRoot":"","sources":["../../../src/utils/propertyCoalescer.test.js"],"names":[],"mappings":""}
|
|
@@ -7,12 +7,15 @@ test("CoalesceProperties works as expected", () => {
|
|
|
7
7
|
|
|
8
8
|
const coalesced = coalesceProperties(
|
|
9
9
|
() => props,
|
|
10
|
+
// @ts-expect-error
|
|
10
11
|
() => defaults
|
|
11
12
|
);
|
|
12
13
|
|
|
13
14
|
expect(coalesced.a).toEqual(1);
|
|
15
|
+
// @ts-expect-error
|
|
14
16
|
expect(coalesced.b).toEqual(11);
|
|
15
17
|
expect(coalesced.c).toEqual(2);
|
|
18
|
+
// @ts-expect-error
|
|
16
19
|
expect(coalesced.undef).toBeUndefined();
|
|
17
20
|
|
|
18
21
|
expect("a" in coalesced).toBeTruthy();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radixSort.test.d.ts","sourceRoot":"","sources":["../../../src/utils/radixSort.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservationMap.test.d.ts","sourceRoot":"","sources":["../../../src/utils/reservationMap.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ringBuffer.test.d.ts","sourceRoot":"","sources":["../../../src/utils/ringBuffer.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topK.test.d.ts","sourceRoot":"","sources":["../../../src/utils/topK.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trees.test.d.ts","sourceRoot":"","sources":["../../../src/utils/trees.test.js"],"names":[],"mappings":""}
|
|
@@ -3,8 +3,10 @@ import { nodesToTrees, visitTree } from "./trees.js";
|
|
|
3
3
|
import { describe } from "vitest";
|
|
4
4
|
|
|
5
5
|
describe("NodesToTrees", () => {
|
|
6
|
+
const NULL = /** @type {any} */ (null);
|
|
7
|
+
|
|
6
8
|
test("NodesToTrees converts an array of nodes to a tree", () => {
|
|
7
|
-
const a = { parent:
|
|
9
|
+
const a = { parent: NULL };
|
|
8
10
|
const b = { parent: a };
|
|
9
11
|
const c = { parent: a };
|
|
10
12
|
const d = { parent: b };
|
|
@@ -41,10 +43,10 @@ describe("NodesToTrees", () => {
|
|
|
41
43
|
});
|
|
42
44
|
|
|
43
45
|
test("NodesToTrees converts two disjoint node arrays to two trees", () => {
|
|
44
|
-
const a = { parent:
|
|
46
|
+
const a = { parent: NULL };
|
|
45
47
|
const b = { parent: a };
|
|
46
48
|
|
|
47
|
-
const c = { parent:
|
|
49
|
+
const c = { parent: NULL };
|
|
48
50
|
const d = { parent: c };
|
|
49
51
|
|
|
50
52
|
const nodes = [a, b, c, d];
|
|
@@ -84,6 +86,7 @@ describe("VisitTree", () => {
|
|
|
84
86
|
children: [
|
|
85
87
|
{
|
|
86
88
|
id: "d",
|
|
89
|
+
/** @type {any[]} */
|
|
87
90
|
children: [],
|
|
88
91
|
},
|
|
89
92
|
{
|
|
@@ -99,7 +102,9 @@ describe("VisitTree", () => {
|
|
|
99
102
|
],
|
|
100
103
|
};
|
|
101
104
|
|
|
105
|
+
/** @type {any[]} */
|
|
102
106
|
const visitedPre = [];
|
|
107
|
+
/** @type {any[]} */
|
|
103
108
|
const visitedPost = [];
|
|
104
109
|
|
|
105
110
|
visitTree(tree, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variableTools.test.d.ts","sourceRoot":"","sources":["../../../src/utils/variableTools.test.js"],"names":[],"mappings":""}
|
|
@@ -1,24 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @template {import("../spec/channel.js").PositionalChannel}[T=PositionalChannel]
|
|
3
|
+
*
|
|
4
|
+
* @typedef {object} AxisResolutionMember
|
|
5
|
+
* @prop {import("./unitView.js").default} view
|
|
6
|
+
* @prop {T} channel
|
|
7
|
+
* @prop {import("../spec/channel.js").ChannelDefWithScale} channelDef
|
|
8
|
+
*/
|
|
1
9
|
export default class AxisResolution {
|
|
2
10
|
/**
|
|
3
|
-
* @typedef {
|
|
11
|
+
* @typedef {import("./unitView.js").default} UnitView
|
|
12
|
+
* @typedef {import("../spec/channel.js").PositionalChannel} PositionalChannel
|
|
4
13
|
*/
|
|
5
14
|
/**
|
|
6
15
|
* @param {import("../spec/channel.js").PrimaryPositionalChannel} channel
|
|
7
16
|
*/
|
|
8
17
|
constructor(channel: import("../spec/channel.js").PrimaryPositionalChannel);
|
|
9
18
|
channel: import("../spec/channel.js").PrimaryPositionalChannel;
|
|
10
|
-
/** @type {
|
|
11
|
-
members:
|
|
19
|
+
/** @type {AxisResolutionMember[]} The involved views */
|
|
20
|
+
members: AxisResolutionMember[];
|
|
12
21
|
get scaleResolution(): import("./scaleResolution.js").default;
|
|
13
22
|
/**
|
|
14
23
|
* N.B. This is expected to be called in depth-first order, AFTER the
|
|
15
24
|
* scales have been resolved.
|
|
16
25
|
*
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {import("../spec/channel.js").PositionalChannel} channel TODO: Do something for this
|
|
26
|
+
* @param {AxisResolutionMember} newMember
|
|
19
27
|
*/
|
|
20
|
-
pushUnitView(
|
|
28
|
+
pushUnitView(newMember: AxisResolutionMember): void;
|
|
21
29
|
getAxisProps(): import("../spec/axis.js").GenomeAxis;
|
|
22
30
|
getTitle(): string;
|
|
23
31
|
}
|
|
32
|
+
export type AxisResolutionMember<T extends import("../spec/channel.js").PositionalChannel = import("../spec/channel.js").PositionalChannel> = {
|
|
33
|
+
view: import("./unitView.js").default;
|
|
34
|
+
channel: T;
|
|
35
|
+
channelDef: import("../spec/channel.js").ChannelDefWithScale;
|
|
36
|
+
};
|
|
24
37
|
//# sourceMappingURL=axisResolution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axisResolution.d.ts","sourceRoot":"","sources":["../../../src/view/axisResolution.js"],"names":[],"mappings":"AAeA;IACI
|
|
1
|
+
{"version":3,"file":"axisResolution.d.ts","sourceRoot":"","sources":["../../../src/view/axisResolution.js"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AACH;IACI;;;OAGG;IAEH;;OAEG;IACH,qBAFW,OAAO,oBAAoB,EAAE,wBAAwB,EAM/D;IAHG,+DAAsB;IACtB,wDAAwD;IACxD,SADW,oBAAoB,EAAE,CAChB;IAGrB,8DAEC;IAED;;;;;OAKG;IACH,wBAFW,oBAAoB,QAkB9B;IAED,qDAuBC;IAED,mBAyDC;CACJ;;UAlIS,OAAO,eAAe,EAAE,OAAO;aAC/B,CAAC;gBACD,OAAO,oBAAoB,EAAE,mBAAmB"}
|