@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,890 @@
1
+ import { AggregateExpression, SQLExpression } from '../Expression.js';
2
+ import { ParamRef } from '../Param.js';
3
+ import { PlotMarkData } from '../PlotFrom.js';
4
+ import { CurveName, FrameAnchor, Interval, Reducer, ScaleName } from '../PlotTypes.js';
5
+ import { Transform } from '../Transform.js';
6
+ /** The set of known channel names. */
7
+ export type ChannelName = 'ariaLabel' | 'fill' | 'fillOpacity' | 'fontSize' | 'fx' | 'fy' | 'geometry' | 'height' | 'href' | 'length' | 'opacity' | 'path' | 'r' | 'rotate' | 'src' | 'stroke' | 'strokeOpacity' | 'strokeWidth' | 'symbol' | 'text' | 'title' | 'weight' | 'width' | 'x' | 'x1' | 'x2' | 'y' | 'y1' | 'y2' | 'z';
8
+ type ChannelScale = ScaleName | 'auto' | boolean | null;
9
+ /**
10
+ * A channel’s values may be expressed as:
11
+ *
12
+ * - a field name, to extract the corresponding value for each datum
13
+ * - an iterable of values, typically of the same length as the data
14
+ * - a channel transform or SQL expression
15
+ * - a constant number or boolean
16
+ * - null to represent no value
17
+ */
18
+ export type ChannelValue = any[] | (string & Record<never, never>) | number | boolean | null | Transform | SQLExpression | AggregateExpression;
19
+ /**
20
+ * When specifying a mark channel’s value, you can provide a {value, scale}
21
+ * object to override the scale that would normally be associated with the
22
+ * channel.
23
+ */
24
+ export type ChannelValueSpec = ChannelValue | {
25
+ value: ChannelValue;
26
+ label?: string;
27
+ scale?: ScaleName | 'auto' | boolean | null;
28
+ };
29
+ /**
30
+ * In some contexts, when specifying a mark channel’s value, you can provide a
31
+ * {value, interval} object to specify an associated interval.
32
+ */
33
+ export type ChannelValueIntervalSpec = ChannelValueSpec | {
34
+ value: ChannelValue;
35
+ interval: Interval;
36
+ };
37
+ /** A channel name, or an implied one for domain sorting. */
38
+ type ChannelDomainName = ChannelName | 'data' | 'width' | 'height';
39
+ /**
40
+ * The available inputs for imputing scale domains. In addition to a named
41
+ * channel, an input may be specified as:
42
+ *
43
+ * - *data* - impute from mark data
44
+ * - *width* - impute from |*x2* - *x1*|
45
+ * - *height* - impute from |*y2* - *y1*|
46
+ * - null - impute from input order
47
+ *
48
+ * If the *x* channel is not defined, the *x2* channel will be used instead if
49
+ * available, and similarly for *y* and *y2*; this is useful for marks that
50
+ * implicitly stack. The *data* input is typically used in conjunction with a
51
+ * custom **reduce** function, as when the built-in single-channel reducers are
52
+ * insufficient.
53
+ */
54
+ export type ChannelDomainValue = ChannelDomainName | `-${ChannelDomainName}` | null;
55
+ /** Options for imputing scale domains from channel values. */
56
+ export interface ChannelDomainOptions {
57
+ /**
58
+ * How to produce a singular value (for subsequent sorting) from aggregated
59
+ * channel values; one of:
60
+ *
61
+ * - true (default) - alias for *max*
62
+ * - false or null - disabled; don’t impute the scale domain
63
+ * - a named reducer implementation such as *count* or *sum*
64
+ * - a function that takes an array of values and returns the reduced value
65
+ * - an object that implements the *reduceIndex* method
66
+ */
67
+ reduce?: Reducer | boolean | null;
68
+ /** How to order reduced values. */
69
+ order?: 'ascending' | 'descending' | null;
70
+ /** If true, reverse the order after sorting. */
71
+ reverse?: boolean;
72
+ /**
73
+ * If a positive number, limit the domain to the first *n* sorted values. If a
74
+ * negative number, limit the domain to the last *-n* sorted values. Hence, a
75
+ * positive **limit** with **reverse** true will return the top *n* values in
76
+ * descending order.
77
+ *
78
+ * If an array [*lo*, *hi*], slices the sorted domain from *lo* (inclusive) to
79
+ * *hi* (exclusive). As with [*array*.slice][1], if either *lo* or *hi* are
80
+ * negative, it indicates an offset from the end of the array; if *lo* is
81
+ * undefined it defaults to 0, and if *hi* is undefined it defaults to
82
+ * Infinity.
83
+ *
84
+ * Note: limiting the imputed domain of one scale, say *x*, does not affect
85
+ * the imputed domain of another scale, say *y*; each scale domain is imputed
86
+ * independently.
87
+ *
88
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
89
+ */
90
+ limit?: number | [lo?: number, hi?: number];
91
+ }
92
+ /** How to derive a scale’s domain from a channel’s values. */
93
+ export type ChannelDomainValueSpec = ChannelDomainValue | ({
94
+ value: ChannelDomainValue;
95
+ } & ChannelDomainOptions);
96
+ /** How to impute scale domains from channel values. */
97
+ export type ChannelDomainSort = {
98
+ [key in ScaleName]?: ChannelDomainValueSpec;
99
+ } & ChannelDomainOptions;
100
+ /**
101
+ * Output channels for aggregating transforms, such as bin and group. Each
102
+ * declared output channel has an associated reducer, and typically a
103
+ * corresponding input channel in *options*. Non-grouping channels declared in
104
+ * *options* but not *outputs* are computed on reduced data after grouping,
105
+ * which defaults to the array of data for the current group.
106
+ *
107
+ * If **title** is in *options* but not *outputs*, the reducer defaults to
108
+ * summarizing the most common values. If **href** is in *options* but not
109
+ * *outputs*, the reducer defaults to *first*. When **x1** or **x2** is in
110
+ * *outputs*, reads the input channel **x** if **x1** or **x2** is not in
111
+ * *options*; likewise for **y1** or **y2**, reads the input channel **y** if
112
+ * **y1** or **y2** is not in *options*.
113
+ */
114
+ export type ChannelReducers<T = Reducer> = {
115
+ [key in ChannelName]?: T | {
116
+ reduce: T;
117
+ scale?: ChannelScale;
118
+ } | null;
119
+ };
120
+ /** Abstract (unscaled) values, and associated scale, per channel. */
121
+ export type ChannelStates = {
122
+ [key in ChannelName]?: {
123
+ value: any[];
124
+ scale: ScaleName | null;
125
+ };
126
+ };
127
+ /** Possibly-scaled values for each channel. */
128
+ export type ChannelValues = {
129
+ [key in ChannelName]?: any[];
130
+ } & {
131
+ channels: ChannelStates;
132
+ };
133
+ /**
134
+ * How to order values; one of:
135
+ *
136
+ * - a function for comparing data, returning a signed number
137
+ * - a channel value definition for sorting given values in ascending order
138
+ * - a {value, order} object for sorting given values
139
+ * - a {channel, order} object for sorting the named channel’s values
140
+ */
141
+ export type SortOrder = ChannelValue | {
142
+ value?: ChannelValue;
143
+ order?: 'ascending' | 'descending';
144
+ } | {
145
+ channel?: ChannelName | `-${ChannelName}`;
146
+ order?: 'ascending' | 'descending';
147
+ };
148
+ /** The pointer mode for the tip; corresponds to pointerX, pointerY, and pointer. */
149
+ export type TipPointer = 'x' | 'y' | 'xy';
150
+ export interface MarkData {
151
+ /**
152
+ * The data source for the mark.
153
+ */
154
+ data: PlotMarkData;
155
+ }
156
+ export interface MarkDataOptional {
157
+ /**
158
+ * The data source for the mark.
159
+ */
160
+ data?: PlotMarkData;
161
+ }
162
+ /** Shared options for all marks. */
163
+ export interface MarkOptions {
164
+ /**
165
+ * Applies a transform to filter the mark’s index according to the given
166
+ * channel values; only truthy values are retained.
167
+ *
168
+ * Note that filtering only affects the rendered mark index, not the
169
+ * associated channel values, and thus has no effect on imputed scale domains.
170
+ */
171
+ filter?: ChannelValue;
172
+ /**
173
+ * Applies a transform to reverse the order of the mark’s index, say for
174
+ * reverse input order.
175
+ */
176
+ reverse?: boolean | ParamRef;
177
+ /**
178
+ * Either applies a transform to sort the mark’s index by the specified
179
+ * channel values, or imputes ordinal scale domains from this mark’s channels.
180
+ *
181
+ * When imputing ordinal scale domains from channel values, the **sort**
182
+ * option is an object whose keys are ordinal scale names such as *x* or *fx*,
183
+ * and whose values are channel names such as *y*, *y1*, or *y2*. For example,
184
+ * to impute the *y* scale’s domain from the associated *x* channel values in
185
+ * ascending order:
186
+ *
187
+ * ```js
188
+ * sort: {y: "x"}
189
+ * ```
190
+ *
191
+ * For different sort options for different scales, replace the channel name
192
+ * with a *value* object and per-scale options:
193
+ *
194
+ * ```js
195
+ * sort: {y: {value: "-x"}}
196
+ * ```
197
+ *
198
+ * When sorting the mark’s index, the **sort** option is instead one of:
199
+ *
200
+ * - a channel value definition for sorting given values in ascending order
201
+ * - a {value, order} object for sorting given values
202
+ * - a {channel, order} object for sorting the named channel’s values
203
+ */
204
+ sort?: SortOrder | ChannelDomainSort;
205
+ /**
206
+ * The horizontal facet position channel, for mark-level faceting, bound to
207
+ * the *fx* scale.
208
+ */
209
+ fx?: ChannelValue;
210
+ /**
211
+ * The vertical facet position channel, for mark-level faceting, bound to the
212
+ * *fy* scale.
213
+ */
214
+ fy?: ChannelValue;
215
+ /**
216
+ * Whether to enable or disable faceting; one of:
217
+ *
218
+ * - *auto* (default) - automatically determine if this mark should be faceted
219
+ * - *include* (or true) - draw the subset of the mark’s data in the current facet
220
+ * - *exclude* - draw the subset of the mark’s data *not* in the current facet
221
+ * - *super* - draw this mark in a single frame that covers all facets
222
+ * - null (or false) - repeat this mark’s data across all facets (*i.e.*, no faceting)
223
+ *
224
+ * When a mark uses *super* faceting, it is not allowed to use position scales
225
+ * (*x*, *y*, *fx*, or *fy*); *super* faceting is intended for decorations,
226
+ * such as labels and legends.
227
+ *
228
+ * When top-level faceting is used, the default *auto* setting is equivalent
229
+ * to *include* when the mark data is strictly equal to the top-level facet
230
+ * data; otherwise it is equivalent to null. When the *include* or *exclude*
231
+ * facet mode is chosen, the mark data must be parallel to the top-level facet
232
+ * data: the data must have the same length and order. If the data are not
233
+ * parallel, then the wrong data may be shown in each facet. The default
234
+ * *auto* therefore requires strict equality (`===`) for safety, and using the
235
+ * facet data as mark data is recommended when using the *exclude* facet mode.
236
+ * (To construct parallel data safely, consider using [*array*.map][1] on the
237
+ * facet data.)
238
+ *
239
+ * When mark-level faceting is used, the default *auto* setting is equivalent
240
+ * to *include*: the mark will be faceted if either the **fx** or **fy**
241
+ * channel option (or both) is specified. The null or false option will
242
+ * disable faceting, while *exclude* draws the subset of the mark’s data *not*
243
+ * in the current facet.
244
+ *
245
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
246
+ */
247
+ facet?: 'auto' | 'include' | 'exclude' | 'super' | boolean | null | ParamRef;
248
+ /**
249
+ * How to place the mark with respect to facets; one of:
250
+ *
251
+ * - null (default for most marks) - display the mark in each non-empty facet
252
+ * - *top*, *right*, *bottom*, or *left* - display the mark only in facets on
253
+ * the given side
254
+ * - *top-empty*, *right-empty*, *bottom-empty*, or *left-empty* (default for
255
+ * axis marks) - display the mark only in facets that have empty space on
256
+ * the given side: either the margin, or an empty facet
257
+ * - *empty* - display the mark in empty facets only
258
+ */
259
+ facetAnchor?: 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-empty' | 'right-empty' | 'bottom-empty' | 'left-empty' | 'empty' | null | ParamRef;
260
+ /**
261
+ * Shorthand to set the same default for all four mark margins: **marginTop**,
262
+ * **marginRight**, **marginBottom**, and **marginLeft**; typically defaults
263
+ * to 0, except for axis marks.
264
+ */
265
+ margin?: number | ParamRef;
266
+ /**
267
+ * The mark’s top margin; the minimum distance in pixels between the top edges
268
+ * of the inner and outer plot area.
269
+ */
270
+ marginTop?: number | ParamRef;
271
+ /**
272
+ * The mark’s right margin; the minimum distance in pixels between the right
273
+ * edges of the mark’s inner and outer plot area.
274
+ */
275
+ marginRight?: number | ParamRef;
276
+ /**
277
+ * The mark’s bottom margin; the minimum distance in pixels between the bottom
278
+ * edges of the inner and outer plot area.
279
+ */
280
+ marginBottom?: number | ParamRef;
281
+ /**
282
+ * The mark’s left margin; the minimum distance in pixels between the left
283
+ * edges of the inner and outer plot area.
284
+ */
285
+ marginLeft?: number | ParamRef;
286
+ /**
287
+ * The [aria-description][1]; a constant textual description.
288
+ *
289
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-description
290
+ */
291
+ ariaDescription?: string | ParamRef;
292
+ /**
293
+ * The [aria-hidden][1] state; a constant indicating whether the element is
294
+ * exposed to an accessibility API.
295
+ *
296
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden
297
+ */
298
+ ariaHidden?: string | ParamRef;
299
+ /**
300
+ * The [aria-label][1]; a channel specifying short textual labels representing
301
+ * the value in the accessibility tree.
302
+ *
303
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
304
+ */
305
+ ariaLabel?: ChannelValue;
306
+ /**
307
+ * The [pointer-events][1] property; a constant string such as *none*.
308
+ *
309
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events
310
+ */
311
+ pointerEvents?: string | ParamRef;
312
+ /**
313
+ * The title; a channel specifying accessible, short textual descriptions as
314
+ * strings (possibly with newlines). If the tip option is specified, the title
315
+ * will be displayed with an interactive tooltip instead of using the SVG
316
+ * [title element][1].
317
+ *
318
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title
319
+ */
320
+ title?: ChannelValue;
321
+ /** Whether to generate a tooltip for this mark, and any tip options. */
322
+ tip?: boolean | TipPointer | (TipOptions & {
323
+ pointer?: TipPointer;
324
+ }) | ParamRef;
325
+ /**
326
+ * How to clip the mark; one of:
327
+ *
328
+ * - *frame* or true - clip to the plot’s frame (inner area)
329
+ * - *sphere* - clip to the projected sphere (*e.g.*, front hemisphere)
330
+ * - null or false - do not clip
331
+ *
332
+ * The *sphere* clip option requires a geographic projection.
333
+ */
334
+ clip?: 'frame' | 'sphere' | boolean | null | ParamRef;
335
+ /**
336
+ * The horizontal offset in pixels; a constant option. On low-density screens,
337
+ * an additional 0.5px offset may be applied for crisp edges.
338
+ */
339
+ dx?: number | ParamRef;
340
+ /**
341
+ * The vertical offset in pixels; a constant option. On low-density screens,
342
+ * an additional 0.5px offset may be applied for crisp edges.
343
+ */
344
+ dy?: number | ParamRef;
345
+ /**
346
+ * The [fill][1]; a constant CSS color string, or a channel typically bound to
347
+ * the *color* scale. If all channel values are valid CSS colors, by default
348
+ * the channel will not be bound to the *color* scale, interpreting the colors
349
+ * literally.
350
+ *
351
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill
352
+ */
353
+ fill?: ChannelValueSpec | ParamRef;
354
+ /**
355
+ * The [fill-opacity][1]; a constant number between 0 and 1, or a channel
356
+ * typically bound to the *opacity* scale. If all channel values are numbers
357
+ * in [0, 1], by default the channel will not be bound to the *opacity* scale,
358
+ * interpreting the opacities literally.
359
+ *
360
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-opacity
361
+ */
362
+ fillOpacity?: ChannelValueSpec | ParamRef;
363
+ /**
364
+ * The [stroke][1]; a constant CSS color string, or a channel typically bound
365
+ * to the *color* scale. If all channel values are valid CSS colors, by
366
+ * default the channel will not be bound to the *color* scale, interpreting
367
+ * the colors literally.
368
+ *
369
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke
370
+ */
371
+ stroke?: ChannelValueSpec | ParamRef;
372
+ /**
373
+ * The [stroke-dasharray][1]; a constant number indicating the length in
374
+ * pixels of alternating dashes and gaps, or a constant string of numbers
375
+ * separated by spaces or commas (_e.g._, *10 2* for dashes of 10 pixels
376
+ * separated by gaps of 2 pixels), or *none* (the default) for no dashing
377
+ *
378
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
379
+ */
380
+ strokeDasharray?: string | number | ParamRef;
381
+ /**
382
+ * The [stroke-dashoffset][1]; a constant indicating the offset in pixels of
383
+ * the first dash along the stroke; defaults to zero.
384
+ *
385
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset
386
+ */
387
+ strokeDashoffset?: string | number | ParamRef;
388
+ /**
389
+ * The [stroke-linecap][1]; a constant specifying how to cap stroked paths,
390
+ * such as *butt*, *round*, or *square*.
391
+ *
392
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap
393
+ */
394
+ strokeLinecap?: string | ParamRef;
395
+ /**
396
+ * The [stroke-linejoin][1]; a constant specifying how to join stroked paths,
397
+ * such as *bevel*, *miter*, *miter-clip*, or *round*.
398
+ *
399
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linejoin
400
+ */
401
+ strokeLinejoin?: string | ParamRef;
402
+ /**
403
+ * The [stroke-miterlimit][1]; a constant number specifying how to limit the
404
+ * length of *miter* joins on stroked paths.
405
+ *
406
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit
407
+ */
408
+ strokeMiterlimit?: number | ParamRef;
409
+ /**
410
+ * The [stroke-opacity][1]; a constant between 0 and 1, or a channel typically
411
+ * bound to the *opacity* scale. If all channel values are numbers in [0, 1],
412
+ * by default the channel will not be bound to the *opacity* scale,
413
+ * interpreting the opacities literally.
414
+ *
415
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-opacity
416
+ */
417
+ strokeOpacity?: ChannelValueSpec;
418
+ /**
419
+ * The [stroke-width][1]; a constant number in pixels, or a channel.
420
+ *
421
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width
422
+ */
423
+ strokeWidth?: ChannelValueSpec;
424
+ /**
425
+ * The [opacity][1]; a constant between 0 and 1, or a channel typically bound
426
+ * to the *opacity* scale. If all channel values are numbers in [0, 1], by
427
+ * default the channel will not be bound to the *opacity* scale, interpreting
428
+ * the opacities literally. For faster rendering, prefer the **strokeOpacity**
429
+ * or **fillOpacity** option.
430
+ *
431
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/opacity
432
+ */
433
+ opacity?: ChannelValueSpec;
434
+ /**
435
+ * The [mix-blend-mode][1]; a constant string specifying how to blend content
436
+ * such as *multiply*.
437
+ *
438
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode
439
+ */
440
+ mixBlendMode?: string | ParamRef;
441
+ /**
442
+ * A CSS [filter][1]; a constant string used to adjust the rendering of
443
+ * images, such as *blur(5px)*.
444
+ *
445
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/filter
446
+ */
447
+ imageFilter?: string | ParamRef;
448
+ /**
449
+ * The [paint-order][1]; a constant string specifying the order in which the
450
+ * **fill**, **stroke**, and any markers are drawn; defaults to *normal*,
451
+ * which draws the fill, then stroke, then markers; defaults to *stroke* for
452
+ * the text mark to create a “halo” around text to improve legibility.
453
+ *
454
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/paint-order
455
+ */
456
+ paintOrder?: string | ParamRef;
457
+ /**
458
+ * The [shape-rendering][1]; a constant string such as *crispEdges*.
459
+ *
460
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering
461
+ */
462
+ shapeRendering?: string | ParamRef;
463
+ /**
464
+ * The [href][1]; a channel specifying URLs for clickable links. May be used
465
+ * in conjunction with the **target** option to open links in another window.
466
+ *
467
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/href
468
+ */
469
+ href?: ChannelValue;
470
+ /**
471
+ * The [target][1]; a constant string specifying the target window (_e.g._,
472
+ * *_blank*) for clickable links; used in conjunction with the **href**
473
+ * option.
474
+ *
475
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/target
476
+ */
477
+ target?: string | ParamRef;
478
+ }
479
+ /** Options for insetting rectangular shapes. */
480
+ export interface InsetOptions {
481
+ /**
482
+ * Shorthand to set the same default for all four insets: **insetTop**,
483
+ * **insetRight**, **insetBottom**, and **insetLeft**. All insets typically
484
+ * default to zero, though not always (say when using bin transform). A
485
+ * positive inset reduces effective area, while a negative inset increases it.
486
+ */
487
+ inset?: number | ParamRef;
488
+ /**
489
+ * Insets the top edge by the specified number of pixels. A positive value
490
+ * insets towards the bottom edge (reducing effective area), while a negative
491
+ * value insets away from the bottom edge (increasing it).
492
+ */
493
+ insetTop?: number | ParamRef;
494
+ /**
495
+ * Insets the right edge by the specified number of pixels. A positive value
496
+ * insets towards the left edge (reducing effective area), while a negative
497
+ * value insets away from the left edge (increasing it).
498
+ */
499
+ insetRight?: number | ParamRef;
500
+ /**
501
+ * Insets the bottom edge by the specified number of pixels. A positive value
502
+ * insets towards the top edge (reducing effective area), while a negative
503
+ * value insets away from the top edge (increasing it).
504
+ */
505
+ insetBottom?: number | ParamRef;
506
+ /**
507
+ * Insets the left edge by the specified number of pixels. A positive value
508
+ * insets towards the right edge (reducing effective area), while a negative
509
+ * value insets away from the right edge (increasing it).
510
+ */
511
+ insetLeft?: number | ParamRef;
512
+ }
513
+ /** Options for styling text (independent of anchor position). */
514
+ export interface TextStyles {
515
+ /**
516
+ * The [text anchor][1] controls how text is aligned (typically horizontally)
517
+ * relative to its anchor point; it is one of *start*, *end*, or *middle*. If
518
+ * the frame anchor is *left*, *top-left*, or *bottom-left*, the default text
519
+ * anchor is *start*; if the frame anchor is *right*, *top-right*, or
520
+ * *bottom-right*, the default is *end*; otherwise it is *middle*.
521
+ *
522
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor
523
+ */
524
+ textAnchor?: 'start' | 'middle' | 'end' | ParamRef;
525
+ /**
526
+ * The line height in ems; defaults to 1. The line height affects the
527
+ * (typically vertical) separation between adjacent baselines of text, as well
528
+ * as the separation between the text and its anchor point.
529
+ */
530
+ lineHeight?: number | ParamRef;
531
+ /**
532
+ * The line width in ems (e.g., 10 for about 20 characters); defaults to
533
+ * infinity, disabling wrapping and clipping.
534
+ *
535
+ * If **textOverflow** is null, lines will be wrapped at the specified length.
536
+ * If a line is split at a soft hyphen (\xad), a hyphen (-) will be displayed
537
+ * at the end of the line. If **textOverflow** is not null, lines will be
538
+ * clipped according to the given strategy.
539
+ */
540
+ lineWidth?: number | ParamRef;
541
+ /**
542
+ * How truncate (or wrap) lines of text longer than the given **lineWidth**;
543
+ * one of:
544
+ *
545
+ * - null (default) - preserve overflowing characters (and wrap if needed)
546
+ * - *clip* or *clip-end* - remove characters from the end
547
+ * - *clip-start* - remove characters from the start
548
+ * - *ellipsis* or *ellipsis-end* - replace characters from the end with an ellipsis (…)
549
+ * - *ellipsis-start* - replace characters from the start with an ellipsis (…)
550
+ * - *ellipsis-middle* - replace characters from the middle with an ellipsis (…)
551
+ *
552
+ * If no **title** was specified, if text requires truncation, a title
553
+ * containing the non-truncated text will be implicitly added.
554
+ */
555
+ textOverflow?: null | 'clip' | 'ellipsis' | 'clip-start' | 'clip-end' | 'ellipsis-start' | 'ellipsis-middle' | 'ellipsis-end' | ParamRef;
556
+ /**
557
+ * If true, changes the default **fontFamily** to *monospace*, and uses
558
+ * simplified monospaced text metrics calculations.
559
+ */
560
+ monospace?: boolean | ParamRef;
561
+ /**
562
+ * The [font-family][1]; a constant; defaults to the plot’s font family, which
563
+ * is typically [*system-ui*][2].
564
+ *
565
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
566
+ * [2]: https://drafts.csswg.org/css-fonts-4/#valdef-font-family-system-ui
567
+ */
568
+ fontFamily?: string | ParamRef;
569
+ /**
570
+ * The [font size][1] in pixels; either a constant or a channel; defaults to
571
+ * the plot’s font size, which is typically 10. When a number, it is
572
+ * interpreted as a constant; otherwise it is interpreted as a channel.
573
+ *
574
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/font-size
575
+ */
576
+ fontSize?: ChannelValue | ParamRef;
577
+ /**
578
+ * The [font style][1]; a constant; defaults to the plot’s font style, which
579
+ * is typically *normal*.
580
+ *
581
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/font-style
582
+ */
583
+ fontStyle?: string | ParamRef;
584
+ /**
585
+ * The [font variant][1]; a constant; if the **text** channel contains numbers
586
+ * or dates, defaults to *tabular-nums* to facilitate comparing numbers;
587
+ * otherwise defaults to the plot’s font style, which is typically *normal*.
588
+ *
589
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant
590
+ */
591
+ fontVariant?: string | ParamRef;
592
+ /**
593
+ * The [font weight][1]; a constant; defaults to the plot’s font weight, which
594
+ * is typically *normal*.
595
+ *
596
+ * [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
597
+ */
598
+ fontWeight?: string | number | ParamRef;
599
+ }
600
+ /** Options for the tip mark. */
601
+ export interface TipOptions extends MarkOptions, TextStyles {
602
+ /**
603
+ * The horizontal position channel specifying the tip’s anchor, typically
604
+ * bound to the *x* scale.
605
+ */
606
+ x?: ChannelValueSpec;
607
+ /**
608
+ * The starting horizontal position channel specifying the tip’s anchor,
609
+ * typically bound to the *x* scale.
610
+ */
611
+ x1?: ChannelValueSpec;
612
+ /**
613
+ * The ending horizontal position channel specifying the tip’s anchor,
614
+ * typically bound to the *x* scale.
615
+ */
616
+ x2?: ChannelValueSpec;
617
+ /**
618
+ * The vertical position channel specifying the tip’s anchor, typically
619
+ * bound to the *y* scale.
620
+ */
621
+ y?: ChannelValueSpec;
622
+ /**
623
+ * The starting vertical position channel specifying the tip’s anchor,
624
+ * typically bound to the *y* scale.
625
+ */
626
+ y1?: ChannelValueSpec;
627
+ /**
628
+ * The ending vertical position channel specifying the tip’s anchor, typically
629
+ * bound to the *y* scale.
630
+ */
631
+ y2?: ChannelValueSpec;
632
+ /**
633
+ * The frame anchor specifies defaults for **x** and **y** based on the plot’s
634
+ * frame; it may be one of the four sides (*top*, *right*, *bottom*, *left*),
635
+ * one of the four corners (*top-left*, *top-right*, *bottom-right*,
636
+ * *bottom-left*), or the *middle* of the frame. For example, for tips
637
+ * distributed horizontally at the top of the frame:
638
+ *
639
+ * ```js
640
+ * Plot.tip(data, {x: "date", frameAnchor: "top"})
641
+ * ```
642
+ */
643
+ frameAnchor?: FrameAnchor | ParamRef;
644
+ /**
645
+ * The tip anchor specifies how to orient the tip box relative to its anchor
646
+ * position; it refers to the part of the tip box that is attached to the
647
+ * anchor point. For example, the *top-left* anchor places the top-left corner
648
+ * of tip box near the anchor position, hence placing the tip box below and to
649
+ * the right of the anchor position.
650
+ */
651
+ anchor?: FrameAnchor | ParamRef;
652
+ /**
653
+ * If an explicit tip anchor is not specified, an anchor is chosen
654
+ * automatically such that the tip fits within the plot’s frame; if the
655
+ * preferred anchor fits, it is chosen.
656
+ */
657
+ preferredAnchor?: FrameAnchor | null | ParamRef;
658
+ /**
659
+ * How channel values are formatted for display. If a format is a string, it
660
+ * is interpreted as a (UTC) time format for temporal channels, and otherwise
661
+ * a number format.
662
+ */
663
+ format?: {
664
+ [name in ChannelName]?: boolean | string | ParamRef;
665
+ };
666
+ /** The image filter for the tip’s box; defaults to a drop shadow. */
667
+ pathFilter?: string | ParamRef;
668
+ /** The size of the tip’s pointer in pixels; defaults to 12. */
669
+ pointerSize?: number | ParamRef;
670
+ /** The padding around the text in pixels; defaults to 8. */
671
+ textPadding?: number | ParamRef;
672
+ }
673
+ /** How to interpolate between control points. */
674
+ export type Curve = CurveName;
675
+ /** Options for marks that support curves, such as lines and areas. */
676
+ export interface CurveOptions extends CurveAutoOptions {
677
+ /**
678
+ * The curve (interpolation) method for connecting adjacent points. One of:
679
+ *
680
+ * - *basis* - a cubic basis spline (repeating the end points)
681
+ * - *basis-open* - an open cubic basis spline
682
+ * - *basis-closed* - a closed cubic basis spline
683
+ * - *bump-x* - a Bézier curve with horizontal tangents
684
+ * - *bump-y* - a Bézier curve with vertical tangents
685
+ * - *bundle* - a straightened cubic basis spline (suitable for lines only, not areas)
686
+ * - *cardinal* - a cubic cardinal spline (with one-sided differences at the ends)
687
+ * - *cardinal-open* - an open cubic cardinal spline
688
+ * - *cardinal-closed* - an closed cubic cardinal spline
689
+ * - *catmull-rom* - a cubic Catmull–Rom spline (with one-sided differences at the ends)
690
+ * - *catmull-rom-open* - an open cubic Catmull–Rom spline
691
+ * - *catmull-rom-closed* - a closed cubic Catmull–Rom spline
692
+ * - *linear* - a piecewise linear curve (*i.e.*, straight line segments)
693
+ * - *linear-closed* - a closed piecewise linear curve (*i.e.*, straight line segments)
694
+ * - *monotone-x* - a cubic spline that preserves monotonicity in *x*
695
+ * - *monotone-y* - a cubic spline that preserves monotonicity in *y*
696
+ * - *natural* - a natural cubic spline
697
+ * - *step* - a piecewise constant function where *y* changes at the midpoint of *x*
698
+ * - *step-after* - a piecewise constant function where *y* changes after *x*
699
+ * - *step-before* - a piecewise constant function where *x* changes after *y*
700
+ */
701
+ curve?: Curve | ParamRef;
702
+ }
703
+ /** Options for marks that support possibly-projected curves. */
704
+ export interface CurveAutoOptions {
705
+ /**
706
+ * The curve (interpolation) method for connecting adjacent points. One of:
707
+ *
708
+ * - *basis* - a cubic basis spline (repeating the end points)
709
+ * - *basis-open* - an open cubic basis spline
710
+ * - *basis-closed* - a closed cubic basis spline
711
+ * - *bump-x* - a Bézier curve with horizontal tangents
712
+ * - *bump-y* - a Bézier curve with vertical tangents
713
+ * - *bundle* - a straightened cubic basis spline (suitable for lines only, not areas)
714
+ * - *cardinal* - a cubic cardinal spline (with one-sided differences at the ends)
715
+ * - *cardinal-open* - an open cubic cardinal spline
716
+ * - *cardinal-closed* - an closed cubic cardinal spline
717
+ * - *catmull-rom* - a cubic Catmull–Rom spline (with one-sided differences at the ends)
718
+ * - *catmull-rom-open* - an open cubic Catmull–Rom spline
719
+ * - *catmull-rom-closed* - a closed cubic Catmull–Rom spline
720
+ * - *linear* - a piecewise linear curve (*i.e.*, straight line segments)
721
+ * - *linear-closed* - a closed piecewise linear curve (*i.e.*, straight line segments)
722
+ * - *monotone-x* - a cubic spline that preserves monotonicity in *x*
723
+ * - *monotone-y* - a cubic spline that preserves monotonicity in *y*
724
+ * - *natural* - a natural cubic spline
725
+ * - *step* - a piecewise constant function where *y* changes at the midpoint of *x*
726
+ * - *step-after* - a piecewise constant function where *y* changes after *x*
727
+ * - *step-before* - a piecewise constant function where *x* changes after *y*
728
+ * - *auto* (default) - like *linear*, but use the (possibly spherical) projection, if any
729
+ *
730
+ * The *auto* curve is typically used in conjunction with a spherical
731
+ * projection to interpolate along geodesics.
732
+ */
733
+ curve?: Curve | 'auto' | ParamRef;
734
+ /**
735
+ * The tension option only has an effect on bundle, cardinal and Catmull–Rom
736
+ * splines (*bundle*, *cardinal*, *cardinal-open*, *cardinal-closed*,
737
+ * *catmull-rom*, *catmull-rom-open*, and *catmull-rom-closed*). For bundle
738
+ * splines, it corresponds to [beta][1]; for cardinal splines, [tension][2];
739
+ * for Catmull–Rom splines, [alpha][3].
740
+ *
741
+ * [1]: https://d3js.org/d3-shape/curve#curveBundle_beta
742
+ * [2]: https://d3js.org/d3-shape/curve#curveCardinal_tension
743
+ * [3]: https://d3js.org/d3-shape/curve#curveCatmullRom_alpha
744
+ */
745
+ tension?: number | ParamRef;
746
+ }
747
+ /**
748
+ * A built-in stack offset method; one of:
749
+ *
750
+ * - *normalize* - rescale each stack to fill [0, 1]
751
+ * - *center* - align the centers of all stacks
752
+ * - *wiggle* - translate stacks to minimize apparent movement
753
+ *
754
+ * If a given stack has zero total value, the *normalize* offset will not adjust
755
+ * the stack’s position. Both the *center* and *wiggle* offsets ensure that the
756
+ * lowest element across stacks starts at zero for better default axes. The
757
+ * *wiggle* offset is recommended for streamgraphs in conjunction with the
758
+ * *inside-out* order. For more, see [Byron & Wattenberg][1].
759
+ *
760
+ * [1]: https://leebyron.com/streamgraph/
761
+ */
762
+ export type StackOffsetName = 'center' | 'normalize' | 'wiggle';
763
+ /**
764
+ * A stack offset method; one of:
765
+ *
766
+ * - *normalize* - rescale each stack to fill [0, 1]
767
+ * - *center* - align the centers of all stacks
768
+ * - *wiggle* - translate stacks to minimize apparent movement
769
+ *
770
+ * If a given stack has zero total value, the *normalize* offset will not adjust
771
+ * the stack’s position. Both the *center* and *wiggle* offsets ensure that the
772
+ * lowest element across stacks starts at zero for better default axes. The
773
+ * *wiggle* offset is recommended for streamgraphs in conjunction with the
774
+ * *inside-out* order. For more, see [Byron & Wattenberg][1].
775
+ *
776
+ * [1]: https://leebyron.com/streamgraph/
777
+ */
778
+ export type StackOffset = StackOffsetName;
779
+ /**
780
+ * The built-in stack order methods; one of:
781
+ *
782
+ * - *x* - alias of *value*; for stackX only
783
+ * - *y* - alias of *value*; for stackY only
784
+ * - *value* - ascending value (or descending with **reverse**)
785
+ * - *sum* - total value per series
786
+ * - *appearance* - position of maximum value per series
787
+ * - *inside-out* (default with *wiggle*) - order the earliest-appearing series on the inside
788
+ *
789
+ * The *inside-out* order is recommended for streamgraphs in conjunction with
790
+ * the *wiggle* offset. For more, see [Byron & Wattenberg][1].
791
+ *
792
+ * [1]: https://leebyron.com/streamgraph/
793
+ */
794
+ export type StackOrderName = 'value' | 'x' | 'y' | 'z' | 'sum' | 'appearance' | 'inside-out';
795
+ /**
796
+ * How to order layers prior to stacking; one of:
797
+ *
798
+ * - a named stack order method such as *inside-out* or *sum*
799
+ * - a field name, for natural order of the corresponding values
800
+ * - an array of explicit **z** values in the desired order
801
+ */
802
+ export type StackOrder = StackOrderName | `-${StackOrderName}` | (string & Record<never, never>) | any[];
803
+ /** Options for the stack transform. */
804
+ export interface StackOptions {
805
+ /**
806
+ * After stacking, an optional **offset** can be applied to translate and
807
+ * scale stacks, say to produce a streamgraph; defaults to null for a zero
808
+ * baseline (**y** = 0 for stackY, and **x** = 0 for stackX). If the *wiggle*
809
+ * offset is used, the default **order** changes to *inside-out*.
810
+ */
811
+ offset?: StackOffset | null | ParamRef;
812
+ /**
813
+ * The order in which stacks are layered; one of:
814
+ *
815
+ * - null (default) for input order
816
+ * - a named stack order method such as *inside-out* or *sum*
817
+ * - a field name, for natural order of the corresponding values
818
+ * - a function of data, for natural order of the corresponding values
819
+ * - an array of explicit **z** values in the desired order
820
+ *
821
+ * If the *wiggle* **offset** is used, as for a streamgraph, the default
822
+ * changes to *inside-out*.
823
+ */
824
+ order?: StackOrder | null | ParamRef;
825
+ /** If true, reverse the effective order of the stacks. */
826
+ reverse?: boolean | ParamRef;
827
+ /**
828
+ * The **z** channel defines the series of each value in the stack. Used when
829
+ * the **order** is *sum*, *appearance*, *inside-out*, or an explicit array of
830
+ * **z** values.
831
+ */
832
+ z?: ChannelValue;
833
+ }
834
+ /**
835
+ * The built-in marker implementations; one of:
836
+ *
837
+ * - *arrow* - an arrowhead with *auto* orientation
838
+ * - *arrow-reverse* - an arrowhead with *auto-start-reverse* orientation
839
+ * - *dot* - a filled *circle* with no stroke and 2.5px radius
840
+ * - *circle-fill* - a filled circle with a white stroke and 3px radius
841
+ * - *circle-stroke* - a stroked circle with a white fill and 3px radius
842
+ * - *circle* - alias for *circle-fill*
843
+ * - *tick* - a small opposing line
844
+ * - *tick-x* - a small horizontal line
845
+ * - *tick-y* - a small vertical line
846
+ */
847
+ export type MarkerName = 'arrow' | 'arrow-reverse' | 'dot' | 'circle' | 'circle-fill' | 'circle-stroke' | 'tick' | 'tick-x' | 'tick-y';
848
+ /** Options for marks that support markers, such as lines and links. */
849
+ export interface MarkerOptions {
850
+ /**
851
+ * Shorthand to set the same default for markerStart, markerMid, and
852
+ * markerEnd; one of:
853
+ *
854
+ * - a marker name such as *arrow* or *circle*
855
+ * - *none* (default) - no marker
856
+ * * true - alias for *circle-fill*
857
+ * * false or null - alias for *none*
858
+ */
859
+ marker?: MarkerName | 'none' | boolean | null | ParamRef;
860
+ /**
861
+ * The marker for the starting point of a line segment; one of:
862
+ *
863
+ * - a marker name such as *arrow* or *circle*
864
+ * * *none* (default) - no marker
865
+ * * true - alias for *circle-fill*
866
+ * * false or null - alias for *none*
867
+ */
868
+ markerStart?: MarkerName | 'none' | boolean | null | ParamRef;
869
+ /**
870
+ * The marker for any middle (interior) points of a line segment. If the line
871
+ * segment only has a start and end point, this option has no effect. One of:
872
+ *
873
+ * - a marker name such as *arrow* or *circle*
874
+ * * *none* (default) - no marker
875
+ * * true - alias for *circle-fill*
876
+ * * false or null - alias for *none*
877
+ * * a function - a custom marker function; see below
878
+ */
879
+ markerMid?: MarkerName | 'none' | boolean | null | ParamRef;
880
+ /**
881
+ * The marker for the ending point of a line segment; one of:
882
+ *
883
+ * - a marker name such as *arrow* or *circle*
884
+ * * *none* (default) - no marker
885
+ * * true - alias for *circle-fill*
886
+ * * false or null - alias for *none*
887
+ */
888
+ markerEnd?: MarkerName | 'none' | boolean | null | ParamRef;
889
+ }
890
+ export {};