-
Notifications
You must be signed in to change notification settings - Fork 186
/
Copy pathcell.d.ts
74 lines (68 loc) · 2.85 KB
/
cell.d.ts
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
import type {ChannelValueSpec} from "../channel.js";
import type {InsetOptions} from "../inset.js";
import type {Data, MarkOptions, RenderableMark} from "../mark.js";
import type {RectCornerOptions} from "./rect.js";
/** Options for the cell mark. */
export interface CellOptions extends MarkOptions, InsetOptions, RectCornerOptions {
/**
* The horizontal position of the cell; an optional ordinal channel typically
* bound to the *x* scale. If not specified, the cell spans the horizontal
* extent of the frame; otherwise the *x* scale must be a *band* scale.
*
* If *x* represents quantitative or temporal values, use a barX mark instead;
* if *y* is also quantitative or temporal, use a rect mark.
*/
x?: ChannelValueSpec;
/**
* The vertical position of the cell; an optional ordinal channel typically
* bound to the *y* scale. If not specified, the cell spans the vertical
* extent of the frame; otherwise the *y* scale must be a *band* scale.
*
* If *y* represents quantitative or temporal values, use a barY mark instead;
* if *x* is also quantitative or temporal, use a rect mark.
*/
y?: ChannelValueSpec;
}
/**
* Returns a rectangular cell mark for the given *data* and *options*. Along
* with **x** and/or **y**, a **fill** channel is typically specified to encode
* value as color. For example, for a heatmap of the IMDb ratings of Simpons
* episodes by season:
*
* ```js
* Plot.cell(simpsons, {x: "number_in_season", y: "season", fill: "imdb_rating"})
* ```
*
* If neither **x** nor **y** are specified, *data* is assumed to be an array of
* pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*,
* *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …].
*
* Both **x** and **y** should be ordinal; if only **x** is quantitative (or
* temporal), use a barX mark; if only **y** is quantitative, use a barY mark;
* if both are quantitative, use a rect mark.
*/
export function cell(data?: Data, options?: CellOptions): Cell;
/**
* Like cell, but **x** defaults to the zero-based index [0, 1, 2, …], and if
* **stroke** is not a channel, **fill** defaults to the identity function,
* assuming that *data* = [*x₀*, *x₁*, *x₂*, …]. For a quick horizontal stripe
* map visualizating an array of numbers:
*
* ```js
* Plot.cellX(values)
* ```
*/
export function cellX(data?: Data, options?: CellOptions): Cell;
/**
* Like cell, but **y** defaults to the zero-based index [0, 1, 2, …], and if
* **stroke** is not a channel, **fill** defaults to the identity function,
* assuming that *data* = [*y₀*, *y₁*, *y₂*, …]. For a quick vertical stripe map
* visualizating an array of numbers:
*
* ```js
* Plot.cellY(values)
* ```
*/
export function cellY(data?: Data, options?: CellOptions): Cell;
/** The cell mark. */
export class Cell extends RenderableMark {}