@genome-spy/core 0.48.1 → 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.
Files changed (241) hide show
  1. package/dist/bundle/index.es.js +7485 -7097
  2. package/dist/bundle/index.js +124 -111
  3. package/dist/schema.json +838 -344
  4. package/dist/src/data/collector.d.ts +10 -8
  5. package/dist/src/data/collector.d.ts.map +1 -1
  6. package/dist/src/data/collector.js +131 -33
  7. package/dist/src/data/collector.test.d.ts +2 -0
  8. package/dist/src/data/collector.test.d.ts.map +1 -0
  9. package/dist/src/data/collector.test.js +55 -1
  10. package/dist/src/data/dataFlow.test.d.ts +2 -0
  11. package/dist/src/data/dataFlow.test.d.ts.map +1 -0
  12. package/dist/src/data/flow.test.d.ts +2 -0
  13. package/dist/src/data/flow.test.d.ts.map +1 -0
  14. package/dist/src/data/flow.test.js +19 -14
  15. package/dist/src/data/flowNode.test.d.ts +2 -0
  16. package/dist/src/data/flowNode.test.d.ts.map +1 -0
  17. package/dist/src/data/flowOptimizer.test.d.ts +2 -0
  18. package/dist/src/data/flowOptimizer.test.d.ts.map +1 -0
  19. package/dist/src/data/flowOptimizer.test.js +9 -10
  20. package/dist/src/data/formats/fasta.test.d.ts +2 -0
  21. package/dist/src/data/formats/fasta.test.d.ts.map +1 -0
  22. package/dist/src/data/sources/inlineSource.test.d.ts +2 -0
  23. package/dist/src/data/sources/inlineSource.test.d.ts.map +1 -0
  24. package/dist/src/data/sources/inlineSource.test.js +23 -16
  25. package/dist/src/data/sources/sequenceSource.test.d.ts +2 -0
  26. package/dist/src/data/sources/sequenceSource.test.d.ts.map +1 -0
  27. package/dist/src/data/sources/sequenceSource.test.js +59 -42
  28. package/dist/src/data/transforms/clone.test.d.ts +2 -0
  29. package/dist/src/data/transforms/clone.test.d.ts.map +1 -0
  30. package/dist/src/data/transforms/coverage.test.d.ts +2 -0
  31. package/dist/src/data/transforms/coverage.test.d.ts.map +1 -0
  32. package/dist/src/data/transforms/coverage.test.js +1 -1
  33. package/dist/src/data/transforms/filter.d.ts +10 -0
  34. package/dist/src/data/transforms/filter.d.ts.map +1 -1
  35. package/dist/src/data/transforms/filter.js +30 -1
  36. package/dist/src/data/transforms/filter.test.d.ts +2 -0
  37. package/dist/src/data/transforms/filter.test.d.ts.map +1 -0
  38. package/dist/src/data/transforms/flatten.test.d.ts +2 -0
  39. package/dist/src/data/transforms/flatten.test.d.ts.map +1 -0
  40. package/dist/src/data/transforms/flatten.test.js +10 -7
  41. package/dist/src/data/transforms/flattenDelimited.test.d.ts +2 -0
  42. package/dist/src/data/transforms/flattenDelimited.test.d.ts.map +1 -0
  43. package/dist/src/data/transforms/flattenDelimited.test.js +16 -13
  44. package/dist/src/data/transforms/flattenSequence.test.d.ts +2 -0
  45. package/dist/src/data/transforms/flattenSequence.test.d.ts.map +1 -0
  46. package/dist/src/data/transforms/flattenSequence.test.js +1 -1
  47. package/dist/src/data/transforms/formula.test.d.ts +2 -0
  48. package/dist/src/data/transforms/formula.test.d.ts.map +1 -0
  49. package/dist/src/data/transforms/formula.test.js +1 -1
  50. package/dist/src/data/transforms/identifier.d.ts +1 -1
  51. package/dist/src/data/transforms/identifier.d.ts.map +1 -1
  52. package/dist/src/data/transforms/identifier.js +2 -2
  53. package/dist/src/data/transforms/identifier.test.d.ts +2 -0
  54. package/dist/src/data/transforms/identifier.test.d.ts.map +1 -0
  55. package/dist/src/data/transforms/identifier.test.js +23 -14
  56. package/dist/src/data/transforms/pileup.test.d.ts +2 -0
  57. package/dist/src/data/transforms/pileup.test.d.ts.map +1 -0
  58. package/dist/src/data/transforms/project.test.d.ts +2 -0
  59. package/dist/src/data/transforms/project.test.d.ts.map +1 -0
  60. package/dist/src/data/transforms/project.test.js +1 -1
  61. package/dist/src/data/transforms/regexExtract.test.d.ts +2 -0
  62. package/dist/src/data/transforms/regexExtract.test.d.ts.map +1 -0
  63. package/dist/src/data/transforms/regexExtract.test.js +6 -3
  64. package/dist/src/data/transforms/regexFold.test.d.ts +2 -0
  65. package/dist/src/data/transforms/regexFold.test.d.ts.map +1 -0
  66. package/dist/src/data/transforms/sample.test.d.ts +2 -0
  67. package/dist/src/data/transforms/sample.test.d.ts.map +1 -0
  68. package/dist/src/data/transforms/stack.test.d.ts +2 -0
  69. package/dist/src/data/transforms/stack.test.d.ts.map +1 -0
  70. package/dist/src/data/transforms/stack.test.js +8 -8
  71. package/dist/src/encoder/accessor.d.ts +17 -14
  72. package/dist/src/encoder/accessor.d.ts.map +1 -1
  73. package/dist/src/encoder/accessor.js +127 -56
  74. package/dist/src/encoder/accessor.test.d.ts +2 -0
  75. package/dist/src/encoder/accessor.test.d.ts.map +1 -0
  76. package/dist/src/encoder/accessor.test.js +145 -31
  77. package/dist/src/encoder/encoder.d.ts +26 -13
  78. package/dist/src/encoder/encoder.d.ts.map +1 -1
  79. package/dist/src/encoder/encoder.js +98 -114
  80. package/dist/src/encoder/encoder.test.d.ts +2 -0
  81. package/dist/src/encoder/encoder.test.d.ts.map +1 -0
  82. package/dist/src/encoder/encoder.test.js +85 -82
  83. package/dist/src/fonts/bmFontManager.d.ts.map +1 -1
  84. package/dist/src/fonts/bmFontManager.js +10 -4
  85. package/dist/src/genome/genome.test.d.ts +2 -0
  86. package/dist/src/genome/genome.test.d.ts.map +1 -0
  87. package/dist/src/genome/scaleIndex.test.d.ts +2 -0
  88. package/dist/src/genome/scaleIndex.test.d.ts.map +1 -0
  89. package/dist/src/genome/scaleLocus.test.d.ts +2 -0
  90. package/dist/src/genome/scaleLocus.test.d.ts.map +1 -0
  91. package/dist/src/genomeSpy.d.ts +3 -2
  92. package/dist/src/genomeSpy.d.ts.map +1 -1
  93. package/dist/src/genomeSpy.js +29 -21
  94. package/dist/src/gl/dataToVertices.d.ts +5 -7
  95. package/dist/src/gl/dataToVertices.d.ts.map +1 -1
  96. package/dist/src/gl/dataToVertices.js +42 -30
  97. package/dist/src/gl/glslScaleGenerator.d.ts +84 -15
  98. package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
  99. package/dist/src/gl/glslScaleGenerator.js +260 -73
  100. package/dist/src/gl/includes/picking.vertex.glsl.js +1 -1
  101. package/dist/src/marks/link.common.glsl.js +1 -1
  102. package/dist/src/marks/link.d.ts.map +1 -1
  103. package/dist/src/marks/link.js +10 -0
  104. package/dist/src/marks/link.vertex.glsl.js +1 -1
  105. package/dist/src/marks/mark.d.ts +6 -9
  106. package/dist/src/marks/mark.d.ts.map +1 -1
  107. package/dist/src/marks/mark.js +212 -95
  108. package/dist/src/marks/point.d.ts.map +1 -1
  109. package/dist/src/marks/point.js +5 -1
  110. package/dist/src/marks/rect.d.ts.map +1 -1
  111. package/dist/src/marks/rect.js +9 -4
  112. package/dist/src/marks/rule.d.ts.map +1 -1
  113. package/dist/src/marks/rule.js +4 -0
  114. package/dist/src/marks/text.d.ts.map +1 -1
  115. package/dist/src/marks/text.js +5 -1
  116. package/dist/src/scale/scale.test.d.ts +2 -0
  117. package/dist/src/scale/scale.test.d.ts.map +1 -0
  118. package/dist/src/scale/scale.test.js +2 -0
  119. package/dist/src/scale/ticks.test.d.ts +2 -0
  120. package/dist/src/scale/ticks.test.d.ts.map +1 -0
  121. package/dist/src/scale/ticks.test.js +6 -0
  122. package/dist/src/selection/selection.d.ts +39 -0
  123. package/dist/src/selection/selection.d.ts.map +1 -0
  124. package/dist/src/selection/selection.js +78 -0
  125. package/dist/src/spec/channel.d.ts +137 -83
  126. package/dist/src/spec/mark.d.ts +9 -0
  127. package/dist/src/spec/parameter.d.ts +112 -3
  128. package/dist/src/spec/root.d.ts +0 -1
  129. package/dist/src/spec/transform.d.ts +19 -1
  130. package/dist/src/spec/view.d.ts +3 -3
  131. package/dist/src/tooltip/dataTooltipHandler.js +1 -1
  132. package/dist/src/types/encoder.d.ts +80 -26
  133. package/dist/src/types/rendering.d.ts +1 -0
  134. package/dist/src/types/selectionTypes.d.ts +44 -0
  135. package/dist/src/types/viewContext.d.ts +1 -4
  136. package/dist/src/utils/addBaseUrl.test.d.ts +2 -0
  137. package/dist/src/utils/addBaseUrl.test.d.ts.map +1 -0
  138. package/dist/src/utils/animator.d.ts.map +1 -1
  139. package/dist/src/utils/animator.js +3 -1
  140. package/dist/src/utils/binnedIndex.test.d.ts +2 -0
  141. package/dist/src/utils/binnedIndex.test.d.ts.map +1 -0
  142. package/dist/src/utils/cloner.test.d.ts +2 -0
  143. package/dist/src/utils/cloner.test.d.ts.map +1 -0
  144. package/dist/src/utils/coalesce.test.d.ts +2 -0
  145. package/dist/src/utils/coalesce.test.d.ts.map +1 -0
  146. package/dist/src/utils/concatIterables.test.d.ts +2 -0
  147. package/dist/src/utils/concatIterables.test.d.ts.map +1 -0
  148. package/dist/src/utils/domainArray.test.d.ts +2 -0
  149. package/dist/src/utils/domainArray.test.d.ts.map +1 -0
  150. package/dist/src/utils/expression.d.ts +2 -2
  151. package/dist/src/utils/expression.d.ts.map +1 -1
  152. package/dist/src/utils/expression.js +11 -2
  153. package/dist/src/utils/indexer.test.d.ts +2 -0
  154. package/dist/src/utils/indexer.test.d.ts.map +1 -0
  155. package/dist/src/utils/inertia.d.ts.map +1 -1
  156. package/dist/src/utils/inertia.js +4 -0
  157. package/dist/src/utils/inputBinding.d.ts.map +1 -1
  158. package/dist/src/utils/inputBinding.js +4 -0
  159. package/dist/src/utils/iterateNestedMaps.d.ts +4 -3
  160. package/dist/src/utils/iterateNestedMaps.d.ts.map +1 -1
  161. package/dist/src/utils/iterateNestedMaps.js +3 -2
  162. package/dist/src/utils/iterateNestedMaps.test.d.ts +2 -0
  163. package/dist/src/utils/iterateNestedMaps.test.d.ts.map +1 -0
  164. package/dist/src/utils/kWayMerge.test.d.ts +2 -0
  165. package/dist/src/utils/kWayMerge.test.d.ts.map +1 -0
  166. package/dist/src/utils/mergeObjects.test.d.ts +2 -0
  167. package/dist/src/utils/mergeObjects.test.d.ts.map +1 -0
  168. package/dist/src/utils/numberExtractor.test.d.ts +2 -0
  169. package/dist/src/utils/numberExtractor.test.d.ts.map +1 -0
  170. package/dist/src/utils/propertyCacher.test.d.ts +2 -0
  171. package/dist/src/utils/propertyCacher.test.d.ts.map +1 -0
  172. package/dist/src/utils/propertyCoalescer.test.d.ts +2 -0
  173. package/dist/src/utils/propertyCoalescer.test.d.ts.map +1 -0
  174. package/dist/src/utils/propertyCoalescer.test.js +3 -0
  175. package/dist/src/utils/radixSort.d.ts +9 -0
  176. package/dist/src/utils/radixSort.d.ts.map +1 -0
  177. package/dist/src/utils/radixSort.js +130 -0
  178. package/dist/src/utils/radixSort.test.d.ts +2 -0
  179. package/dist/src/utils/radixSort.test.d.ts.map +1 -0
  180. package/dist/src/utils/radixSort.test.js +51 -0
  181. package/dist/src/utils/reservationMap.test.d.ts +2 -0
  182. package/dist/src/utils/reservationMap.test.d.ts.map +1 -0
  183. package/dist/src/utils/ringBuffer.test.d.ts +2 -0
  184. package/dist/src/utils/ringBuffer.test.d.ts.map +1 -0
  185. package/dist/src/utils/topK.test.d.ts +2 -0
  186. package/dist/src/utils/topK.test.d.ts.map +1 -0
  187. package/dist/src/utils/trees.test.d.ts +2 -0
  188. package/dist/src/utils/trees.test.d.ts.map +1 -0
  189. package/dist/src/utils/trees.test.js +8 -3
  190. package/dist/src/utils/variableTools.test.d.ts +2 -0
  191. package/dist/src/utils/variableTools.test.d.ts.map +1 -0
  192. package/dist/src/view/axisResolution.d.ts +19 -6
  193. package/dist/src/view/axisResolution.d.ts.map +1 -1
  194. package/dist/src/view/axisResolution.js +16 -7
  195. package/dist/src/view/axisResolution.test.d.ts +2 -0
  196. package/dist/src/view/axisResolution.test.d.ts.map +1 -0
  197. package/dist/src/view/axisResolution.test.js +16 -11
  198. package/dist/src/view/facetView.d.ts +1 -1
  199. package/dist/src/view/facetView.d.ts.map +1 -1
  200. package/dist/src/view/flowBuilder.d.ts +1 -1
  201. package/dist/src/view/flowBuilder.d.ts.map +1 -1
  202. package/dist/src/view/flowBuilder.js +34 -5
  203. package/dist/src/view/flowBuilder.test.d.ts +2 -0
  204. package/dist/src/view/flowBuilder.test.d.ts.map +1 -0
  205. package/dist/src/view/gridView.d.ts +0 -6
  206. package/dist/src/view/gridView.d.ts.map +1 -1
  207. package/dist/src/view/layerView.d.ts +0 -6
  208. package/dist/src/view/layerView.d.ts.map +1 -1
  209. package/dist/src/view/layout/flexLayout.test.d.ts +2 -0
  210. package/dist/src/view/layout/flexLayout.test.d.ts.map +1 -0
  211. package/dist/src/view/layout/grid.test.d.ts +2 -0
  212. package/dist/src/view/layout/grid.test.d.ts.map +1 -0
  213. package/dist/src/view/layout/rectangle.test.d.ts +2 -0
  214. package/dist/src/view/layout/rectangle.test.d.ts.map +1 -0
  215. package/dist/src/view/paramMediator.d.ts +32 -5
  216. package/dist/src/view/paramMediator.d.ts.map +1 -1
  217. package/dist/src/view/paramMediator.js +97 -9
  218. package/dist/src/view/paramMediator.test.d.ts +2 -0
  219. package/dist/src/view/paramMediator.test.d.ts.map +1 -0
  220. package/dist/src/view/paramMediator.test.js +17 -1
  221. package/dist/src/view/scaleResolution.d.ts +17 -9
  222. package/dist/src/view/scaleResolution.d.ts.map +1 -1
  223. package/dist/src/view/scaleResolution.js +51 -34
  224. package/dist/src/view/scaleResolution.test.d.ts +2 -0
  225. package/dist/src/view/scaleResolution.test.d.ts.map +1 -0
  226. package/dist/src/view/scaleResolution.test.js +2 -0
  227. package/dist/src/view/testUtils.d.ts.map +1 -1
  228. package/dist/src/view/testUtils.js +15 -3
  229. package/dist/src/view/unitView.d.ts +5 -15
  230. package/dist/src/view/unitView.d.ts.map +1 -1
  231. package/dist/src/view/unitView.js +81 -101
  232. package/dist/src/view/view.d.ts +1 -1
  233. package/dist/src/view/view.d.ts.map +1 -1
  234. package/dist/src/view/view.test.d.ts +2 -0
  235. package/dist/src/view/view.test.d.ts.map +1 -0
  236. package/dist/src/view/view.test.js +73 -55
  237. package/dist/src/view/viewFactory.test.d.ts +2 -0
  238. package/dist/src/view/viewFactory.test.d.ts.map +1 -0
  239. package/dist/src/view/viewFactory.test.js +2 -2
  240. package/dist/src/view/zoom.js +2 -2
  241. 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 FilterParams extends TransformParamsBase {
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
 
@@ -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 { VariableParameter } from "./parameter.js";
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?: VariableParameter[];
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?: VariableParameter[] | Record<string, any>;
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?.accessor?.fields.includes(key)) {
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 AccessorMetadata {
24
- /** True if the accessor returns the same value for all objects */
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
- /** The fields that the return value is based on (if any) */
39
+ /**
40
+ * The fields that the return value is based on (if any)
41
+ */
28
42
  fields: string[];
29
- }
30
43
 
31
- export type Accessor = ((datum: any) => any) & AccessorMetadata;
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
- export interface EncoderMetadata {
34
- /** True if the accessor returns the same value for all objects */
35
- constant: boolean;
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
- /** True the encoder returns a "value" without a scale */
38
- constantValue: boolean;
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
- invert: (value: Scalar) => Scalar;
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
- accessor: Accessor;
97
+ /**
98
+ * An accessor, or if the ChannelDef has conditions, all the accessors.
99
+ */
100
+ accessors: Accessor[];
45
101
 
46
- /** Converts ordinal values to index numbers */
47
- indexer?: (value: any) => number;
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 "./containerView.js";
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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=addBaseUrl.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addBaseUrl.test.d.ts","sourceRoot":"","sources":["../../../src/utils/addBaseUrl.test.js"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"animator.d.ts","sourceRoot":"","sources":["../../../src/utils/animator.js"],"names":[],"mappings":"AAoFA;;;;;;;;;;;;;;GAcG;AACH,6EARW,OAAO,sBAAsB,EAAE,OAAO,0BACxB,IAAI,YAClB,MAAM,UACN,MAAM,oCAEY,IAAI;UAAY,MAAM,IAAI;EAgFtD;AA9KD;IACI;;;OAGG;IACH,mCAFoB,MAAM,KAAE,IAAI,EAS/B;IANG,wBAHgB,MAAM,KAAE,IAAI,CAGS;IACrC,0BAA6B;IAC7B,eAAkB;IAElB,wCAAwC;IACxC,aADW,QAAU,MAAM,KAAE,IAAI,CAAC,EAAE,CACf;IAGzB;;;;;;;;;OASG;IACH,mCAFoB,MAAM,KAAE,IAAI,QAM/B;IAED;;OAEG;IACH,kCAFoB,MAAM,KAAE,IAAI,QAO/B;IAED;;;;OAIG;IACH,sBAoBC;IAED;;;;;OAKG;IACH,oBAFW,OAAO,iBAAiB,EAAE,iBAAiB,gBAQrD;CACJ"}
1
+ {"version":3,"file":"animator.d.ts","sourceRoot":"","sources":["../../../src/utils/animator.js"],"names":[],"mappings":"AAoFA;;;;;;;;;;;;;;GAcG;AACH,6EARW,OAAO,sBAAsB,EAAE,OAAO,0BACxB,IAAI,YAClB,MAAM,UACN,MAAM,oCAEY,IAAI;UAAY,MAAM,IAAI;EAkFtD;AAhLD;IACI;;;OAGG;IACH,mCAFoB,MAAM,KAAE,IAAI,EAS/B;IANG,wBAHgB,MAAM,KAAE,IAAI,CAGS;IACrC,0BAA6B;IAC7B,eAAkB;IAElB,wCAAwC;IACxC,aADW,QAAU,MAAM,KAAE,IAAI,CAAC,EAAE,CACf;IAGzB;;;;;;;;;OASG;IACH,mCAFoB,MAAM,KAAE,IAAI,QAM/B;IAED;;OAEG;IACH,kCAFoB,MAAM,KAAE,IAAI,QAO/B;IAED;;;;OAIG;IACH,sBAoBC;IAED;;;;;OAKG;IACH,oBAFW,OAAO,iBAAiB,EAAE,iBAAiB,gBAQrD;CACJ"}
@@ -151,7 +151,9 @@ export function makeLerpSmoother(
151
151
  current = target;
152
152
  callback(current);
153
153
  settled = true;
154
- animator.requestRender();
154
+ if (maxDiff != 0) {
155
+ animator.requestRender();
156
+ }
155
157
  } else {
156
158
  animator.requestTransition((t) => smoothUpdate(t));
157
159
  }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=binnedIndex.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binnedIndex.test.d.ts","sourceRoot":"","sources":["../../../src/utils/binnedIndex.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cloner.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloner.test.d.ts","sourceRoot":"","sources":["../../../src/utils/cloner.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=coalesce.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coalesce.test.d.ts","sourceRoot":"","sources":["../../../src/utils/coalesce.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=concatIterables.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concatIterables.test.d.ts","sourceRoot":"","sources":["../../../src/utils/concatIterables.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=domainArray.test.d.ts.map
@@ -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?: object) => any) & ExpressionProps } ExpressionFunction
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?: object) => any) & ExpressionProps;
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":"AAyDA;;;;;;;;;;GAUG;AACH,6CAHW,MAAM,sBACJ,kBAAkB,CAyB9B;;YAhCU,MAAM,EAAE;aACR,MAAM,EAAE;UACR,MAAM;;2CAEO,MAAM,KAAK,GAAG"}
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?: object) => any) & ExpressionProps } ExpressionFunction
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"; return (${generatedCode.code});`
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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=indexer.test.d.ts.map
@@ -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":"inertia.d.ts","sourceRoot":"","sources":["../../../src/utils/inertia.js"],"names":[],"mappings":"AAoEA;;;GAGG;AACH,8EAiBC;AArFD;;GAEG;AACH;IACI;;;OAGG;IACH,sBAHW,OAAO,eAAe,EAAE,OAAO,aAC/B,OAAO,EA0BjB;IAvBG,0CAAwB;IACxB,kBAA0B;IAG1B,oBAAsB;IAEtB,oCAAoC;IACpC,iBADoB,MAAM,KAAE,IAAI,CACZ;IAEpB,oBAAoB;IACpB,kBAAkB;IAElB;;;;MAUC;IAGL,eAIC;IAED;;;;OAIG;IACH,mBAHW,MAAM,mBACG,MAAM,KAAE,IAAI,QAkB/B;CACJ"}
1
+ {"version":3,"file":"inertia.d.ts","sourceRoot":"","sources":["../../../src/utils/inertia.js"],"names":[],"mappings":"AAwEA;;;GAGG;AACH,8EAiBC;AAzFD;;GAEG;AACH;IACI;;;OAGG;IACH,sBAHW,OAAO,eAAe,EAAE,OAAO,aAC/B,OAAO,EA0BjB;IAvBG,0CAAwB;IACxB,kBAA0B;IAG1B,oBAAsB;IAEtB,oCAAoC;IACpC,iBADoB,MAAM,KAAE,IAAI,CACZ;IAEpB,oBAAoB;IACpB,kBAAkB;IAElB;;;;MAUC;IAGL,eAQC;IAED;;;;OAIG;IACH,mBAHW,MAAM,mBACG,MAAM,KAAE,IAAI,QAkB/B;CACJ"}
@@ -37,6 +37,10 @@ export default class Inertia {
37
37
  }
