@uwdata/mosaic-spec 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/mosaic-schema.json +186153 -0
  2. package/dist/mosaic-spec.js +3387 -4641
  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 +16 -7
  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,23 @@
1
+ import { ParamRef } from './Param.js';
2
+
3
+ /**
4
+ * An array of inline data values to visualize. As this data does not come
5
+ * from a database, it can not be filtered by interactive selections.
6
+ */
7
+ export type PlotDataInline = any[];
8
+
9
+ /** Input data specification for a plot mark. */
10
+ export interface PlotFrom {
11
+ /** The name of the backing data table. */
12
+ from: string;
13
+ /** A selection that filters the mark data. */
14
+ filterBy?: ParamRef;
15
+ /**
16
+ * A flag (default `true`) to enable any mark-specific query optimizations.
17
+ * If `false`, optimizations are disabled to aid testing and debugging.
18
+ */
19
+ optimize?: boolean;
20
+ }
21
+
22
+ /** Input data for a marks */
23
+ export type PlotMarkData = PlotDataInline | PlotFrom;
@@ -0,0 +1,25 @@
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
+
8
+ /** A plot interactor entry. */
9
+ export type PlotInteractor =
10
+ | Highlight
11
+ | IntervalX
12
+ | IntervalY
13
+ | IntervalXY
14
+ | NearestX
15
+ | NearestY
16
+ | Toggle
17
+ | ToggleX
18
+ | ToggleY
19
+ | ToggleColor
20
+ | Pan
21
+ | PanX
22
+ | PanY
23
+ | PanZoom
24
+ | PanZoomX
25
+ | PanZoomY;
@@ -0,0 +1,70 @@
1
+ import { ParamRef } from './Param.js';
2
+
3
+ /**
4
+ * A legend defined as an entry within a plot.
5
+ */
6
+ export interface PlotLegend {
7
+ /**
8
+ * A legend of the given type.
9
+ * The valid types are `"color"`, `"opacity"`, and `"symbol"`.
10
+ */
11
+ legend: 'color' | 'opacity' | 'symbol';
12
+ /**
13
+ * The output selection. If specified, the legend is interactive, using a
14
+ * `toggle` interaction for discrete legends or an `intervalX` interaction
15
+ * for continuous legends.
16
+ */
17
+ as?: ParamRef;
18
+ /**
19
+ * The data field over which to generate output selection clauses. If
20
+ * unspecified, a matching field is retrieved from existing plot marks.
21
+ */
22
+ field?: string;
23
+ /**
24
+ * The legend label.
25
+ */
26
+ label?: string;
27
+ /**
28
+ * The size of legend ticks in a continuous legend, in pixels.
29
+ */
30
+ tickSize?: number;
31
+ /**
32
+ * The top margin of the legend component, in pixels.
33
+ */
34
+ marginTop?: number;
35
+ /**
36
+ * The right margin of the legend component, in pixels.
37
+ */
38
+ marginRight?: number;
39
+ /**
40
+ * The bottom margin of the legend component, in pixels.
41
+ */
42
+ marginBottom?: number;
43
+ /**
44
+ * The left margin of the legend component, in pixels.
45
+ */
46
+ marginLeft?: number;
47
+ /**
48
+ * The width of a continuous legend, in pixels.
49
+ */
50
+ width?: number;
51
+ /**
52
+ * The height of a continuous legend, in pixels.
53
+ */
54
+ height?: number;
55
+ /**
56
+ * The number of columns to use to layout a discrete legend.
57
+ */
58
+ columns?: number;
59
+ }
60
+
61
+ /**
62
+ * A legend defined as a top-level spec component.
63
+ */
64
+ export interface Legend extends PlotLegend {
65
+ /**
66
+ * The name of the plot this legend applies to.
67
+ * A plot must include a `name` attribute to be referenced.
68
+ */
69
+ for: string;
70
+ }
@@ -0,0 +1,51 @@
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
+
26
+ /** A plot mark entry. */
27
+ export type PlotMark =
28
+ | Area | AreaX | AreaY
29
+ | Arrow
30
+ | AxisX | AxisY | AxisFx | AxisFy | GridX | GridY | GridFx | GridFy
31
+ | BarX | BarY
32
+ | Cell | CellX | CellY
33
+ | Contour
34
+ | DelaunayLink | DelaunayMesh | Hull | Voronoi | VoronoiMesh
35
+ | DenseLine
36
+ | Density | DensityX | DensityY
37
+ | Dot | DotX | DotY | Circle | Hexagon
38
+ | Frame
39
+ | Geo | Graticule | Sphere
40
+ | Hexbin
41
+ | Hexgrid
42
+ | Image
43
+ | Line | LineX | LineY
44
+ | Link
45
+ | Raster | Heatmap | RasterTile
46
+ | Rect | RectX | RectY
47
+ | RegressionY
48
+ | RuleX | RuleY
49
+ | Text | TextX | TextY
50
+ | TickX | TickY
51
+ | Vector | VectorX | VectorY | Spike;
@@ -0,0 +1,519 @@
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
+
8
+ // For internal use.
9
+ export type LiteralTimeInterval =
10
+ | '3 months'
11
+ | '10 years'
12
+ | TimeIntervalName
13
+ | (`${TimeIntervalName}s` & Record<never, never>)
14
+ | (`${number} ${TimeIntervalName}` & Record<never, never>)
15
+ | (`${number} ${TimeIntervalName}s` & Record<never, never>);
16
+
17
+ /**
18
+ * The built-in time intervals; UTC or local time, depending on context. The
19
+ * *week* interval is an alias for *sunday*. The *quarter* interval is every
20
+ * three months, and the *half* interval is every six months, aligned at the
21
+ * start of the year.
22
+ */
23
+ export type TimeIntervalName =
24
+ | 'second'
25
+ | 'minute'
26
+ | 'hour'
27
+ | 'day'
28
+ | 'week'
29
+ | 'month'
30
+ | 'quarter' // 3 months
31
+ | 'half' // 6 months
32
+ | 'year'
33
+ | 'monday'
34
+ | 'tuesday'
35
+ | 'wednesday'
36
+ | 'thursday'
37
+ | 'friday'
38
+ | 'saturday'
39
+ | 'sunday';
40
+
41
+ /**
42
+ * How to partition a continuous range into discrete intervals; one of:
43
+ *
44
+ * - a named time interval such as *day* (for date intervals)
45
+ * - a number (for number intervals), defining intervals at integer multiples of *n*
46
+ */
47
+ export type Interval<T = any> = T extends Date ? LiteralTimeInterval
48
+ : T extends number ? number
49
+ : never;
50
+
51
+ /**
52
+ * The built-in scale names; one of:
53
+ *
54
+ * - *x* - horizontal position
55
+ * - *y* - vertical position
56
+ * - *fx* - horizontal facet position
57
+ * - *fy* - vertical facet position
58
+ * - *r* - radius (for dots and point geos)
59
+ * - *color* - color
60
+ * - *opacity* - opacity
61
+ * - *symbol* - categorical symbol (for dots)
62
+ * - *length* - length (for vectors)
63
+ *
64
+ * Position scales may have associated axes. Color, opacity, and symbol scales
65
+ * may have an associated legend.
66
+ */
67
+ export type ScaleName = 'x' | 'y' | 'fx' | 'fy' | 'r' | 'color' | 'opacity' | 'symbol' | 'length';
68
+
69
+ /**
70
+ * The supported scale types for *x* and *y* position encodings.
71
+ *
72
+ * For quantitative data, one of:
73
+ *
74
+ * - *linear* (default) - linear transform (translate and scale)
75
+ * - *pow* - power (exponential) transform
76
+ * - *sqrt* - square-root transform; *pow* with *exponent* = 0.5
77
+ * - *log* - logarithmic transform
78
+ * - *symlog* - bi-symmetric logarithmic transform per Webber et al.
79
+ *
80
+ * For temporal data, one of:
81
+ *
82
+ * - *utc* (default, recommended) - UTC time
83
+ * - *time* - local time
84
+ *
85
+ * For ordinal data, one of:
86
+ *
87
+ * - *point* (for position only) - divide a continuous range into discrete points
88
+ * - *band* (for position only) - divide a continuous range into discrete points
89
+ *
90
+ * Other scale types:
91
+ *
92
+ * - *identity* - do not transform values when encoding
93
+ */
94
+ export type PositionScaleType =
95
+ | 'linear'
96
+ | 'pow'
97
+ | 'sqrt'
98
+ | 'log'
99
+ | 'symlog'
100
+ | 'utc'
101
+ | 'time'
102
+ | 'point'
103
+ | 'band'
104
+ | 'threshold'
105
+ | 'quantile'
106
+ | 'quantize'
107
+ | 'identity';
108
+
109
+ /**
110
+ * The supported scale types for *color* encodings.
111
+ *
112
+ * For quantitative data, one of:
113
+ *
114
+ * - *linear* (default) - linear transform (translate and scale)
115
+ * - *pow* - power (exponential) transform
116
+ * - *sqrt* - square-root transform; *pow* with *exponent* = 0.5
117
+ * - *log* - logarithmic transform
118
+ * - *symlog* - bi-symmetric logarithmic transform per Webber et al.
119
+ *
120
+ * For temporal data, one of:
121
+ *
122
+ * - *utc* (default, recommended) - UTC time
123
+ * - *time* - local time
124
+ *
125
+ * For ordinal data, one of:
126
+ *
127
+ * - *ordinal* - from discrete inputs to discrete outputs
128
+ *
129
+ * For color, one of:
130
+ *
131
+ * - *categorical* - equivalent to *ordinal*; defaults to *observable10*
132
+ * - *sequential* - equivalent to *linear*; defaults to *turbo*
133
+ * - *cyclical* - equivalent to *linear*; defaults to *rainbow*
134
+ * - *threshold* - encodes using discrete thresholds; defaults to *rdylbu*
135
+ * - *quantile* - encodes using quantile thresholds; defaults to *rdylbu*
136
+ * - *quantize* - uniformly quantizes a continuous domain; defaults to *rdylbu*
137
+ * - *diverging* - *linear*, but with a pivot; defaults to *rdbu*
138
+ * - *diverging-log* - *log*, but with a pivot; defaults to *rdbu*
139
+ * - *diverging-pow* - *pow*, but with a pivot; defaults to *rdbu*
140
+ * - *diverging-sqrt* - *sqrt*, but with a pivot; defaults to *rdbu*
141
+ * - *diverging-symlog* - *symlog*, but with a pivot; defaults to *rdbu*
142
+ *
143
+ * Other scale types:
144
+ *
145
+ * - *identity* - do not transform values when encoding
146
+ */
147
+ export type ColorScaleType =
148
+ | 'linear'
149
+ | 'pow'
150
+ | 'sqrt'
151
+ | 'log'
152
+ | 'symlog'
153
+ | 'utc'
154
+ | 'time'
155
+ | 'point'
156
+ | 'band'
157
+ | 'ordinal'
158
+ | 'sequential'
159
+ | 'cyclical'
160
+ | 'diverging'
161
+ | 'diverging-log'
162
+ | 'diverging-pow'
163
+ | 'diverging-sqrt'
164
+ | 'diverging-symlog'
165
+ | 'categorical'
166
+ | 'threshold'
167
+ | 'quantile'
168
+ | 'quantize'
169
+ | 'identity';
170
+
171
+ /**
172
+ * The supported scale types for continuous encoding channels.
173
+ *
174
+ * For quantitative data, one of:
175
+ *
176
+ * - *linear* (default) - linear transform (translate and scale)
177
+ * - *pow* - power (exponential) transform
178
+ * - *sqrt* - square-root transform; *pow* with *exponent* = 0.5
179
+ * - *log* - logarithmic transform
180
+ * - *symlog* - bi-symmetric logarithmic transform per Webber et al.
181
+ *
182
+ * For temporal data, one of:
183
+ *
184
+ * - *utc* (default, recommended) - UTC time
185
+ * - *time* - local time
186
+ *
187
+ * Other scale types:
188
+ *
189
+ * - *identity* - do not transform values when encoding
190
+ */
191
+ export type ContinuousScaleType =
192
+ | 'linear'
193
+ | 'pow'
194
+ | 'sqrt'
195
+ | 'log'
196
+ | 'symlog'
197
+ | 'utc'
198
+ | 'time'
199
+ | 'identity';
200
+
201
+ /**
202
+ * The supported scale types for discrete encoding channels. One of:
203
+ *
204
+ * - *ordinal* - from discrete inputs to discrete outputs
205
+ * - *identity* - do not transform values when encoding
206
+ */
207
+ export type DiscreteScaleType =
208
+ | 'ordinal'
209
+ | 'identity';
210
+
211
+ /**
212
+ * The built-in projection implementations; one of:
213
+ *
214
+ * - *albers-usa* - a U.S.-centric composite projection with insets for Alaska and Hawaii
215
+ * - *albers* - a U.S.-centric *conic-equal-area* projection
216
+ * - *azimuthal-equal-area* - the azimuthal equal-area projection
217
+ * - *azimuthal-equidistant* - the azimuthal equidistant projection
218
+ * - *conic-conformal* - the conic conformal projection
219
+ * - *conic-equal-area* - the conic equal-area projection
220
+ * - *conic-equidistant* - the conic equidistant projection
221
+ * - *equal-earth* - the Equal Earth projection Šavrič et al., 2018
222
+ * - *equirectangular* - the equirectangular (plate carrée) projection
223
+ * - *gnomonic* - the gnomonic projection
224
+ * - *identity* - the identity projection
225
+ * - *reflect-y* - the identity projection, but flipping *y*
226
+ * - *mercator* - the spherical Mercator projection
227
+ * - *orthographic* - the orthographic projection
228
+ * - *stereographic* - the stereographic projection
229
+ * - *transverse-mercator* - the transverse spherical Mercator projection
230
+ */
231
+ export type ProjectionName =
232
+ | 'albers-usa'
233
+ | 'albers'
234
+ | 'azimuthal-equal-area'
235
+ | 'azimuthal-equidistant'
236
+ | 'conic-conformal'
237
+ | 'conic-equal-area'
238
+ | 'conic-equidistant'
239
+ | 'equal-earth'
240
+ | 'equirectangular'
241
+ | 'gnomonic'
242
+ | 'identity'
243
+ | 'reflect-y'
244
+ | 'mercator'
245
+ | 'orthographic'
246
+ | 'stereographic'
247
+ | 'transverse-mercator';
248
+
249
+ /**
250
+ * How to interpolate range (output) values for continuous scales; one of:
251
+ *
252
+ * - *number* - linear numeric interpolation
253
+ * - *rgb* - red, green, blue (sRGB)
254
+ * - *hsl* - hue, saturation, lightness (HSL; cylindrical sRGB)
255
+ * - *hcl* - hue, chroma, perceptual lightness (CIELCh_ab; cylindrical CIELAB)
256
+ * - *lab* - perceptual lightness and opponent colors (L\*a\*b\*, CIELAB)
257
+ */
258
+ export type Interpolate =
259
+ | 'number'
260
+ | 'rgb'
261
+ | 'hsl'
262
+ | 'hcl'
263
+ | 'lab';
264
+
265
+ /** The built-in color schemes, cased. */
266
+ type ColorSchemeCase =
267
+ | 'Accent'
268
+ | 'Category10'
269
+ | 'Dark2'
270
+ | 'Observable10'
271
+ | 'Paired'
272
+ | 'Pastel1'
273
+ | 'Pastel2'
274
+ | 'Set1'
275
+ | 'Set2'
276
+ | 'Set3'
277
+ | 'Tableau10'
278
+ | 'BrBG'
279
+ | 'PRGn'
280
+ | 'PiYG'
281
+ | 'PuOr'
282
+ | 'RdBu'
283
+ | 'RdGy'
284
+ | 'RdYlBu'
285
+ | 'RdYlGn'
286
+ | 'Spectral'
287
+ | 'BuRd'
288
+ | 'BuYlRd'
289
+ | 'Blues'
290
+ | 'Greens'
291
+ | 'Greys'
292
+ | 'Oranges'
293
+ | 'Purples'
294
+ | 'Reds'
295
+ | 'Turbo'
296
+ | 'Viridis'
297
+ | 'Magma'
298
+ | 'Inferno'
299
+ | 'Plasma'
300
+ | 'Cividis'
301
+ | 'Cubehelix'
302
+ | 'Warm'
303
+ | 'Cool'
304
+ | 'BuGn'
305
+ | 'BuPu'
306
+ | 'GnBu'
307
+ | 'OrRd'
308
+ | 'PuBu'
309
+ | 'PuBuGn'
310
+ | 'PuRd'
311
+ | 'RdPu'
312
+ | 'YlGn'
313
+ | 'YlGnBu'
314
+ | 'YlOrBr'
315
+ | 'YlOrRd'
316
+ | 'Rainbow'
317
+ | 'Sinebow';
318
+
319
+ /**
320
+ * The built-in color schemes. For categorical data, one of:
321
+ *
322
+ * - *Accent* - eight colors
323
+ * - *Category10* - ten colors
324
+ * - *Dark2* - eight colors
325
+ * - *Observable10* (default) - ten colors
326
+ * - *Paired* - twelve paired colors
327
+ * - *Pastel1* - nine colors
328
+ * - *Pastel2* - eight colors
329
+ * - *Set1* - nine colors
330
+ * - *Set2* - eight colors
331
+ * - *Set3* - twelve colors
332
+ * - *Tableau10* - ten colors
333
+ *
334
+ * For diverging data, one of:
335
+ *
336
+ * - *BrBG* - from brown to white to blue-green
337
+ * - *PRGn* - from purple to white to green
338
+ * - *PiYG* - from pink to white to yellow-green
339
+ * - *PuOr* - from purple to white to orange
340
+ * - *RdBu* (default) - from red to white to blue
341
+ * - *RdGy* - from red to white to gray
342
+ * - *RdYlBu* - from red to yellow to blue
343
+ * - *RdYlGn* - from red to yellow to green
344
+ * - *Spectral* - from red to blue, through the spectrum
345
+ * - *BuRd* - from blue to white to red
346
+ * - *BuYlRd* - from blue to yellow to red
347
+ *
348
+ * For sequential data, one of:
349
+ *
350
+ * - *Blues* - from white to blue
351
+ * - *Greens* - from white to green
352
+ * - *Greys* - from white to gray
353
+ * - *Oranges* - from white to orange
354
+ * - *Purples* - from white to purple
355
+ * - *Reds* - from white to red
356
+ * - *Turbo* (default) - from blue to red, through the spectrum
357
+ * - *Viridis* - from blue to green to yellow
358
+ * - *Magma* - from purple to orange to yellow
359
+ * - *Inferno* - from purple to orange to yellow
360
+ * - *Plasma* - from purple to orange to yellow
361
+ * - *Cividis* - from blue to yellow
362
+ * - *Cubehelix* - from black to white, rotating hue
363
+ * - *Warm* - from purple to green, through warm hues
364
+ * - *Cool* - from green to to purple, through cool hues
365
+ * - *BuGn* - from light blue to dark green
366
+ * - *BuPu* - from light blue to dark purple
367
+ * - *GnBu* - from light green to dark blue
368
+ * - *OrRd* - from light orange to dark red
369
+ * - *PuBu* - from light purple to dark blue
370
+ * - *PuBuGn* - from light purple to blue to dark green
371
+ * - *PuRd* - from light purple to dark red
372
+ * - *RdPu* - from light red to dark purple
373
+ * - *YlGn* - from light yellow to dark green
374
+ * - *YlGnBu* - from light yellow to green to dark blue
375
+ * - *YlOrBr* - from light yellow to orange to dark brown
376
+ * - *YlOrRd* - from light yellow to orange to dark red
377
+ *
378
+ * For cyclical data, one of:
379
+ *
380
+ * - *Rainbow* (default) - the less-angry rainbow color scheme
381
+ * - *Sinebow* - Bumgardner and Loyd’s “sinebow” scheme
382
+ */
383
+ export type ColorScheme = ColorSchemeCase | (Lowercase<ColorSchemeCase> & Record<never, never>);
384
+
385
+ /**
386
+ * The built-in symbol implementations. For fill, one of:
387
+ *
388
+ * - *circle* - a circle
389
+ * - *cross* - a Greek cross with arms of equal length
390
+ * - *diamond* - a rhombus
391
+ * - *square* - a square
392
+ * - *star* - a pentagonal star (pentagram)
393
+ * - *triangle* - an up-pointing triangle
394
+ * - *wye* - a Y with arms of equal length
395
+ *
396
+ * For stroke (based on [Heman Robinson’s research][1]), one of:
397
+ *
398
+ * - *circle* - a circle
399
+ * - *plus* - a plus sign
400
+ * - *times* - an X with arms of equal length
401
+ * - *triangle2* - an (alternate) up-pointing triangle
402
+ * - *asterisk* - an asterisk
403
+ * - *square2* - a (alternate) square
404
+ * - *diamond2* - a rotated square
405
+ *
406
+ * The *hexagon* symbol is also supported.
407
+ *
408
+ * [1]: https://www.tandfonline.com/doi/abs/10.1080/10618600.2019.1637746
409
+ */
410
+ export type SymbolType =
411
+ | 'asterisk'
412
+ | 'circle'
413
+ | 'cross'
414
+ | 'diamond'
415
+ | 'diamond2'
416
+ | 'hexagon'
417
+ | 'plus'
418
+ | 'square'
419
+ | 'square2'
420
+ | 'star'
421
+ | 'times'
422
+ | 'triangle'
423
+ | 'triangle2'
424
+ | 'wye';
425
+
426
+ /**
427
+ * How to anchor a mark relative to the plot’s frame; one of:
428
+ *
429
+ * - *middle* - centered in the middle
430
+ * - in the middle of one of the edges: *top*, *right*, *bottom*, *left*
431
+ * - in one of the corners: *top-left*, *top-right*, *bottom-right*, *bottom-left*
432
+ */
433
+ export type FrameAnchor =
434
+ | 'middle'
435
+ | 'top-left'
436
+ | 'top'
437
+ | 'top-right'
438
+ | 'right'
439
+ | 'bottom-right'
440
+ | 'bottom'
441
+ | 'bottom-left'
442
+ | 'left';
443
+
444
+ // from https://github.com/observablehq/plot/blob/main/src/reducer.d.ts
445
+ type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
446
+
447
+ // For internal use.
448
+ export type ReducerPercentile =
449
+ | (`p${Digit}${Digit}` & Record<never, never>) // see https://github.com/microsoft/TypeScript/issues/29729
450
+ | 'p25'
451
+ | 'p50'
452
+ | 'p75';
453
+
454
+ /**
455
+ * How to reduce aggregated (binned or grouped) values; one of:
456
+ *
457
+ * - *first* - the first value, in input order
458
+ * - *last* - the last value, in input order
459
+ * - *count* - the number of elements (frequency)
460
+ * - *distinct* - the number of distinct values
461
+ * - *sum* - the sum of values
462
+ * - *proportion* - the sum proportional to the overall total (weighted frequency)
463
+ * - *proportion-facet* - the sum proportional to the facet total
464
+ * - *deviation* - the standard deviation
465
+ * - *min* - the minimum value
466
+ * - *min-index* - the zero-based index of the minimum value
467
+ * - *max* - the maximum value
468
+ * - *max-index* - the zero-based index of the maximum value
469
+ * - *mean* - the mean value (average)
470
+ * - *median* - the median value
471
+ * - *variance* - the variance per [Welford’s algorithm][1]
472
+ * - *mode* - the value with the most occurrences
473
+ * - *pXX* - the percentile value, where XX is a number in [00,99]
474
+ * - *identity* - the array of values
475
+ *
476
+ * [1]: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm
477
+ */
478
+ export type Reducer =
479
+ | 'first'
480
+ | 'last'
481
+ | 'identity'
482
+ | 'count'
483
+ | 'distinct'
484
+ | 'sum'
485
+ | 'proportion'
486
+ | 'proportion-facet'
487
+ | 'deviation'
488
+ | 'min'
489
+ | 'min-index'
490
+ | 'max'
491
+ | 'max-index'
492
+ | 'mean'
493
+ | 'median'
494
+ | 'variance'
495
+ | 'mode'
496
+ | ReducerPercentile;
497
+
498
+ /** The built-in curve implementations. */
499
+ export type CurveName =
500
+ | 'basis'
501
+ | 'basis-closed'
502
+ | 'basis-open'
503
+ | 'bundle'
504
+ | 'bump-x'
505
+ | 'bump-y'
506
+ | 'cardinal'
507
+ | 'cardinal-closed'
508
+ | 'cardinal-open'
509
+ | 'catmull-rom'
510
+ | 'catmull-rom-closed'
511
+ | 'catmull-rom-open'
512
+ | 'linear'
513
+ | 'linear-closed'
514
+ | 'monotone-x'
515
+ | 'monotone-y'
516
+ | 'natural'
517
+ | 'step'
518
+ | 'step-after'
519
+ | 'step-before';