@uwdata/mosaic-spec 0.7.1 → 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.
Files changed (154) hide show
  1. package/dist/mosaic-schema.json +186153 -0
  2. package/dist/mosaic-spec.js +2977 -4237
  3. package/dist/mosaic-spec.min.js +23 -23
  4. package/dist/types/ast/ASTNode.d.ts +26 -0
  5. package/dist/types/ast/DataNode.d.ts +60 -0
  6. package/dist/types/ast/ExpressionNode.d.ts +15 -0
  7. package/dist/types/ast/HConcatNode.d.ts +10 -0
  8. package/dist/types/ast/HSpaceNode.d.ts +11 -0
  9. package/dist/types/ast/InputNode.d.ts +8 -0
  10. package/dist/types/ast/LiteralNode.d.ts +7 -0
  11. package/dist/types/ast/OptionsNode.d.ts +10 -0
  12. package/dist/types/ast/ParamNode.d.ts +9 -0
  13. package/dist/types/ast/ParamRefNode.d.ts +8 -0
  14. package/dist/types/ast/PlotAttributeNode.d.ts +18 -0
  15. package/dist/types/ast/PlotFromNode.d.ts +9 -0
  16. package/dist/types/ast/PlotInteractorNode.d.ts +8 -0
  17. package/dist/types/ast/PlotLegendNode.d.ts +10 -0
  18. package/dist/types/ast/PlotMarkNode.d.ts +10 -0
  19. package/dist/types/ast/PlotNode.d.ts +11 -0
  20. package/dist/types/ast/SelectionNode.d.ts +12 -0
  21. package/dist/types/ast/SpecNode.d.ts +10 -0
  22. package/dist/types/ast/TransformNode.d.ts +13 -0
  23. package/dist/types/ast/VConcatNode.d.ts +10 -0
  24. package/dist/types/ast/VSpaceNode.d.ts +11 -0
  25. package/dist/types/ast-to-dom.d.ts +38 -0
  26. package/dist/types/ast-to-esm.d.ts +64 -0
  27. package/dist/types/config/components.d.ts +4 -0
  28. package/dist/types/config/extensions.d.ts +9 -0
  29. package/dist/types/config/inputs.d.ts +5 -0
  30. package/dist/types/config/plots.d.ts +34 -0
  31. package/dist/types/config/transforms.d.ts +4 -0
  32. package/dist/types/constants.d.ts +30 -0
  33. package/dist/types/index.d.ts +29 -0
  34. package/dist/types/parse-spec.d.ts +86 -0
  35. package/dist/types/spec/CSSStyles.d.ts +3 -0
  36. package/dist/types/spec/Data.d.ts +165 -0
  37. package/dist/types/spec/Expression.d.ts +27 -0
  38. package/dist/types/spec/HConcat.d.ts +8 -0
  39. package/dist/types/spec/HSpace.d.ts +9 -0
  40. package/dist/types/spec/Input.d.ts +182 -0
  41. package/dist/types/spec/Param.d.ts +51 -0
  42. package/dist/types/spec/Plot.d.ts +14 -0
  43. package/dist/types/spec/PlotAttribute.d.ts +1522 -0
  44. package/dist/types/spec/PlotFrom.d.ts +20 -0
  45. package/dist/types/spec/PlotInteractor.d.ts +8 -0
  46. package/dist/types/spec/PlotLegend.d.ts +68 -0
  47. package/dist/types/spec/PlotMark.d.ts +26 -0
  48. package/dist/types/spec/PlotTypes.d.ts +293 -0
  49. package/dist/types/spec/Spec.d.ts +45 -0
  50. package/dist/types/spec/Transform.d.ts +278 -0
  51. package/dist/types/spec/VConcat.d.ts +8 -0
  52. package/dist/types/spec/VSpace.d.ts +9 -0
  53. package/dist/types/spec/interactors/Highlight.d.ts +37 -0
  54. package/dist/types/spec/interactors/Interval1D.d.ts +63 -0
  55. package/dist/types/spec/interactors/Interval2D.d.ts +46 -0
  56. package/dist/types/spec/interactors/Nearest.d.ts +25 -0
  57. package/dist/types/spec/interactors/PanZoom.d.ts +58 -0
  58. package/dist/types/spec/interactors/Toggle.d.ts +51 -0
  59. package/dist/types/spec/marks/Area.d.ts +139 -0
  60. package/dist/types/spec/marks/Arrow.d.ts +94 -0
  61. package/dist/types/spec/marks/Axis.d.ts +281 -0
  62. package/dist/types/spec/marks/Bar.d.ts +150 -0
  63. package/dist/types/spec/marks/Cell.d.ts +57 -0
  64. package/dist/types/spec/marks/Contour.d.ts +23 -0
  65. package/dist/types/spec/marks/Delaunay.d.ts +86 -0
  66. package/dist/types/spec/marks/DenseLine.d.ts +27 -0
  67. package/dist/types/spec/marks/Density.d.ts +121 -0
  68. package/dist/types/spec/marks/Dot.d.ts +129 -0
  69. package/dist/types/spec/marks/Frame.d.ts +21 -0
  70. package/dist/types/spec/marks/Geo.d.ts +53 -0
  71. package/dist/types/spec/marks/Hexbin.d.ts +30 -0
  72. package/dist/types/spec/marks/Hexgrid.d.ts +25 -0
  73. package/dist/types/spec/marks/Image.d.ts +89 -0
  74. package/dist/types/spec/marks/Line.d.ts +82 -0
  75. package/dist/types/spec/marks/Link.d.ts +60 -0
  76. package/dist/types/spec/marks/Marks.d.ts +890 -0
  77. package/dist/types/spec/marks/Raster.d.ts +124 -0
  78. package/dist/types/spec/marks/Rect.d.ts +166 -0
  79. package/dist/types/spec/marks/Regression.d.ts +58 -0
  80. package/dist/types/spec/marks/Rule.d.ts +100 -0
  81. package/dist/types/spec/marks/Text.d.ts +106 -0
  82. package/dist/types/spec/marks/Tick.d.ts +61 -0
  83. package/dist/types/spec/marks/Vector.d.ts +99 -0
  84. package/dist/types/util.d.ts +12 -0
  85. package/jsconfig.json +10 -0
  86. package/package.json +16 -9
  87. package/src/ast/ASTNode.js +23 -2
  88. package/src/ast/DataNode.js +79 -21
  89. package/src/ast/HSpaceNode.js +1 -1
  90. package/src/ast/InputNode.js +1 -2
  91. package/src/ast/ParamNode.js +1 -2
  92. package/src/ast/PlotAttributeNode.js +1 -2
  93. package/src/ast/PlotInteractorNode.js +1 -2
  94. package/src/ast/PlotLegendNode.js +1 -2
  95. package/src/ast/PlotMarkNode.js +3 -2
  96. package/src/ast/TransformNode.js +1 -2
  97. package/src/ast/VSpaceNode.js +1 -1
  98. package/src/ast-to-dom.js +9 -3
  99. package/src/ast-to-esm.js +41 -12
  100. package/src/config/inputs.js +1 -0
  101. package/src/config/plots.js +4 -0
  102. package/src/index.js +4 -0
  103. package/src/parse-spec.js +38 -5
  104. package/src/spec/CSSStyles.ts +9 -0
  105. package/src/spec/Data.ts +184 -0
  106. package/src/spec/Expression.ts +31 -0
  107. package/src/spec/HConcat.ts +9 -0
  108. package/src/spec/HSpace.ts +9 -0
  109. package/src/spec/Input.ts +182 -0
  110. package/src/spec/Param.ts +68 -0
  111. package/src/spec/Plot.ts +15 -0
  112. package/src/spec/PlotAttribute.ts +1783 -0
  113. package/src/spec/PlotFrom.ts +23 -0
  114. package/src/spec/PlotInteractor.ts +25 -0
  115. package/src/spec/PlotLegend.ts +70 -0
  116. package/src/spec/PlotMark.ts +51 -0
  117. package/src/spec/PlotTypes.ts +519 -0
  118. package/src/spec/Spec.ts +63 -0
  119. package/src/spec/Transform.ts +394 -0
  120. package/src/spec/VConcat.ts +9 -0
  121. package/src/spec/VSpace.ts +9 -0
  122. package/src/spec/interactors/Highlight.ts +38 -0
  123. package/src/spec/interactors/Interval1D.ts +67 -0
  124. package/src/spec/interactors/Interval2D.ts +48 -0
  125. package/src/spec/interactors/Nearest.ts +28 -0
  126. package/src/spec/interactors/PanZoom.ts +65 -0
  127. package/src/spec/interactors/Toggle.ts +56 -0
  128. package/src/spec/marks/Area.ts +154 -0
  129. package/src/spec/marks/Arrow.ts +108 -0
  130. package/src/spec/marks/Axis.ts +305 -0
  131. package/src/spec/marks/Bar.ts +160 -0
  132. package/src/spec/marks/Cell.ts +62 -0
  133. package/src/spec/marks/Contour.ts +25 -0
  134. package/src/spec/marks/Delaunay.ts +95 -0
  135. package/src/spec/marks/DenseLine.ts +30 -0
  136. package/src/spec/marks/Density.ts +145 -0
  137. package/src/spec/marks/Dot.ts +147 -0
  138. package/src/spec/marks/Frame.ts +23 -0
  139. package/src/spec/marks/Geo.ts +58 -0
  140. package/src/spec/marks/Hexbin.ts +34 -0
  141. package/src/spec/marks/Hexgrid.ts +27 -0
  142. package/src/spec/marks/Image.ts +101 -0
  143. package/src/spec/marks/Line.ts +93 -0
  144. package/src/spec/marks/Link.ts +70 -0
  145. package/src/spec/marks/Marks.ts +1062 -0
  146. package/src/spec/marks/Raster.ts +145 -0
  147. package/src/spec/marks/Rect.ts +183 -0
  148. package/src/spec/marks/Regression.ts +63 -0
  149. package/src/spec/marks/Rule.ts +113 -0
  150. package/src/spec/marks/Text.ts +122 -0
  151. package/src/spec/marks/Tick.ts +69 -0
  152. package/src/spec/marks/Vector.ts +113 -0
  153. package/src/util.js +8 -0
  154. package/tsconfig.json +11 -0
