@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
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ParamRef } from '../Param.js';
|
|
2
|
-
import { FrameAnchor } from '../PlotTypes.js';
|
|
3
|
-
import { ChannelValue, ChannelValueSpec, MarkData, MarkOptions } from './Marks.js';
|
|
4
|
-
/**
|
|
5
|
-
* The built-in vector shape implementations; one of:
|
|
6
|
-
*
|
|
7
|
-
* - *arrow* - a straight line with an open arrowhead at the end (↑)
|
|
8
|
-
* - *spike* - an isosceles triangle with a flat base (▲)
|
|
9
|
-
*/
|
|
10
|
-
export type VectorShapeName = 'arrow' | 'spike';
|
|
11
|
-
/** How to draw a vector: either a named shape or a custom implementation. */
|
|
12
|
-
export type VectorShape = VectorShapeName;
|
|
13
|
-
/** Options for the vector mark. */
|
|
14
|
-
export interface VectorOptions extends MarkOptions {
|
|
15
|
-
/**
|
|
16
|
-
* The horizontal position of the vector’s anchor point; an optional channel
|
|
17
|
-
* bound to the *x* scale. Default depends on the **frameAnchor**.
|
|
18
|
-
*/
|
|
19
|
-
x?: ChannelValueSpec;
|
|
20
|
-
/**
|
|
21
|
-
* The vertical position of the vector’s anchor point; an optional channel
|
|
22
|
-
* bound to the *y* scale. Default depends on the **frameAnchor**.
|
|
23
|
-
*/
|
|
24
|
-
y?: ChannelValueSpec;
|
|
25
|
-
/**
|
|
26
|
-
* The vector shape’s radius, such as half the width of the *arrow*’s head or
|
|
27
|
-
* the *spike*’s base; a constant number in pixels. Defaults to 3.5 pixels.
|
|
28
|
-
*/
|
|
29
|
-
r?: number | ParamRef;
|
|
30
|
-
/**
|
|
31
|
-
* The vector’s length; either an optional channel bound to the *length* scale
|
|
32
|
-
* or a constant number in pixels. Defaults to 12 pixels.
|
|
33
|
-
*/
|
|
34
|
-
length?: ChannelValueSpec;
|
|
35
|
-
/**
|
|
36
|
-
* The vector’s orientation (rotation angle); either a constant number in
|
|
37
|
-
* degrees clockwise, or an optional channel (with no associated scale).
|
|
38
|
-
* Defaults to 0 degrees with the vector pointing up.
|
|
39
|
-
*/
|
|
40
|
-
rotate?: ChannelValue;
|
|
41
|
-
/** The shape of the vector; a constant. Defaults to *arrow*. */
|
|
42
|
-
shape?: VectorShape | ParamRef;
|
|
43
|
-
/**
|
|
44
|
-
* The vector’s position along its orientation relative to its anchor point; a
|
|
45
|
-
* constant. Assuming a default **rotate** angle of 0°, one of:
|
|
46
|
-
*
|
|
47
|
-
* - *start* - from [*x*, *y*] to [*x*, *y* - *l*]
|
|
48
|
-
* - *middle* (default) - from [*x*, *y* + *l* / 2] to [*x*, *y* - *l* / 2]
|
|
49
|
-
* - *end* - from [*x*, *y* + *l*] to [*x*, *y*]
|
|
50
|
-
*
|
|
51
|
-
* where [*x*, *y*] is the vector’s anchor point and *l* is the vector’s
|
|
52
|
-
* (possibly scaled) length in pixels.
|
|
53
|
-
*/
|
|
54
|
-
anchor?: 'start' | 'middle' | 'end' | ParamRef;
|
|
55
|
-
/**
|
|
56
|
-
* The vector’s frame anchor, to default **x** and **y** relative to the
|
|
57
|
-
* frame; a constant representing one of the frame corners (*top-left*,
|
|
58
|
-
* *top-right*, *bottom-right*, *bottom-left*), sides (*top*, *right*,
|
|
59
|
-
* *bottom*, *left*), or *middle* (default). Has no effect if both **x**
|
|
60
|
-
* and **y** are specified.
|
|
61
|
-
*/
|
|
62
|
-
frameAnchor?: FrameAnchor | ParamRef;
|
|
63
|
-
}
|
|
64
|
-
/** The vector mark. */
|
|
65
|
-
export interface Vector extends MarkData, VectorOptions {
|
|
66
|
-
/**
|
|
67
|
-
* A vector mark.
|
|
68
|
-
*
|
|
69
|
-
* If none of **frameAnchor**, **x**, and **y** are specified, then **x** and
|
|
70
|
-
* **y** default to accessors assuming that *data* contains tuples [[*x₀*,
|
|
71
|
-
* *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …]
|
|
72
|
-
*/
|
|
73
|
-
mark: 'vector';
|
|
74
|
-
}
|
|
75
|
-
/** The vectorX mark. */
|
|
76
|
-
export interface VectorX extends MarkData, VectorOptions {
|
|
77
|
-
/**
|
|
78
|
-
* Like vector, but **x** instead defaults to the identity function and **y**
|
|
79
|
-
* defaults to null, assuming that *data* is an array of numbers [*x₀*, *x₁*,
|
|
80
|
-
* *x₂*, …].
|
|
81
|
-
*/
|
|
82
|
-
mark: 'vectorX';
|
|
83
|
-
}
|
|
84
|
-
/** The vectorY mark. */
|
|
85
|
-
export interface VectorY extends MarkData, VectorOptions {
|
|
86
|
-
/**
|
|
87
|
-
* Like vector, but **y** instead defaults to the identity function and **x**
|
|
88
|
-
* defaults to null, assuming that *data* is an array of numbers [*y₀*, *y₁*,
|
|
89
|
-
* *y₂*, …].
|
|
90
|
-
*/
|
|
91
|
-
mark: 'vectorY';
|
|
92
|
-
}
|
|
93
|
-
/** The spike mark. */
|
|
94
|
-
export interface Spike extends MarkData, VectorOptions {
|
|
95
|
-
/**
|
|
96
|
-
* Like vector, but with default *options* suitable for drawing a spike map.
|
|
97
|
-
*/
|
|
98
|
-
mark: 'spike';
|
|
99
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ParamRef } from '../Param.js';
|
|
2
|
-
import { BarXOptions, BarYOptions } from './Bar.js';
|
|
3
|
-
import { MarkData } from './Marks.js';
|
|
4
|
-
/** Options for the waffleX and waffleY mark. */
|
|
5
|
-
export interface WaffleOptions {
|
|
6
|
-
/** The number of cells per row or column; defaults to undefined for automatic. */
|
|
7
|
-
multiple?: number | ParamRef;
|
|
8
|
-
/** The quantity each cell represents; defaults to 1. */
|
|
9
|
-
unit?: number | ParamRef;
|
|
10
|
-
/** The gap in pixels between cells; defaults to 1. */
|
|
11
|
-
gap?: number | ParamRef;
|
|
12
|
-
/** If true, round to integers to avoid partial cells. */
|
|
13
|
-
round?: boolean | ParamRef;
|
|
14
|
-
}
|
|
15
|
-
/** The waffleX mark. */
|
|
16
|
-
export interface WaffleX extends MarkData, BarXOptions, WaffleOptions {
|
|
17
|
-
/**
|
|
18
|
-
* A horizontal waffle mark. The required *x* values should be quantitative,
|
|
19
|
-
* and the optional *y* values should be ordinal.
|
|
20
|
-
*
|
|
21
|
-
* If neither **x1** nor **x2** nor **interval** is specified, an implicit
|
|
22
|
-
* stackX transform is applied and **x** defaults to the identity function,
|
|
23
|
-
* assuming that *data* = [*x₀*, *x₁*, *x₂*, …]. Otherwise if an **interval**
|
|
24
|
-
* is specified, then **x1** and **x2** are derived from **x**, representing
|
|
25
|
-
* the lower and upper bound of the containing interval, respectively.
|
|
26
|
-
* Otherwise, if only one of **x1** or **x2** is specified, the other
|
|
27
|
-
* defaults to **x**, which defaults to zero.
|
|
28
|
-
*
|
|
29
|
-
* The optional **y** ordinal channel specifies the vertical position; it is
|
|
30
|
-
* typically bound to the *y* scale, which must be a *band* scale. If the
|
|
31
|
-
* **y** channel is not specified, the bar will span the vertical extent of
|
|
32
|
-
* the plot’s frame. Because a waffle represents a discrete number of square
|
|
33
|
-
* cells, it may not use all of the available bandwidth.
|
|
34
|
-
*/
|
|
35
|
-
mark: 'waffleX';
|
|
36
|
-
}
|
|
37
|
-
/** The waffleY mark. */
|
|
38
|
-
export interface WaffleY extends MarkData, BarYOptions, WaffleOptions {
|
|
39
|
-
/**
|
|
40
|
-
* A vertical waffle mark. The required *y* values should be quantitative,
|
|
41
|
-
* and the optional *x* values should be ordinal.
|
|
42
|
-
*
|
|
43
|
-
* If neither **y1** nor **y2** nor **interval** is specified, an implicit
|
|
44
|
-
* stackY transform is applied and **y** defaults to the identity function,
|
|
45
|
-
* assuming that *data* = [*y₀*, *y₁*, *y₂*, …]. Otherwise if an **interval**
|
|
46
|
-
* is specified, then **y1** and **y2** are derived from **y**, representing
|
|
47
|
-
* the lower and upper bound of the containing interval, respectively.
|
|
48
|
-
* Otherwise, if only one of **y1** or **y2** is specified, the other
|
|
49
|
-
* defaults to **y**, which defaults to zero.
|
|
50
|
-
*
|
|
51
|
-
* The optional **x** ordinal channel specifies the horizontal position; it
|
|
52
|
-
* is typically bound to the *x* scale, which must be a *band* scale. If the
|
|
53
|
-
* **x** channel is not specified, the bar will span the horizontal extent of
|
|
54
|
-
* the plot’s frame. Because a waffle represents a discrete number of square
|
|
55
|
-
* cells, it may not use all of the available bandwidth.
|
|
56
|
-
*/
|
|
57
|
-
mark: 'waffleY';
|
|
58
|
-
}
|
package/dist/types/util.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function paramRef(value: any): any;
|
|
2
|
-
export function paramStr(value: any): any;
|
|
3
|
-
export function toParamRef(name: any): string;
|
|
4
|
-
export function toArray(value: any): any[];
|
|
5
|
-
export function isArray(value: any): value is any[];
|
|
6
|
-
export function isObject(value: any): boolean;
|
|
7
|
-
export function isNumber(value: any): value is number;
|
|
8
|
-
export function isNumberOrString(value: any): boolean;
|
|
9
|
-
export function isString(value: any): value is string;
|
|
10
|
-
export function isFunction(value: any): boolean;
|
|
11
|
-
export function error(message: any, data: any): void;
|
|
12
|
-
export function isoparse(string: any, fallback: any): any;
|