@@ -2,20 +2,79 @@ import type {ChannelValueSpec} from "../channel.js";
2
2
import type { InsetOptions } from "../inset.js" ;
3
3
import type { Data , MarkOptions , RenderableMark } from "../mark.js" ;
4
4
5
+ /** Options for the tickX mark. */
5
6
export interface TickXOptions extends MarkOptions , Omit < InsetOptions , "insetLeft" | "insetRight" > {
7
+ /**
8
+ * The required horizontal position of the tick; a channel typically bound to
9
+ * the *x* scale.
10
+ */
6
11
x ?: ChannelValueSpec ;
12
+
13
+ /**
14
+ * The optional vertical position of the tick; a categorical channel typically
15
+ * bound to the *y* scale. If not specified, the tick spans the vertical
16
+ * extent of the frame; otherwise the *y* scale must be a *band* scale.
17
+ *
18
+ * If **y** represents quantitative or temporal values, use a ruleX mark
19
+ * instead.
20
+ */
7
21
y ?: ChannelValueSpec ;
8
22
}
9
23
24
+ /** Options for the tickY mark. */
10
25
export interface TickYOptions extends MarkOptions , Omit < InsetOptions , "insetTop" | "insetBottom" > {
26
+ /**
27
+ * The required vertical position of the tick; a channel typically bound to
28
+ * the *y* scale.
29
+ */
11
30
y ?: ChannelValueSpec ;
31
+
32
+ /**
33
+ * The optional horizontal position of the tick; a categorical channel
34
+ * typically bound to the *x* scale. If not specified, the tick spans the
35
+ * horizontal extent of the frame; otherwise the *x* scale must be a *band*
36
+ * scale.
37
+ *
38
+ * If **x** represents quantitative or temporal values, use a ruleY mark
39
+ * instead.
40
+ */
12
41
x ?: ChannelValueSpec ;
13
42
}
14
43
44
+ /**
45
+ * Returns a new horizontally-positioned tickX mark (a vertical line, |) for the
46
+ * given *data* and *options*. The **x** channel specifies the tick’s horizontal
47
+ * position and defaults to identity, assuming that *data* = [*x₀*, *x₁*, *x₂*,
48
+ * …]; the optional **y** categorical channel specifies its vertical position.
49
+ * For example, for a horizontal barcode plot of penguins’ weights:
50
+ *
51
+ * ```js
52
+ * Plot.tickX(penguins, {x: "body_mass_g", y: "sex", stroke: "species"})
53
+ * ```
54
+ *
55
+ * If **y** represents quantitative or temporal values, use a ruleX mark
56
+ * instead.
57
+ */
15
58
export function tickX ( data ?: Data , options ?: TickXOptions ) : TickX ;
16
59
60
+ /**
61
+ * Returns a new vertically-positioned tickY mark (a horizontal line, —) for the
62
+ * given *data* and *options*. The **y** channel specifies the vertical position
63
+ * of the tick and defaults to identity, assuming that *data* = [*y₀*, *y₁*,
64
+ * *y₂*, …]; the optional **x** categorical channel specifies its horizontal
65
+ * position. For example, fpr a vertical barcode plot of penguins’ weights:
66
+ *
67
+ * ```js
68
+ * Plot.tickY(penguins, {y: "body_mass_g", x: "sex", stroke: "species"})
69
+ * ```
70
+ *
71
+ * If **x** represents quantitative or temporal values, use a ruleY mark
72
+ * instead.
73
+ */
17
74
export function tickY ( data ?: Data , options ?: TickYOptions ) : TickY ;
18
75
76
+ /** The tickX mark. */
19
77
export class TickX extends RenderableMark { }
20
78
79
+ /** The tickY mark. */
21
80
export class TickY extends RenderableMark { }
0 commit comments