@genome-spy/core 0.30.0 → 0.30.2
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/index.es.js +16373 -0
- package/dist/index.js +43 -43
- package/package.json +10 -7
- package/src/data/collector.js +0 -183
- package/src/data/collector.test.js +0 -84
- package/src/data/dataFlow.js +0 -148
- package/src/data/dataFlow.test.js +0 -5
- package/src/data/facetNode.js +0 -17
- package/src/data/flow.test.js +0 -72
- package/src/data/flowBatch.d.ts +0 -40
- package/src/data/flowNode.js +0 -283
- package/src/data/flowNode.test.js +0 -50
- package/src/data/flowOptimizer.js +0 -123
- package/src/data/flowOptimizer.test.js +0 -193
- package/src/data/flowTestUtils.js +0 -63
- package/src/data/formats/fasta.js +0 -32
- package/src/data/formats/fasta.test.js +0 -27
- package/src/data/sources/dataSource.js +0 -22
- package/src/data/sources/dataSourceFactory.js +0 -24
- package/src/data/sources/dataUtils.js +0 -78
- package/src/data/sources/dynamicCallbackSource.js +0 -57
- package/src/data/sources/dynamicSource.js +0 -37
- package/src/data/sources/inlineSource.js +0 -67
- package/src/data/sources/inlineSource.test.js +0 -56
- package/src/data/sources/namedSource.js +0 -79
- package/src/data/sources/sequenceSource.js +0 -46
- package/src/data/sources/sequenceSource.test.js +0 -46
- package/src/data/sources/urlSource.js +0 -74
- package/src/data/transforms/aggregate.js +0 -70
- package/src/data/transforms/clone.js +0 -40
- package/src/data/transforms/clone.test.js +0 -11
- package/src/data/transforms/coverage.js +0 -187
- package/src/data/transforms/coverage.test.js +0 -123
- package/src/data/transforms/filter.js +0 -37
- package/src/data/transforms/filter.test.js +0 -18
- package/src/data/transforms/filterScoredLabels.js +0 -134
- package/src/data/transforms/flattenCompressedExons.js +0 -57
- package/src/data/transforms/flattenDelimited.js +0 -74
- package/src/data/transforms/flattenDelimited.test.js +0 -87
- package/src/data/transforms/flattenSequence.js +0 -39
- package/src/data/transforms/flattenSequence.test.js +0 -34
- package/src/data/transforms/formula.js +0 -39
- package/src/data/transforms/formula.test.js +0 -19
- package/src/data/transforms/identifier.js +0 -108
- package/src/data/transforms/identifier.test.js +0 -83
- package/src/data/transforms/linearizeGenomicCoordinate.js +0 -101
- package/src/data/transforms/measureText.js +0 -44
- package/src/data/transforms/pileup.js +0 -128
- package/src/data/transforms/pileup.test.js +0 -70
- package/src/data/transforms/project.js +0 -41
- package/src/data/transforms/project.test.js +0 -32
- package/src/data/transforms/regexExtract.js +0 -61
- package/src/data/transforms/regexExtract.test.js +0 -67
- package/src/data/transforms/regexFold.js +0 -141
- package/src/data/transforms/regexFold.test.js +0 -160
- package/src/data/transforms/sample.js +0 -101
- package/src/data/transforms/sample.test.js +0 -38
- package/src/data/transforms/stack.js +0 -137
- package/src/data/transforms/stack.test.js +0 -91
- package/src/data/transforms/transformFactory.js +0 -60
- package/src/embedApi.d.ts +0 -67
- package/src/encoder/accessor.js +0 -82
- package/src/encoder/accessor.test.js +0 -47
- package/src/encoder/encoder.js +0 -394
- package/src/encoder/encoder.test.js +0 -98
- package/src/fonts/Lato-Regular.json +0 -1267
- package/src/fonts/Lato-Regular.png +0 -0
- package/src/fonts/OFL.txt +0 -93
- package/src/fonts/README.md +0 -3
- package/src/fonts/bmFont.d.ts +0 -58
- package/src/fonts/bmFontManager.js +0 -357
- package/src/fonts/bmFontMetrics.js +0 -108
- package/src/genome/genome.js +0 -317
- package/src/genome/genome.test.js +0 -188
- package/src/genome/genomeStore.js +0 -54
- package/src/genome/locusFormat.js +0 -31
- package/src/genome/scaleIndex.d.ts +0 -38
- package/src/genome/scaleIndex.js +0 -166
- package/src/genome/scaleIndex.test.js +0 -78
- package/src/genome/scaleLocus.d.ts +0 -11
- package/src/genome/scaleLocus.js +0 -108
- package/src/genome/scaleLocus.test.js +0 -4
- package/src/genomeSpy.js +0 -785
- package/src/gl/arrayBuilder.js +0 -199
- package/src/gl/dataToVertices.js +0 -636
- package/src/gl/includes/common.glsl +0 -63
- package/src/gl/includes/picking.fragment.glsl +0 -1
- package/src/gl/includes/picking.vertex.glsl +0 -27
- package/src/gl/includes/sampleFacet.glsl +0 -107
- package/src/gl/includes/scales.glsl +0 -112
- package/src/gl/link.fragment.glsl +0 -18
- package/src/gl/link.vertex.glsl +0 -111
- package/src/gl/point.fragment.glsl +0 -123
- package/src/gl/point.vertex.glsl +0 -129
- package/src/gl/rect.fragment.glsl +0 -51
- package/src/gl/rect.vertex.glsl +0 -114
- package/src/gl/rule.fragment.glsl +0 -52
- package/src/gl/rule.vertex.glsl +0 -89
- package/src/gl/text.fragment.glsl +0 -31
- package/src/gl/text.vertex.glsl +0 -246
- package/src/gl/webGLHelper.js +0 -504
- package/src/img/bowtie.svg +0 -1
- package/src/img/genomespy-favicon.svg +0 -34
- package/src/index.html +0 -11
- package/src/index.js +0 -128
- package/src/marks/link.js +0 -175
- package/src/marks/mark.js +0 -975
- package/src/marks/markUtils.js +0 -125
- package/src/marks/pointMark.js +0 -251
- package/src/marks/rectMark.js +0 -241
- package/src/marks/rule.js +0 -250
- package/src/marks/text.js +0 -278
- package/src/node_modules/.vitest/results.json +0 -1
- package/src/scale/colorUtils.js +0 -184
- package/src/scale/glslScaleGenerator.js +0 -502
- package/src/scale/scale.js +0 -451
- package/src/scale/scale.test.js +0 -324
- package/src/scale/ticks.js +0 -203
- package/src/scale/ticks.test.js +0 -40
- package/src/singlePageApp.js +0 -13
- package/src/spec/axis.d.ts +0 -296
- package/src/spec/channel.d.ts +0 -430
- package/src/spec/data.d.ts +0 -196
- package/src/spec/font.d.ts +0 -15
- package/src/spec/genome.d.ts +0 -35
- package/src/spec/mark.d.ts +0 -429
- package/src/spec/root.d.ts +0 -17
- package/src/spec/sampleView.d.ts +0 -180
- package/src/spec/scale.d.ts +0 -273
- package/src/spec/title.d.ts +0 -102
- package/src/spec/tooltip.d.ts +0 -9
- package/src/spec/transform.d.ts +0 -479
- package/src/spec/view.d.ts +0 -201
- package/src/styles/genome-spy.scss +0 -153
- package/src/tooltip/dataTooltipHandler.js +0 -64
- package/src/tooltip/refseqGeneTooltipHandler.js +0 -78
- package/src/tooltip/tooltipHandler.ts +0 -12
- package/src/types/filetypes.d.ts +0 -14
- package/src/types/flatqueue.d.ts +0 -53
- package/src/types/glsl.d.ts +0 -4
- package/src/types/internmap.d.ts +0 -22
- package/src/types/object.d.ts +0 -21
- package/src/types/vega-loader.d.ts +0 -1
- package/src/types/vega-scale.d.ts +0 -60
- package/src/utils/addBaseUrl.js +0 -19
- package/src/utils/addBaseUrl.test.js +0 -22
- package/src/utils/animator.js +0 -83
- package/src/utils/arrayUtils.js +0 -61
- package/src/utils/binnedIndex.js +0 -167
- package/src/utils/binnedIndex.test.js +0 -155
- package/src/utils/clamp.js +0 -8
- package/src/utils/cloner.js +0 -34
- package/src/utils/cloner.test.js +0 -24
- package/src/utils/coalesce.js +0 -11
- package/src/utils/coalesce.test.js +0 -16
- package/src/utils/concatIterables.js +0 -26
- package/src/utils/concatIterables.test.js +0 -8
- package/src/utils/debounce.js +0 -37
- package/src/utils/domainArray.js +0 -216
- package/src/utils/domainArray.test.js +0 -130
- package/src/utils/eerp.js +0 -13
- package/src/utils/expression.js +0 -32
- package/src/utils/field.js +0 -28
- package/src/utils/formatObject.js +0 -31
- package/src/utils/indexer.js +0 -43
- package/src/utils/indexer.test.js +0 -47
- package/src/utils/inertia.js +0 -124
- package/src/utils/interactionEvent.js +0 -33
- package/src/utils/iterateNestedMaps.js +0 -21
- package/src/utils/iterateNestedMaps.test.js +0 -33
- package/src/utils/kWayMerge.js +0 -42
- package/src/utils/kWayMerge.test.js +0 -26
- package/src/utils/layout/flexLayout.js +0 -368
- package/src/utils/layout/flexLayout.test.js +0 -311
- package/src/utils/layout/grid.js +0 -95
- package/src/utils/layout/grid.test.js +0 -71
- package/src/utils/layout/padding.js +0 -120
- package/src/utils/layout/point.js +0 -23
- package/src/utils/layout/rectangle.js +0 -288
- package/src/utils/layout/rectangle.test.js +0 -172
- package/src/utils/mergeObjects.js +0 -99
- package/src/utils/mergeObjects.test.js +0 -42
- package/src/utils/numberExtractor.js +0 -24
- package/src/utils/numberExtractor.test.js +0 -6
- package/src/utils/point.js +0 -14
- package/src/utils/propertyCacher.js +0 -70
- package/src/utils/propertyCacher.test.js +0 -85
- package/src/utils/propertyCoalescer.js +0 -42
- package/src/utils/propertyCoalescer.test.js +0 -22
- package/src/utils/reservationMap.js +0 -103
- package/src/utils/reservationMap.test.js +0 -20
- package/src/utils/scaleNull.js +0 -19
- package/src/utils/setOperations.js +0 -75
- package/src/utils/smoothstep.js +0 -10
- package/src/utils/throttle.js +0 -34
- package/src/utils/topK.js +0 -76
- package/src/utils/topK.test.js +0 -64
- package/src/utils/transition.js +0 -74
- package/src/utils/ui/tooltip.js +0 -189
- package/src/utils/url.js +0 -22
- package/src/utils/variableTools.js +0 -24
- package/src/utils/variableTools.test.js +0 -13
- package/src/view/axisResolution.js +0 -140
- package/src/view/axisResolution.test.js +0 -201
- package/src/view/axisView.js +0 -747
- package/src/view/concatView.js +0 -45
- package/src/view/containerView.js +0 -159
- package/src/view/facetView.js +0 -491
- package/src/view/flowBuilder.js +0 -367
- package/src/view/flowBuilder.test.js +0 -125
- package/src/view/gridView.js +0 -786
- package/src/view/implicitRootView.js +0 -14
- package/src/view/importView.js +0 -19
- package/src/view/layerView.js +0 -74
- package/src/view/rendering.d.ts +0 -44
- package/src/view/renderingContext/compositeViewRenderingContext.js +0 -51
- package/src/view/renderingContext/deferredViewRenderingContext.js +0 -176
- package/src/view/renderingContext/layoutRecorderViewRenderingContext.js +0 -128
- package/src/view/renderingContext/simpleViewRenderingContext.js +0 -64
- package/src/view/renderingContext/svgViewRenderingContext.js +0 -125
- package/src/view/renderingContext/viewRenderingContext.js +0 -41
- package/src/view/scaleResolution.js +0 -797
- package/src/view/scaleResolution.test.js +0 -572
- package/src/view/scaleResolutionApi.d.ts +0 -40
- package/src/view/testUtils.js +0 -51
- package/src/view/title.js +0 -165
- package/src/view/unitView.js +0 -382
- package/src/view/view.js +0 -612
- package/src/view/view.test.js +0 -214
- package/src/view/viewContext.d.ts +0 -62
- package/src/view/viewFactory.js +0 -181
- package/src/view/viewFactory.test.js +0 -17
- package/src/view/viewUtils.js +0 -327
- package/src/view/zoom.js +0 -89
package/src/spec/transform.d.ts
DELETED
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The name of the field or a JavaScript expression for accessing nested properties.
|
|
3
|
-
* Dots and brackets in the field name must be escaped.
|
|
4
|
-
*/
|
|
5
|
-
export type Field = string;
|
|
6
|
-
|
|
7
|
-
export interface TransformParamsBase {
|
|
8
|
-
/** The type of the transform to be applied */
|
|
9
|
-
type: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface IdentifierParams extends TransformParamsBase {
|
|
13
|
-
type: "identifier";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* **Default:** `"_uniqueId"`
|
|
17
|
-
*/
|
|
18
|
-
as?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface FilterParams extends TransformParamsBase {
|
|
21
|
-
type: "filter";
|
|
22
|
-
|
|
23
|
-
/** An expression string. The data object is removed if the expression evaluates to false. */
|
|
24
|
-
expr: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface FormulaParams extends TransformParamsBase {
|
|
28
|
-
type: "formula";
|
|
29
|
-
|
|
30
|
-
/** An expression string */
|
|
31
|
-
expr: string;
|
|
32
|
-
|
|
33
|
-
/** The (new) field where the computed value is written to */
|
|
34
|
-
as: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface ProjectParams extends TransformParamsBase {
|
|
38
|
-
type: "project";
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The fields to be projected.
|
|
42
|
-
*/
|
|
43
|
-
fields: Field[];
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* New names for the projected fields. If omitted, the names of the source fields are used.
|
|
47
|
-
*/
|
|
48
|
-
as?: string[];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface RegexExtractParams extends TransformParamsBase {
|
|
52
|
-
type: "regexExtract";
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* A valid JavaScript regular expression with at least one group. For example: `"^Sample(\\d+)$"`.
|
|
56
|
-
*
|
|
57
|
-
* Read more at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
|
|
58
|
-
**/
|
|
59
|
-
regex: string;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* The source field
|
|
63
|
-
*/
|
|
64
|
-
field: Field;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* The new field or an array of fields where the extracted values are written.
|
|
68
|
-
*/
|
|
69
|
-
as: string | string[];
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Do not complain about invalid input. Just skip it and leave the new fields undefined on the affected datum.
|
|
73
|
-
*
|
|
74
|
-
* **Default:** `false`
|
|
75
|
-
**/
|
|
76
|
-
skipInvalidInput?: boolean;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface RegexFoldParams extends TransformParamsBase {
|
|
80
|
-
type: "regexFold";
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* A regular expression that matches to column names. The regex must have one
|
|
84
|
-
* capturing group that is used for extracting the key (e.g., a sample id)
|
|
85
|
-
* from the column name.
|
|
86
|
-
*/
|
|
87
|
-
columnRegex: string[] | string;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* A new column name for the extracted values.
|
|
91
|
-
*/
|
|
92
|
-
asValue: string[] | string;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* An optional regex that matches to fields that should not be included
|
|
96
|
-
* in the new folded data objects.
|
|
97
|
-
*/
|
|
98
|
-
skipRegex?: string;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* **Default:** `"sample"`
|
|
102
|
-
*/
|
|
103
|
-
asKey?: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export type SortOrder = "ascending" | "descending";
|
|
107
|
-
|
|
108
|
-
export interface CompareParams {
|
|
109
|
-
/**
|
|
110
|
-
* The field(s) to sort by
|
|
111
|
-
*/
|
|
112
|
-
field: Field[] | Field;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* The order(s) to use: `"ascending"` (default), `"descending"`.
|
|
116
|
-
*/
|
|
117
|
-
order?: SortOrder[] | SortOrder;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface StackParams extends TransformParamsBase {
|
|
121
|
-
type: "stack";
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The field to stack. If no field is defined, a constant value of one is assumed.
|
|
125
|
-
*/
|
|
126
|
-
field?: Field;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* The fields to be used for forming groups for different stacks.
|
|
130
|
-
*/
|
|
131
|
-
groupby: Field[];
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* The sort order of data in each stack.
|
|
135
|
-
*/
|
|
136
|
-
sort?: CompareParams;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* How to offset the values in a stack.
|
|
140
|
-
* `"zero"` (default) starts stacking at 0.
|
|
141
|
-
* `"center"` centers the values around zero.
|
|
142
|
-
* `"normalize"` computes intra-stack percentages and normalizes the values to the range of `[0, 1]`.
|
|
143
|
-
* `"information"` computes a layout for a sequence logo. The total height of the stack reflects
|
|
144
|
-
* the group's information content.
|
|
145
|
-
*/
|
|
146
|
-
offset?: "zero" | "center" | "normalize" | "information";
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Fields to write the stacked values.
|
|
150
|
-
*
|
|
151
|
-
* **Default:** `["y0", "y1"]`
|
|
152
|
-
*/
|
|
153
|
-
as: string[];
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Cardinality, e.g., the number if distinct bases or amino acids. Used for
|
|
157
|
-
* information content calculation when the offset is `"information"`.
|
|
158
|
-
*
|
|
159
|
-
* **Default:** `4`
|
|
160
|
-
*/
|
|
161
|
-
cardinality?: number;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* The field that contains the base or amino acid. Used for
|
|
165
|
-
* information content calculation when the offset is `"information"`.
|
|
166
|
-
* The data objects that have `null` in the baseField are considered gaps
|
|
167
|
-
* and they are taken into account when scaling the the locus' information
|
|
168
|
-
* content.
|
|
169
|
-
*/
|
|
170
|
-
baseField?: Field;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export interface AggregateParams extends TransformParamsBase {
|
|
174
|
-
type: "aggregate";
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Which fields to use for grouping. Missing `groupby` results in a single
|
|
178
|
-
* group that includes all the data items.
|
|
179
|
-
*/
|
|
180
|
-
groupby?: Field[];
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export interface FlattenDelimitedParams extends TransformParamsBase {
|
|
184
|
-
type: "flattenDelimited";
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* The field(s) to split and flatten
|
|
188
|
-
*/
|
|
189
|
-
field: Field[] | Field;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Separator(s) used on the field(s)
|
|
193
|
-
* TODO: Rename to delimiter
|
|
194
|
-
*/
|
|
195
|
-
separator: string[] | string;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* The output field name(s) for the flattened field.
|
|
199
|
-
*
|
|
200
|
-
* **Default:** the input fields.
|
|
201
|
-
*/
|
|
202
|
-
as?: string[] | string;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export interface FlattenSequenceParams extends TransformParamsBase {
|
|
206
|
-
type: "flattenSequence";
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* The field to flatten.
|
|
210
|
-
*
|
|
211
|
-
* **Default:** `"sequence"`
|
|
212
|
-
*/
|
|
213
|
-
field?: Field;
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Name of the fields where the zero-based index number and flattened
|
|
217
|
-
* sequence letter are written to.
|
|
218
|
-
*
|
|
219
|
-
* **Default:** `["pos", "sequence"]`
|
|
220
|
-
*/
|
|
221
|
-
as?: [string, string];
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export interface PileupParams extends TransformParamsBase {
|
|
225
|
-
type: "pileup";
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* The field representing the start coordinate of the segment (inclusive).
|
|
229
|
-
*/
|
|
230
|
-
start: Field;
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* The field representing the end coordinate of the segment (exclusive).
|
|
234
|
-
*/
|
|
235
|
-
end: Field;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* The output field name for the computed lane.
|
|
239
|
-
*
|
|
240
|
-
* **Default:** `"lane"`.
|
|
241
|
-
*/
|
|
242
|
-
as?: string;
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* The spacing between adjacent segments on the same lane in coordinate units.
|
|
246
|
-
*
|
|
247
|
-
* **Default:** `1`.
|
|
248
|
-
*/
|
|
249
|
-
spacing?: number;
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* An optional field indicating the preferred lane. Use together with the
|
|
253
|
-
* `preferredOrder` property.
|
|
254
|
-
*/
|
|
255
|
-
preference?: Field;
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* The order of the lane preferences. The first element contains the value that
|
|
259
|
-
* should place the segment on the first lane and so forth.
|
|
260
|
-
* If the preferred lane is occupied, the first available lane is taken.
|
|
261
|
-
*/
|
|
262
|
-
preferredOrder?: string[] | number[] | boolean[];
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export interface CoverageParams extends TransformParamsBase {
|
|
266
|
-
type: "coverage";
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* An optional chromosome field that is passed through. TODO: groupby
|
|
270
|
-
*/
|
|
271
|
-
chrom?: Field;
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* The field representing the start coordinate of the segment (inclusive).
|
|
275
|
-
*/
|
|
276
|
-
start: Field;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* The field representing the end coordinate of the segment (exclusive).
|
|
280
|
-
*/
|
|
281
|
-
end: Field;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* A field representing an optional weight for the segment. Can be used with
|
|
285
|
-
* copy ratios, for example.
|
|
286
|
-
*/
|
|
287
|
-
weight?: Field;
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* The output field for the computed coverage.
|
|
291
|
-
*/
|
|
292
|
-
as?: string;
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* The output field for the chromosome.
|
|
296
|
-
*
|
|
297
|
-
* **Default:** Same as `chrom`
|
|
298
|
-
*/
|
|
299
|
-
asChrom?: string;
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* The output field for the start coordinate.
|
|
303
|
-
*
|
|
304
|
-
* **Default:** Same as `start`
|
|
305
|
-
*/
|
|
306
|
-
asStart?: string;
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* The output field for the end coordinate.
|
|
310
|
-
*
|
|
311
|
-
* **Default:** Same as `end`
|
|
312
|
-
*/
|
|
313
|
-
asEnd?: string;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export interface CollectParams extends TransformParamsBase {
|
|
317
|
-
type: "collect";
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Arranges the data into consecutive batches based on the groups.
|
|
321
|
-
* This is mainly intended for internal use so that faceted data can
|
|
322
|
-
* be handled as batches.
|
|
323
|
-
*/
|
|
324
|
-
groupby?: Field[];
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* The sort order.
|
|
328
|
-
*/
|
|
329
|
-
sort?: CompareParams;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export interface SampleParams extends TransformParamsBase {
|
|
333
|
-
type: "sample";
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* The maximum sample size.
|
|
337
|
-
*
|
|
338
|
-
* **Default:** `500`
|
|
339
|
-
*/
|
|
340
|
-
size?: number;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export interface MeasureTextParams extends TransformParamsBase {
|
|
344
|
-
type: "measureText";
|
|
345
|
-
|
|
346
|
-
field: Field;
|
|
347
|
-
|
|
348
|
-
fontSize: number;
|
|
349
|
-
|
|
350
|
-
as: string;
|
|
351
|
-
|
|
352
|
-
// TODO: FontFamily etc
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
export interface MergeFacetsParams extends TransformParamsBase {
|
|
356
|
-
type: "mergeFacets";
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export interface LinearizeGenomicCoordinateParams extends TransformParamsBase {
|
|
360
|
-
type: "linearizeGenomicCoordinate";
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Get the genome assembly from the scale of the channel.
|
|
364
|
-
*
|
|
365
|
-
* **Default:** `"x"`
|
|
366
|
-
*/
|
|
367
|
-
channel?: "x" | "y";
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* The chromosome/contig field
|
|
371
|
-
*/
|
|
372
|
-
chrom: Field;
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* The field or fields that contain intra-chromosomal positions
|
|
376
|
-
*/
|
|
377
|
-
pos: Field | Field[];
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* An offset or offsets that allow for adjusting the numbering base. The offset
|
|
381
|
-
* is subtracted from the positions.
|
|
382
|
-
*
|
|
383
|
-
* GenomeSpy uses internally zero-based indexing with half-open intervals.
|
|
384
|
-
* UCSC-based formats (BED, etc.) generally use this scheme. However, for example,
|
|
385
|
-
* VCF files use one-based indexing and must be adjusted by setting the offset to
|
|
386
|
-
* `1`.
|
|
387
|
-
*
|
|
388
|
-
* **Default:** `0`
|
|
389
|
-
*/
|
|
390
|
-
offset?: number | number[];
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* The output field or fields for linearized coordinates.
|
|
394
|
-
*/
|
|
395
|
-
as: string | string[];
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
export interface FilterScoredLabelsParams extends TransformParamsBase {
|
|
399
|
-
type: "filterScoredLabels";
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* The field representing the score used for prioritization.
|
|
403
|
-
*/
|
|
404
|
-
score: Field;
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* The field representing element's width in pixels
|
|
408
|
-
*/
|
|
409
|
-
width: Field;
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* The field representing element's position on the domain.
|
|
413
|
-
*/
|
|
414
|
-
pos: Field;
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* An optional field representing element's lane, e.g., if transcripts
|
|
418
|
-
* are shown using a piled up layout.
|
|
419
|
-
*/
|
|
420
|
-
lane?: Field;
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Padding (in pixels) around the element.
|
|
424
|
-
*
|
|
425
|
-
* **Default:** `0`
|
|
426
|
-
*/
|
|
427
|
-
padding?: number;
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* **Default:** `"x"`
|
|
431
|
-
*/
|
|
432
|
-
channel?: "x" | "y";
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
export interface FlattenCompressedExonsParams extends TransformParamsBase {
|
|
436
|
-
type: "flattenCompressedExons";
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* The field containing the exons.
|
|
440
|
-
*
|
|
441
|
-
* **Default:** `"exons"`
|
|
442
|
-
*/
|
|
443
|
-
exons?: Field;
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Start coordinate of the gene body.
|
|
447
|
-
*
|
|
448
|
-
* **Default:** `"start"`
|
|
449
|
-
*/
|
|
450
|
-
start?: Field;
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Field names for the flattened exons.
|
|
454
|
-
*
|
|
455
|
-
* **Default:** `["exonStart", "exonEnd"]`
|
|
456
|
-
*/
|
|
457
|
-
as?: [string, string];
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
export type TransformParams =
|
|
461
|
-
| AggregateParams
|
|
462
|
-
| CollectParams
|
|
463
|
-
| CoverageParams
|
|
464
|
-
| FlattenDelimitedParams
|
|
465
|
-
| FormulaParams
|
|
466
|
-
| FilterParams
|
|
467
|
-
| FilterScoredLabelsParams
|
|
468
|
-
| FlattenCompressedExonsParams
|
|
469
|
-
| FlattenSequenceParams
|
|
470
|
-
| IdentifierParams
|
|
471
|
-
| LinearizeGenomicCoordinateParams
|
|
472
|
-
| MeasureTextParams
|
|
473
|
-
| MergeFacetsParams
|
|
474
|
-
| PileupParams
|
|
475
|
-
| ProjectParams
|
|
476
|
-
| RegexExtractParams
|
|
477
|
-
| RegexFoldParams
|
|
478
|
-
| SampleParams
|
|
479
|
-
| StackParams;
|
package/src/spec/view.d.ts
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { Data } from "./data";
|
|
2
|
-
import { TransformParams } from "./transform";
|
|
3
|
-
import {
|
|
4
|
-
Channel,
|
|
5
|
-
Encoding,
|
|
6
|
-
FacetFieldDef,
|
|
7
|
-
PrimaryPositionalChannel,
|
|
8
|
-
} from "./channel";
|
|
9
|
-
import {
|
|
10
|
-
FillAndStrokeProps,
|
|
11
|
-
MarkConfigAndType,
|
|
12
|
-
MarkType,
|
|
13
|
-
RectProps,
|
|
14
|
-
} from "./mark";
|
|
15
|
-
import { Title } from "./title";
|
|
16
|
-
import { SampleSpec } from "./sampleView";
|
|
17
|
-
|
|
18
|
-
export interface SizeDef {
|
|
19
|
-
/** Size in pixels */
|
|
20
|
-
px?: number;
|
|
21
|
-
|
|
22
|
-
/** Share of the remaining space */
|
|
23
|
-
grow?: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// TODO: Perhaps this should be in "utils"
|
|
27
|
-
export type GeometricDimension = "width" | "height";
|
|
28
|
-
|
|
29
|
-
export interface FacetMapping {
|
|
30
|
-
column?: FacetFieldDef;
|
|
31
|
-
row?: FacetFieldDef;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* DynamicOpacity specifies a zoom-dependent behavior for view opacity.
|
|
36
|
-
* The opacity is interpolated between the specified stops.
|
|
37
|
-
*/
|
|
38
|
-
export interface DynamicOpacity {
|
|
39
|
-
channel?: PrimaryPositionalChannel;
|
|
40
|
-
/** Stops expressed as units (base pairs, for example) per pixel. */
|
|
41
|
-
unitsPerPixel: number[];
|
|
42
|
-
/** Opacity values that match the given stops. */
|
|
43
|
-
values: number[];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type ViewOpacityDef = number | DynamicOpacity;
|
|
47
|
-
|
|
48
|
-
export interface Step {
|
|
49
|
-
step: number;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export type Side = "top" | "right" | "bottom" | "left";
|
|
53
|
-
|
|
54
|
-
export type Paddings = Partial<Record<Side, number>>;
|
|
55
|
-
|
|
56
|
-
export type PaddingConfig = Paddings | number;
|
|
57
|
-
|
|
58
|
-
export interface ViewBackground extends RectProps, FillAndStrokeProps {
|
|
59
|
-
// TODO: style?: string | string[];
|
|
60
|
-
|
|
61
|
-
// TODO: Move to FillAndStrokeProps or something
|
|
62
|
-
strokeWidth?: number;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface ViewSpecBase extends ResolveSpec {
|
|
66
|
-
name?: string;
|
|
67
|
-
|
|
68
|
-
height?: SizeDef | number | Step | "container";
|
|
69
|
-
width?: SizeDef | number | Step | "container";
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Padding in pixels.
|
|
73
|
-
*
|
|
74
|
-
* **Default:* `0`
|
|
75
|
-
*/
|
|
76
|
-
padding?: PaddingConfig;
|
|
77
|
-
|
|
78
|
-
data?: Data;
|
|
79
|
-
transform?: TransformParams[];
|
|
80
|
-
encoding?: Encoding;
|
|
81
|
-
title?: string | Title;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* A description of the view. Multiple lines can be provided as an array.
|
|
85
|
-
*/
|
|
86
|
-
description?: string | string[];
|
|
87
|
-
|
|
88
|
-
baseUrl?: string;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Opacity of the view and all its children.
|
|
92
|
-
*
|
|
93
|
-
* **Default:* `1.0`
|
|
94
|
-
*/
|
|
95
|
-
// TODO: Should be available only in Unit and Layer views.
|
|
96
|
-
opacity?: ViewOpacityDef;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Visibility of the view. An invisible view is removed from the layout
|
|
100
|
-
* and not rendered.
|
|
101
|
-
*
|
|
102
|
-
* **Default:** `true`
|
|
103
|
-
*/
|
|
104
|
-
// TODO: Detach invisible views from the data flow.
|
|
105
|
-
visible?: boolean;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Is the visibility configurable interactively from the App.
|
|
109
|
-
* Configurability requires that the view has an explicitly specified name
|
|
110
|
-
* that is *unique* in within the view specification.
|
|
111
|
-
*
|
|
112
|
-
* **Default:** `false` for children of `layer`, `true` for others.
|
|
113
|
-
*/
|
|
114
|
-
configurableVisibility?: boolean;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface UnitSpec extends ViewSpecBase, AggregateSamplesSpec {
|
|
118
|
-
view?: ViewBackground;
|
|
119
|
-
mark: MarkType | MarkConfigAndType;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface AggregateSamplesSpec {
|
|
123
|
-
// TODO: Introduce a type (UnitSpec | LayerSpec) that can ba used in SampleView and here
|
|
124
|
-
aggregateSamples?: (UnitSpec | LayerSpec)[];
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface LayerSpec extends ViewSpecBase, AggregateSamplesSpec {
|
|
128
|
-
view?: ViewBackground;
|
|
129
|
-
layer: (LayerSpec | UnitSpec)[];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export interface FacetSpec extends ViewSpecBase {
|
|
133
|
-
facet: any; //FacetMapping | FacetFieldDef
|
|
134
|
-
spec: LayerSpec | UnitSpec;
|
|
135
|
-
columns?: number;
|
|
136
|
-
spacing?: number;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export type ResolutionTarget = "scale" | "axis";
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* `"independent"` and `"shared"` behave similarly to Vega-Lite.
|
|
143
|
-
* `"excluded"` behaves like `"shared"`, but is not pulled towards the root.
|
|
144
|
-
*/
|
|
145
|
-
export type ResolutionBehavior = "independent" | "shared" | "excluded";
|
|
146
|
-
|
|
147
|
-
export interface ResolveSpec {
|
|
148
|
-
resolve?: Partial<
|
|
149
|
-
Record<
|
|
150
|
-
ResolutionTarget,
|
|
151
|
-
Partial<Record<Channel | "default", ResolutionBehavior>>
|
|
152
|
-
>
|
|
153
|
-
>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export type ContainerSpec = (
|
|
157
|
-
| LayerSpec
|
|
158
|
-
// | FacetSpec
|
|
159
|
-
| SampleSpec
|
|
160
|
-
| VConcatSpec
|
|
161
|
-
| HConcatSpec
|
|
162
|
-
| ConcatSpec
|
|
163
|
-
| UnitSpec
|
|
164
|
-
) &
|
|
165
|
-
ResolveSpec;
|
|
166
|
-
|
|
167
|
-
export type ViewSpec =
|
|
168
|
-
| UnitSpec
|
|
169
|
-
| LayerSpec
|
|
170
|
-
// | FacetSpec
|
|
171
|
-
| SampleSpec
|
|
172
|
-
| VConcatSpec
|
|
173
|
-
| HConcatSpec
|
|
174
|
-
| ConcatSpec;
|
|
175
|
-
|
|
176
|
-
export interface ImportConfig {
|
|
177
|
-
name?: string;
|
|
178
|
-
url?: string;
|
|
179
|
-
params?: object;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export interface ImportSpec {
|
|
183
|
-
import: ImportConfig;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface ConcatBase extends ViewSpecBase {
|
|
187
|
-
spacing?: number;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export interface VConcatSpec extends ConcatBase {
|
|
191
|
-
vconcat: (ViewSpec | ImportSpec)[];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export interface HConcatSpec extends ConcatBase {
|
|
195
|
-
hconcat: (ViewSpec | ImportSpec)[];
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export interface ConcatSpec extends ConcatBase {
|
|
199
|
-
concat: (ViewSpec | ImportSpec)[];
|
|
200
|
-
columns: number;
|
|
201
|
-
}
|