@uwdata/mosaic-spec 0.16.1 → 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
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Abstract base class for Mosaic spec AST nodes.
|
|
3
|
-
*/
|
|
4
|
-
export class ASTNode {
|
|
5
|
-
constructor(type: any, children?: any);
|
|
6
|
-
/** @type {string} */
|
|
7
|
-
type: string;
|
|
8
|
-
/** @type {ASTNode[] | null} */
|
|
9
|
-
children: ASTNode[] | null;
|
|
10
|
-
/**
|
|
11
|
-
* Instantiate this AST node to use in a live web application.
|
|
12
|
-
* @param {import('../ast-to-dom.js').InstantiateContext} ctx The instantiation context.
|
|
13
|
-
* @returns {*} The instantiated value of this node.
|
|
14
|
-
*/
|
|
15
|
-
instantiate(ctx: import("../ast-to-dom.js").InstantiateContext): any;
|
|
16
|
-
/**
|
|
17
|
-
* Generate ESM code for this AST node.
|
|
18
|
-
* @param {import('../ast-to-esm.js').CodegenContext} ctx The code generator context.
|
|
19
|
-
* @returns {string|void} The generated ESM code for the node.
|
|
20
|
-
*/
|
|
21
|
-
codegen(ctx: import("../ast-to-esm.js").CodegenContext): string | void;
|
|
22
|
-
/**
|
|
23
|
-
* @returns {*} This AST node in JSON specification format.
|
|
24
|
-
*/
|
|
25
|
-
toJSON(): any;
|
|
26
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse a data definition spec.
|
|
3
|
-
* @param {string} name The name of the dataset
|
|
4
|
-
* @param {import('../spec/Data.js').DataDefinition} spec The data definition spec.
|
|
5
|
-
* @param {import('../parse-spec.js').ParseContext} ctx The parser context.
|
|
6
|
-
* @returns {DataNode} a parsed data definition AST node
|
|
7
|
-
*/
|
|
8
|
-
export function parseData(name: string, spec: import("../spec/Data.js").DataDefinition, ctx: import("../parse-spec.js").ParseContext): DataNode;
|
|
9
|
-
export const TABLE_DATA: "table";
|
|
10
|
-
export const PARQUET_DATA: "parquet";
|
|
11
|
-
export const CSV_DATA: "csv";
|
|
12
|
-
export const JSON_DATA: "json";
|
|
13
|
-
export const SPATIAL_DATA: "spatial";
|
|
14
|
-
export class DataNode extends ASTNode {
|
|
15
|
-
name: any;
|
|
16
|
-
format: any;
|
|
17
|
-
}
|
|
18
|
-
export class QueryDataNode extends DataNode {
|
|
19
|
-
/**
|
|
20
|
-
* Instantiate a table creation query.
|
|
21
|
-
* @param {import('../ast-to-dom.js').InstantiateContext} ctx The instantiation context.
|
|
22
|
-
* @returns {string|void} The instantiated query.
|
|
23
|
-
*/
|
|
24
|
-
instantiateQuery(ctx: import("../ast-to-dom.js").InstantiateContext): string | void;
|
|
25
|
-
/**
|
|
26
|
-
* Code generate a table creation query.
|
|
27
|
-
* @param {import('../ast-to-esm.js').CodegenContext} ctx The code generator context.
|
|
28
|
-
* @returns {string|void} The generated query code.
|
|
29
|
-
*/
|
|
30
|
-
codegenQuery(ctx: import("../ast-to-esm.js").CodegenContext): string | void;
|
|
31
|
-
}
|
|
32
|
-
export class TableDataNode extends QueryDataNode {
|
|
33
|
-
constructor(name: any, query: any, options: any);
|
|
34
|
-
query: any;
|
|
35
|
-
options: any;
|
|
36
|
-
}
|
|
37
|
-
export class FileDataNode extends QueryDataNode {
|
|
38
|
-
constructor(name: any, format: any, method: any, file: any, options: any);
|
|
39
|
-
file: any;
|
|
40
|
-
method: any;
|
|
41
|
-
options: any;
|
|
42
|
-
}
|
|
43
|
-
export class SpatialDataNode extends FileDataNode {
|
|
44
|
-
constructor(name: any, file: any, options: any);
|
|
45
|
-
}
|
|
46
|
-
export class ParquetDataNode extends FileDataNode {
|
|
47
|
-
constructor(name: any, file: any, options: any);
|
|
48
|
-
}
|
|
49
|
-
export class CSVDataNode extends FileDataNode {
|
|
50
|
-
constructor(name: any, file: any, options: any);
|
|
51
|
-
}
|
|
52
|
-
export class JSONDataNode extends FileDataNode {
|
|
53
|
-
constructor(name: any, file: any, options: any);
|
|
54
|
-
}
|
|
55
|
-
export class LiteralJSONDataNode extends QueryDataNode {
|
|
56
|
-
constructor(name: any, data: any, options: any);
|
|
57
|
-
data: any;
|
|
58
|
-
options: any;
|
|
59
|
-
}
|
|
60
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function parseExpression(spec: any, ctx: any): ExpressionNode;
|
|
2
|
-
export class ExpressionNode extends ASTNode {
|
|
3
|
-
constructor(value: any, spans: any, params: any);
|
|
4
|
-
value: any;
|
|
5
|
-
spans: any;
|
|
6
|
-
params: any;
|
|
7
|
-
instantiate(ctx: any): any;
|
|
8
|
-
codegen(ctx: any): string;
|
|
9
|
-
toJSON(): {
|
|
10
|
-
sql: any;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function parseHConcat(spec: any, ctx: any): HConcatNode;
|
|
2
|
-
export class HConcatNode extends ASTNode {
|
|
3
|
-
constructor(children: any);
|
|
4
|
-
instantiate(ctx: any): any;
|
|
5
|
-
codegen(ctx: any): string;
|
|
6
|
-
toJSON(): {
|
|
7
|
-
[x: string]: any[];
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function parseHSpace(spec: any): HSpaceNode;
|
|
2
|
-
export class HSpaceNode extends ASTNode {
|
|
3
|
-
constructor(value: any);
|
|
4
|
-
value: any;
|
|
5
|
-
instantiate(ctx: any): any;
|
|
6
|
-
codegen(ctx: any): string;
|
|
7
|
-
toJSON(): {
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function parseOptions(spec: any, ctx: any): OptionsNode;
|
|
2
|
-
export class OptionsNode extends ASTNode {
|
|
3
|
-
constructor(options: any);
|
|
4
|
-
options: any;
|
|
5
|
-
filter(predicate: any): OptionsNode;
|
|
6
|
-
instantiate(ctx: any): {};
|
|
7
|
-
codegen(ctx: any): string;
|
|
8
|
-
toJSON(): {};
|
|
9
|
-
}
|
|
10
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function parseParam(spec: any, ctx: any): import("./SelectionNode.js").SelectionNode | ParamNode;
|
|
2
|
-
export class ParamNode extends ASTNode {
|
|
3
|
-
value: any;
|
|
4
|
-
date: any;
|
|
5
|
-
instantiate(ctx: any): any;
|
|
6
|
-
codegen(ctx: any): string;
|
|
7
|
-
}
|
|
8
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function parseAttribute(key: any, value: any, ctx: any): PlotAttributeNode;
|
|
2
|
-
export class PlotAttributeNode extends ASTNode {
|
|
3
|
-
name: any;
|
|
4
|
-
value: any;
|
|
5
|
-
instantiate(ctx: any): any;
|
|
6
|
-
codegen(ctx: any): string;
|
|
7
|
-
toJSON(): {
|
|
8
|
-
[name]: any;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export class PlotFixedNode extends ASTNode {
|
|
12
|
-
constructor();
|
|
13
|
-
value: string;
|
|
14
|
-
instantiate(ctx: any): any;
|
|
15
|
-
codegen(ctx: any): string;
|
|
16
|
-
toJSON(): string;
|
|
17
|
-
}
|
|
18
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function parseMarkData(spec: any, ctx: any): LiteralNode | PlotFromNode;
|
|
2
|
-
export class PlotFromNode extends ASTNode {
|
|
3
|
-
table: any;
|
|
4
|
-
options: any;
|
|
5
|
-
instantiate(ctx: any): any;
|
|
6
|
-
codegen(ctx: any): string;
|
|
7
|
-
}
|
|
8
|
-
import { LiteralNode } from './LiteralNode.js';
|
|
9
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function parseLegend(spec: any, ctx: any): PlotLegendNode;
|
|
2
|
-
export class PlotLegendNode extends ASTNode {
|
|
3
|
-
constructor(key: any, name: any, options: any);
|
|
4
|
-
key: any;
|
|
5
|
-
name: any;
|
|
6
|
-
options: any;
|
|
7
|
-
instantiate(ctx: any): any;
|
|
8
|
-
codegen(ctx: any): string;
|
|
9
|
-
}
|
|
10
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function parseMark(spec: any, ctx: any): PlotMarkNode;
|
|
2
|
-
export class PlotMarkNode extends ASTNode {
|
|
3
|
-
constructor(name: any, data: any, options: any);
|
|
4
|
-
name: any;
|
|
5
|
-
data: any;
|
|
6
|
-
options: any;
|
|
7
|
-
instantiate(ctx: any): any;
|
|
8
|
-
codegen(ctx: any): string;
|
|
9
|
-
}
|
|
10
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function parseTopLevelMark(spec: any, ctx: any): PlotNode;
|
|
2
|
-
export function parsePlot(spec: any, ctx: any): PlotNode;
|
|
3
|
-
export class PlotNode extends ASTNode {
|
|
4
|
-
attributes: any;
|
|
5
|
-
instantiate(ctx: any): any;
|
|
6
|
-
codegen(ctx: any): string;
|
|
7
|
-
toJSON(): {
|
|
8
|
-
[x: string]: any[];
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export function parseSelection(spec: any, ctx: any): SelectionNode;
|
|
2
|
-
export class SelectionNode extends ASTNode {
|
|
3
|
-
/**
|
|
4
|
-
* Create a Selection AST node.
|
|
5
|
-
* @param {string} select The selection type.
|
|
6
|
-
* @param {OptionsNode} options Selection options.
|
|
7
|
-
*/
|
|
8
|
-
constructor(select?: string, options?: OptionsNode);
|
|
9
|
-
select: string;
|
|
10
|
-
options: OptionsNode;
|
|
11
|
-
instantiate(ctx: any): any;
|
|
12
|
-
codegen(ctx: any): string;
|
|
13
|
-
toJSON(): {
|
|
14
|
-
select: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export class IncludeNode extends ASTNode {
|
|
18
|
-
constructor(refs: any);
|
|
19
|
-
refs: any;
|
|
20
|
-
instantiate(ctx: any): any;
|
|
21
|
-
codegen(ctx: any): string;
|
|
22
|
-
}
|
|
23
|
-
import { ASTNode } from './ASTNode.js';
|
|
24
|
-
import { OptionsNode } from './OptionsNode.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export class SpecNode extends ASTNode {
|
|
2
|
-
constructor(root: any, meta: any, config: any, data: any, params: any, plotDefaults: any);
|
|
3
|
-
root: any;
|
|
4
|
-
meta: any;
|
|
5
|
-
config: any;
|
|
6
|
-
data: any;
|
|
7
|
-
params: any;
|
|
8
|
-
plotDefaults: any;
|
|
9
|
-
}
|
|
10
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function parseTransform(spec: any, ctx: any): BinTransformNode | TransformNode;
|
|
2
|
-
export class TransformNode extends ASTNode {
|
|
3
|
-
constructor(name: any, args: any, options: any);
|
|
4
|
-
name: any;
|
|
5
|
-
args: any;
|
|
6
|
-
options: any;
|
|
7
|
-
instantiate(ctx: any): any;
|
|
8
|
-
codegen(ctx: any): string;
|
|
9
|
-
toJSON(): {
|
|
10
|
-
[name]: any;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export class BinTransformNode extends ASTNode {
|
|
14
|
-
constructor(name: any, arg: any, options: any);
|
|
15
|
-
name: any;
|
|
16
|
-
arg: any;
|
|
17
|
-
options: any;
|
|
18
|
-
instantiate(ctx: any): any;
|
|
19
|
-
codegen(ctx: any): string;
|
|
20
|
-
}
|
|
21
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function parseVConcat(spec: any, ctx: any): VConcatNode;
|
|
2
|
-
export class VConcatNode extends ASTNode {
|
|
3
|
-
constructor(children: any);
|
|
4
|
-
instantiate(ctx: any): any;
|
|
5
|
-
codegen(ctx: any): string;
|
|
6
|
-
toJSON(): {
|
|
7
|
-
[x: string]: any[];
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function parseVSpace(spec: any): VSpaceNode;
|
|
2
|
-
export class VSpaceNode extends ASTNode {
|
|
3
|
-
constructor(value: any);
|
|
4
|
-
value: any;
|
|
5
|
-
instantiate(ctx: any): any;
|
|
6
|
-
codegen(ctx: any): string;
|
|
7
|
-
toJSON(): {
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
import { ASTNode } from './ASTNode.js';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate a running web application (DOM content) for a Mosaic spec AST.
|
|
3
|
-
* @param {SpecNode} ast Mosaic AST root node.
|
|
4
|
-
* @param {ConstructorParameters<typeof InstantiateContext>[0]} [options] Instantiation options.
|
|
5
|
-
* @returns {Promise<{
|
|
6
|
-
* element: HTMLElement | SVGSVGElement;
|
|
7
|
-
* params: Map<string, Param | Selection>;
|
|
8
|
-
* }>} A Promise to an object with the resulting
|
|
9
|
-
* DOM element, and a map of named parameters (Param and Selection instances).
|
|
10
|
-
*/
|
|
11
|
-
export function astToDOM(ast: SpecNode, options?: ConstructorParameters<typeof InstantiateContext>[0]): Promise<{
|
|
12
|
-
element: HTMLElement | SVGSVGElement;
|
|
13
|
-
params: Map<string, Param | Selection>;
|
|
14
|
-
}>;
|
|
15
|
-
export class InstantiateContext {
|
|
16
|
-
/**
|
|
17
|
-
* Create a new InstantiateContext instance.
|
|
18
|
-
* @param {object} options Optional instantiation options.
|
|
19
|
-
* @param {string} [options.baseURL] The base URL for loading data files.
|
|
20
|
-
* @param {any[]} [options.plotDefaults] Array of default plot attributes.
|
|
21
|
-
* @param {Map<string, Param>} [options.params] A map of predefined Params/Selections.
|
|
22
|
-
* @param {ReturnType<typeof createAPIContext>} [options.api] The context to be used for vgplot API methods.
|
|
23
|
-
*/
|
|
24
|
-
constructor({ api, plotDefaults, params, baseURL }?: {
|
|
25
|
-
baseURL?: string;
|
|
26
|
-
plotDefaults?: any[];
|
|
27
|
-
params?: Map<string, Param>;
|
|
28
|
-
api?: ReturnType<typeof createAPIContext>;
|
|
29
|
-
});
|
|
30
|
-
api: any;
|
|
31
|
-
plotDefaults: any[];
|
|
32
|
-
activeParams: Map<string, Param>;
|
|
33
|
-
baseURL: string;
|
|
34
|
-
coordinator: any;
|
|
35
|
-
error(message: any, data: any): void;
|
|
36
|
-
}
|
|
37
|
-
import type { SpecNode } from './ast/SpecNode.js';
|
|
38
|
-
import type { Param } from '@uwdata/mosaic-core';
|
|
39
|
-
import type { Selection } from '@uwdata/mosaic-core';
|
|
40
|
-
import { createAPIContext } from '@uwdata/vgplot';
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate ESM code for a Mosaic spec AST.
|
|
3
|
-
* @param {SpecNode} ast Mosaic AST root node.
|
|
4
|
-
* @param {object} [options] Code generation options.
|
|
5
|
-
* @param {string} [options.baseURL] The base URL for loading data files.
|
|
6
|
-
* @param {string} [options.connector] A database connector to initialize.
|
|
7
|
-
* Valid values are 'wasm', 'socket', and 'rest'.
|
|
8
|
-
* If undefined, no connector code is generated.
|
|
9
|
-
* @param {string} [options.namespace='vg'] The vgplot API namespace object.
|
|
10
|
-
* @param {number} [options.depth=0] The starting indentation depth.
|
|
11
|
-
* @param {Map<string,string|string[]>} [options.imports] A Map of ESM
|
|
12
|
-
* imports to include in generated code. Keys are packages (e.g.,
|
|
13
|
-
* '@uwdata/vgplot') and values indicate what to import (e.g., '* as vg').
|
|
14
|
-
* @param {string|string[]} [options.preamble] Code to include after imports.
|
|
15
|
-
* @returns {string} Generated ESM code using the vgplot API.
|
|
16
|
-
*/
|
|
17
|
-
export function astToESM(ast: SpecNode, options?: {
|
|
18
|
-
baseURL?: string;
|
|
19
|
-
connector?: string;
|
|
20
|
-
namespace?: string;
|
|
21
|
-
depth?: number;
|
|
22
|
-
imports?: Map<string, string | string[]>;
|
|
23
|
-
preamble?: string | string[];
|
|
24
|
-
}): string;
|
|
25
|
-
export class CodegenContext {
|
|
26
|
-
/**
|
|
27
|
-
* Create a new code generator context.
|
|
28
|
-
* @param {object} [options] Code generation options.
|
|
29
|
-
* @param {*} [options.plotDefaults] Default attributes to apply to all plots.
|
|
30
|
-
* @param {string} [options.baseURL] The base URL for loading data files.
|
|
31
|
-
* @param {string} [options.connector] A database connector to initialize.
|
|
32
|
-
* Valid values are 'wasm', 'socket', and 'rest'.
|
|
33
|
-
* If undefined, no connector code is generated.
|
|
34
|
-
* @param {string} [options.namespace='vg'] The vgplot API namespace object.
|
|
35
|
-
* @param {number} [options.depth=0] The starting indentation depth.
|
|
36
|
-
* @param {Map<string,string|string[]>} [options.imports] A Map of ESM
|
|
37
|
-
* imports to include in generated code. Keys are packages (e.g.,
|
|
38
|
-
* '@uwdata/vgplot') and values indicate what to import (e.g., '* as vg').
|
|
39
|
-
*/
|
|
40
|
-
constructor({ plotDefaults, namespace, connector, imports, baseURL, depth }?: {
|
|
41
|
-
plotDefaults?: any;
|
|
42
|
-
baseURL?: string;
|
|
43
|
-
connector?: string;
|
|
44
|
-
namespace?: string;
|
|
45
|
-
depth?: number;
|
|
46
|
-
imports?: Map<string, string | string[]>;
|
|
47
|
-
});
|
|
48
|
-
plotDefaults: any;
|
|
49
|
-
namespace: string;
|
|
50
|
-
connector: string;
|
|
51
|
-
imports: Map<string, string | string[]>;
|
|
52
|
-
baseURL: string;
|
|
53
|
-
depth: number;
|
|
54
|
-
addImport(pkg: any, method: any): void;
|
|
55
|
-
setImports(pkg: any, all: any): void;
|
|
56
|
-
ns(): string;
|
|
57
|
-
indent(): void;
|
|
58
|
-
undent(): void;
|
|
59
|
-
tab(): string;
|
|
60
|
-
stringify(value: any): any;
|
|
61
|
-
maybeLineWrap(spans: any): any;
|
|
62
|
-
error(message: any, data: any): void;
|
|
63
|
-
}
|
|
64
|
-
import type { SpecNode } from './ast/SpecNode.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Construct a set of database extensions to load.
|
|
3
|
-
* Automatically adds the spatial extension if a
|
|
4
|
-
* dataset with format "spatial" is loaded.
|
|
5
|
-
* @param {SpecNode} ast Mosaic AST root node.
|
|
6
|
-
* @returns {Set<string>} A set of extension names.
|
|
7
|
-
*/
|
|
8
|
-
export function resolveExtensions(ast: SpecNode): Set<string>;
|
|
9
|
-
import type { SpecNode } from '../ast/SpecNode.js';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate an object of lookup maps for vgplot components.
|
|
3
|
-
*/
|
|
4
|
-
export function plotNames({ attributes, interactors, legends, marks }?: {
|
|
5
|
-
attributes?: Set<string>;
|
|
6
|
-
interactors?: Set<string>;
|
|
7
|
-
legends?: Set<string>;
|
|
8
|
-
marks?: Set<string>;
|
|
9
|
-
}): {
|
|
10
|
-
attributes: Set<string>;
|
|
11
|
-
interactors: Set<string>;
|
|
12
|
-
legends: Set<string>;
|
|
13
|
-
marks: Set<string>;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Names of attribute directive functions.
|
|
17
|
-
* @returns {Set<string>}
|
|
18
|
-
*/
|
|
19
|
-
export function plotAttributeNames(overrides?: any[]): Set<string>;
|
|
20
|
-
/**
|
|
21
|
-
* Names interactor directive functions.
|
|
22
|
-
* @returns {Set<string>}
|
|
23
|
-
*/
|
|
24
|
-
export function plotInteractorNames(overrides?: any[]): Set<string>;
|
|
25
|
-
/**
|
|
26
|
-
* Names of legend directive functions.
|
|
27
|
-
* @returns {Set<string>}
|
|
28
|
-
*/
|
|
29
|
-
export function plotLegendNames(overrides?: any[]): Set<string>;
|
|
30
|
-
/**
|
|
31
|
-
* Names of mark directive functions.
|
|
32
|
-
* @returns {Set<string>}
|
|
33
|
-
*/
|
|
34
|
-
export function plotMarkNames(overrides?: any[]): Set<string>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export const SPEC: "spec";
|
|
2
|
-
export const LITERAL: "literal";
|
|
3
|
-
export const DATAREF: "dataref";
|
|
4
|
-
export const OPTIONS: "options";
|
|
5
|
-
export const SELECTION: "selection";
|
|
6
|
-
export const PARAMREF: "paramref";
|
|
7
|
-
export const COLUMPARAMREF: "columnparamref";
|
|
8
|
-
export const PARAM: "param";
|
|
9
|
-
export const INCLUDE: "include";
|
|
10
|
-
export const SELECT: "select";
|
|
11
|
-
export const VALUE: "value";
|
|
12
|
-
export const CROSSFILTER: "crossfilter";
|
|
13
|
-
export const INTERSECT: "intersect";
|
|
14
|
-
export const UNION: "union";
|
|
15
|
-
export const SINGLE: "single";
|
|
16
|
-
export const DATA: "data";
|
|
17
|
-
export const EXPRESSION: "expression";
|
|
18
|
-
export const SQL: "sql";
|
|
19
|
-
export const INPUT: "input";
|
|
20
|
-
export const HCONCAT: "hconcat";
|
|
21
|
-
export const VCONCAT: "vconcat";
|
|
22
|
-
export const HSPACE: "hspace";
|
|
23
|
-
export const VSPACE: "vspace";
|
|
24
|
-
export const MARK: "mark";
|
|
25
|
-
export const FROM: "from";
|
|
26
|
-
export const PLOT: "plot";
|
|
27
|
-
export const LEGEND: "legend";
|
|
28
|
-
export const ATTRIBUTE: "attribute";
|
|
29
|
-
export const TRANSFORM: "transform";
|
|
30
|
-
export const INTERACTOR: "interactor";
|
|
31
|
-
export const FIXED: "Fixed";
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export { parseSpec } from "./parse-spec.js";
|
|
2
|
-
export * from "./constants.js";
|
|
3
|
-
export { ASTNode } from "./ast/ASTNode.js";
|
|
4
|
-
export { ExpressionNode } from "./ast/ExpressionNode.js";
|
|
5
|
-
export { HConcatNode } from "./ast/HConcatNode.js";
|
|
6
|
-
export { HSpaceNode } from "./ast/HSpaceNode.js";
|
|
7
|
-
export { InputNode } from "./ast/InputNode.js";
|
|
8
|
-
export { LiteralNode } from "./ast/LiteralNode.js";
|
|
9
|
-
export { OptionsNode } from "./ast/OptionsNode.js";
|
|
10
|
-
export { ParamNode } from "./ast/ParamNode.js";
|
|
11
|
-
export { ParamRefNode } from "./ast/ParamRefNode.js";
|
|
12
|
-
export { PlotFromNode } from "./ast/PlotFromNode.js";
|
|
13
|
-
export { PlotInteractorNode } from "./ast/PlotInteractorNode.js";
|
|
14
|
-
export { PlotLegendNode } from "./ast/PlotLegendNode.js";
|
|
15
|
-
export { PlotMarkNode } from "./ast/PlotMarkNode.js";
|
|
16
|
-
export { PlotNode } from "./ast/PlotNode.js";
|
|
17
|
-
export { SelectionNode } from "./ast/SelectionNode.js";
|
|
18
|
-
export { SpecNode } from "./ast/SpecNode.js";
|
|
19
|
-
export { TransformNode } from "./ast/TransformNode.js";
|
|
20
|
-
export { VConcatNode } from "./ast/VConcatNode.js";
|
|
21
|
-
export { VSpaceNode } from "./ast/VSpaceNode.js";
|
|
22
|
-
/**
|
|
23
|
-
* A Mosaic declarative specification.
|
|
24
|
-
*/
|
|
25
|
-
export type Spec = import("./spec/Spec.js").Spec;
|
|
26
|
-
export { astToDOM, InstantiateContext } from "./ast-to-dom.js";
|
|
27
|
-
export { astToESM, CodegenContext } from "./ast-to-esm.js";
|
|
28
|
-
export { DataNode, QueryDataNode, TableDataNode, FileDataNode, CSVDataNode, JSONDataNode, ParquetDataNode, SpatialDataNode, LiteralJSONDataNode } from "./ast/DataNode.js";
|
|
29
|
-
export { PlotAttributeNode, PlotFixedNode } from "./ast/PlotAttributeNode.js";
|