@genome-spy/core 0.30.0 → 0.30.3

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 (234) hide show
  1. package/dist/index.es.js +16379 -0
  2. package/dist/index.js +43 -43
  3. package/package.json +10 -7
  4. package/src/data/collector.js +0 -183
  5. package/src/data/collector.test.js +0 -84
  6. package/src/data/dataFlow.js +0 -148
  7. package/src/data/dataFlow.test.js +0 -5
  8. package/src/data/facetNode.js +0 -17
  9. package/src/data/flow.test.js +0 -72
  10. package/src/data/flowBatch.d.ts +0 -40
  11. package/src/data/flowNode.js +0 -283
  12. package/src/data/flowNode.test.js +0 -50
  13. package/src/data/flowOptimizer.js +0 -123
  14. package/src/data/flowOptimizer.test.js +0 -193
  15. package/src/data/flowTestUtils.js +0 -63
  16. package/src/data/formats/fasta.js +0 -32
  17. package/src/data/formats/fasta.test.js +0 -27
  18. package/src/data/sources/dataSource.js +0 -22
  19. package/src/data/sources/dataSourceFactory.js +0 -24
  20. package/src/data/sources/dataUtils.js +0 -78
  21. package/src/data/sources/dynamicCallbackSource.js +0 -57
  22. package/src/data/sources/dynamicSource.js +0 -37
  23. package/src/data/sources/inlineSource.js +0 -67
  24. package/src/data/sources/inlineSource.test.js +0 -56
  25. package/src/data/sources/namedSource.js +0 -79
  26. package/src/data/sources/sequenceSource.js +0 -46
  27. package/src/data/sources/sequenceSource.test.js +0 -46
  28. package/src/data/sources/urlSource.js +0 -74
  29. package/src/data/transforms/aggregate.js +0 -70
  30. package/src/data/transforms/clone.js +0 -40
  31. package/src/data/transforms/clone.test.js +0 -11
  32. package/src/data/transforms/coverage.js +0 -187
  33. package/src/data/transforms/coverage.test.js +0 -123
  34. package/src/data/transforms/filter.js +0 -37
  35. package/src/data/transforms/filter.test.js +0 -18
  36. package/src/data/transforms/filterScoredLabels.js +0 -134
  37. package/src/data/transforms/flattenCompressedExons.js +0 -57
  38. package/src/data/transforms/flattenDelimited.js +0 -74
  39. package/src/data/transforms/flattenDelimited.test.js +0 -87
  40. package/src/data/transforms/flattenSequence.js +0 -39
  41. package/src/data/transforms/flattenSequence.test.js +0 -34
  42. package/src/data/transforms/formula.js +0 -39
  43. package/src/data/transforms/formula.test.js +0 -19
  44. package/src/data/transforms/identifier.js +0 -108
  45. package/src/data/transforms/identifier.test.js +0 -83
  46. package/src/data/transforms/linearizeGenomicCoordinate.js +0 -101
  47. package/src/data/transforms/measureText.js +0 -44
  48. package/src/data/transforms/pileup.js +0 -128
  49. package/src/data/transforms/pileup.test.js +0 -70
  50. package/src/data/transforms/project.js +0 -41
  51. package/src/data/transforms/project.test.js +0 -32
  52. package/src/data/transforms/regexExtract.js +0 -61
  53. package/src/data/transforms/regexExtract.test.js +0 -67
  54. package/src/data/transforms/regexFold.js +0 -141
  55. package/src/data/transforms/regexFold.test.js +0 -160
  56. package/src/data/transforms/sample.js +0 -101
  57. package/src/data/transforms/sample.test.js +0 -38
  58. package/src/data/transforms/stack.js +0 -137
  59. package/src/data/transforms/stack.test.js +0 -91
  60. package/src/data/transforms/transformFactory.js +0 -60
  61. package/src/embedApi.d.ts +0 -67
  62. package/src/encoder/accessor.js +0 -82
  63. package/src/encoder/accessor.test.js +0 -47
  64. package/src/encoder/encoder.js +0 -394
  65. package/src/encoder/encoder.test.js +0 -98
  66. package/src/fonts/Lato-Regular.json +0 -1267
  67. package/src/fonts/Lato-Regular.png +0 -0
  68. package/src/fonts/OFL.txt +0 -93
  69. package/src/fonts/README.md +0 -3
  70. package/src/fonts/bmFont.d.ts +0 -58
  71. package/src/fonts/bmFontManager.js +0 -357
  72. package/src/fonts/bmFontMetrics.js +0 -108
  73. package/src/genome/genome.js +0 -317
  74. package/src/genome/genome.test.js +0 -188
  75. package/src/genome/genomeStore.js +0 -54
  76. package/src/genome/locusFormat.js +0 -31
  77. package/src/genome/scaleIndex.d.ts +0 -38
  78. package/src/genome/scaleIndex.js +0 -166
  79. package/src/genome/scaleIndex.test.js +0 -78
  80. package/src/genome/scaleLocus.d.ts +0 -11
  81. package/src/genome/scaleLocus.js +0 -108
  82. package/src/genome/scaleLocus.test.js +0 -4
  83. package/src/genomeSpy.js +0 -785
  84. package/src/gl/arrayBuilder.js +0 -199
  85. package/src/gl/dataToVertices.js +0 -636
  86. package/src/gl/includes/common.glsl +0 -63
  87. package/src/gl/includes/picking.fragment.glsl +0 -1
  88. package/src/gl/includes/picking.vertex.glsl +0 -27
  89. package/src/gl/includes/sampleFacet.glsl +0 -107
  90. package/src/gl/includes/scales.glsl +0 -112
  91. package/src/gl/link.fragment.glsl +0 -18
  92. package/src/gl/link.vertex.glsl +0 -111
  93. package/src/gl/point.fragment.glsl +0 -123
  94. package/src/gl/point.vertex.glsl +0 -129
  95. package/src/gl/rect.fragment.glsl +0 -51
  96. package/src/gl/rect.vertex.glsl +0 -114
  97. package/src/gl/rule.fragment.glsl +0 -52
  98. package/src/gl/rule.vertex.glsl +0 -89
  99. package/src/gl/text.fragment.glsl +0 -31
  100. package/src/gl/text.vertex.glsl +0 -246
  101. package/src/gl/webGLHelper.js +0 -504
  102. package/src/img/bowtie.svg +0 -1
  103. package/src/img/genomespy-favicon.svg +0 -34
  104. package/src/index.html +0 -11
  105. package/src/index.js +0 -128
  106. package/src/marks/link.js +0 -175
  107. package/src/marks/mark.js +0 -975
  108. package/src/marks/markUtils.js +0 -125
  109. package/src/marks/pointMark.js +0 -251
  110. package/src/marks/rectMark.js +0 -241
  111. package/src/marks/rule.js +0 -250
  112. package/src/marks/text.js +0 -278
  113. package/src/node_modules/.vitest/results.json +0 -1
  114. package/src/scale/colorUtils.js +0 -184
  115. package/src/scale/glslScaleGenerator.js +0 -502
  116. package/src/scale/scale.js +0 -451
  117. package/src/scale/scale.test.js +0 -324
  118. package/src/scale/ticks.js +0 -203
  119. package/src/scale/ticks.test.js +0 -40
  120. package/src/singlePageApp.js +0 -13
  121. package/src/spec/axis.d.ts +0 -296
  122. package/src/spec/channel.d.ts +0 -430
  123. package/src/spec/data.d.ts +0 -196
  124. package/src/spec/font.d.ts +0 -15
  125. package/src/spec/genome.d.ts +0 -35
  126. package/src/spec/mark.d.ts +0 -429
  127. package/src/spec/root.d.ts +0 -17
  128. package/src/spec/sampleView.d.ts +0 -180
  129. package/src/spec/scale.d.ts +0 -273
  130. package/src/spec/title.d.ts +0 -102
  131. package/src/spec/tooltip.d.ts +0 -9
  132. package/src/spec/transform.d.ts +0 -479
  133. package/src/spec/view.d.ts +0 -201
  134. package/src/styles/genome-spy.scss +0 -153
  135. package/src/tooltip/dataTooltipHandler.js +0 -64
  136. package/src/tooltip/refseqGeneTooltipHandler.js +0 -78
  137. package/src/tooltip/tooltipHandler.ts +0 -12
  138. package/src/types/filetypes.d.ts +0 -14
  139. package/src/types/flatqueue.d.ts +0 -53
  140. package/src/types/glsl.d.ts +0 -4
  141. package/src/types/internmap.d.ts +0 -22
  142. package/src/types/object.d.ts +0 -21
  143. package/src/types/vega-loader.d.ts +0 -1
  144. package/src/types/vega-scale.d.ts +0 -60
  145. package/src/utils/addBaseUrl.js +0 -19
  146. package/src/utils/addBaseUrl.test.js +0 -22
  147. package/src/utils/animator.js +0 -83
  148. package/src/utils/arrayUtils.js +0 -61
  149. package/src/utils/binnedIndex.js +0 -167
  150. package/src/utils/binnedIndex.test.js +0 -155
  151. package/src/utils/clamp.js +0 -8
  152. package/src/utils/cloner.js +0 -34
  153. package/src/utils/cloner.test.js +0 -24
  154. package/src/utils/coalesce.js +0 -11
  155. package/src/utils/coalesce.test.js +0 -16
  156. package/src/utils/concatIterables.js +0 -26
  157. package/src/utils/concatIterables.test.js +0 -8
  158. package/src/utils/debounce.js +0 -37
  159. package/src/utils/domainArray.js +0 -216
  160. package/src/utils/domainArray.test.js +0 -130
  161. package/src/utils/eerp.js +0 -13
  162. package/src/utils/expression.js +0 -32
  163. package/src/utils/field.js +0 -28
  164. package/src/utils/formatObject.js +0 -31
  165. package/src/utils/indexer.js +0 -43
  166. package/src/utils/indexer.test.js +0 -47
  167. package/src/utils/inertia.js +0 -124
  168. package/src/utils/interactionEvent.js +0 -33
  169. package/src/utils/iterateNestedMaps.js +0 -21
  170. package/src/utils/iterateNestedMaps.test.js +0 -33
  171. package/src/utils/kWayMerge.js +0 -42
  172. package/src/utils/kWayMerge.test.js +0 -26
  173. package/src/utils/layout/flexLayout.js +0 -368
  174. package/src/utils/layout/flexLayout.test.js +0 -311
  175. package/src/utils/layout/grid.js +0 -95
  176. package/src/utils/layout/grid.test.js +0 -71
  177. package/src/utils/layout/padding.js +0 -120
  178. package/src/utils/layout/point.js +0 -23
  179. package/src/utils/layout/rectangle.js +0 -288
  180. package/src/utils/layout/rectangle.test.js +0 -172
  181. package/src/utils/mergeObjects.js +0 -99
  182. package/src/utils/mergeObjects.test.js +0 -42
  183. package/src/utils/numberExtractor.js +0 -24
  184. package/src/utils/numberExtractor.test.js +0 -6
  185. package/src/utils/point.js +0 -14
  186. package/src/utils/propertyCacher.js +0 -70
  187. package/src/utils/propertyCacher.test.js +0 -85
  188. package/src/utils/propertyCoalescer.js +0 -42
  189. package/src/utils/propertyCoalescer.test.js +0 -22
  190. package/src/utils/reservationMap.js +0 -103
  191. package/src/utils/reservationMap.test.js +0 -20
  192. package/src/utils/scaleNull.js +0 -19
  193. package/src/utils/setOperations.js +0 -75
  194. package/src/utils/smoothstep.js +0 -10
  195. package/src/utils/throttle.js +0 -34
  196. package/src/utils/topK.js +0 -76
  197. package/src/utils/topK.test.js +0 -64
  198. package/src/utils/transition.js +0 -74
  199. package/src/utils/ui/tooltip.js +0 -189
  200. package/src/utils/url.js +0 -22
  201. package/src/utils/variableTools.js +0 -24
  202. package/src/utils/variableTools.test.js +0 -13
  203. package/src/view/axisResolution.js +0 -140
  204. package/src/view/axisResolution.test.js +0 -201
  205. package/src/view/axisView.js +0 -747
  206. package/src/view/concatView.js +0 -45
  207. package/src/view/containerView.js +0 -159
  208. package/src/view/facetView.js +0 -491
  209. package/src/view/flowBuilder.js +0 -367
  210. package/src/view/flowBuilder.test.js +0 -125
  211. package/src/view/gridView.js +0 -786
  212. package/src/view/implicitRootView.js +0 -14
  213. package/src/view/importView.js +0 -19
  214. package/src/view/layerView.js +0 -74
  215. package/src/view/rendering.d.ts +0 -44
  216. package/src/view/renderingContext/compositeViewRenderingContext.js +0 -51
  217. package/src/view/renderingContext/deferredViewRenderingContext.js +0 -176
  218. package/src/view/renderingContext/layoutRecorderViewRenderingContext.js +0 -128
  219. package/src/view/renderingContext/simpleViewRenderingContext.js +0 -64
  220. package/src/view/renderingContext/svgViewRenderingContext.js +0 -125
  221. package/src/view/renderingContext/viewRenderingContext.js +0 -41
  222. package/src/view/scaleResolution.js +0 -797
  223. package/src/view/scaleResolution.test.js +0 -572
  224. package/src/view/scaleResolutionApi.d.ts +0 -40
  225. package/src/view/testUtils.js +0 -51
  226. package/src/view/title.js +0 -165
  227. package/src/view/unitView.js +0 -382
  228. package/src/view/view.js +0 -612
  229. package/src/view/view.test.js +0 -214
  230. package/src/view/viewContext.d.ts +0 -62
  231. package/src/view/viewFactory.js +0 -181
  232. package/src/view/viewFactory.test.js +0 -17
  233. package/src/view/viewUtils.js +0 -327
  234. package/src/view/zoom.js +0 -89
