-
Notifications
You must be signed in to change notification settings - Fork 219
Expand file tree
/
Copy pathpointer.d.ts
More file actions
87 lines (74 loc) · 2.99 KB
/
pointer.d.ts
File metadata and controls
87 lines (74 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import type {ChannelValue, ChannelValueSpec} from "../channel.js";
import type {Rendered} from "../transforms/basic.js";
/** Options for the pointer transform. */
export interface PointerOptions {
/**
* The maximum radius in pixels to determine whether to render the closest
* point; if no point is within this radius to the pointer, nothing will be
* rendered. Defaults to 40 pixels. On pointerX and pointerY, only the *x* and
* *y* distance is considered, respectively.
*/
maxRadius?: number;
/** The horizontal target position channel, typically bound to the *x* scale. */
px?: ChannelValue;
/** The vertical target position channel, typically bound to the *y* scale. */
py?: ChannelValue;
/**
* Whether this mark participates in the pointer pool, which ensures that
* only the closest point is shown when multiple pointer marks are present.
* Defaults to true for the tip mark.
*/
pool?: boolean;
/**
* The fallback horizontal target position channel, typically bound to the *x*
* scale; used if **px** is not specified.
*/
x?: ChannelValueSpec;
/**
* The fallback vertical target position channel, typically bound to the *y*
* scale; used if **py** is not specified.
*/
y?: ChannelValueSpec;
/**
* The starting horizontal target position channel, typically bound to the *x*
* scale; used if **px** is not specified.
*/
x1?: ChannelValueSpec;
/**
* The ending horizontal target position channel, typically bound to the *x*
* scale; used if **px** is not specified.
*/
x2?: ChannelValueSpec;
/**
* The starting vertical target position channel, typically bound to the *y*
* scale; used if **py** is not specified.
*/
y1?: ChannelValueSpec;
/**
* The ending vertical target position channel, typically bound to the *y*
* scale; used if **py** is not specified.
*/
y2?: ChannelValueSpec;
}
/**
* Applies a render transform to the specified *options* to filter the mark
* index such that only the point closest to the pointer is rendered; the mark
* will re-render interactively in response to pointer events.
*/
export function pointer<T>(options: T & PointerOptions): Rendered<T>;
/**
* Like the pointer transform, except the determination of the closest point
* considers mostly the *x* (horizontal↔︎) position; this should be used for
* plots where *x* is the dominant dimension, such as time in a time-series
* chart, the binned quantitative dimension in a histogram, or the categorical
* dimension of a bar chart.
*/
export function pointerX<T>(options: T & PointerOptions): Rendered<T>;
/**
* Like the pointer transform, except the determination of the closest point
* considers mostly the *y* (vertical↕︎) position; this should be used for plots
* where *y* is the dominant dimension, such as time in a time-series chart, the
* binned quantitative dimension in a histogram, or the categorical dimension of
* a bar chart.
*/
export function pointerY<T>(options: T & PointerOptions): Rendered<T>;