@@ -0,0 +1,20 @@
1
+ import { ParamRef } from './Param.js';
2
+ /**
3
+ * An array of inline data values to visualize. As this data does not come
4
+ * from a database, it can not be filtered by interactive selections.
5
+ */
6
+ export type PlotDataInline = any[];
7
+ /** Input data specification for a plot mark. */
8
+ export interface PlotFrom {
9
+ /** The name of the backing data table. */
10
+ from: string;
11
+ /** A selection that filters the mark data. */
12
+ filterBy?: ParamRef;
13
+ /**
14
+ * A flag (default `true`) to enable any mark-specific query optimizations.
15
+ * If `false`, optimizations are disabled to aid testing and debugging.
16
+ */
17
+ optimize?: boolean;
18
+ }
19
+ /** Input data for a marks */
20
+ export type PlotMarkData = PlotDataInline | PlotFrom;
@@ -0,0 +1,8 @@
1
+ import { Highlight } from './interactors/Highlight.js';
2
+ import { IntervalX, IntervalY } from './interactors/Interval1D.js';
3
+ import { IntervalXY } from './interactors/Interval2D.js';
4
+ import { NearestX, NearestY } from './interactors/Nearest.js';
5
+ import { Pan, PanX, PanY, PanZoom, PanZoomX, PanZoomY } from './interactors/PanZoom.js';
6
+ import { Toggle, ToggleColor, ToggleX, ToggleY } from './interactors/Toggle.js';
7
+ /** A plot interactor entry. */
8
+ export type PlotInteractor = Highlight | IntervalX | IntervalY | IntervalXY | NearestX | NearestY | Toggle | ToggleX | ToggleY | ToggleColor | Pan | PanX | PanY | PanZoom | PanZoomX | PanZoomY;
@@ -0,0 +1,68 @@
1
+ import { ParamRef } from './Param.js';
2
+ /**
3
+ * A legend defined as an entry within a plot.
4
+ */
5
+ export interface PlotLegend {
6
+ /**
7
+ * A legend of the given type.
8
+ * The valid types are `"color"`, `"opacity"`, and `"symbol"`.
9
+ */
10
+ legend: 'color' | 'opacity' | 'symbol';
11
+ /**
12
+ * The output selection. If specified, the legend is interactive, using a
13
+ * `toggle` interaction for discrete legends or an `intervalX` interaction
14
+ * for continuous legends.
15
+ */
16
+ as?: ParamRef;
17
+ /**
18
+ * The data field over which to generate output selection clauses. If
19
+ * unspecified, a matching field is retrieved from existing plot marks.
20
+ */
21
+ field?: string;
22
+ /**
23
+ * The legend label.
24
+ */
25
+ label?: string;
26
+ /**
27
+ * The size of legend ticks in a continuous legend, in pixels.
28
+ */
29
+ tickSize?: number;
30
+ /**
31
+ * The top margin of the legend component, in pixels.
32
+ */
33
+ marginTop?: number;
34
+ /**
35
+ * The right margin of the legend component, in pixels.
36
+ */
37
+ marginRight?: number;
38
+ /**
39
+ * The bottom margin of the legend component, in pixels.
40
+ */
41
+ marginBottom?: number;
42
+ /**
43
+ * The left margin of the legend component, in pixels.
44
+ */
45
+ marginLeft?: number;
46
+ /**
47
+ * The width of a continuous legend, in pixels.
48
+ */
49
+ width?: number;
50
+ /**
51
+ * The height of a continuous legend, in pixels.
52
+ */
53
+ height?: number;
54
+ /**
55
+ * The number of columns to use to layout a discrete legend.
56
+ */
57
+ columns?: number;
58
+ }
59
+ /**
60
+ * A legend defined as a top-level spec component.
61
+ */
62
+ export interface Legend extends PlotLegend {
63
+ /**
64
+ * The name of the plot this legend applies to.
65
+ * A plot must include a `name` attribute to be referenced.
66
+ */
67
+ for: string;
68
+ }
@@ -0,0 +1,26 @@
1
+ import { Area, AreaX, AreaY } from './marks/Area.js';
2
+ import { Arrow } from './marks/Arrow.js';
3
+ import { AxisFx, AxisFy, AxisX, AxisY, GridFx, GridFy, GridX, GridY } from './marks/Axis.js';
4
+ import { BarX, BarY } from './marks/Bar.js';
5
+ import { Cell, CellX, CellY } from './marks/Cell.js';
6
+ import { Contour } from './marks/Contour.js';
7
+ import { DelaunayLink, DelaunayMesh, Hull, Voronoi, VoronoiMesh } from './marks/Delaunay.js';
8
+ import { DenseLine } from './marks/DenseLine.js';
9
+ import { Density, DensityX, DensityY } from './marks/Density.js';
10
+ import { Circle, Dot, DotX, DotY, Hexagon } from './marks/Dot.js';
11
+ import { Frame } from './marks/Frame.js';
12
+ import { Geo, Graticule, Sphere } from './marks/Geo.js';
13
+ import { Hexbin } from './marks/Hexbin.js';
14
+ import { Hexgrid } from './marks/Hexgrid.js';
15
+ import { Image } from './marks/Image.js';
16
+ import { Line, LineX, LineY } from './marks/Line.js';
17
+ import { Link } from './marks/Link.js';
18
+ import { Heatmap, Raster, RasterTile } from './marks/Raster.js';
19
+ import { Rect, RectX, RectY } from './marks/Rect.js';
20
+ import { RegressionY } from './marks/Regression.js';
21
+ import { RuleX, RuleY } from './marks/Rule.js';
22
+ import { Text, TextX, TextY } from './marks/Text.js';
23
+ import { TickX, TickY } from './marks/Tick.js';
24
+ import { Spike, Vector, VectorX, VectorY } from './marks/Vector.js';
25
+ /** A plot mark entry. */
26
+ export type PlotMark = Area | AreaX | AreaY | Arrow | AxisX | AxisY | AxisFx | AxisFy | GridX | GridY | GridFx | GridFy | BarX | BarY | Cell | CellX | CellY | Contour | DelaunayLink | DelaunayMesh | Hull | Voronoi | VoronoiMesh | DenseLine | Density | DensityX | DensityY | Dot | DotX | DotY | Circle | Hexagon | Frame | Geo | Graticule | Sphere | Hexbin | Hexgrid | Image | Line | LineX | LineY | Link | Raster | Heatmap | RasterTile | Rect | RectX | RectY | RegressionY | RuleX | RuleY | Text | TextX | TextY | TickX | TickY | Vector | VectorX | VectorY | Spike;
@@ -0,0 +1,293 @@
1
+ /**
2
+ * A symbol indicating a fixed scale domain. A fixed domain is initially
3
+ * determined from data as usual, but subsequently "fixed" so that it does not
4
+ * change over subsequent interactive filtering, ensring stable comparisons.
5
+ */
6
+ export type Fixed = 'Fixed';
7
+ export type LiteralTimeInterval = '3 months' | '10 years' | TimeIntervalName | (`${TimeIntervalName}s` & Record<never, never>) | (`${number} ${TimeIntervalName}` & Record<never, never>) | (`${number} ${TimeIntervalName}s` & Record<never, never>);
8
+ /**
9
+ * The built-in time intervals; UTC or local time, depending on context. The
10
+ * *week* interval is an alias for *sunday*. The *quarter* interval is every
11
+ * three months, and the *half* interval is every six months, aligned at the
12
+ * start of the year.
13
+ */
14
+ export type TimeIntervalName = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'half' | 'year' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
15
+ /**
16
+ * How to partition a continuous range into discrete intervals; one of:
17
+ *
18
+ * - a named time interval such as *day* (for date intervals)
19
+ * - a number (for number intervals), defining intervals at integer multiples of *n*
20
+ */
21
+ export type Interval<T = any> = T extends Date ? LiteralTimeInterval : T extends number ? number : never;
22
+ /**
23
+ * The built-in scale names; one of:
24
+ *
25
+ * - *x* - horizontal position
26
+ * - *y* - vertical position
27
+ * - *fx* - horizontal facet position
28
+ * - *fy* - vertical facet position
29
+ * - *r* - radius (for dots and point geos)
30
+ * - *color* - color
31
+ * - *opacity* - opacity
32
+ * - *symbol* - categorical symbol (for dots)
33
+ * - *length* - length (for vectors)
34
+ *
35
+ * Position scales may have associated axes. Color, opacity, and symbol scales
36
+ * may have an associated legend.
37
+ */
38
+ export type ScaleName = 'x' | 'y' | 'fx' | 'fy' | 'r' | 'color' | 'opacity' | 'symbol' | 'length';
39
+ /**
40
+ * The supported scale types for *x* and *y* position encodings.
41
+ *
42
+ * For quantitative data, one of:
43
+ *
44
+ * - *linear* (default) - linear transform (translate and scale)
45
+ * - *pow* - power (exponential) transform
46
+ * - *sqrt* - square-root transform; *pow* with *exponent* = 0.5
47
+ * - *log* - logarithmic transform
48
+ * - *symlog* - bi-symmetric logarithmic transform per Webber et al.
49
+ *
50
+ * For temporal data, one of:
51
+ *
52
+ * - *utc* (default, recommended) - UTC time
53
+ * - *time* - local time
54
+ *
55
+ * For ordinal data, one of:
56
+ *
57
+ * - *point* (for position only) - divide a continuous range into discrete points
58
+ * - *band* (for position only) - divide a continuous range into discrete points
59
+ *
60
+ * Other scale types:
61
+ *
62
+ * - *identity* - do not transform values when encoding
63
+ */
64
+ export type PositionScaleType = 'linear' | 'pow' | 'sqrt' | 'log' | 'symlog' | 'utc' | 'time' | 'point' | 'band' | 'threshold' | 'quantile' | 'quantize' | 'identity';
65
+ /**
66
+ * The supported scale types for *color* encodings.
67
+ *
68
+ * For quantitative data, one of:
69
+ *
70
+ * - *linear* (default) - linear transform (translate and scale)
71
+ * - *pow* - power (exponential) transform
72
+ * - *sqrt* - square-root transform; *pow* with *exponent* = 0.5
73
+ * - *log* - logarithmic transform
74
+ * - *symlog* - bi-symmetric logarithmic transform per Webber et al.
75
+ *
76
+ * For temporal data, one of:
77
+ *
78
+ * - *utc* (default, recommended) - UTC time
79
+ * - *time* - local time
80
+ *
81
+ * For ordinal data, one of:
82
+ *
83
+ * - *ordinal* - from discrete inputs to discrete outputs
84
+ *
85
+ * For color, one of:
86
+ *
87
+ * - *categorical* - equivalent to *ordinal*; defaults to *observable10*
88
+ * - *sequential* - equivalent to *linear*; defaults to *turbo*
89
+ * - *cyclical* - equivalent to *linear*; defaults to *rainbow*
90
+ * - *threshold* - encodes using discrete thresholds; defaults to *rdylbu*
91
+ * - *quantile* - encodes using quantile thresholds; defaults to *rdylbu*
92
+ * - *quantize* - uniformly quantizes a continuous domain; defaults to *rdylbu*
93
+ * - *diverging* - *linear*, but with a pivot; defaults to *rdbu*
94
+ * - *diverging-log* - *log*, but with a pivot; defaults to *rdbu*
95
+ * - *diverging-pow* - *pow*, but with a pivot; defaults to *rdbu*
96
+ * - *diverging-sqrt* - *sqrt*, but with a pivot; defaults to *rdbu*
97
+ * - *diverging-symlog* - *symlog*, but with a pivot; defaults to *rdbu*
98
+ *
99
+ * Other scale types:
100
+ *
101
+ * - *identity* - do not transform values when encoding
102
+ */
103
+ export type ColorScaleType = 'linear' | 'pow' | 'sqrt' | 'log' | 'symlog' | 'utc' | 'time' | 'point' | 'band' | 'ordinal' | 'sequential' | 'cyclical' | 'diverging' | 'diverging-log' | 'diverging-pow' | 'diverging-sqrt' | 'diverging-symlog' | 'categorical' | 'threshold' | 'quantile' | 'quantize' | 'identity';
104
+ /**
105
+ * The supported scale types for continuous encoding channels.
106
+ *
107
+ * For quantitative data, one of:
108
+ *
109
+ * - *linear* (default) - linear transform (translate and scale)
110
+ * - *pow* - power (exponential) transform
111
+ * - *sqrt* - square-root transform; *pow* with *exponent* = 0.5
112
+ * - *log* - logarithmic transform
113
+ * - *symlog* - bi-symmetric logarithmic transform per Webber et al.
114
+ *
115
+ * For temporal data, one of:
116
+ *
117
+ * - *utc* (default, recommended) - UTC time
118
+ * - *time* - local time
119
+ *
120
+ * Other scale types:
121
+ *
122
+ * - *identity* - do not transform values when encoding
123
+ */
124
+ export type ContinuousScaleType = 'linear' | 'pow' | 'sqrt' | 'log' | 'symlog' | 'utc' | 'time' | 'identity';
125
+ /**
126
+ * The supported scale types for discrete encoding channels. One of:
127
+ *
128
+ * - *ordinal* - from discrete inputs to discrete outputs
129
+ * - *identity* - do not transform values when encoding
130
+ */
131
+ export type DiscreteScaleType = 'ordinal' | 'identity';
132
+ /**
133
+ * The built-in projection implementations; one of:
134
+ *
135
+ * - *albers-usa* - a U.S.-centric composite projection with insets for Alaska and Hawaii
136
+ * - *albers* - a U.S.-centric *conic-equal-area* projection
137
+ * - *azimuthal-equal-area* - the azimuthal equal-area projection
138
+ * - *azimuthal-equidistant* - the azimuthal equidistant projection
139
+ * - *conic-conformal* - the conic conformal projection
140
+ * - *conic-equal-area* - the conic equal-area projection
141
+ * - *conic-equidistant* - the conic equidistant projection
142
+ * - *equal-earth* - the Equal Earth projection Šavrič et al., 2018
143
+ * - *equirectangular* - the equirectangular (plate carrée) projection
144
+ * - *gnomonic* - the gnomonic projection
145
+ * - *identity* - the identity projection
146
+ * - *reflect-y* - the identity projection, but flipping *y*
147
+ * - *mercator* - the spherical Mercator projection
148
+ * - *orthographic* - the orthographic projection
149
+ * - *stereographic* - the stereographic projection
150
+ * - *transverse-mercator* - the transverse spherical Mercator projection
151
+ */
152
+ export type ProjectionName = 'albers-usa' | 'albers' | 'azimuthal-equal-area' | 'azimuthal-equidistant' | 'conic-conformal' | 'conic-equal-area' | 'conic-equidistant' | 'equal-earth' | 'equirectangular' | 'gnomonic' | 'identity' | 'reflect-y' | 'mercator' | 'orthographic' | 'stereographic' | 'transverse-mercator';
153
+ /**
154
+ * How to interpolate range (output) values for continuous scales; one of:
155
+ *
156
+ * - *number* - linear numeric interpolation
157
+ * - *rgb* - red, green, blue (sRGB)
158
+ * - *hsl* - hue, saturation, lightness (HSL; cylindrical sRGB)
159
+ * - *hcl* - hue, chroma, perceptual lightness (CIELCh_ab; cylindrical CIELAB)
160
+ * - *lab* - perceptual lightness and opponent colors (L\*a\*b\*, CIELAB)
161
+ */
162
+ export type Interpolate = 'number' | 'rgb' | 'hsl' | 'hcl' | 'lab';
163
+ /** The built-in color schemes, cased. */
164
+ type ColorSchemeCase = 'Accent' | 'Category10' | 'Dark2' | 'Observable10' | 'Paired' | 'Pastel1' | 'Pastel2' | 'Set1' | 'Set2' | 'Set3' | 'Tableau10' | 'BrBG' | 'PRGn' | 'PiYG' | 'PuOr' | 'RdBu' | 'RdGy' | 'RdYlBu' | 'RdYlGn' | 'Spectral' | 'BuRd' | 'BuYlRd' | 'Blues' | 'Greens' | 'Greys' | 'Oranges' | 'Purples' | 'Reds' | 'Turbo' | 'Viridis' | 'Magma' | 'Inferno' | 'Plasma' | 'Cividis' | 'Cubehelix' | 'Warm' | 'Cool' | 'BuGn' | 'BuPu' | 'GnBu' | 'OrRd' | 'PuBu' | 'PuBuGn' | 'PuRd' | 'RdPu' | 'YlGn' | 'YlGnBu' | 'YlOrBr' | 'YlOrRd' | 'Rainbow' | 'Sinebow';
165
+ /**
166
+ * The built-in color schemes. For categorical data, one of:
167
+ *
168
+ * - *Accent* - eight colors
169
+ * - *Category10* - ten colors
170
+ * - *Dark2* - eight colors
171
+ * - *Observable10* (default) - ten colors
172
+ * - *Paired* - twelve paired colors
173
+ * - *Pastel1* - nine colors
174
+ * - *Pastel2* - eight colors
175
+ * - *Set1* - nine colors
176
+ * - *Set2* - eight colors
177
+ * - *Set3* - twelve colors
178
+ * - *Tableau10* - ten colors
179
+ *
180
+ * For diverging data, one of:
181
+ *
182
+ * - *BrBG* - from brown to white to blue-green
183
+ * - *PRGn* - from purple to white to green
184
+ * - *PiYG* - from pink to white to yellow-green
185
+ * - *PuOr* - from purple to white to orange
186
+ * - *RdBu* (default) - from red to white to blue
187
+ * - *RdGy* - from red to white to gray
188
+ * - *RdYlBu* - from red to yellow to blue
189
+ * - *RdYlGn* - from red to yellow to green
190
+ * - *Spectral* - from red to blue, through the spectrum
191
+ * - *BuRd* - from blue to white to red
192
+ * - *BuYlRd* - from blue to yellow to red
193
+ *
194
+ * For sequential data, one of:
195
+ *
196
+ * - *Blues* - from white to blue
197
+ * - *Greens* - from white to green
198
+ * - *Greys* - from white to gray
199
+ * - *Oranges* - from white to orange
200
+ * - *Purples* - from white to purple
201
+ * - *Reds* - from white to red
202
+ * - *Turbo* (default) - from blue to red, through the spectrum
203
+ * - *Viridis* - from blue to green to yellow
204
+ * - *Magma* - from purple to orange to yellow
205
+ * - *Inferno* - from purple to orange to yellow
206
+ * - *Plasma* - from purple to orange to yellow
207
+ * - *Cividis* - from blue to yellow
208
+ * - *Cubehelix* - from black to white, rotating hue
209
+ * - *Warm* - from purple to green, through warm hues
210
+ * - *Cool* - from green to to purple, through cool hues
211
+ * - *BuGn* - from light blue to dark green
212
+ * - *BuPu* - from light blue to dark purple
213
+ * - *GnBu* - from light green to dark blue
214
+ * - *OrRd* - from light orange to dark red
215
+ * - *PuBu* - from light purple to dark blue
216
+ * - *PuBuGn* - from light purple to blue to dark green
217
+ * - *PuRd* - from light purple to dark red
218
+ * - *RdPu* - from light red to dark purple
219
+ * - *YlGn* - from light yellow to dark green
220
+ * - *YlGnBu* - from light yellow to green to dark blue
221
+ * - *YlOrBr* - from light yellow to orange to dark brown
222
+ * - *YlOrRd* - from light yellow to orange to dark red
223
+ *
224
+ * For cyclical data, one of:
225
+ *
226
+ * - *Rainbow* (default) - the less-angry rainbow color scheme
227
+ * - *Sinebow* - Bumgardner and Loyd’s “sinebow” scheme
228
+ */
229
+ export type ColorScheme = ColorSchemeCase | (Lowercase<ColorSchemeCase> & Record<never, never>);
230
+ /**
231
+ * The built-in symbol implementations. For fill, one of:
232
+ *
233
+ * - *circle* - a circle
234
+ * - *cross* - a Greek cross with arms of equal length
235
+ * - *diamond* - a rhombus
236
+ * - *square* - a square
237
+ * - *star* - a pentagonal star (pentagram)
238
+ * - *triangle* - an up-pointing triangle
239
+ * - *wye* - a Y with arms of equal length
240
+ *
241
+ * For stroke (based on [Heman Robinson’s research][1]), one of:
242
+ *
243
+ * - *circle* - a circle
244
+ * - *plus* - a plus sign
245
+ * - *times* - an X with arms of equal length
246
+ * - *triangle2* - an (alternate) up-pointing triangle
247
+ * - *asterisk* - an asterisk
248
+ * - *square2* - a (alternate) square
249
+ * - *diamond2* - a rotated square
250
+ *
251
+ * The *hexagon* symbol is also supported.
252
+ *
253
+ * [1]: https://www.tandfonline.com/doi/abs/10.1080/10618600.2019.1637746
254
+ */
255
+ export type SymbolType = 'asterisk' | 'circle' | 'cross' | 'diamond' | 'diamond2' | 'hexagon' | 'plus' | 'square' | 'square2' | 'star' | 'times' | 'triangle' | 'triangle2' | 'wye';
256
+ /**
257
+ * How to anchor a mark relative to the plot’s frame; one of:
258
+ *
259
+ * - *middle* - centered in the middle
260
+ * - in the middle of one of the edges: *top*, *right*, *bottom*, *left*
261
+ * - in one of the corners: *top-left*, *top-right*, *bottom-right*, *bottom-left*
262
+ */
263
+ export type FrameAnchor = 'middle' | 'top-left' | 'top' | 'top-right' | 'right' | 'bottom-right' | 'bottom' | 'bottom-left' | 'left';
264
+ type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
265
+ export type ReducerPercentile = (`p${Digit}${Digit}` & Record<never, never>) | 'p25' | 'p50' | 'p75';
266
+ /**
267
+ * How to reduce aggregated (binned or grouped) values; one of:
268
+ *
269
+ * - *first* - the first value, in input order
270
+ * - *last* - the last value, in input order
271
+ * - *count* - the number of elements (frequency)
272
+ * - *distinct* - the number of distinct values
273
+ * - *sum* - the sum of values
274
+ * - *proportion* - the sum proportional to the overall total (weighted frequency)
275
+ * - *proportion-facet* - the sum proportional to the facet total
276
+ * - *deviation* - the standard deviation
277
+ * - *min* - the minimum value
278
+ * - *min-index* - the zero-based index of the minimum value
279
+ * - *max* - the maximum value
280
+ * - *max-index* - the zero-based index of the maximum value
281
+ * - *mean* - the mean value (average)
282
+ * - *median* - the median value
283
+ * - *variance* - the variance per [Welford’s algorithm][1]
284
+ * - *mode* - the value with the most occurrences
285
+ * - *pXX* - the percentile value, where XX is a number in [00,99]
286
+ * - *identity* - the array of values
287
+ *
288
+ * [1]: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm
289
+ */
290
+ export type Reducer = 'first' | 'last' | 'identity' | 'count' | 'distinct' | 'sum' | 'proportion' | 'proportion-facet' | 'deviation' | 'min' | 'min-index' | 'max' | 'max-index' | 'mean' | 'median' | 'variance' | 'mode' | ReducerPercentile;
291
+ /** The built-in curve implementations. */
292
+ export type CurveName = 'basis' | 'basis-closed' | 'basis-open' | 'bundle' | 'bump-x' | 'bump-y' | 'cardinal' | 'cardinal-closed' | 'cardinal-open' | 'catmull-rom' | 'catmull-rom-closed' | 'catmull-rom-open' | 'linear' | 'linear-closed' | 'monotone-x' | 'monotone-y' | 'natural' | 'step' | 'step-after' | 'step-before';
293
+ export {};
@@ -0,0 +1,45 @@
1
+ import { DataDefinition } from './Data.js';
2
+ import { ParamDefinition } from './Param.js';
3
+ import { HConcat } from './HConcat.js';
4
+ import { VConcat } from './VConcat.js';
5
+ import { HSpace } from './HSpace.js';
6
+ import { VSpace } from './VSpace.js';
7
+ import { Menu, Search, Slider, Table } from './Input.js';
8
+ import { Plot } from './Plot.js';
9
+ import { PlotMark } from './PlotMark.js';
10
+ import { Legend } from './PlotLegend.js';
11
+ import { PlotAttributes } from './PlotAttribute.js';
12
+ /** Specification metadata. */
13
+ export interface Meta extends Record<string, any> {
14
+ /** The specification title. */
15
+ title?: string;
16
+ /** A description of the specification content. */
17
+ description?: string;
18
+ /** Credits or other acknowledgements. */
19
+ credit?: string;
20
+ }
21
+ /** Configuration options. */
22
+ export interface Config extends Record<string, any> {
23
+ extensions?: string | string[];
24
+ }
25
+ /** Top-level dataset definitions. */
26
+ export type Data = Record<string, DataDefinition>;
27
+ /** Top-level Param and Selection definitions. */
28
+ export type Params = Record<string, ParamDefinition>;
29
+ /** Top-level specification properties. */
30
+ export interface SpecHead {
31
+ /** Specification metadata. */
32
+ meta?: Meta;
33
+ /** Configuration options. */
34
+ config?: Config;
35
+ /** Dataset definitions. */
36
+ data?: Data;
37
+ /** Param and Selection definitions. */
38
+ params?: Params;
39
+ /** A default set of attributes to apply to all plot components. */
40
+ plotDefaults?: PlotAttributes;
41
+ }
42
+ /** A specifcation component such as a plot, input widget, or layout. */
43
+ export type Component = HConcat | VConcat | HSpace | VSpace | Menu | Search | Slider | Table | Plot | PlotMark | Legend;
44
+ /** A declarative Mosaic specification. */
45
+ export type Spec = SpecHead & Component;