@@ -1,430 +0,0 @@
1
- /*!
2
- * Partially based on
3
- * https://github.com/vega/vega-lite/blob/master/src/channeldef.ts
4
- *
5
- * Copyright (c) 2015-2018, University of Washington Interactive Data Lab
6
- * All rights reserved.
7
- *
8
- * BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE
9
- */
10
-
11
- import { Scale } from "./scale";
12
- import { Axis } from "./axis";
13
-
14
- export type Scalar = string | number | boolean;
15
- export type Value = Scalar | null;
16
-
17
- export type FieldName = string;
18
- export type Field = FieldName;
19
-
20
- export type PrimaryPositionalChannel = "x" | "y";
21
- export type SecondaryPositionalChannel = "x2" | "y2";
22
-
23
- export type PositionalChannel =
24
- | PrimaryPositionalChannel
25
- | SecondaryPositionalChannel;
26
-
27
- export type Channel =
28
- | PositionalChannel
29
- | "color"
30
- | "fill"
31
- | "stroke"
32
- | "opacity"
33
- | "fillOpacity"
34
- | "strokeOpacity"
35
- | "strokeWidth"
36
- | "size"
37
- | "shape"
38
- | "text"
39
- | "angle"
40
- | "sample"
41
- | "uniqueId"
42
- | "search"
43
- | "facetIndex"
44
- | "semanticScore"
45
- | "dx"
46
- | "dy"
47
- | "uniqueId";
48
-
49
- // TODO
50
- export type FacetFieldDef = any;
51
-
52
- // TODO: Belongs to "guide"
53
- export interface TitleMixins {
54
- /**
55
- * A title for the field. If `null`, the title will be removed.
56
- */
57
- title?: string | null;
58
- }
59
-
60
- export interface BandMixins {
61
- /**
62
- * Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.
63
- *
64
- * @minimum 0
65
- * @maximum 1
66
- */
67
- // TODO: rename to bandPosition: https://github.com/vega/vega-lite/pull/7190
68
- // bandPosition?: number;
69
- band?: number;
70
- }
71
-
72
- export interface FormatMixins {
73
- /**
74
- * When used with the default `"number"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.
75
- *
76
- * - If the format type is `"number"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).
77
- *
78
- * See the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.
79
- */
80
- format?: string;
81
- }
82
-
83
- export type StringDatumDef = DatumDef & FormatMixins;
84
-
85
- export type Type = "quantitative" | "ordinal" | "nominal" | "index" | "locus";
86
-
87
- export type TypeForShape = "ordinal" | "nominal";
88
-
89
- export interface TypeMixins<T extends Type> {
90
- type: T;
91
- }
92
-
93
- export interface FieldDefBase<F> {
94
- /**
95
- * __Required.__ A string defining the name of the field from which to pull a data value
96
- * or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.
97
- *
98
- * __See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.
99
- *
100
- * __Notes:__
101
- * 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `"field": "foo.bar"` and `"field": "foo['bar']"`).
102
- * If field names contain dots or brackets but are not nested, you can use `\\` to escape dots and brackets (e.g., `"a\\.b"` and `"a\\[0\\]"`).
103
- * See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).
104
- * 2) `field` is not required if `aggregate` is `count`.
105
- */
106
- field?: F;
107
- }
108
-
109
- export type TypedFieldDef<
110
- F extends Field,
111
- T extends Type = any
112
- > = FieldDefBase<F> & TitleMixins & TypeMixins<T>;
113
-
114
- export type ScaleFieldDef<F extends Field, T extends Type> = TypedFieldDef<
115
- F,
116
- T
117
- > &
118
- ScaleMixins;
119
-
120
- export type FieldDefWithoutScale<F extends Field> = FieldDefBase<F> &
121
- TitleMixins;
122
-
123
- export interface ScaleMixins {
124
- /**
125
- * An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.
126
- *
127
- * If `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).
128
- *
129
- * __Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.
130
- *
131
- * __See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation.
132
- */
133
- scale?: Scale | null;
134
-
135
- /**
136
- * An alternative channel for scale resolution.
137
- *
138
- * This is mainly for internal use and allows using `color` channel to resolve `fill` and `stroke` channels under certain circumstances.
139
- */
140
- resolutionChannel?: Channel;
141
- }
142
-
143
- export interface ValueDef<V extends Value = Scalar> {
144
- /**
145
- * A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).
146
- */
147
- value: V;
148
- }
149
-
150
- export interface DatumDef extends TitleMixins {
151
- /**
152
- * A constant value in data domain.
153
- */
154
- datum?: Scalar;
155
- }
156
-
157
- export interface ExprDef {
158
- /** An expression. Properties of the data can be accessed through the `datum` object. */
159
- expr: string;
160
- }
161
-
162
- /**
163
- * Field definition of a mark property, which can contain a legend.
164
- */
165
- export type MarkPropFieldDef<
166
- F extends Field,
167
- T extends Type = Type
168
- > = ScaleFieldDef<F, T> & LegendMixins;
169
-
170
- export type MarkPropExprDef<T extends Type = Type> = ExprDef &
171
- TypeMixins<T> &
172
- ScaleMixins;
173
-
174
- export type MarkPropDatumDef<T extends Type> = LegendMixins &
175
- ScaleDatumDef &
176
- TypeMixins<T>;
177
-
178
- export type MarkPropFieldOrDatumOrExprDef<
179
- F extends Field,
180
- T extends Type = Type
181
- > = MarkPropFieldDef<F, T> | MarkPropDatumDef<T> | MarkPropExprDef;
182
-
183
- export interface LegendMixins {
184
- /**
185
- * An object defining properties of the legend.
186
- * If `null`, the legend for the encoding channel will be removed.
187
- *
188
- * __Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.
189
- *
190
- * __See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation.
191
- */
192
- // TODO: legend?: Legend<ExprRef | SignalRef> | null;
193
- }
194
-
195
- export type MarkPropDef<
196
- F extends Field,
197
- V extends Value,
198
- T extends Type = Type
199
- > = MarkPropFieldOrDatumOrExprDef<F, T> | ValueDef<V>;
200
-
201
- export type ColorDef<F extends Field> = MarkPropDef<F, string | null>;
202
-
203
- export type SecondaryFieldDef<F extends Field> = FieldDefBase<F> & TitleMixins;
204
-
205
- export type NumericValueDef = ValueDef<number>;
206
-
207
- export type ScaleDatumDef = ScaleMixins & DatumDef;
208
-
209
- export type PositionDatumDefBase = ScaleDatumDef & TypeMixins<Type>;
210
-
211
- export type PositionFieldDef<F extends Field> = PositionFieldDefBase<F> &
212
- PositionMixins;
213
-
214
- export type PositionDatumDef = PositionDatumDefBase & PositionMixins;
215
-
216
- export type PositionExprDef = ExprDef &
217
- PositionMixins &
218
- BandMixins &
219
- TypeMixins<Type>;
220
-
221
- export type PositionValueDef = NumericValueDef;
222
-
223
- export interface PositionMixins extends BandMixins {
224
- /**
225
- * An object defining properties of axis's gridlines, ticks and labels.
226
- * If `null`, the axis for the encoding channel will be removed.
227
- *
228
- * __Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.
229
- *
230
- * __See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation.
231
- */
232
- axis?: Axis | null;
233
- }
234
-
235
- export type PositionFieldDefBase<F extends Field> = ScaleFieldDef<F, Type>;
236
-
237
- export interface ChromPosDefBase extends BandMixins {
238
- /**
239
- * The field having the chromosome or contig.
240
- */
241
- chrom: FieldName;
242
-
243
- /**
244
- * The field having an intra-chromosomal position.
245
- */
246
- pos?: FieldName;
247
-
248
- /**
249
- * An offset or offsets that allow for adjusting the numbering base. The offset
250
- * is subtracted from the positions.
251
- *
252
- * GenomeSpy uses internally zero-based indexing with half-open intervals.
253
- * UCSC-based formats (BED, etc.) generally use this scheme. However, for example,
254
- * VCF files use one-based indexing and must be adjusted by setting the offset to
255
- * `1`.
256
- *
257
- * **Default:** `0`
258
- */
259
- offset?: number;
260
- }
261
-
262
- export type SecondaryChromPosDef = ChromPosDefBase &
263
- TitleMixins &
264
- PositionMixins;
265
-
266
- export type ChromPosDef = SecondaryChromPosDef &
267
- TypeMixins<"locus"> &
268
- ScaleMixins;
269
-
270
- export type PositionDef<F extends Field> =
271
- | PositionFieldDef<F>
272
- | ChromPosDef
273
- | PositionDatumDef
274
- | PositionExprDef
275
- | PositionValueDef;
276
-
277
- export type Position2Def<F extends Field> =
278
- | (SecondaryFieldDef<F> & BandMixins)
279
- | SecondaryChromPosDef
280
- | (DatumDef & BandMixins)
281
- | (ExprDef & BandMixins)
282
- | PositionValueDef;
283
-
284
- export type NumericMarkPropDef<F extends Field> = MarkPropDef<F, number>;
285
-
286
- export type ShapeDef<F extends Field> = MarkPropDef<
287
- F,
288
- string | null,
289
- TypeForShape
290
- >;
291
-
292
- export interface StringFieldDef<F extends Field>
293
- extends FieldDefWithoutScale<F>,
294
- FormatMixins {}
295
-
296
- export type TextDef<F extends Field> =
297
- | StringFieldDef<F>
298
- | StringDatumDef
299
- | ExprDef;
300
-
301
- export type ChannelDef<F extends Field = string> =
302
- Encoding<F>[keyof Encoding<F>];
303
-
304
- // TODO: Does this make sense?
305
- export type ChannelDefWithScale = ScaleMixins & TypeMixins<Type>;
306
-
307
- export interface Encoding<F extends Field = string> {
308
- /**
309
- * X coordinates of the marks.
310
- *
311
- * The `value` of this channel can be a number between zero and one.
312
- */
313
- x?: PositionDef<F>;
314
-
315
- /**
316
- * Y coordinates of the marks.
317
- *
318
- * The `value` of this channel can be a number between zero and one.
319
- */
320
- y?: PositionDef<F>;
321
-
322
- /**
323
- * X2 coordinates of the marks.
324
- *
325
- * The `value` of this channel can be a number between zero and one.
326
- */
327
- x2?: Position2Def<F>;
328
-
329
- /**
330
- * Y2 coordinates of the marks.
331
- *
332
- * The `value` of this channel can be a number between zero and one.
333
- */
334
- y2?: Position2Def<F>;
335
-
336
- dx?: NumericMarkPropDef<F>;
337
- dy?: NumericMarkPropDef<F>;
338
-
339
- /**
340
- * Color of the marks – either fill or stroke color based on the `filled` property of mark definition.
341
- *
342
- * _Note:_
343
- * 1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. The `fill` or `stroke` encodings have higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified.
344
- * 2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme).
345
- */
346
- color?: ColorDef<F>;
347
-
348
- /**
349
- * Fill color of the marks.
350
- *
351
- * _Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified.
352
- */
353
- fill?: ColorDef<F>;
354
-
355
- /**
356
- * Stroke color of the marks.
357
- *
358
- * _Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified.
359
- */
360
-
361
- stroke?: ColorDef<F>;
362
-
363
- /**
364
- * Opacity of the marks.
365
- */
366
- opacity?: NumericMarkPropDef<F>;
367
-
368
- /**
369
- * Fill opacity of the marks.
370
- */
371
- fillOpacity?: NumericMarkPropDef<F>;
372
-
373
- /**
374
- * Stroke opacity of the marks.
375
- */
376
- strokeOpacity?: NumericMarkPropDef<F>;
377
-
378
- /**
379
- * Stroke width of the marks.
380
- */
381
- strokeWidth?: NumericMarkPropDef<F>;
382
-
383
- /**
384
- * Size of the mark.
385
- * - For `"point"` – the symbol size, or pixel area of the mark.
386
- * - For `"text"` – the text's font size.
387
- */
388
- size?: NumericMarkPropDef<F>;
389
-
390
- /**
391
- * Rotation angle of point and text marks.
392
- */
393
- angle?: NumericMarkPropDef<F>;
394
-
395
- /**
396
- * Shape of the mark.
397
- *
398
- * For `point` marks the supported values include:
399
- * - plotting shapes: `"circle"`, `"square"`, `"cross"`, `"diamond"`, `"triangle-up"`, `"triangle-down"`, `"triangle-right"`, or `"triangle-left"`.
400
- * - centered directional shape `"triangle"`
401
- */
402
- shape?: ShapeDef<F>;
403
-
404
- /**
405
- * Text of the `text` mark.
406
- */
407
- text?: TextDef<F>;
408
-
409
- /**
410
- * Facet identifier for interactive filtering, sorting, and grouping in the App.
411
- */
412
- sample?: FieldDefWithoutScale<F>;
413
-
414
- /**
415
- * For internal use
416
- */
417
- // TODO: proper type
418
- uniqueId?: FieldDefWithoutScale<F>;
419
-
420
- // TODO: proper type
421
- search?: FieldDefWithoutScale<F>;
422
-
423
- /**
424
- * For internal use
425
- */
426
- // TODO: proper type
427
- facetIndex?: FieldDefWithoutScale<F>;
428
-
429
- semanticScore?: FieldDefWithoutScale<F>;
430
- }
@@ -1,196 +0,0 @@
1
- /*!
2
- * Adapted from
3
- * https://github.com/vega/vega-lite/blob/master/src/data.ts
4
- *
5
- * Copyright (c) 2015-2018, University of Washington Interactive Data Lab
6
- * All rights reserved.
7
- *
8
- * BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE
9
- */
10
-
11
- /*
12
- * Constants and utilities for data.
13
- */
14
- import { FieldName } from "./channel";
15
-
16
- export type ParseValue =
17
- | null
18
- | string
19
- | "string"
20
- | "boolean"
21
- | "date"
22
- | "number";
23
-
24
- export interface Parse {
25
- [field: string]: ParseValue;
26
- }
27
-
28
- export interface DataFormatBase {
29
- /**
30
- * If set to `null`, disable type inference based on the spec and only use type inference based on the data.
31
- * Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `"number"`, `"boolean"`, `"date"`, or null (do not parse the field)).
32
- * For example, `"parse": {"modified_on": "date"}` parses the `modified_on` field in each input record a Date value.
33
- *
34
- * For `"date"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
35
- * For Specific date formats can be provided (e.g., `{foo: "date:'%m%d%Y'"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: "utc:'%m%d%Y'"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)
36
- */
37
- parse?: Parse | null;
38
-
39
- /**
40
- * Type of input data: `"json"`, `"csv"`, `"tsv"`, `"dsv"`.
41
- *
42
- * __Default value:__ The default format type is determined by the extension of the file URL.
43
- * If no extension is detected, `"json"` will be used by default.
44
- */
45
- type?: DataFormatType;
46
- }
47
-
48
- export interface CsvDataFormat extends DataFormatBase {
49
- type?: "csv" | "tsv";
50
- }
51
-
52
- export interface DsvDataFormat extends DataFormatBase {
53
- type?: "dsv";
54
-
55
- /**
56
- * The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.
57
- *
58
- * @minLength 1
59
- * @maxLength 1
60
- */
61
- delimiter: string;
62
- }
63
-
64
- export interface JsonDataFormat extends DataFormatBase {
65
- type?: "json";
66
-
67
- /**
68
- * The JSON property containing the desired data.
69
- * This parameter can be used when the loaded JSON file may have surrounding structure or meta-data.
70
- * For example `"property": "values.features"` is equivalent to retrieving `json.values.features`
71
- * from the loaded JSON object.
72
- */
73
- property?: string;
74
- }
75
-
76
- /**
77
- * Other data format, such as `"fasta"`
78
- */
79
- export interface OtherDataFormat {
80
- type: string;
81
- }
82
-
83
- export type DataFormat =
84
- | CsvDataFormat
85
- | DsvDataFormat
86
- | JsonDataFormat
87
- | OtherDataFormat;
88
-
89
- export type DataFormatType = "json" | "csv" | "tsv" | "dsv" | string;
90
-
91
- export type DataSource =
92
- | UrlData
93
- | InlineData
94
- | NamedData
95
- | DynamicCallbackData
96
- | DynamicData;
97
-
98
- export type Data = DataSource | Generator;
99
-
100
- export type InlineDataset =
101
- | number[]
102
- | string[]
103
- | boolean[]
104
- | object[]
105
- | string
106
- | object;
107
-
108
- export interface DataBase {
109
- /**
110
- * An object that specifies the format for parsing the data.
111
- */
112
- format?: DataFormat;
113
-
114
- /**
115
- * Provide a placeholder name and bind data at runtime.
116
- */
117
- name?: string;
118
- }
119
-
120
- export interface UrlData extends DataBase {
121
- /**
122
- * An URL or an array of URLs from which to load the data set.
123
- * Use the `format.type` property to ensure the loaded data is correctly parsed.
124
- */
125
- url: string | string[];
126
- }
127
-
128
- export interface InlineData extends DataBase {
129
- /**
130
- * The full data set, included inline. This can be an array of objects or primitive values, an object, or a string.
131
- * Arrays of primitive values are ingested as objects with a `data` property. Strings are parsed according to the specified format type.
132
- */
133
- values: InlineDataset;
134
- }
135
-
136
- export interface NamedData extends DataBase {
137
- /**
138
- * Provide a placeholder name and bind data at runtime.
139
- */
140
- name: string;
141
- }
142
-
143
- export interface DynamicCallbackData extends DataBase {
144
- /**
145
- * The View class has `getDynamicData()` methods that provides the data.
146
- * This is intended for internal use.
147
- */
148
- dynamicCallbackSource: boolean;
149
- }
150
-
151
- export interface DynamicData extends DataBase {
152
- /**
153
- * For internal use.
154
- */
155
- dynamicSource: boolean;
156
- }
157
-
158
- export type Generator = SequenceGenerator;
159
-
160
- export interface GeneratorBase {
161
- /**
162
- * Provide a placeholder name and bind data at runtime.
163
- */
164
- name?: string;
165
- }
166
-
167
- export interface SequenceGenerator extends GeneratorBase {
168
- /**
169
- * Generate a sequence of numbers.
170
- */
171
- sequence: SequenceParams;
172
- }
173
-
174
- export interface SequenceParams {
175
- /**
176
- * The starting value of the sequence (inclusive).
177
- */
178
- start: number;
179
- /**
180
- * The ending value of the sequence (exclusive).
181
- */
182
- stop: number;
183
- /**
184
- * The step value between sequence entries.
185
- *
186
- * __Default value:__ `1`
187
- */
188
- step?: number;
189
-
190
- /**
191
- * The name of the generated sequence field.
192
- *
193
- * __Default value:__ `"data"`
194
- */
195
- as?: FieldName;
196
- }
@@ -1,15 +0,0 @@
1
- export type FontStyle = "normal" | "italic";
2
-
3
- export type FontWeight =
4
- | number
5
- | "thin"
6
- | "light"
7
- | "regular"
8
- | "normal"
9
- | "medium"
10
- | "bold"
11
- | "black";
12
-
13
- export type Align = "left" | "center" | "right";
14
-
15
- export type Baseline = "top" | "middle" | "bottom" | "alphabetic";
@@ -1,35 +0,0 @@
1
- export interface Contig {
2
- name: string;
3
- size: number;
4
- }
5
-
6
- export interface GenomeConfig {
7
- /**
8
- * Name of the genome assembly, e.g., `hg19` or `hg38`.
9
- */
10
- name: string;
11
-
12
- /**
13
- * Base url of data files: chromsizes, cytobands, and gene annotations.
14
- *
15
- * **Default:** `"https://genomespy.app/data/genomes/"`
16
- */
17
- baseUrl?: string;
18
-
19
- /**
20
- * As an alternative for chromSizes, the contigs can be provided inline.
21
- */
22
- contigs?: Contig[];
23
- }
24
-
25
- export interface ChromosomalLocus {
26
- /**
27
- * The name of the chromosome. For example: `"chr1"`, `"CHR1"`, or `"1"`.
28
- */
29
- chrom: string;
30
-
31
- /**
32
- * The zero-based position inside the chromosome or contig.
33
- */
34
- pos?: number;
35
- }