38
38
 
39
39
  cancel() {
40
+ if (this.lastValue === this.targetValue) {
41
+ return;
42
+ }
43
+
40
44
  // decelelerate rapidly
41
45
  this.targetValue = lerp([this.lastValue, this.targetValue], 0.3);
42
46
  this.smoother({ x: this.targetValue });
@@ -1 +1 @@
1
- {"version":3,"file":"inputBinding.d.ts","sourceRoot":"","sources":["../../../src/utils/inputBinding.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,sDAFW,OAAO,0BAA0B,EAAE,OAAO,8CAqIpD"}
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;
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * Yields arrays that contain the compound key and the grouped data items.
5
5
  *
6
- * @param {Map<any, any>} map The root
6
+ * @param {Map<any, T>} map The root
7
7
  * @param {any[]} [path] The path so far.
8
- * @returns {Generator<[any[], any[]]>}
8
+ * @returns {Generator<[any[], T]>}
9
+ * @template T
9
10
  */
10
- export default function iterateNestedMaps(map: Map<any, any>, path?: any[]): Generator<[any[], any[]]>;
11
+ export default function iterateNestedMaps<T>(map: Map<any, T>, path?: any[]): Generator<[any[], T], any, any>;
11
12
  //# sourceMappingURL=iterateNestedMaps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"iterateNestedMaps.d.ts","sourceRoot":"","sources":["../../../src/utils/iterateNestedMaps.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,+CAJW,IAAI,GAAG,EAAE,GAAG,CAAC,SACb,GAAG,EAAE,GACH,UAAU,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAarC"}
1
+ {"version":3,"file":"iterateNestedMaps.d.ts","sourceRoot":"","sources":["../../../src/utils/iterateNestedMaps.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,sEAJW,GAAG,EAAE,mCAef"}
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * Yields arrays that contain the compound key and the grouped data items.
5
5
  *
6
- * @param {Map<any, any>} map The root
6
+ * @param {Map<any, T>} map The root
7
7
  * @param {any[]} [path] The path so far.
8
- * @returns {Generator<[any[], any[]]>}
8
+ * @returns {Generator<[any[], T]>}
9
+ * @template T
9
10
  */
10
11
  export default function* iterateNestedMaps(map, path = []) {
11
12
  for (const [key, value] of map.entries()) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=iterateNestedMaps.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterateNestedMaps.test.d.ts","sourceRoot":"","sources":["../../../src/utils/iterateNestedMaps.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=kWayMerge.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kWayMerge.test.d.ts","sourceRoot":"","sources":["../../../src/utils/kWayMerge.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mergeObjects.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeObjects.test.d.ts","sourceRoot":"","sources":["../../../src/utils/mergeObjects.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=numberExtractor.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberExtractor.test.d.ts","sourceRoot":"","sources":["../../../src/utils/numberExtractor.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=propertyCacher.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propertyCacher.test.d.ts","sourceRoot":"","sources":["../../../src/utils/propertyCacher.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=propertyCoalescer.test.d.ts.map
@@ -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,9 @@
1
+ /**
2
+ * @param {number[]} arr An array of unsigned integers
3
+ */
4
+ export default function radixSort(arr: number[]): number[];
5
+ /**
6
+ * @param {number[]} arr An array of unsigned integers
7
+ */
8
+ export function radixSortIntoLookupArray(arr: number[]): number[];
9
+ //# sourceMappingURL=radixSort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radixSort.d.ts","sourceRoot":"","sources":["../../../src/utils/radixSort.js"],"names":[],"mappings":"AAKA;;GAEG;AACH,uCAFW,MAAM,EAAE,YAyDlB;AAaD;;GAEG;AACH,8CAFW,MAAM,EAAE,YAoDlB"}