@uwdata/mosaic-spec 0.7.1 → 0.9.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 (158) hide show
  1. package/dist/mosaic-schema.json +192673 -0
  2. package/dist/mosaic-spec.js +5077 -5774
  3. package/dist/mosaic-spec.min.js +23 -23
  4. package/dist/types/ast/ASTNode.d.ts +26 -0
  5. package/dist/types/ast/DataNode.d.ts +60 -0
  6. package/dist/types/ast/ExpressionNode.d.ts +15 -0
  7. package/dist/types/ast/HConcatNode.d.ts +10 -0
  8. package/dist/types/ast/HSpaceNode.d.ts +11 -0
  9. package/dist/types/ast/InputNode.d.ts +8 -0
  10. package/dist/types/ast/LiteralNode.d.ts +7 -0
  11. package/dist/types/ast/OptionsNode.d.ts +10 -0
  12. package/dist/types/ast/ParamNode.d.ts +9 -0
  13. package/dist/types/ast/ParamRefNode.d.ts +8 -0
  14. package/dist/types/ast/PlotAttributeNode.d.ts +18 -0
  15. package/dist/types/ast/PlotFromNode.d.ts +9 -0
  16. package/dist/types/ast/PlotInteractorNode.d.ts +8 -0
  17. package/dist/types/ast/PlotLegendNode.d.ts +10 -0
  18. package/dist/types/ast/PlotMarkNode.d.ts +10 -0
  19. package/dist/types/ast/PlotNode.d.ts +11 -0
  20. package/dist/types/ast/SelectionNode.d.ts +12 -0
  21. package/dist/types/ast/SpecNode.d.ts +10 -0
  22. package/dist/types/ast/TransformNode.d.ts +13 -0
  23. package/dist/types/ast/VConcatNode.d.ts +10 -0
  24. package/dist/types/ast/VSpaceNode.d.ts +11 -0
  25. package/dist/types/ast-to-dom.d.ts +38 -0
  26. package/dist/types/ast-to-esm.d.ts +64 -0
  27. package/dist/types/config/components.d.ts +4 -0
  28. package/dist/types/config/extensions.d.ts +9 -0
  29. package/dist/types/config/inputs.d.ts +5 -0
  30. package/dist/types/config/plots.d.ts +34 -0
  31. package/dist/types/config/transforms.d.ts +4 -0
  32. package/dist/types/constants.d.ts +30 -0
  33. package/dist/types/index.d.ts +29 -0
  34. package/dist/types/parse-spec.d.ts +86 -0
  35. package/dist/types/spec/CSSStyles.d.ts +3 -0
  36. package/dist/types/spec/Data.d.ts +165 -0
  37. package/dist/types/spec/Expression.d.ts +27 -0
  38. package/dist/types/spec/HConcat.d.ts +8 -0
  39. package/dist/types/spec/HSpace.d.ts +9 -0
  40. package/dist/types/spec/Input.d.ts +207 -0
  41. package/dist/types/spec/Param.d.ts +51 -0
  42. package/dist/types/spec/Plot.d.ts +14 -0
  43. package/dist/types/spec/PlotAttribute.d.ts +1522 -0
  44. package/dist/types/spec/PlotFrom.d.ts +20 -0
  45. package/dist/types/spec/PlotInteractor.d.ts +8 -0
  46. package/dist/types/spec/PlotLegend.d.ts +68 -0
  47. package/dist/types/spec/PlotMark.d.ts +27 -0
  48. package/dist/types/spec/PlotTypes.d.ts +293 -0
  49. package/dist/types/spec/Spec.d.ts +52 -0
  50. package/dist/types/spec/Transform.d.ts +314 -0
  51. package/dist/types/spec/VConcat.d.ts +8 -0
  52. package/dist/types/spec/VSpace.d.ts +9 -0
  53. package/dist/types/spec/interactors/Highlight.d.ts +37 -0
  54. package/dist/types/spec/interactors/Interval1D.d.ts +63 -0
  55. package/dist/types/spec/interactors/Interval2D.d.ts +46 -0
  56. package/dist/types/spec/interactors/Nearest.d.ts +44 -0
  57. package/dist/types/spec/interactors/PanZoom.d.ts +58 -0
  58. package/dist/types/spec/interactors/Toggle.d.ts +59 -0
  59. package/dist/types/spec/marks/Area.d.ts +139 -0
  60. package/dist/types/spec/marks/Arrow.d.ts +94 -0
  61. package/dist/types/spec/marks/Axis.d.ts +281 -0
  62. package/dist/types/spec/marks/Bar.d.ts +150 -0
  63. package/dist/types/spec/marks/Cell.d.ts +57 -0
  64. package/dist/types/spec/marks/Contour.d.ts +23 -0
  65. package/dist/types/spec/marks/Delaunay.d.ts +86 -0
  66. package/dist/types/spec/marks/DenseLine.d.ts +27 -0
  67. package/dist/types/spec/marks/Density.d.ts +121 -0
  68. package/dist/types/spec/marks/Dot.d.ts +133 -0
  69. package/dist/types/spec/marks/ErrorBar.d.ts +82 -0
  70. package/dist/types/spec/marks/Frame.d.ts +21 -0
  71. package/dist/types/spec/marks/Geo.d.ts +53 -0
  72. package/dist/types/spec/marks/Hexbin.d.ts +30 -0
  73. package/dist/types/spec/marks/Hexgrid.d.ts +25 -0
  74. package/dist/types/spec/marks/Image.d.ts +89 -0
  75. package/dist/types/spec/marks/Line.d.ts +82 -0
  76. package/dist/types/spec/marks/Link.d.ts +60 -0
  77. package/dist/types/spec/marks/Marks.d.ts +905 -0
  78. package/dist/types/spec/marks/Raster.d.ts +124 -0
  79. package/dist/types/spec/marks/Rect.d.ts +166 -0
  80. package/dist/types/spec/marks/Regression.d.ts +58 -0
  81. package/dist/types/spec/marks/Rule.d.ts +100 -0
  82. package/dist/types/spec/marks/Text.d.ts +110 -0
  83. package/dist/types/spec/marks/Tick.d.ts +61 -0
  84. package/dist/types/spec/marks/Vector.d.ts +99 -0
  85. package/dist/types/util.d.ts +12 -0
  86. package/jsconfig.json +10 -0
  87. package/package.json +14 -9
  88. package/src/ast/ASTNode.js +23 -2
  89. package/src/ast/DataNode.js +79 -21
  90. package/src/ast/HSpaceNode.js +1 -1
  91. package/src/ast/InputNode.js +1 -2
  92. package/src/ast/ParamNode.js +1 -2
  93. package/src/ast/PlotAttributeNode.js +1 -2
  94. package/src/ast/PlotInteractorNode.js +1 -2
  95. package/src/ast/PlotLegendNode.js +1 -2
  96. package/src/ast/PlotMarkNode.js +3 -2
  97. package/src/ast/TransformNode.js +1 -2
  98. package/src/ast/VSpaceNode.js +1 -1
  99. package/src/ast-to-dom.js +9 -3
  100. package/src/ast-to-esm.js +41 -12
  101. package/src/config/inputs.js +1 -0
  102. package/src/config/plots.js +4 -0
  103. package/src/config/transforms.js +6 -0
  104. package/src/index.js +4 -0
  105. package/src/parse-spec.js +38 -5
  106. package/src/spec/CSSStyles.ts +9 -0
  107. package/src/spec/Data.ts +184 -0
  108. package/src/spec/Expression.ts +31 -0
  109. package/src/spec/HConcat.ts +9 -0
  110. package/src/spec/HSpace.ts +9 -0
  111. package/src/spec/Input.ts +204 -0
  112. package/src/spec/Param.ts +68 -0
  113. package/src/spec/Plot.ts +15 -0
  114. package/src/spec/PlotAttribute.ts +1783 -0
  115. package/src/spec/PlotFrom.ts +23 -0
  116. package/src/spec/PlotInteractor.ts +25 -0
  117. package/src/spec/PlotLegend.ts +70 -0
  118. package/src/spec/PlotMark.ts +53 -0
  119. package/src/spec/PlotTypes.ts +519 -0
  120. package/src/spec/Spec.ts +70 -0
  121. package/src/spec/Transform.ts +446 -0
  122. package/src/spec/VConcat.ts +9 -0
  123. package/src/spec/VSpace.ts +9 -0
  124. package/src/spec/interactors/Highlight.ts +38 -0
  125. package/src/spec/interactors/Interval1D.ts +67 -0
  126. package/src/spec/interactors/Interval2D.ts +48 -0
  127. package/src/spec/interactors/Nearest.ts +48 -0
  128. package/src/spec/interactors/PanZoom.ts +65 -0
  129. package/src/spec/interactors/Toggle.ts +65 -0
  130. package/src/spec/marks/Area.ts +154 -0
  131. package/src/spec/marks/Arrow.ts +108 -0
  132. package/src/spec/marks/Axis.ts +305 -0
  133. package/src/spec/marks/Bar.ts +160 -0
  134. package/src/spec/marks/Cell.ts +62 -0
  135. package/src/spec/marks/Contour.ts +25 -0
  136. package/src/spec/marks/Delaunay.ts +95 -0
  137. package/src/spec/marks/DenseLine.ts +30 -0
  138. package/src/spec/marks/Density.ts +145 -0
  139. package/src/spec/marks/Dot.ts +152 -0
  140. package/src/spec/marks/ErrorBar.ts +91 -0
  141. package/src/spec/marks/Frame.ts +23 -0
  142. package/src/spec/marks/Geo.ts +58 -0
  143. package/src/spec/marks/Hexbin.ts +34 -0
  144. package/src/spec/marks/Hexgrid.ts +27 -0
  145. package/src/spec/marks/Image.ts +101 -0
  146. package/src/spec/marks/Line.ts +93 -0
  147. package/src/spec/marks/Link.ts +70 -0
  148. package/src/spec/marks/Marks.ts +1088 -0
  149. package/src/spec/marks/Raster.ts +145 -0
  150. package/src/spec/marks/Rect.ts +183 -0
  151. package/src/spec/marks/Regression.ts +63 -0
  152. package/src/spec/marks/Rule.ts +113 -0
  153. package/src/spec/marks/Text.ts +127 -0
  154. package/src/spec/marks/Tick.ts +69 -0
  155. package/src/spec/marks/Vector.ts +113 -0
  156. package/src/util.js +8 -0
  157. package/tsconfig.json +11 -0
  158. package/LICENSE +0 -47
