@uwdata/mosaic-spec 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mosaic-schema.json +186153 -0
- package/dist/mosaic-spec.js +3387 -4641
- package/dist/mosaic-spec.min.js +23 -23
- package/dist/types/ast/ASTNode.d.ts +26 -0
- package/dist/types/ast/DataNode.d.ts +60 -0
- package/dist/types/ast/ExpressionNode.d.ts +15 -0
- package/dist/types/ast/HConcatNode.d.ts +10 -0
- package/dist/types/ast/HSpaceNode.d.ts +11 -0
- package/dist/types/ast/InputNode.d.ts +8 -0
- package/dist/types/ast/LiteralNode.d.ts +7 -0
- package/dist/types/ast/OptionsNode.d.ts +10 -0
- package/dist/types/ast/ParamNode.d.ts +9 -0
- package/dist/types/ast/ParamRefNode.d.ts +8 -0
- package/dist/types/ast/PlotAttributeNode.d.ts +18 -0
- package/dist/types/ast/PlotFromNode.d.ts +9 -0
- package/dist/types/ast/PlotInteractorNode.d.ts +8 -0
- package/dist/types/ast/PlotLegendNode.d.ts +10 -0
- package/dist/types/ast/PlotMarkNode.d.ts +10 -0
- package/dist/types/ast/PlotNode.d.ts +11 -0
- package/dist/types/ast/SelectionNode.d.ts +12 -0
- package/dist/types/ast/SpecNode.d.ts +10 -0
- package/dist/types/ast/TransformNode.d.ts +13 -0
- package/dist/types/ast/VConcatNode.d.ts +10 -0
- package/dist/types/ast/VSpaceNode.d.ts +11 -0
- package/dist/types/ast-to-dom.d.ts +38 -0
- package/dist/types/ast-to-esm.d.ts +64 -0
- package/dist/types/config/components.d.ts +4 -0
- package/dist/types/config/extensions.d.ts +9 -0
- package/dist/types/config/inputs.d.ts +5 -0
- package/dist/types/config/plots.d.ts +34 -0
- package/dist/types/config/transforms.d.ts +4 -0
- package/dist/types/constants.d.ts +30 -0
- package/dist/types/index.d.ts +29 -0
- package/dist/types/parse-spec.d.ts +86 -0
- package/dist/types/spec/CSSStyles.d.ts +3 -0
- package/dist/types/spec/Data.d.ts +165 -0
- package/dist/types/spec/Expression.d.ts +27 -0
- package/dist/types/spec/HConcat.d.ts +8 -0
- package/dist/types/spec/HSpace.d.ts +9 -0
- package/dist/types/spec/Input.d.ts +182 -0
- package/dist/types/spec/Param.d.ts +51 -0
- package/dist/types/spec/Plot.d.ts +14 -0
- package/dist/types/spec/PlotAttribute.d.ts +1522 -0
- package/dist/types/spec/PlotFrom.d.ts +20 -0
- package/dist/types/spec/PlotInteractor.d.ts +8 -0
- package/dist/types/spec/PlotLegend.d.ts +68 -0
- package/dist/types/spec/PlotMark.d.ts +26 -0
- package/dist/types/spec/PlotTypes.d.ts +293 -0
- package/dist/types/spec/Spec.d.ts +45 -0
- package/dist/types/spec/Transform.d.ts +278 -0
- package/dist/types/spec/VConcat.d.ts +8 -0
- package/dist/types/spec/VSpace.d.ts +9 -0
- package/dist/types/spec/interactors/Highlight.d.ts +37 -0
- package/dist/types/spec/interactors/Interval1D.d.ts +63 -0
- package/dist/types/spec/interactors/Interval2D.d.ts +46 -0
- package/dist/types/spec/interactors/Nearest.d.ts +25 -0
- package/dist/types/spec/interactors/PanZoom.d.ts +58 -0
- package/dist/types/spec/interactors/Toggle.d.ts +51 -0
- package/dist/types/spec/marks/Area.d.ts +139 -0
- package/dist/types/spec/marks/Arrow.d.ts +94 -0
- package/dist/types/spec/marks/Axis.d.ts +281 -0
- package/dist/types/spec/marks/Bar.d.ts +150 -0
- package/dist/types/spec/marks/Cell.d.ts +57 -0
- package/dist/types/spec/marks/Contour.d.ts +23 -0
- package/dist/types/spec/marks/Delaunay.d.ts +86 -0
- package/dist/types/spec/marks/DenseLine.d.ts +27 -0
- package/dist/types/spec/marks/Density.d.ts +121 -0
- package/dist/types/spec/marks/Dot.d.ts +129 -0
- package/dist/types/spec/marks/Frame.d.ts +21 -0
- package/dist/types/spec/marks/Geo.d.ts +53 -0
- package/dist/types/spec/marks/Hexbin.d.ts +30 -0
- package/dist/types/spec/marks/Hexgrid.d.ts +25 -0
- package/dist/types/spec/marks/Image.d.ts +89 -0
- package/dist/types/spec/marks/Line.d.ts +82 -0
- package/dist/types/spec/marks/Link.d.ts +60 -0
- package/dist/types/spec/marks/Marks.d.ts +890 -0
- package/dist/types/spec/marks/Raster.d.ts +124 -0
- package/dist/types/spec/marks/Rect.d.ts +166 -0
- package/dist/types/spec/marks/Regression.d.ts +58 -0
- package/dist/types/spec/marks/Rule.d.ts +100 -0
- package/dist/types/spec/marks/Text.d.ts +106 -0
- package/dist/types/spec/marks/Tick.d.ts +61 -0
- package/dist/types/spec/marks/Vector.d.ts +99 -0
- package/dist/types/util.d.ts +12 -0
- package/jsconfig.json +10 -0
- package/package.json +16 -9
- package/src/ast/ASTNode.js +23 -2
- package/src/ast/DataNode.js +79 -21
- package/src/ast/HSpaceNode.js +1 -1
- package/src/ast/InputNode.js +1 -2
- package/src/ast/ParamNode.js +1 -2
- package/src/ast/PlotAttributeNode.js +1 -2
- package/src/ast/PlotInteractorNode.js +1 -2
- package/src/ast/PlotLegendNode.js +1 -2
- package/src/ast/PlotMarkNode.js +3 -2
- package/src/ast/TransformNode.js +1 -2
- package/src/ast/VSpaceNode.js +1 -1
- package/src/ast-to-dom.js +16 -7
- package/src/ast-to-esm.js +41 -12
- package/src/config/inputs.js +1 -0
- package/src/config/plots.js +4 -0
- package/src/index.js +4 -0
- package/src/parse-spec.js +38 -5
- package/src/spec/CSSStyles.ts +9 -0
- package/src/spec/Data.ts +184 -0
- package/src/spec/Expression.ts +31 -0
- package/src/spec/HConcat.ts +9 -0
- package/src/spec/HSpace.ts +9 -0
- package/src/spec/Input.ts +182 -0
- package/src/spec/Param.ts +68 -0
- package/src/spec/Plot.ts +15 -0
- package/src/spec/PlotAttribute.ts +1783 -0
- package/src/spec/PlotFrom.ts +23 -0
- package/src/spec/PlotInteractor.ts +25 -0
- package/src/spec/PlotLegend.ts +70 -0
- package/src/spec/PlotMark.ts +51 -0
- package/src/spec/PlotTypes.ts +519 -0
- package/src/spec/Spec.ts +63 -0
- package/src/spec/Transform.ts +394 -0
- package/src/spec/VConcat.ts +9 -0
- package/src/spec/VSpace.ts +9 -0
- package/src/spec/interactors/Highlight.ts +38 -0
- package/src/spec/interactors/Interval1D.ts +67 -0
- package/src/spec/interactors/Interval2D.ts +48 -0
- package/src/spec/interactors/Nearest.ts +28 -0
- package/src/spec/interactors/PanZoom.ts +65 -0
- package/src/spec/interactors/Toggle.ts +56 -0
- package/src/spec/marks/Area.ts +154 -0
- package/src/spec/marks/Arrow.ts +108 -0
- package/src/spec/marks/Axis.ts +305 -0
- package/src/spec/marks/Bar.ts +160 -0
- package/src/spec/marks/Cell.ts +62 -0
- package/src/spec/marks/Contour.ts +25 -0
- package/src/spec/marks/Delaunay.ts +95 -0
- package/src/spec/marks/DenseLine.ts +30 -0
- package/src/spec/marks/Density.ts +145 -0
- package/src/spec/marks/Dot.ts +147 -0
- package/src/spec/marks/Frame.ts +23 -0
- package/src/spec/marks/Geo.ts +58 -0
- package/src/spec/marks/Hexbin.ts +34 -0
- package/src/spec/marks/Hexgrid.ts +27 -0
- package/src/spec/marks/Image.ts +101 -0
- package/src/spec/marks/Line.ts +93 -0
- package/src/spec/marks/Link.ts +70 -0
- package/src/spec/marks/Marks.ts +1062 -0
- package/src/spec/marks/Raster.ts +145 -0
- package/src/spec/marks/Rect.ts +183 -0
- package/src/spec/marks/Regression.ts +63 -0
- package/src/spec/marks/Rule.ts +113 -0
- package/src/spec/marks/Text.ts +122 -0
- package/src/spec/marks/Tick.ts +69 -0
- package/src/spec/marks/Vector.ts +113 -0
- package/src/util.js +8 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { ParamRef } from './Param.js';
|
|
2
|
+
/** A field argument to a data transform. */
|
|
3
|
+
export type TransformField = string | ParamRef;
|
|
4
|
+
/** Window transform options. */
|
|
5
|
+
export interface WindowOptions {
|
|
6
|
+
orderby?: TransformField | TransformField[];
|
|
7
|
+
partitionby?: TransformField | TransformField[];
|
|
8
|
+
rows?: (number | null)[] | ParamRef;
|
|
9
|
+
range?: (number | null)[] | ParamRef;
|
|
10
|
+
}
|
|
11
|
+
/** Aggregate transform options. */
|
|
12
|
+
export interface AggregateOptions {
|
|
13
|
+
distinct?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** A transform argument. */
|
|
16
|
+
type Arg = string | number | boolean;
|
|
17
|
+
/** A zero argument transform signature. */
|
|
18
|
+
type Arg0 = null | [];
|
|
19
|
+
/** A single argument transform signature. */
|
|
20
|
+
type Arg1 = Arg | [Arg];
|
|
21
|
+
/**
|
|
22
|
+
* A two argument transform signature; both arguments are required.
|
|
23
|
+
*/
|
|
24
|
+
type Arg2 = [Arg, Arg];
|
|
25
|
+
/**
|
|
26
|
+
* A two argument transform signature; the second argument is optional.
|
|
27
|
+
*/
|
|
28
|
+
type Arg2Opt = Arg | [Arg, Arg?];
|
|
29
|
+
/**
|
|
30
|
+
* A three argument transform signature; the
|
|
31
|
+
* second and third arguments are optional.
|
|
32
|
+
*/
|
|
33
|
+
type Arg3Opt = Arg | [Arg, Arg?, Arg?];
|
|
34
|
+
/** Bin transform options. */
|
|
35
|
+
export interface BinOptions {
|
|
36
|
+
/**
|
|
37
|
+
* The target number of binning steps to use. To accommodate human-friendly
|
|
38
|
+
* bin boundaries, the actual number of bins may diverge from this exact number.
|
|
39
|
+
*/
|
|
40
|
+
steps?: number;
|
|
41
|
+
/**
|
|
42
|
+
* The minimum allowed bin step size (default `0`).
|
|
43
|
+
* For example, a setting of `1` will prevent step sizes less than 1.
|
|
44
|
+
*/
|
|
45
|
+
minstep?: number;
|
|
46
|
+
/**
|
|
47
|
+
* A flag requesting "nice" human-friendly step sizes (default `true`).
|
|
48
|
+
*/
|
|
49
|
+
nice?: true;
|
|
50
|
+
/**
|
|
51
|
+
* Offset for computed bins (default `0`). For example, a value of `1` will
|
|
52
|
+
* result in using the next consecutive bin boundary.
|
|
53
|
+
*/
|
|
54
|
+
offset?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface Bin {
|
|
57
|
+
/**
|
|
58
|
+
* Bin a continuous variable into discrete intervals. This transform accepts
|
|
59
|
+
* a data column to bin over as well as an optional bin options object.
|
|
60
|
+
*/
|
|
61
|
+
bin: Arg | [Arg] | [Arg, BinOptions];
|
|
62
|
+
}
|
|
63
|
+
export interface DateMonth {
|
|
64
|
+
/**
|
|
65
|
+
* Transform a Date value to a month boundary for cyclic comparison.
|
|
66
|
+
* Year values are collapsed to enable comparison over months only.
|
|
67
|
+
*/
|
|
68
|
+
dateMonth: Arg1;
|
|
69
|
+
}
|
|
70
|
+
export interface DateMonthDay {
|
|
71
|
+
/**
|
|
72
|
+
* Transform a Date value to a month and day boundary for cyclic comparison.
|
|
73
|
+
* Year values are collapsed to enable comparison over months and days only.
|
|
74
|
+
*/
|
|
75
|
+
dateMonthDay: Arg1;
|
|
76
|
+
}
|
|
77
|
+
export interface DateDay {
|
|
78
|
+
/**
|
|
79
|
+
* Transform a Date value to a day of the month for cyclic comparison.
|
|
80
|
+
* Year and month values are collapsed to enable comparison over days only.
|
|
81
|
+
*/
|
|
82
|
+
dateDay: Arg1;
|
|
83
|
+
}
|
|
84
|
+
export interface Centroid {
|
|
85
|
+
/**
|
|
86
|
+
* Compute the 2D centroid of geometry-typed data.
|
|
87
|
+
* This transform requires the DuckDB `spatial` extension.
|
|
88
|
+
*/
|
|
89
|
+
centroid: Arg1;
|
|
90
|
+
}
|
|
91
|
+
export interface CentroidX {
|
|
92
|
+
/**
|
|
93
|
+
* Compute the centroid x-coordinate of geometry-typed data.
|
|
94
|
+
* This transform requires the DuckDB `spatial` extension.
|
|
95
|
+
*/
|
|
96
|
+
centroidX: Arg1;
|
|
97
|
+
}
|
|
98
|
+
export interface CentroidY {
|
|
99
|
+
/**
|
|
100
|
+
* Compute the centroid y-coordinate of geometry-typed data.
|
|
101
|
+
* This transform requires the DuckDB `spatial` extension.
|
|
102
|
+
*/
|
|
103
|
+
centroidY: Arg1;
|
|
104
|
+
}
|
|
105
|
+
export interface GeoJSON {
|
|
106
|
+
/**
|
|
107
|
+
* Compute a GeoJSON-formatted string from geometry-typed data.
|
|
108
|
+
* This transform requires the DuckDB `spatial` extension.
|
|
109
|
+
*/
|
|
110
|
+
geojson: Arg1;
|
|
111
|
+
}
|
|
112
|
+
export interface Argmax extends AggregateOptions, WindowOptions {
|
|
113
|
+
/**
|
|
114
|
+
* Find a value of the first column that maximizes the second column.
|
|
115
|
+
*/
|
|
116
|
+
argmax: Arg2;
|
|
117
|
+
}
|
|
118
|
+
export interface Argmin extends AggregateOptions, WindowOptions {
|
|
119
|
+
/**
|
|
120
|
+
* Find a value of the first column that minimizes the second column.
|
|
121
|
+
*/
|
|
122
|
+
argmin: Arg2;
|
|
123
|
+
}
|
|
124
|
+
export interface Avg extends AggregateOptions, WindowOptions {
|
|
125
|
+
/**
|
|
126
|
+
* Compute the average (mean) value of the given column.
|
|
127
|
+
*/
|
|
128
|
+
avg: Arg1;
|
|
129
|
+
}
|
|
130
|
+
export interface Count extends AggregateOptions, WindowOptions {
|
|
131
|
+
/**
|
|
132
|
+
* Compute the count of records in an aggregation group.
|
|
133
|
+
*/
|
|
134
|
+
count: Arg0 | Arg1;
|
|
135
|
+
}
|
|
136
|
+
export interface First extends AggregateOptions, WindowOptions {
|
|
137
|
+
/**
|
|
138
|
+
* Return the first column value found in an aggregation group.
|
|
139
|
+
*/
|
|
140
|
+
first: Arg1;
|
|
141
|
+
}
|
|
142
|
+
export interface Last extends AggregateOptions, WindowOptions {
|
|
143
|
+
/**
|
|
144
|
+
* Return the last column value found in an aggregation group.
|
|
145
|
+
*/
|
|
146
|
+
last: Arg1;
|
|
147
|
+
}
|
|
148
|
+
export interface Max extends AggregateOptions, WindowOptions {
|
|
149
|
+
/**
|
|
150
|
+
* Compute the maximum value of the given column.
|
|
151
|
+
*/
|
|
152
|
+
max: Arg1;
|
|
153
|
+
}
|
|
154
|
+
export interface Min extends AggregateOptions, WindowOptions {
|
|
155
|
+
/**
|
|
156
|
+
* Compute the minimum value of the given column.
|
|
157
|
+
*/
|
|
158
|
+
min: Arg1;
|
|
159
|
+
}
|
|
160
|
+
export interface Median extends AggregateOptions, WindowOptions {
|
|
161
|
+
/**
|
|
162
|
+
* Compute the median value of the given column.
|
|
163
|
+
*/
|
|
164
|
+
median: Arg1;
|
|
165
|
+
}
|
|
166
|
+
export interface Mode extends AggregateOptions, WindowOptions {
|
|
167
|
+
/**
|
|
168
|
+
* Compute the mode value of the given column.
|
|
169
|
+
*/
|
|
170
|
+
mode: Arg1;
|
|
171
|
+
}
|
|
172
|
+
export interface Product extends AggregateOptions, WindowOptions {
|
|
173
|
+
/**
|
|
174
|
+
* Compute the product of the given column.
|
|
175
|
+
*/
|
|
176
|
+
product: Arg1;
|
|
177
|
+
}
|
|
178
|
+
export interface Quantile extends AggregateOptions, WindowOptions {
|
|
179
|
+
/**
|
|
180
|
+
* Compute the quantile value of the given column at the provided
|
|
181
|
+
* probability threshold. For example, 0.5 is the median.
|
|
182
|
+
*/
|
|
183
|
+
quantile: Arg2;
|
|
184
|
+
}
|
|
185
|
+
export interface Sum extends AggregateOptions, WindowOptions {
|
|
186
|
+
/**
|
|
187
|
+
* Compute the sum of the given column.
|
|
188
|
+
*/
|
|
189
|
+
sum: Arg1;
|
|
190
|
+
}
|
|
191
|
+
export interface RowNumber extends WindowOptions {
|
|
192
|
+
/**
|
|
193
|
+
* Compute the 1-based row number over an ordered window partition.
|
|
194
|
+
*/
|
|
195
|
+
row_number: Arg0;
|
|
196
|
+
}
|
|
197
|
+
export interface Rank extends WindowOptions {
|
|
198
|
+
/**
|
|
199
|
+
* Compute the row rank over an ordered window partition.
|
|
200
|
+
* Sorting ties result in gaps in the rank numbers ([1, 1, 3, ...]).
|
|
201
|
+
*/
|
|
202
|
+
rank: Arg0;
|
|
203
|
+
}
|
|
204
|
+
export interface DenseRank extends WindowOptions {
|
|
205
|
+
/**
|
|
206
|
+
* Compute the dense row rank (no gaps) over an ordered window partition.
|
|
207
|
+
* Sorting ties do not result in gaps in the rank numbers ( [1, 1, 2, ...]).
|
|
208
|
+
*/
|
|
209
|
+
dense_rank: Arg0;
|
|
210
|
+
}
|
|
211
|
+
export interface PercentRank extends WindowOptions {
|
|
212
|
+
/**
|
|
213
|
+
* Compute the percetange rank over an ordered window partition.
|
|
214
|
+
*/
|
|
215
|
+
percent_rank: Arg0;
|
|
216
|
+
}
|
|
217
|
+
export interface CumeDist extends WindowOptions {
|
|
218
|
+
/**
|
|
219
|
+
* Compute the cumulative distribution value over an ordered window
|
|
220
|
+
* partition. Equals the number of partition rows preceding or peer with
|
|
221
|
+
* the current row, divided by the total number of partition rows.
|
|
222
|
+
*/
|
|
223
|
+
cume_dist: Arg0;
|
|
224
|
+
}
|
|
225
|
+
export interface NTile extends WindowOptions {
|
|
226
|
+
/**
|
|
227
|
+
* Compute an n-tile integer ranging from 1 to the provided argument
|
|
228
|
+
* (num_buckets), dividing the partition as equally as possible.
|
|
229
|
+
*/
|
|
230
|
+
ntile: Arg1;
|
|
231
|
+
}
|
|
232
|
+
export interface Lag extends WindowOptions {
|
|
233
|
+
/**
|
|
234
|
+
* Compute lagging values in a column. Returns the value at the row that is
|
|
235
|
+
* `offset` (second argument, default `1`) rows before the current row within
|
|
236
|
+
* the window frame. If there is no such row, instead return `default` (third
|
|
237
|
+
* argument, default `null`). Both offset and default are evaluated with
|
|
238
|
+
* respect to the current row.
|
|
239
|
+
*/
|
|
240
|
+
lag: Arg3Opt;
|
|
241
|
+
}
|
|
242
|
+
export interface Lead extends WindowOptions {
|
|
243
|
+
/**
|
|
244
|
+
* Compute leading values in a column. Returns the value at the row that is
|
|
245
|
+
* `offset` (second argument, default `1`) rows after the current row within
|
|
246
|
+
* the window frame. If there is no such row, instead return `default` (third
|
|
247
|
+
* argument, default `null`). Both offset and default are evaluated with
|
|
248
|
+
* respect to the current row.
|
|
249
|
+
*/
|
|
250
|
+
lag: Arg3Opt;
|
|
251
|
+
}
|
|
252
|
+
export interface FirstValue extends WindowOptions {
|
|
253
|
+
/**
|
|
254
|
+
* Get the first value of the given column in the current window frame.
|
|
255
|
+
*/
|
|
256
|
+
first_value: Arg1;
|
|
257
|
+
}
|
|
258
|
+
export interface LastValue extends WindowOptions {
|
|
259
|
+
/**
|
|
260
|
+
* Get the last value of the given column in the current window frame.
|
|
261
|
+
*/
|
|
262
|
+
last_value: Arg1;
|
|
263
|
+
}
|
|
264
|
+
export interface NthValue extends WindowOptions {
|
|
265
|
+
/**
|
|
266
|
+
* Get the nth value of the given column in the current window frame,
|
|
267
|
+
* counting from one. The second argument is the offset for the nth row.
|
|
268
|
+
*/
|
|
269
|
+
nth_value: Arg2Opt;
|
|
270
|
+
}
|
|
271
|
+
/** A data transform that maps one column value to another. */
|
|
272
|
+
export type ColumnTransform = Bin | DateMonth | DateMonthDay | DateDay | Centroid | CentroidX | CentroidY | GeoJSON;
|
|
273
|
+
/** An aggregate transform that combines multiple values. */
|
|
274
|
+
export type AggregateTransform = Argmax | Argmin | Avg | Count | Max | Min | First | Last | Max | Min | Median | Mode | Product | Quantile | Sum;
|
|
275
|
+
export type WindowTransform = RowNumber | Rank | DenseRank | PercentRank | CumeDist | NTile | Rank | Lag | Lead | FirstValue | LastValue | NthValue;
|
|
276
|
+
/** A data transform. */
|
|
277
|
+
export type Transform = ColumnTransform | AggregateTransform | WindowTransform;
|
|
278
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ParamRef } from '../Param.js';
|
|
2
|
+
/** A highlight interactor. */
|
|
3
|
+
export interface Highlight {
|
|
4
|
+
/**
|
|
5
|
+
* Highlight selected marks by deemphasizing the others.
|
|
6
|
+
*/
|
|
7
|
+
select: 'highlight';
|
|
8
|
+
/**
|
|
9
|
+
* The input selection. Unselected marks are deemphasized.
|
|
10
|
+
*/
|
|
11
|
+
by: ParamRef;
|
|
12
|
+
/**
|
|
13
|
+
* The overall opacity of deemphasized marks.
|
|
14
|
+
* By default the opacity is set to 0.2.
|
|
15
|
+
*/
|
|
16
|
+
opacity?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The fill opacity of deemphasized marks.
|
|
19
|
+
* By default the fill opacity is unchanged.
|
|
20
|
+
*/
|
|
21
|
+
fillOpacity?: number;
|
|
22
|
+
/**
|
|
23
|
+
* The stroke opacity of deemphasized marks.
|
|
24
|
+
* By default the stroke opacity is unchanged.
|
|
25
|
+
*/
|
|
26
|
+
strokeOpacity?: number;
|
|
27
|
+
/**
|
|
28
|
+
* The fill color of deemphasized marks.
|
|
29
|
+
* By default the fill is unchanged.
|
|
30
|
+
*/
|
|
31
|
+
fill?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The stroke color of deemphasized marks.
|
|
34
|
+
* By default the stroke is unchanged.
|
|
35
|
+
*/
|
|
36
|
+
stroke?: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ParamRef } from '../Param.js';
|
|
2
|
+
/** Styles for rectangular selection brushes. */
|
|
3
|
+
export interface BrushStyles {
|
|
4
|
+
/**
|
|
5
|
+
* The overall opacity of the brush rectangle.
|
|
6
|
+
*/
|
|
7
|
+
opacity?: number;
|
|
8
|
+
/**
|
|
9
|
+
* The fill opacity of the brush rectangle.
|
|
10
|
+
*/
|
|
11
|
+
fillOpacity?: number;
|
|
12
|
+
/**
|
|
13
|
+
* The stroke opacity of the brush rectangle.
|
|
14
|
+
*/
|
|
15
|
+
strokeOpacity?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The fill color of the brush rectangle.
|
|
18
|
+
*/
|
|
19
|
+
fill?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The stroke color of the brush rectangle.
|
|
22
|
+
*/
|
|
23
|
+
stroke?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Options for 1D interval interactors. */
|
|
26
|
+
export interface Interval1DOptions {
|
|
27
|
+
/**
|
|
28
|
+
* The output selection. A clause of the form `field BETWEEN lo AND hi`
|
|
29
|
+
* is added for the currently selected interval [lo, hi].
|
|
30
|
+
*/
|
|
31
|
+
as: ParamRef;
|
|
32
|
+
/**
|
|
33
|
+
* The name of the field (database column) over which the interval
|
|
34
|
+
* selection should be defined. If unspecified, the channel field of the
|
|
35
|
+
* first valid prior mark definition is used.
|
|
36
|
+
*/
|
|
37
|
+
field?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The size of an interative pixel (default `1`). Larger pixel sizes reduce
|
|
40
|
+
* the brush resolution, which can reduce the size of data cube indexes.
|
|
41
|
+
*/
|
|
42
|
+
pixelSize?: number;
|
|
43
|
+
/**
|
|
44
|
+
* A flag indicating if peer (sibling) marks are when cross-filtering
|
|
45
|
+
* (default `true`). If set, peer marks will not be filtered by this
|
|
46
|
+
* interactor's selection in cross-filtering setups.
|
|
47
|
+
*/
|
|
48
|
+
peers?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* CSS styles for the brush (SVG `rect`) element.
|
|
51
|
+
*/
|
|
52
|
+
brush?: BrushStyles;
|
|
53
|
+
}
|
|
54
|
+
/** An intervalX interactor. */
|
|
55
|
+
export interface IntervalX extends Interval1DOptions {
|
|
56
|
+
/** Select a continuous 1D interval selection over the `x` scale domain. */
|
|
57
|
+
select: 'intervalX';
|
|
58
|
+
}
|
|
59
|
+
/** An intervalY interactor. */
|
|
60
|
+
export interface IntervalY extends Interval1DOptions {
|
|
61
|
+
/** Select a continuous 1D interval selection over the `y` scale domain. */
|
|
62
|
+
select: 'intervalY';
|
|
63
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ParamRef } from '../Param.js';
|
|
2
|
+
import { BrushStyles } from './Interval1D.js';
|
|
3
|
+
/** Options for 2D interval interactors. */
|
|
4
|
+
export interface Interval2DOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The output selection. A clause of the form
|
|
7
|
+
* `(xfield BETWEEN x1 AND x2) AND (yfield BETWEEN y1 AND y2)`
|
|
8
|
+
* is added for the currently selected intervals.
|
|
9
|
+
*/
|
|
10
|
+
as: ParamRef;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the field (database column) over which the `x`-component
|
|
13
|
+
* of the interval selection should be defined. If unspecified, the `x`
|
|
14
|
+
* channel field of the first valid prior mark definition is used.
|
|
15
|
+
*/
|
|
16
|
+
xfield?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The name of the field (database column) over which the `y`-component
|
|
19
|
+
* of the interval selection should be defined. If unspecified, the `y`
|
|
20
|
+
* channel field of the first valid prior mark definition is used.
|
|
21
|
+
*/
|
|
22
|
+
yfield?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The size of an interative pixel (default `1`). Larger pixel sizes reduce
|
|
25
|
+
* the brush resolution, which can reduce the size of data cube indexes.
|
|
26
|
+
*/
|
|
27
|
+
pixelSize?: number;
|
|
28
|
+
/**
|
|
29
|
+
* A flag indicating if peer (sibling) marks are when cross-filtering
|
|
30
|
+
* (default `true`). If set, peer marks will not be filtered by this
|
|
31
|
+
* interactor's selection in cross-filtering setups.
|
|
32
|
+
*/
|
|
33
|
+
peers?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* CSS styles for the brush (SVG `rect`) element.
|
|
36
|
+
*/
|
|
37
|
+
brush?: BrushStyles;
|
|
38
|
+
}
|
|
39
|
+
/** An intervalXY interactor. */
|
|
40
|
+
export interface IntervalXY extends Interval2DOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Select a continuous 2D interval selection
|
|
43
|
+
* over the `x` and `y` scale domains.
|
|
44
|
+
*/
|
|
45
|
+
select: 'intervalXY';
|
|
46
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ParamRef } from '../Param.js';
|
|
2
|
+
/** Options for nearest interactors. */
|
|
3
|
+
export interface NearestOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The output selection. A clause of the form `field = value`
|
|
6
|
+
* is added for the currently nearest value.
|
|
7
|
+
*/
|
|
8
|
+
as: ParamRef;
|
|
9
|
+
/**
|
|
10
|
+
* The name of the field (database column) over which the nearest
|
|
11
|
+
* selection should be defined. If unspecified, the channel field of the
|
|
12
|
+
* first valid prior mark definition is used.
|
|
13
|
+
*/
|
|
14
|
+
field?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A nearestX interactor. */
|
|
17
|
+
export interface NearestX extends NearestOptions {
|
|
18
|
+
/** Select the **x** domain value of the mark closest to the pointer. */
|
|
19
|
+
select: 'nearestX';
|
|
20
|
+
}
|
|
21
|
+
/** A nearestY interactor. */
|
|
22
|
+
export interface NearestY extends NearestOptions {
|
|
23
|
+
/** Select the **y** domain value of the mark closest to the pointer. */
|
|
24
|
+
select: 'nearestY';
|
|
25
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ParamRef } from '../Param.js';
|
|
2
|
+
/** Options for pan/zoom interactors. */
|
|
3
|
+
export interface PanZoomOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The output selection for the `x` domain.
|
|
6
|
+
* A clause of the form `field BETWEEN x1 AND x2` is added for the
|
|
7
|
+
* current pan/zom interval [x1, x2].
|
|
8
|
+
*/
|
|
9
|
+
x?: ParamRef;
|
|
10
|
+
/**
|
|
11
|
+
* The output selection for the `y` domain.
|
|
12
|
+
* A clause of the form `field BETWEEN y1 AND y2` is added for the
|
|
13
|
+
* current pan/zom interval [y1, y2].
|
|
14
|
+
*/
|
|
15
|
+
y?: ParamRef;
|
|
16
|
+
/**
|
|
17
|
+
* The name of the field (database column) over which the `x`-component
|
|
18
|
+
* of the pan/zoom interval should be defined. If unspecified, the `x`
|
|
19
|
+
* channel field of the first valid prior mark definition is used.
|
|
20
|
+
*/
|
|
21
|
+
xfield?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The name of the field (database column) over which the `y`-component
|
|
24
|
+
* of the pan/zoom interval should be defined. If unspecified, the `y`
|
|
25
|
+
* channel field of the first valid prior mark definition is used.
|
|
26
|
+
*/
|
|
27
|
+
yfield?: string;
|
|
28
|
+
}
|
|
29
|
+
/** A pan interactor. */
|
|
30
|
+
export interface Pan extends PanZoomOptions {
|
|
31
|
+
/** Pan a plot along both the `x` and `y` scales. */
|
|
32
|
+
select: 'pan';
|
|
33
|
+
}
|
|
34
|
+
/** A panX interactor. */
|
|
35
|
+
export interface PanX extends PanZoomOptions {
|
|
36
|
+
/** Pan a plot along the `x` scale only. */
|
|
37
|
+
select: 'panX';
|
|
38
|
+
}
|
|
39
|
+
/** A panY interactor. */
|
|
40
|
+
export interface PanY extends PanZoomOptions {
|
|
41
|
+
/** Pan a plot along the `y` scale only. */
|
|
42
|
+
select: 'panY';
|
|
43
|
+
}
|
|
44
|
+
/** A panZoom interactor. */
|
|
45
|
+
export interface PanZoom extends PanZoomOptions {
|
|
46
|
+
/** Pan and zoom a plot along both the `x` and `y` scales. */
|
|
47
|
+
select: 'panZoom';
|
|
48
|
+
}
|
|
49
|
+
/** A panZoomX interactor. */
|
|
50
|
+
export interface PanZoomX extends PanZoomOptions {
|
|
51
|
+
/** Pan and zoom a plot along the `x` scale only. */
|
|
52
|
+
select: 'panZoomX';
|
|
53
|
+
}
|
|
54
|
+
/** A panZoomY interactor. */
|
|
55
|
+
export interface PanZoomY extends PanZoomOptions {
|
|
56
|
+
/** Pan and zoom a plot along the `y` scale only. */
|
|
57
|
+
select: 'panZoomY';
|
|
58
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ParamRef } from '../Param.js';
|
|
2
|
+
/** Options for toggle interactors. */
|
|
3
|
+
export interface ToggleOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The output selection. A clause of the form
|
|
6
|
+
* `(field = value1) OR (field = value2) ...`
|
|
7
|
+
* is added for the currently selected values.
|
|
8
|
+
*/
|
|
9
|
+
as: ParamRef;
|
|
10
|
+
/**
|
|
11
|
+
* A flag indicating if peer (sibling) marks are when cross-filtering
|
|
12
|
+
* (default `true`). If set, peer marks will not be filtered by this
|
|
13
|
+
* interactor's selection in cross-filtering setups.
|
|
14
|
+
*/
|
|
15
|
+
peers?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** A toggle interactor. */
|
|
18
|
+
export interface Toggle extends ToggleOptions {
|
|
19
|
+
/** Select individal values. */
|
|
20
|
+
select: 'toggle';
|
|
21
|
+
/**
|
|
22
|
+
* The encoding channels over which to select values.
|
|
23
|
+
* For a selected mark, selection clauses will cover
|
|
24
|
+
* the backing data fields for each channel.
|
|
25
|
+
*/
|
|
26
|
+
channels: string[];
|
|
27
|
+
}
|
|
28
|
+
/** A toggleX interactor. */
|
|
29
|
+
export interface ToggleX extends ToggleOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Select individal values in the `x` scale domain.
|
|
32
|
+
* Clicking or touching a mark toggles its selection status.
|
|
33
|
+
*/
|
|
34
|
+
select: 'toggleX';
|
|
35
|
+
}
|
|
36
|
+
/** A toggleY interactor. */
|
|
37
|
+
export interface ToggleY extends ToggleOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Select individal values in the `y` scale domain.
|
|
40
|
+
* Clicking or touching a mark toggles its selection status.
|
|
41
|
+
*/
|
|
42
|
+
select: 'toggleY';
|
|
43
|
+
}
|
|
44
|
+
/** A toggleColor interactor. */
|
|
45
|
+
export interface ToggleColor extends ToggleOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Select individal values in the `color` scale domain.
|
|
48
|
+
* Clicking or touching a mark toggles its selection status.
|
|
49
|
+
*/
|
|
50
|
+
select: 'toggleColor';
|
|
51
|
+
}
|