@uwdata/mosaic-spec 0.16.2 → 0.17.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/package.json +8 -12
- package/src/ast/TransformNode.js +11 -17
- package/src/ast/WindowFrameNode.js +61 -0
- package/src/config/transforms.js +8 -0
- package/src/constants.js +1 -0
- package/src/spec/Interval.ts +75 -0
- package/src/spec/Transform.ts +56 -46
- package/tsconfig.json +10 -8
- package/LICENSE +0 -47
- package/dist/mosaic-schema.json +0 -200164
- package/dist/types/ast/ASTNode.d.ts +0 -26
- package/dist/types/ast/ColumnParamRefNode.d.ts +0 -8
- package/dist/types/ast/DataNode.d.ts +0 -60
- package/dist/types/ast/ExpressionNode.d.ts +0 -13
- package/dist/types/ast/HConcatNode.d.ts +0 -10
- package/dist/types/ast/HSpaceNode.d.ts +0 -11
- package/dist/types/ast/InputNode.d.ts +0 -8
- package/dist/types/ast/LiteralNode.d.ts +0 -7
- package/dist/types/ast/OptionsNode.d.ts +0 -10
- package/dist/types/ast/ParamNode.d.ts +0 -8
- package/dist/types/ast/ParamRefNode.d.ts +0 -8
- package/dist/types/ast/PlotAttributeNode.d.ts +0 -18
- package/dist/types/ast/PlotFromNode.d.ts +0 -9
- package/dist/types/ast/PlotInteractorNode.d.ts +0 -8
- package/dist/types/ast/PlotLegendNode.d.ts +0 -10
- package/dist/types/ast/PlotMarkNode.d.ts +0 -10
- package/dist/types/ast/PlotNode.d.ts +0 -11
- package/dist/types/ast/SelectionNode.d.ts +0 -24
- package/dist/types/ast/SpecNode.d.ts +0 -10
- package/dist/types/ast/TransformNode.d.ts +0 -21
- package/dist/types/ast/VConcatNode.d.ts +0 -10
- package/dist/types/ast/VSpaceNode.d.ts +0 -11
- package/dist/types/ast-to-dom.d.ts +0 -40
- package/dist/types/ast-to-esm.d.ts +0 -64
- package/dist/types/config/components.d.ts +0 -4
- package/dist/types/config/extensions.d.ts +0 -9
- package/dist/types/config/inputs.d.ts +0 -5
- package/dist/types/config/plots.d.ts +0 -34
- package/dist/types/config/transforms.d.ts +0 -4
- package/dist/types/constants.d.ts +0 -31
- package/dist/types/index.d.ts +0 -29
- package/dist/types/parse-spec.d.ts +0 -111
- package/dist/types/spec/CSSStyles.d.ts +0 -3
- package/dist/types/spec/Data.d.ts +0 -165
- package/dist/types/spec/Expression.d.ts +0 -27
- package/dist/types/spec/HConcat.d.ts +0 -8
- package/dist/types/spec/HSpace.d.ts +0 -9
- package/dist/types/spec/Input.d.ts +0 -212
- package/dist/types/spec/Param.d.ts +0 -63
- package/dist/types/spec/Plot.d.ts +0 -14
- package/dist/types/spec/PlotAttribute.d.ts +0 -1534
- package/dist/types/spec/PlotFrom.d.ts +0 -20
- package/dist/types/spec/PlotInteractor.d.ts +0 -9
- package/dist/types/spec/PlotLegend.d.ts +0 -68
- package/dist/types/spec/PlotMark.d.ts +0 -28
- package/dist/types/spec/PlotTypes.d.ts +0 -293
- package/dist/types/spec/Spec.d.ts +0 -52
- package/dist/types/spec/Transform.d.ts +0 -346
- package/dist/types/spec/VConcat.d.ts +0 -8
- package/dist/types/spec/VSpace.d.ts +0 -9
- package/dist/types/spec/interactors/BrushStyles.d.ts +0 -27
- package/dist/types/spec/interactors/Highlight.d.ts +0 -37
- package/dist/types/spec/interactors/Interval1D.d.ts +0 -42
- package/dist/types/spec/interactors/Interval2D.d.ts +0 -47
- package/dist/types/spec/interactors/Nearest.d.ts +0 -44
- package/dist/types/spec/interactors/PanZoom.d.ts +0 -58
- package/dist/types/spec/interactors/Region.d.ts +0 -32
- package/dist/types/spec/interactors/Toggle.d.ts +0 -59
- package/dist/types/spec/marks/Area.d.ts +0 -139
- package/dist/types/spec/marks/Arrow.d.ts +0 -94
- package/dist/types/spec/marks/Axis.d.ts +0 -281
- package/dist/types/spec/marks/Bar.d.ts +0 -150
- package/dist/types/spec/marks/Cell.d.ts +0 -57
- package/dist/types/spec/marks/Contour.d.ts +0 -23
- package/dist/types/spec/marks/Delaunay.d.ts +0 -86
- package/dist/types/spec/marks/DenseLine.d.ts +0 -27
- package/dist/types/spec/marks/Density.d.ts +0 -136
- package/dist/types/spec/marks/Dot.d.ts +0 -133
- package/dist/types/spec/marks/ErrorBar.d.ts +0 -82
- package/dist/types/spec/marks/Frame.d.ts +0 -21
- package/dist/types/spec/marks/Geo.d.ts +0 -53
- package/dist/types/spec/marks/Hexbin.d.ts +0 -30
- package/dist/types/spec/marks/Hexgrid.d.ts +0 -25
- package/dist/types/spec/marks/Image.d.ts +0 -89
- package/dist/types/spec/marks/Line.d.ts +0 -82
- package/dist/types/spec/marks/Link.d.ts +0 -60
- package/dist/types/spec/marks/Marks.d.ts +0 -910
- package/dist/types/spec/marks/Raster.d.ts +0 -124
- package/dist/types/spec/marks/Rect.d.ts +0 -166
- package/dist/types/spec/marks/Regression.d.ts +0 -58
- package/dist/types/spec/marks/Rule.d.ts +0 -100
- package/dist/types/spec/marks/Text.d.ts +0 -110
- package/dist/types/spec/marks/Tick.d.ts +0 -61
- package/dist/types/spec/marks/Vector.d.ts +0 -99
- package/dist/types/spec/marks/Waffle.d.ts +0 -58
- package/dist/types/util.d.ts +0 -12
- package/jsconfig.json +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uwdata/mosaic-spec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Declarative specification of Mosaic-powered applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mosaic",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"author": "Jeffrey Heer (https://idl.uw.edu)",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"exports": {
|
|
16
|
-
"types": "./dist/
|
|
16
|
+
"types": "./dist/src/index.d.ts",
|
|
17
17
|
"default": "./src/index.js"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
@@ -22,21 +22,17 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"prebuild": "rimraf dist && mkdir dist",
|
|
25
|
-
"build": "npm run
|
|
25
|
+
"build": "tsc && npm run schema",
|
|
26
26
|
"lint": "eslint src test",
|
|
27
|
-
"types": "tsc && npm run schema",
|
|
28
27
|
"schema": "ts-json-schema-generator -f tsconfig.json -p src/spec/Spec.ts -t Spec --no-type-check --no-ref-encode --functions hide > dist/mosaic-schema.json",
|
|
29
|
-
"
|
|
30
|
-
"test": "vitest run && npm run tsc",
|
|
31
|
-
"tsc": "tsc -p jsconfig.json",
|
|
28
|
+
"test": "vitest run && tsc",
|
|
32
29
|
"version": "cd ../.. && npm run docs:schema",
|
|
33
30
|
"prepublishOnly": "npm run test && npm run lint && npm run build"
|
|
34
31
|
},
|
|
35
32
|
"dependencies": {
|
|
36
|
-
"@uwdata/mosaic-core": "^0.
|
|
37
|
-
"@uwdata/mosaic-sql": "^0.
|
|
38
|
-
"@uwdata/vgplot": "^0.
|
|
33
|
+
"@uwdata/mosaic-core": "^0.17.0",
|
|
34
|
+
"@uwdata/mosaic-sql": "^0.17.0",
|
|
35
|
+
"@uwdata/vgplot": "^0.17.0",
|
|
39
36
|
"ts-json-schema-generator": "^2.3.0"
|
|
40
|
-
}
|
|
41
|
-
"gitHead": "26d2719f4bcab471d2831145e1f03f39f3509869"
|
|
37
|
+
}
|
|
42
38
|
}
|
package/src/ast/TransformNode.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ASTNode } from './ASTNode.js';
|
|
2
2
|
import { TRANSFORM } from '../constants.js';
|
|
3
3
|
import { parseOptions } from './OptionsNode.js';
|
|
4
|
+
import { parseWindowFrame } from './WindowFrameNode.js';
|
|
4
5
|
|
|
5
6
|
function toArray(value, ctx) {
|
|
6
7
|
return value == null
|
|
@@ -30,8 +31,7 @@ export function parseTransform(spec, ctx) {
|
|
|
30
31
|
distinct: spec.distinct,
|
|
31
32
|
orderby: toArray(spec.orderby, ctx),
|
|
32
33
|
partitionby: toArray(spec.partitionby, ctx),
|
|
33
|
-
|
|
34
|
-
range: spec.range ? ctx.maybeParam(spec.range) : null
|
|
34
|
+
frame: parseWindowFrame(spec, ctx)
|
|
35
35
|
};
|
|
36
36
|
return new TransformNode(name, args, options);
|
|
37
37
|
}
|
|
@@ -47,7 +47,7 @@ export class TransformNode extends ASTNode {
|
|
|
47
47
|
|
|
48
48
|
instantiate(ctx) {
|
|
49
49
|
const { name, args, options } = this;
|
|
50
|
-
const { distinct, orderby, partitionby,
|
|
50
|
+
const { distinct, orderby, partitionby, frame } = options;
|
|
51
51
|
|
|
52
52
|
let expr = ctx.api[name](...args.map(a => a.instantiate(ctx)));
|
|
53
53
|
if (distinct) {
|
|
@@ -59,17 +59,15 @@ export class TransformNode extends ASTNode {
|
|
|
59
59
|
if (partitionby.length) {
|
|
60
60
|
expr = expr.partitionby(partitionby.map(v => v.instantiate(ctx)));
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
63
|
-
expr = expr.
|
|
64
|
-
} else if (range != null) {
|
|
65
|
-
expr = expr.range(range.instantiate(ctx));
|
|
62
|
+
if (frame) {
|
|
63
|
+
expr = expr.frame(frame.instantiate(ctx));
|
|
66
64
|
}
|
|
67
65
|
return expr;
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
codegen(ctx) {
|
|
71
69
|
const { name, args, options } = this;
|
|
72
|
-
const { distinct, orderby, partitionby,
|
|
70
|
+
const { distinct, orderby, partitionby, frame } = options;
|
|
73
71
|
|
|
74
72
|
let str = `${ctx.ns()}${name}(`
|
|
75
73
|
+ args.map(v => v.codegen(ctx)).join(', ')
|
|
@@ -86,10 +84,8 @@ export class TransformNode extends ASTNode {
|
|
|
86
84
|
const p = partitionby.map(v => v.codegen(ctx));
|
|
87
85
|
str += `.partitionby(${p.join(', ')})`;
|
|
88
86
|
}
|
|
89
|
-
if (
|
|
90
|
-
str += `.
|
|
91
|
-
} else if (range) {
|
|
92
|
-
str += `.range(${range.codegen(ctx)})`;
|
|
87
|
+
if (frame) {
|
|
88
|
+
str += `.frame(${frame.codegen(ctx)})`;
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
return str;
|
|
@@ -97,7 +93,7 @@ export class TransformNode extends ASTNode {
|
|
|
97
93
|
|
|
98
94
|
toJSON() {
|
|
99
95
|
const { name, args, options } = this;
|
|
100
|
-
const { distinct, orderby, partitionby,
|
|
96
|
+
const { distinct, orderby, partitionby, frame } = options;
|
|
101
97
|
|
|
102
98
|
const json = { [name]: simplify(args.map(v => v.toJSON())) };
|
|
103
99
|
|
|
@@ -110,10 +106,8 @@ export class TransformNode extends ASTNode {
|
|
|
110
106
|
if (partitionby.length) {
|
|
111
107
|
json.partitionby = simplify(partitionby.map(v => v.toJSON()));
|
|
112
108
|
}
|
|
113
|
-
if (
|
|
114
|
-
json
|
|
115
|
-
} else if (range) {
|
|
116
|
-
json.range = range.toJSON();
|
|
109
|
+
if (frame) {
|
|
110
|
+
Object.assign(json, frame.toJSON());
|
|
117
111
|
}
|
|
118
112
|
|
|
119
113
|
return json;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { LiteralNode, WindowFrameNode as WindowFrame } from '@uwdata/mosaic-sql';
|
|
2
|
+
import { WINDOW_FRAME } from '../constants.js';
|
|
3
|
+
import { isObject, paramRef } from '../util.js';
|
|
4
|
+
import { ASTNode } from './ASTNode.js';
|
|
5
|
+
import { parseTransform } from './TransformNode.js';
|
|
6
|
+
|
|
7
|
+
export function parseWindowFrame(spec, ctx) {
|
|
8
|
+
const type = spec.rows ? 'ROWS'
|
|
9
|
+
: spec.range ? 'RANGE'
|
|
10
|
+
: spec.groups ? 'GROUPS'
|
|
11
|
+
: null;
|
|
12
|
+
|
|
13
|
+
if (!type) return null;
|
|
14
|
+
|
|
15
|
+
const value = spec[type.toLowerCase()];
|
|
16
|
+
const name = paramRef(value);
|
|
17
|
+
const extent = name
|
|
18
|
+
? ctx.paramRef(name)
|
|
19
|
+
: value.map(v => isObject(v)
|
|
20
|
+
? parseTransform(v, ctx)
|
|
21
|
+
: new LiteralNode(v)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return new WindowFrameNode(type, extent, spec.exclude);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class WindowFrameNode extends ASTNode {
|
|
28
|
+
constructor(type, extent, exclude) {
|
|
29
|
+
super(WINDOW_FRAME);
|
|
30
|
+
this.type = type;
|
|
31
|
+
this.extent = extent;
|
|
32
|
+
this.exclude = exclude?.toUpperCase();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
instantiate(ctx) {
|
|
36
|
+
const { type, extent, exclude } = this;
|
|
37
|
+
const ex = Array.isArray(extent)
|
|
38
|
+
? extent.map(v => v.instantiate(ctx))
|
|
39
|
+
: extent.instantiate(ctx);
|
|
40
|
+
return new WindowFrame(type, ex, exclude?.toUpperCase());
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
codegen(ctx) {
|
|
44
|
+
const { type, extent, exclude } = this;
|
|
45
|
+
const fn = `frame${type[0].toUpperCase()}${type.slice(1).toLowerCase()}`;
|
|
46
|
+
const ex = Array.isArray(extent)
|
|
47
|
+
? `[${extent.map(v => v.codegen(ctx)).join(', ')}]`
|
|
48
|
+
: extent.codegen(ctx);
|
|
49
|
+
const cl = exclude ? `, '${exclude.toUpperCase()}'` : '';
|
|
50
|
+
return `${ctx.ns()}${fn}(${ex}${cl})`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
toJSON() {
|
|
54
|
+
const { type, extent, exclude } = this;
|
|
55
|
+
const key = type.toLowerCase();
|
|
56
|
+
const ex = Array.isArray(extent)
|
|
57
|
+
? extent.map(v => v.toJSON())
|
|
58
|
+
: extent.toJSON();
|
|
59
|
+
return { [key]: ex, exclude };
|
|
60
|
+
}
|
|
61
|
+
}
|
package/src/config/transforms.js
CHANGED
package/src/constants.js
CHANGED
|
@@ -48,5 +48,6 @@ export const PLOT = 'plot';
|
|
|
48
48
|
export const LEGEND = 'legend';
|
|
49
49
|
export const ATTRIBUTE = 'attribute';
|
|
50
50
|
export const TRANSFORM = 'transform';
|
|
51
|
+
export const WINDOW_FRAME = 'windowframe';
|
|
51
52
|
export const INTERACTOR = 'interactor';
|
|
52
53
|
export const FIXED = 'Fixed';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** Date/time interval. */
|
|
2
|
+
export type IntervalTransform =
|
|
3
|
+
| Years
|
|
4
|
+
| Months
|
|
5
|
+
| Days
|
|
6
|
+
| Hours
|
|
7
|
+
| Minutes
|
|
8
|
+
| Seconds
|
|
9
|
+
| Milliseconds
|
|
10
|
+
| Microseconds
|
|
11
|
+
;
|
|
12
|
+
|
|
13
|
+
/** A date/time interval in units of years. */
|
|
14
|
+
export interface Years {
|
|
15
|
+
/**
|
|
16
|
+
* A date/time interval in units of years.
|
|
17
|
+
*/
|
|
18
|
+
years: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A date/time interval in units of months. */
|
|
22
|
+
export interface Months {
|
|
23
|
+
/**
|
|
24
|
+
* A date/time interval in units of months.
|
|
25
|
+
*/
|
|
26
|
+
months: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** A date/time interval in units of days. */
|
|
30
|
+
export interface Days {
|
|
31
|
+
/**
|
|
32
|
+
* A date/time interval in units of days.
|
|
33
|
+
*/
|
|
34
|
+
days: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** A date/time interval in units of hours. */
|
|
38
|
+
export interface Hours {
|
|
39
|
+
/**
|
|
40
|
+
* A date/time interval in units of hours.
|
|
41
|
+
*/
|
|
42
|
+
hours: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** A date/time interval in units of minutes. */
|
|
46
|
+
export interface Minutes {
|
|
47
|
+
/**
|
|
48
|
+
* A date/time interval in units of minutes.
|
|
49
|
+
*/
|
|
50
|
+
minutes: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A date/time interval in units of seconds. */
|
|
54
|
+
export interface Seconds {
|
|
55
|
+
/**
|
|
56
|
+
* A date/time interval in units of seconds.
|
|
57
|
+
*/
|
|
58
|
+
seconds: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** A date/time interval in units of milliseconds. */
|
|
62
|
+
export interface Milliseconds {
|
|
63
|
+
/**
|
|
64
|
+
* A date/time interval in units of milliseconds.
|
|
65
|
+
*/
|
|
66
|
+
milliseconds: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** A date/time interval in units of microseconds. */
|
|
70
|
+
export interface Microseconds {
|
|
71
|
+
/**
|
|
72
|
+
* A date/time interval in units of microseconds.
|
|
73
|
+
*/
|
|
74
|
+
microseconds: number;
|
|
75
|
+
}
|
package/src/spec/Transform.ts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
import { IntervalTransform } from './Interval.js';
|
|
1
2
|
import { ParamRef } from './Param.js';
|
|
2
3
|
|
|
3
4
|
/** A field argument to a data transform. */
|
|
4
5
|
export type TransformField = string | ParamRef;
|
|
5
6
|
|
|
7
|
+
export type FrameExclude = 'CURRENT ROW' | 'GROUP' | 'TIES' | 'NO OTHERS';
|
|
8
|
+
|
|
9
|
+
export type FrameValue = number | IntervalTransform | null;
|
|
10
|
+
|
|
6
11
|
/** Window transform options. */
|
|
7
12
|
export interface WindowOptions {
|
|
8
13
|
orderby?: TransformField | TransformField[];
|
|
9
14
|
partitionby?: TransformField | TransformField[];
|
|
10
|
-
rows?:
|
|
11
|
-
range?:
|
|
15
|
+
rows?: [FrameValue, FrameValue] | ParamRef;
|
|
16
|
+
range?: [FrameValue, FrameValue] | ParamRef;
|
|
17
|
+
groups?: [FrameValue, FrameValue] | ParamRef;
|
|
18
|
+
exclude?: Uppercase<FrameExclude> | Lowercase<FrameExclude>;
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
/** Aggregate transform options. */
|
|
@@ -53,7 +60,7 @@ export type BinInterval =
|
|
|
53
60
|
| 'month'
|
|
54
61
|
| 'year';
|
|
55
62
|
|
|
56
|
-
|
|
63
|
+
/** A bin transform. */
|
|
57
64
|
export interface Bin {
|
|
58
65
|
/**
|
|
59
66
|
* Bin a continuous variable into discrete intervals. The bin argument
|
|
@@ -102,7 +109,7 @@ export interface Bin {
|
|
|
102
109
|
offset?: number;
|
|
103
110
|
}
|
|
104
111
|
|
|
105
|
-
|
|
112
|
+
/** A column transform. */
|
|
106
113
|
export interface Column {
|
|
107
114
|
/**
|
|
108
115
|
* Intpret a string or param-value as a column reference.
|
|
@@ -110,7 +117,7 @@ export interface Column {
|
|
|
110
117
|
column: Arg1;
|
|
111
118
|
}
|
|
112
119
|
|
|
113
|
-
|
|
120
|
+
/** A dateMonth transform. */
|
|
114
121
|
export interface DateMonth {
|
|
115
122
|
/**
|
|
116
123
|
* Transform a Date value to a month boundary for cyclic comparison.
|
|
@@ -119,7 +126,7 @@ export interface DateMonth {
|
|
|
119
126
|
dateMonth: Arg1;
|
|
120
127
|
}
|
|
121
128
|
|
|
122
|
-
|
|
129
|
+
/** A dateMonthDay transform. */
|
|
123
130
|
export interface DateMonthDay {
|
|
124
131
|
/**
|
|
125
132
|
* Transform a Date value to a month and day boundary for cyclic comparison.
|
|
@@ -128,7 +135,7 @@ export interface DateMonthDay {
|
|
|
128
135
|
dateMonthDay: Arg1;
|
|
129
136
|
}
|
|
130
137
|
|
|
131
|
-
|
|
138
|
+
/** A dateDay transform. */
|
|
132
139
|
export interface DateDay {
|
|
133
140
|
/**
|
|
134
141
|
* Transform a Date value to a day of the month for cyclic comparison.
|
|
@@ -137,7 +144,7 @@ export interface DateDay {
|
|
|
137
144
|
dateDay: Arg1;
|
|
138
145
|
}
|
|
139
146
|
|
|
140
|
-
|
|
147
|
+
/** A centroid transform. */
|
|
141
148
|
export interface Centroid {
|
|
142
149
|
/**
|
|
143
150
|
* Compute the 2D centroid of geometry-typed data.
|
|
@@ -146,7 +153,7 @@ export interface Centroid {
|
|
|
146
153
|
centroid: Arg1;
|
|
147
154
|
}
|
|
148
155
|
|
|
149
|
-
|
|
156
|
+
/** A centroidX transform. */
|
|
150
157
|
export interface CentroidX {
|
|
151
158
|
/**
|
|
152
159
|
* Compute the centroid x-coordinate of geometry-typed data.
|
|
@@ -155,7 +162,7 @@ export interface CentroidX {
|
|
|
155
162
|
centroidX: Arg1;
|
|
156
163
|
}
|
|
157
164
|
|
|
158
|
-
|
|
165
|
+
/** A centroidY transform. */
|
|
159
166
|
export interface CentroidY {
|
|
160
167
|
/**
|
|
161
168
|
* Compute the centroid y-coordinate of geometry-typed data.
|
|
@@ -164,7 +171,7 @@ export interface CentroidY {
|
|
|
164
171
|
centroidY: Arg1;
|
|
165
172
|
}
|
|
166
173
|
|
|
167
|
-
|
|
174
|
+
/** A geojson transform. */
|
|
168
175
|
export interface GeoJSON {
|
|
169
176
|
/**
|
|
170
177
|
* Compute a GeoJSON-formatted string from geometry-typed data.
|
|
@@ -173,7 +180,7 @@ export interface GeoJSON {
|
|
|
173
180
|
geojson: Arg1;
|
|
174
181
|
}
|
|
175
182
|
|
|
176
|
-
|
|
183
|
+
/** An argmax aggregate transform. */
|
|
177
184
|
export interface Argmax extends AggregateOptions, WindowOptions {
|
|
178
185
|
/**
|
|
179
186
|
* Find a value of the first column that maximizes the second column.
|
|
@@ -181,7 +188,7 @@ export interface Argmax extends AggregateOptions, WindowOptions {
|
|
|
181
188
|
argmax: Arg2;
|
|
182
189
|
}
|
|
183
190
|
|
|
184
|
-
|
|
191
|
+
/** An argmin aggregate transform. */
|
|
185
192
|
export interface Argmin extends AggregateOptions, WindowOptions {
|
|
186
193
|
/**
|
|
187
194
|
* Find a value of the first column that minimizes the second column.
|
|
@@ -189,7 +196,7 @@ export interface Argmin extends AggregateOptions, WindowOptions {
|
|
|
189
196
|
argmin: Arg2;
|
|
190
197
|
}
|
|
191
198
|
|
|
192
|
-
|
|
199
|
+
/** An avg (average, or mean) aggregate transform. */
|
|
193
200
|
export interface Avg extends AggregateOptions, WindowOptions {
|
|
194
201
|
/**
|
|
195
202
|
* Compute the average (mean) value of the given column.
|
|
@@ -197,7 +204,7 @@ export interface Avg extends AggregateOptions, WindowOptions {
|
|
|
197
204
|
avg: Arg1;
|
|
198
205
|
}
|
|
199
206
|
|
|
200
|
-
|
|
207
|
+
/** A count aggregate transform. */
|
|
201
208
|
export interface Count extends AggregateOptions, WindowOptions {
|
|
202
209
|
/**
|
|
203
210
|
* Compute the count of records in an aggregation group.
|
|
@@ -205,7 +212,7 @@ export interface Count extends AggregateOptions, WindowOptions {
|
|
|
205
212
|
count: Arg0 | Arg1;
|
|
206
213
|
}
|
|
207
214
|
|
|
208
|
-
|
|
215
|
+
/** A sample covariance aggregate transform. */
|
|
209
216
|
export interface Covariance extends AggregateOptions, WindowOptions {
|
|
210
217
|
/**
|
|
211
218
|
* Compute the sample covariance of between the given columns.
|
|
@@ -213,7 +220,7 @@ export interface Covariance extends AggregateOptions, WindowOptions {
|
|
|
213
220
|
covariance: Arg2;
|
|
214
221
|
}
|
|
215
222
|
|
|
216
|
-
|
|
223
|
+
/** A population covariance aggregate transform. */
|
|
217
224
|
export interface CovarPop extends AggregateOptions, WindowOptions {
|
|
218
225
|
/**
|
|
219
226
|
* Compute the population covariance of between the given columns.
|
|
@@ -221,7 +228,7 @@ export interface CovarPop extends AggregateOptions, WindowOptions {
|
|
|
221
228
|
covarPop: Arg2;
|
|
222
229
|
}
|
|
223
230
|
|
|
224
|
-
|
|
231
|
+
/** A first aggregate transform. */
|
|
225
232
|
export interface First extends AggregateOptions, WindowOptions {
|
|
226
233
|
/**
|
|
227
234
|
* Return the first column value found in an aggregation group.
|
|
@@ -229,7 +236,7 @@ export interface First extends AggregateOptions, WindowOptions {
|
|
|
229
236
|
first: Arg1;
|
|
230
237
|
}
|
|
231
238
|
|
|
232
|
-
|
|
239
|
+
/** A geometric mean aggregate transform. */
|
|
233
240
|
export interface Geomean extends AggregateOptions, WindowOptions {
|
|
234
241
|
/**
|
|
235
242
|
* Compute the geometric mean value of the given column.
|
|
@@ -237,7 +244,7 @@ export interface Geomean extends AggregateOptions, WindowOptions {
|
|
|
237
244
|
geomean: Arg1;
|
|
238
245
|
}
|
|
239
246
|
|
|
240
|
-
|
|
247
|
+
/** A last aggregate transform. */
|
|
241
248
|
export interface Last extends AggregateOptions, WindowOptions {
|
|
242
249
|
/**
|
|
243
250
|
* Return the last column value found in an aggregation group.
|
|
@@ -245,7 +252,7 @@ export interface Last extends AggregateOptions, WindowOptions {
|
|
|
245
252
|
last: Arg1;
|
|
246
253
|
}
|
|
247
254
|
|
|
248
|
-
|
|
255
|
+
/** A max aggregate transform. */
|
|
249
256
|
export interface Max extends AggregateOptions, WindowOptions {
|
|
250
257
|
/**
|
|
251
258
|
* Compute the maximum value of the given column.
|
|
@@ -253,7 +260,7 @@ export interface Max extends AggregateOptions, WindowOptions {
|
|
|
253
260
|
max: Arg1;
|
|
254
261
|
}
|
|
255
262
|
|
|
256
|
-
|
|
263
|
+
/** A min aggregate transform. */
|
|
257
264
|
export interface Min extends AggregateOptions, WindowOptions {
|
|
258
265
|
/**
|
|
259
266
|
* Compute the minimum value of the given column.
|
|
@@ -261,7 +268,7 @@ export interface Min extends AggregateOptions, WindowOptions {
|
|
|
261
268
|
min: Arg1;
|
|
262
269
|
}
|
|
263
270
|
|
|
264
|
-
|
|
271
|
+
/** A median aggregate transform. */
|
|
265
272
|
export interface Median extends AggregateOptions, WindowOptions {
|
|
266
273
|
/**
|
|
267
274
|
* Compute the median value of the given column.
|
|
@@ -269,7 +276,7 @@ export interface Median extends AggregateOptions, WindowOptions {
|
|
|
269
276
|
median: Arg1;
|
|
270
277
|
}
|
|
271
278
|
|
|
272
|
-
|
|
279
|
+
/** A mode aggregate transform. */
|
|
273
280
|
export interface Mode extends AggregateOptions, WindowOptions {
|
|
274
281
|
/**
|
|
275
282
|
* Compute the mode value of the given column.
|
|
@@ -277,7 +284,7 @@ export interface Mode extends AggregateOptions, WindowOptions {
|
|
|
277
284
|
mode: Arg1;
|
|
278
285
|
}
|
|
279
286
|
|
|
280
|
-
|
|
287
|
+
/** A product aggregate transform. */
|
|
281
288
|
export interface Product extends AggregateOptions, WindowOptions {
|
|
282
289
|
/**
|
|
283
290
|
* Compute the product of the given column.
|
|
@@ -285,7 +292,7 @@ export interface Product extends AggregateOptions, WindowOptions {
|
|
|
285
292
|
product: Arg1;
|
|
286
293
|
}
|
|
287
294
|
|
|
288
|
-
|
|
295
|
+
/** A quantile aggregate transform. */
|
|
289
296
|
export interface Quantile extends AggregateOptions, WindowOptions {
|
|
290
297
|
/**
|
|
291
298
|
* Compute the quantile value of the given column at the provided
|
|
@@ -294,7 +301,7 @@ export interface Quantile extends AggregateOptions, WindowOptions {
|
|
|
294
301
|
quantile: Arg2;
|
|
295
302
|
}
|
|
296
303
|
|
|
297
|
-
|
|
304
|
+
/** A sample standard deviation aggregate transform. */
|
|
298
305
|
export interface Stddev extends AggregateOptions, WindowOptions {
|
|
299
306
|
/**
|
|
300
307
|
* Compute the sum of the given column.
|
|
@@ -302,7 +309,7 @@ export interface Stddev extends AggregateOptions, WindowOptions {
|
|
|
302
309
|
stddev: Arg1;
|
|
303
310
|
}
|
|
304
311
|
|
|
305
|
-
|
|
312
|
+
/** A population standard deviation aggregate transform. */
|
|
306
313
|
export interface StddevPop extends AggregateOptions, WindowOptions {
|
|
307
314
|
/**
|
|
308
315
|
* Compute the sum of the given column.
|
|
@@ -310,7 +317,7 @@ export interface StddevPop extends AggregateOptions, WindowOptions {
|
|
|
310
317
|
stddevPop: Arg1;
|
|
311
318
|
}
|
|
312
319
|
|
|
313
|
-
|
|
320
|
+
/** A sum aggregate transform. */
|
|
314
321
|
export interface Sum extends AggregateOptions, WindowOptions {
|
|
315
322
|
/**
|
|
316
323
|
* Compute the sum of the given column.
|
|
@@ -318,7 +325,7 @@ export interface Sum extends AggregateOptions, WindowOptions {
|
|
|
318
325
|
sum: Arg1;
|
|
319
326
|
}
|
|
320
327
|
|
|
321
|
-
|
|
328
|
+
/** A sample variance aggregate transform. */
|
|
322
329
|
export interface Variance extends AggregateOptions, WindowOptions {
|
|
323
330
|
/**
|
|
324
331
|
* Compute the sample variance of the given column.
|
|
@@ -326,7 +333,7 @@ export interface Variance extends AggregateOptions, WindowOptions {
|
|
|
326
333
|
variance: Arg1;
|
|
327
334
|
}
|
|
328
335
|
|
|
329
|
-
|
|
336
|
+
/** A population variance aggregate transform. */
|
|
330
337
|
export interface VarPop extends AggregateOptions, WindowOptions {
|
|
331
338
|
/**
|
|
332
339
|
* Compute the population variance of the given column.
|
|
@@ -334,7 +341,7 @@ export interface VarPop extends AggregateOptions, WindowOptions {
|
|
|
334
341
|
varPop: Arg1;
|
|
335
342
|
}
|
|
336
343
|
|
|
337
|
-
|
|
344
|
+
/** A row_number window transform. */
|
|
338
345
|
export interface RowNumber extends WindowOptions {
|
|
339
346
|
/**
|
|
340
347
|
* Compute the 1-based row number over an ordered window partition.
|
|
@@ -342,7 +349,7 @@ export interface RowNumber extends WindowOptions {
|
|
|
342
349
|
row_number: Arg0;
|
|
343
350
|
}
|
|
344
351
|
|
|
345
|
-
|
|
352
|
+
/** A rank window transform. */
|
|
346
353
|
export interface Rank extends WindowOptions {
|
|
347
354
|
/**
|
|
348
355
|
* Compute the row rank over an ordered window partition.
|
|
@@ -351,7 +358,7 @@ export interface Rank extends WindowOptions {
|
|
|
351
358
|
rank: Arg0;
|
|
352
359
|
}
|
|
353
360
|
|
|
354
|
-
|
|
361
|
+
/** A dense_rank window transform. */
|
|
355
362
|
export interface DenseRank extends WindowOptions {
|
|
356
363
|
/**
|
|
357
364
|
* Compute the dense row rank (no gaps) over an ordered window partition.
|
|
@@ -360,7 +367,7 @@ export interface DenseRank extends WindowOptions {
|
|
|
360
367
|
dense_rank: Arg0;
|
|
361
368
|
}
|
|
362
369
|
|
|
363
|
-
|
|
370
|
+
/** A percent_rank window transform. */
|
|
364
371
|
export interface PercentRank extends WindowOptions {
|
|
365
372
|
/**
|
|
366
373
|
* Compute the percetange rank over an ordered window partition.
|
|
@@ -368,7 +375,7 @@ export interface PercentRank extends WindowOptions {
|
|
|
368
375
|
percent_rank: Arg0;
|
|
369
376
|
}
|
|
370
377
|
|
|
371
|
-
|
|
378
|
+
/** A cume_dist window transform. */
|
|
372
379
|
export interface CumeDist extends WindowOptions {
|
|
373
380
|
/**
|
|
374
381
|
* Compute the cumulative distribution value over an ordered window
|
|
@@ -378,7 +385,7 @@ export interface CumeDist extends WindowOptions {
|
|
|
378
385
|
cume_dist: Arg0;
|
|
379
386
|
}
|
|
380
387
|
|
|
381
|
-
|
|
388
|
+
/** An ntile window transform. */
|
|
382
389
|
export interface NTile extends WindowOptions {
|
|
383
390
|
/**
|
|
384
391
|
* Compute an n-tile integer ranging from 1 to the provided argument
|
|
@@ -387,7 +394,7 @@ export interface NTile extends WindowOptions {
|
|
|
387
394
|
ntile: Arg1;
|
|
388
395
|
}
|
|
389
396
|
|
|
390
|
-
|
|
397
|
+
/** A lag window transform. */
|
|
391
398
|
export interface Lag extends WindowOptions {
|
|
392
399
|
/**
|
|
393
400
|
* Compute lagging values in a column. Returns the value at the row that is
|
|
@@ -399,7 +406,7 @@ export interface Lag extends WindowOptions {
|
|
|
399
406
|
lag: Arg3Opt;
|
|
400
407
|
}
|
|
401
408
|
|
|
402
|
-
|
|
409
|
+
/** A lead window transform. */
|
|
403
410
|
export interface Lead extends WindowOptions {
|
|
404
411
|
/**
|
|
405
412
|
* Compute leading values in a column. Returns the value at the row that is
|
|
@@ -411,7 +418,7 @@ export interface Lead extends WindowOptions {
|
|
|
411
418
|
lag: Arg3Opt;
|
|
412
419
|
}
|
|
413
420
|
|
|
414
|
-
|
|
421
|
+
/** A first_value window transform. */
|
|
415
422
|
export interface FirstValue extends WindowOptions {
|
|
416
423
|
/**
|
|
417
424
|
* Get the first value of the given column in the current window frame.
|
|
@@ -419,7 +426,7 @@ export interface FirstValue extends WindowOptions {
|
|
|
419
426
|
first_value: Arg1;
|
|
420
427
|
}
|
|
421
428
|
|
|
422
|
-
|
|
429
|
+
/** A last_value window transform. */
|
|
423
430
|
export interface LastValue extends WindowOptions {
|
|
424
431
|
/**
|
|
425
432
|
* Get the last value of the given column in the current window frame.
|
|
@@ -427,7 +434,7 @@ export interface LastValue extends WindowOptions {
|
|
|
427
434
|
last_value: Arg1;
|
|
428
435
|
}
|
|
429
436
|
|
|
430
|
-
|
|
437
|
+
/** An nth_value window transform. */
|
|
431
438
|
export interface NthValue extends WindowOptions {
|
|
432
439
|
/**
|
|
433
440
|
* Get the nth value of the given column in the current window frame,
|
|
@@ -468,9 +475,10 @@ export type AggregateTransform =
|
|
|
468
475
|
| StddevPop
|
|
469
476
|
| Sum
|
|
470
477
|
| Variance
|
|
471
|
-
| VarPop
|
|
478
|
+
| VarPop
|
|
479
|
+
;
|
|
472
480
|
|
|
473
|
-
|
|
481
|
+
/** A window transform that operates over a sorted domain. */
|
|
474
482
|
export type WindowTransform =
|
|
475
483
|
| RowNumber
|
|
476
484
|
| Rank
|
|
@@ -483,10 +491,12 @@ export type WindowTransform =
|
|
|
483
491
|
| Lead
|
|
484
492
|
| FirstValue
|
|
485
493
|
| LastValue
|
|
486
|
-
| NthValue
|
|
494
|
+
| NthValue
|
|
495
|
+
;
|
|
487
496
|
|
|
488
497
|
/** A data transform. */
|
|
489
498
|
export type Transform =
|
|
490
499
|
| ColumnTransform
|
|
491
500
|
| AggregateTransform
|
|
492
|
-
| WindowTransform
|
|
501
|
+
| WindowTransform
|
|
502
|
+
;
|