@@ -0,0 +1,70 @@
1
+ import { DataDefinition } from './Data.js';
2
+ import { ParamDefinition } from './Param.js';
3
+ import { HConcat } from './HConcat.js';
4
+ import { VConcat } from './VConcat.js';
5
+ import { HSpace } from './HSpace.js';
6
+ import { VSpace } from './VSpace.js';
7
+ import { Menu, Search, Slider, Table } from './Input.js';
8
+ import { Plot } from './Plot.js';
9
+ import { PlotMark } from './PlotMark.js';
10
+ import { Legend } from './PlotLegend.js';
11
+ import { PlotAttributes } from './PlotAttribute.js';
12
+
13
+ /** Specification metadata. */
14
+ export interface Meta extends Record<string, any> {
15
+ /** The specification title. */
16
+ title?: string;
17
+ /** A description of the specification content. */
18
+ description?: string;
19
+ /** Credits or other acknowledgements. */
20
+ credit?: string;
21
+ }
22
+
23
+ /** Configuration options. */
24
+ export interface Config extends Record<string, any> {
25
+ extensions?: string | string[];
26
+ }
27
+
28
+ /** Top-level dataset definitions. */
29
+ export type Data = Record<string, DataDefinition>;
30
+
31
+ /** Top-level Param and Selection definitions. */
32
+ export type Params = Record<string, ParamDefinition>;
33
+
34
+ /** Top-level specification properties. */
35
+ export interface SpecHead {
36
+ /**
37
+ * A [JSON schema](http://json-schema.org/) URL for this specification,
38
+ * such as https://uwdata.github.io/mosaic/schema/latest.json. This property
39
+ * enables validation and autocomplete in editors with JSON schema support.
40
+ * @format uri
41
+ */
42
+ $schema?: string;
43
+ /** Specification metadata. */
44
+ meta?: Meta;
45
+ /** Configuration options. */
46
+ config?: Config;
47
+ /** Dataset definitions. */
48
+ data?: Data;
49
+ /** Param and Selection definitions. */
50
+ params?: Params;
51
+ /** A default set of attributes to apply to all plot components. */
52
+ plotDefaults?: PlotAttributes;
53
+ }
54
+
55
+ /** A specifcation component such as a plot, input widget, or layout. */
56
+ export type Component =
57
+ | HConcat
58
+ | VConcat
59
+ | HSpace
60
+ | VSpace
61
+ | Menu
62
+ | Search
63
+ | Slider
64
+ | Table
65
+ | Plot
66
+ | PlotMark
67
+ | Legend;
68
+
69
+ /** A declarative Mosaic specification. */
70
+ export type Spec = SpecHead & Component;
@@ -0,0 +1,446 @@
1
+ import { ParamRef } from './Param.js';
2
+
3
+ /** A field argument to a data transform. */
4
+ export type TransformField = string | ParamRef;
5
+
6
+ /** Window transform options. */
7
+ export interface WindowOptions {
8
+ orderby?: TransformField | TransformField[];
9
+ partitionby?: TransformField | TransformField[];
10
+ rows?: (number | null)[] | ParamRef;
11
+ range?: (number | null)[] | ParamRef;
12
+ }
13
+
14
+ /** Aggregate transform options. */
15
+ export interface AggregateOptions {
16
+ distinct?: boolean;
17
+ }
18
+
19
+ /** A transform argument. */
20
+ type Arg = string | number | boolean;
21
+
22
+ /** A zero argument transform signature. */
23
+ type Arg0 = null | [];
24
+
25
+ /** A single argument transform signature. */
26
+ type Arg1 = Arg | [Arg];
27
+
28
+ /**
29
+ * A two argument transform signature; both arguments are required.
30
+ */
31
+ type Arg2 = [Arg, Arg];
32
+
33
+ /**
34
+ * A two argument transform signature; the second argument is optional.
35
+ */
36
+ type Arg2Opt = Arg | [Arg, Arg?];
37
+
38
+ /**
39
+ * A three argument transform signature; the
40
+ * second and third arguments are optional.
41
+ */
42
+ type Arg3Opt = Arg | [Arg, Arg?, Arg?];
43
+
44
+ /** Bin transform options. */
45
+ export interface BinOptions {
46
+ /**
47
+ * The target number of binning steps to use. To accommodate human-friendly
48
+ * bin boundaries, the actual number of bins may diverge from this exact number.
49
+ */
50
+ steps?: number;
51
+ /**
52
+ * The minimum allowed bin step size (default `0`).
53
+ * For example, a setting of `1` will prevent step sizes less than 1.
54
+ */
55
+ minstep?: number;
56
+ /**
57
+ * A flag requesting "nice" human-friendly step sizes (default `true`).
58
+ */
59
+ nice?: true;
60
+ /**
61
+ * Offset for computed bins (default `0`). For example, a value of `1` will
62
+ * result in using the next consecutive bin boundary.
63
+ */
64
+ offset?: number;
65
+ }
66
+
67
+ /* A bin transform. */
68
+ export interface Bin {
69
+ /**
70
+ * Bin a continuous variable into discrete intervals. This transform accepts
71
+ * a data column to bin over as well as an optional bin options object.
72
+ */
73
+ bin: Arg | [Arg] | [Arg, BinOptions];
74
+ }
75
+
76
+ /* A dateMonth transform. */
77
+ export interface DateMonth {
78
+ /**
79
+ * Transform a Date value to a month boundary for cyclic comparison.
80
+ * Year values are collapsed to enable comparison over months only.
81
+ */
82
+ dateMonth: Arg1;
83
+ }
84
+
85
+ /* A dateMonthDay transform. */
86
+ export interface DateMonthDay {
87
+ /**
88
+ * Transform a Date value to a month and day boundary for cyclic comparison.
89
+ * Year values are collapsed to enable comparison over months and days only.
90
+ */
91
+ dateMonthDay: Arg1;
92
+ }
93
+
94
+ /* A dateDay transform. */
95
+ export interface DateDay {
96
+ /**
97
+ * Transform a Date value to a day of the month for cyclic comparison.
98
+ * Year and month values are collapsed to enable comparison over days only.
99
+ */
100
+ dateDay: Arg1;
101
+ }
102
+
103
+ /* A centroid transform. */
104
+ export interface Centroid {
105
+ /**
106
+ * Compute the 2D centroid of geometry-typed data.
107
+ * This transform requires the DuckDB `spatial` extension.
108
+ */
109
+ centroid: Arg1;
110
+ }
111
+
112
+ /* A centroidX transform. */
113
+ export interface CentroidX {
114
+ /**
115
+ * Compute the centroid x-coordinate of geometry-typed data.
116
+ * This transform requires the DuckDB `spatial` extension.
117
+ */
118
+ centroidX: Arg1;
119
+ }
120
+
121
+ /* A centroidY transform. */
122
+ export interface CentroidY {
123
+ /**
124
+ * Compute the centroid y-coordinate of geometry-typed data.
125
+ * This transform requires the DuckDB `spatial` extension.
126
+ */
127
+ centroidY: Arg1;
128
+ }
129
+
130
+ /* A geojson transform. */
131
+ export interface GeoJSON {
132
+ /**
133
+ * Compute a GeoJSON-formatted string from geometry-typed data.
134
+ * This transform requires the DuckDB `spatial` extension.
135
+ */
136
+ geojson: Arg1;
137
+ }
138
+
139
+ /* An argmax aggregate transform. */
140
+ export interface Argmax extends AggregateOptions, WindowOptions {
141
+ /**
142
+ * Find a value of the first column that maximizes the second column.
143
+ */
144
+ argmax: Arg2;
145
+ }
146
+
147
+ /* An argmin aggregate transform. */
148
+ export interface Argmin extends AggregateOptions, WindowOptions {
149
+ /**
150
+ * Find a value of the first column that minimizes the second column.
151
+ */
152
+ argmin: Arg2;
153
+ }
154
+
155
+ /* An avg (average, or mean) aggregate transform. */
156
+ export interface Avg extends AggregateOptions, WindowOptions {
157
+ /**
158
+ * Compute the average (mean) value of the given column.
159
+ */
160
+ avg: Arg1;
161
+ }
162
+
163
+ /* A count aggregate transform. */
164
+ export interface Count extends AggregateOptions, WindowOptions {
165
+ /**
166
+ * Compute the count of records in an aggregation group.
167
+ */
168
+ count: Arg0 | Arg1;
169
+ }
170
+
171
+ /* A sample covariance aggregate transform. */
172
+ export interface Covariance extends AggregateOptions, WindowOptions {
173
+ /**
174
+ * Compute the sample covariance of between the given columns.
175
+ */
176
+ covariance: Arg2;
177
+ }
178
+
179
+ /* A population covariance aggregate transform. */
180
+ export interface CovarPop extends AggregateOptions, WindowOptions {
181
+ /**
182
+ * Compute the population covariance of between the given columns.
183
+ */
184
+ covarPop: Arg2;
185
+ }
186
+
187
+ /* A first aggregate transform. */
188
+ export interface First extends AggregateOptions, WindowOptions {
189
+ /**
190
+ * Return the first column value found in an aggregation group.
191
+ */
192
+ first: Arg1;
193
+ }
194
+
195
+ /* A last aggregate transform. */
196
+ export interface Last extends AggregateOptions, WindowOptions {
197
+ /**
198
+ * Return the last column value found in an aggregation group.
199
+ */
200
+ last: Arg1;
201
+ }
202
+
203
+ /* A max aggregate transform. */
204
+ export interface Max extends AggregateOptions, WindowOptions {
205
+ /**
206
+ * Compute the maximum value of the given column.
207
+ */
208
+ max: Arg1;
209
+ }
210
+
211
+ /* A min aggregate transform. */
212
+ export interface Min extends AggregateOptions, WindowOptions {
213
+ /**
214
+ * Compute the minimum value of the given column.
215
+ */
216
+ min: Arg1;
217
+ }
218
+
219
+ /* A median aggregate transform. */
220
+ export interface Median extends AggregateOptions, WindowOptions {
221
+ /**
222
+ * Compute the median value of the given column.
223
+ */
224
+ median: Arg1;
225
+ }
226
+
227
+ /* A mode aggregate transform. */
228
+ export interface Mode extends AggregateOptions, WindowOptions {
229
+ /**
230
+ * Compute the mode value of the given column.
231
+ */
232
+ mode: Arg1;
233
+ }
234
+
235
+ /* A product aggregate transform. */
236
+ export interface Product extends AggregateOptions, WindowOptions {
237
+ /**
238
+ * Compute the product of the given column.
239
+ */
240
+ product: Arg1;
241
+ }
242
+
243
+ /* A quantile aggregate transform. */
244
+ export interface Quantile extends AggregateOptions, WindowOptions {
245
+ /**
246
+ * Compute the quantile value of the given column at the provided
247
+ * probability threshold. For example, 0.5 is the median.
248
+ */
249
+ quantile: Arg2;
250
+ }
251
+
252
+ /* A sample standard deviation aggregate transform. */
253
+ export interface Stddev extends AggregateOptions, WindowOptions {
254
+ /**
255
+ * Compute the sum of the given column.
256
+ */
257
+ stddev: Arg1;
258
+ }
259
+
260
+ /* A population standard deviation aggregate transform. */
261
+ export interface StddevPop extends AggregateOptions, WindowOptions {
262
+ /**
263
+ * Compute the sum of the given column.
264
+ */
265
+ stddevPop: Arg1;
266
+ }
267
+
268
+ /* A sum aggregate transform. */
269
+ export interface Sum extends AggregateOptions, WindowOptions {
270
+ /**
271
+ * Compute the sum of the given column.
272
+ */
273
+ sum: Arg1;
274
+ }
275
+
276
+ /* A sample variance aggregate transform. */
277
+ export interface Variance extends AggregateOptions, WindowOptions {
278
+ /**
279
+ * Compute the sample variance of the given column.
280
+ */
281
+ variance: Arg1;
282
+ }
283
+
284
+ /* A population variance aggregate transform. */
285
+ export interface VarPop extends AggregateOptions, WindowOptions {
286
+ /**
287
+ * Compute the population variance of the given column.
288
+ */
289
+ varPop: Arg1;
290
+ }
291
+
292
+ /* A row_number window transform. */
293
+ export interface RowNumber extends WindowOptions {
294
+ /**
295
+ * Compute the 1-based row number over an ordered window partition.
296
+ */
297
+ row_number: Arg0;
298
+ }
299
+
300
+ /* A rank window transform. */
301
+ export interface Rank extends WindowOptions {
302
+ /**
303
+ * Compute the row rank over an ordered window partition.
304
+ * Sorting ties result in gaps in the rank numbers ([1, 1, 3, ...]).
305
+ */
306
+ rank: Arg0;
307
+ }
308
+
309
+ /* A dense_rank window transform. */
310
+ export interface DenseRank extends WindowOptions {
311
+ /**
312
+ * Compute the dense row rank (no gaps) over an ordered window partition.
313
+ * Sorting ties do not result in gaps in the rank numbers ( [1, 1, 2, ...]).
314
+ */
315
+ dense_rank: Arg0;
316
+ }
317
+
318
+ /* A percent_rank window transform. */
319
+ export interface PercentRank extends WindowOptions {
320
+ /**
321
+ * Compute the percetange rank over an ordered window partition.
322
+ */
323
+ percent_rank: Arg0;
324
+ }
325
+
326
+ /* A cume_dist window transform. */
327
+ export interface CumeDist extends WindowOptions {
328
+ /**
329
+ * Compute the cumulative distribution value over an ordered window
330
+ * partition. Equals the number of partition rows preceding or peer with
331
+ * the current row, divided by the total number of partition rows.
332
+ */
333
+ cume_dist: Arg0;
334
+ }
335
+
336
+ /* An ntile window transform. */
337
+ export interface NTile extends WindowOptions {
338
+ /**
339
+ * Compute an n-tile integer ranging from 1 to the provided argument
340
+ * (num_buckets), dividing the partition as equally as possible.
341
+ */
342
+ ntile: Arg1;
343
+ }
344
+
345
+ /* A lag window transform. */
346
+ export interface Lag extends WindowOptions {
347
+ /**
348
+ * Compute lagging values in a column. Returns the value at the row that is
349
+ * `offset` (second argument, default `1`) rows before the current row within
350
+ * the window frame. If there is no such row, instead return `default` (third
351
+ * argument, default `null`). Both offset and default are evaluated with
352
+ * respect to the current row.
353
+ */
354
+ lag: Arg3Opt;
355
+ }
356
+
357
+ /* A lead window transform. */
358
+ export interface Lead extends WindowOptions {
359
+ /**
360
+ * Compute leading values in a column. Returns the value at the row that is
361
+ * `offset` (second argument, default `1`) rows after the current row within
362
+ * the window frame. If there is no such row, instead return `default` (third
363
+ * argument, default `null`). Both offset and default are evaluated with
364
+ * respect to the current row.
365
+ */
366
+ lag: Arg3Opt;
367
+ }
368
+
369
+ /* A first_value window transform. */
370
+ export interface FirstValue extends WindowOptions {
371
+ /**
372
+ * Get the first value of the given column in the current window frame.
373
+ */
374
+ first_value: Arg1;
375
+ }
376
+
377
+ /* A last_value window transform. */
378
+ export interface LastValue extends WindowOptions {
379
+ /**
380
+ * Get the last value of the given column in the current window frame.
381
+ */
382
+ last_value: Arg1;
383
+ }
384
+
385
+ /* An nth_value window transform. */
386
+ export interface NthValue extends WindowOptions {
387
+ /**
388
+ * Get the nth value of the given column in the current window frame,
389
+ * counting from one. The second argument is the offset for the nth row.
390
+ */
391
+ nth_value: Arg2Opt;
392
+ }
393
+
394
+ /** A data transform that maps one column value to another. */
395
+ export type ColumnTransform =
396
+ | Bin
397
+ | DateMonth
398
+ | DateMonthDay
399
+ | DateDay
400
+ | Centroid
401
+ | CentroidX
402
+ | CentroidY
403
+ | GeoJSON;
404
+
405
+ /** An aggregate transform that combines multiple values. */
406
+ export type AggregateTransform =
407
+ | Argmax
408
+ | Argmin
409
+ | Avg
410
+ | Count
411
+ | Max
412
+ | Min
413
+ | First
414
+ | Last
415
+ | Max
416
+ | Min
417
+ | Median
418
+ | Mode
419
+ | Product
420
+ | Quantile
421
+ | Stddev
422
+ | StddevPop
423
+ | Sum
424
+ | Variance
425
+ | VarPop;
426
+
427
+ /* A window transform that operates over a sorted domain. */
428
+ export type WindowTransform =
429
+ | RowNumber
430
+ | Rank
431
+ | DenseRank
432
+ | PercentRank
433
+ | CumeDist
434
+ | NTile
435
+ | Rank
436
+ | Lag
437
+ | Lead
438
+ | FirstValue
439
+ | LastValue
440
+ | NthValue;
441
+
442
+ /** A data transform. */
443
+ export type Transform =
444
+ | ColumnTransform
445
+ | AggregateTransform
446
+ | WindowTransform;
@@ -0,0 +1,9 @@
1
+ import { Component } from './Spec.js';
2
+
3
+ /** A vconcat component. */
4
+ export interface VConcat {
5
+ /**
6
+ * Vertically concatenate components in a column layout.
7
+ */
8
+ vconcat: Component[];
9
+ }
@@ -0,0 +1,9 @@
1
+ /** A vspace component. */
2
+ export interface VSpace {
3
+ /**
4
+ * Vertical space to place between components.
5
+ * Number values indicate screen pixels.
6
+ * String values may use CSS units (em, pt, px, etc).
7
+ */
8
+ vspace: number | string;
9
+ }
@@ -0,0 +1,38 @@
1
+ import { ParamRef } from '../Param.js';
2
+
3
+ /** A highlight interactor. */
4
+ export interface Highlight {
5
+ /**
6
+ * Highlight selected marks by deemphasizing the others.
7
+ */
8
+ select: 'highlight';
9
+ /**
10
+ * The input selection. Unselected marks are deemphasized.
11
+ */
12
+ by: ParamRef;
13
+ /**
14
+ * The overall opacity of deemphasized marks.
15
+ * By default the opacity is set to 0.2.
16
+ */
17
+ opacity?: number;
18
+ /**
19
+ * The fill opacity of deemphasized marks.
20
+ * By default the fill opacity is unchanged.
21
+ */
22
+ fillOpacity?: number;
23
+ /**
24
+ * The stroke opacity of deemphasized marks.
25
+ * By default the stroke opacity is unchanged.
26
+ */
27
+ strokeOpacity?: number;
28
+ /**
29
+ * The fill color of deemphasized marks.
30
+ * By default the fill is unchanged.
31
+ */
32
+ fill?: string;
33
+ /**
34
+ * The stroke color of deemphasized marks.
35
+ * By default the stroke is unchanged.
36
+ */
37
+ stroke?: string;
38
+ }
@@ -0,0 +1,67 @@
1
+ import { ParamRef } from '../Param.js';
2
+
3
+ /** Styles for rectangular selection brushes. */
4
+ export interface BrushStyles {
5
+ /**
6
+ * The overall opacity of the brush rectangle.
7
+ */
8
+ opacity?: number;
9
+ /**
10
+ * The fill opacity of the brush rectangle.
11
+ */
12
+ fillOpacity?: number;
13
+ /**
14
+ * The stroke opacity of the brush rectangle.
15
+ */
16
+ strokeOpacity?: number;
17
+ /**
18
+ * The fill color of the brush rectangle.
19
+ */
20
+ fill?: string;
21
+ /**
22
+ * The stroke color of the brush rectangle.
23
+ */
24
+ stroke?: string;
25
+ }
26
+
27
+ /** Options for 1D interval interactors. */
28
+ export interface Interval1DOptions {
29
+ /**
30
+ * The output selection. A clause of the form `field BETWEEN lo AND hi`
31
+ * is added for the currently selected interval [lo, hi].
32
+ */
33
+ as: ParamRef;
34
+ /**
35
+ * The name of the field (database column) over which the interval
36
+ * selection should be defined. If unspecified, the channel field of the
37
+ * first valid prior mark definition is used.
38
+ */
39
+ field?: string;
40
+ /**
41
+ * The size of an interative pixel (default `1`). Larger pixel sizes reduce
42
+ * the brush resolution, which can reduce the size of data cube indexes.
43
+ */
44
+ pixelSize?: number;
45
+ /**
46
+ * A flag indicating if peer (sibling) marks are when cross-filtering
47
+ * (default `true`). If set, peer marks will not be filtered by this
48
+ * interactor's selection in cross-filtering setups.
49
+ */
50
+ peers?: boolean;
51
+ /**
52
+ * CSS styles for the brush (SVG `rect`) element.
53
+ */
54
+ brush?: BrushStyles;
55
+ }
56
+
57
+ /** An intervalX interactor. */
58
+ export interface IntervalX extends Interval1DOptions {
59
+ /** Select a continuous 1D interval selection over the `x` scale domain. */
60
+ select: 'intervalX';
61
+ }
62
+
63
+ /** An intervalY interactor. */
64
+ export interface IntervalY extends Interval1DOptions {
65
+ /** Select a continuous 1D interval selection over the `y` scale domain. */
66
+ select: 'intervalY';
67
+ }
@@ -0,0 +1,48 @@
1
+ import { ParamRef } from '../Param.js';
2
+ import { BrushStyles } from './Interval1D.js';
3
+
4
+ /** Options for 2D interval interactors. */
5
+ export interface Interval2DOptions {
6
+ /**
7
+ * The output selection. A clause of the form
8
+ * `(xfield BETWEEN x1 AND x2) AND (yfield BETWEEN y1 AND y2)`
9
+ * is added for the currently selected intervals.
10
+ */
11
+ as: ParamRef;
12
+ /**
13
+ * The name of the field (database column) over which the `x`-component
14
+ * of the interval selection should be defined. If unspecified, the `x`
15
+ * channel field of the first valid prior mark definition is used.
16
+ */
17
+ xfield?: string;
18
+ /**
19
+ * The name of the field (database column) over which the `y`-component
20
+ * of the interval selection should be defined. If unspecified, the `y`
21
+ * channel field of the first valid prior mark definition is used.
22
+ */
23
+ yfield?: string;
24
+ /**
25
+ * The size of an interative pixel (default `1`). Larger pixel sizes reduce
26
+ * the brush resolution, which can reduce the size of data cube indexes.
27
+ */
28
+ pixelSize?: number;
29
+ /**
30
+ * A flag indicating if peer (sibling) marks are when cross-filtering
31
+ * (default `true`). If set, peer marks will not be filtered by this
32
+ * interactor's selection in cross-filtering setups.
33
+ */
34
+ peers?: boolean;
35
+ /**
36
+ * CSS styles for the brush (SVG `rect`) element.
37
+ */
38
+ brush?: BrushStyles;
39
+ }
40
+
41
+ /** An intervalXY interactor. */
42
+ export interface IntervalXY extends Interval2DOptions {
43
+ /**
44
+ * Select a continuous 2D interval selection
45
+ * over the `x` and `y` scale domains.
46
+ */
47
+ select: 'intervalXY';
48
+ }