Skip to content

Commit 3223bc7

Browse files
committed
document select
1 parent 2e53957 commit 3223bc7

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,36 +1104,41 @@ Groups on the first of *z*, *fill*, or *stroke*, if any; if none of *z*, *fill*,
11041104

11051105
[Source](./src/transforms/select.js) · [Examples](https://observablehq.com/@data-workflows/plot-select)
11061106

1107+
The select transforms extract one (or possibly several) data points from a series. They can be used to label a line, or annotate an extremal value. Series are defined by *facet* and *z* (or *fill* or *stroke*).
1108+
11071109
#### Plot.selectFirst(*options*)
11081110

1109-
1111+
Selects the first point of the series, in input order.
11101112

11111113
#### Plot.selectLast(*options*)
11121114

1113-
1115+
Selects the last point of the series, in input order.
11141116

11151117
#### Plot.selectMinX(*options*)
11161118

1117-
1119+
Selects the left-most point of the series.
11181120

11191121
#### Plot.selectMinY(*options*)
11201122

1121-
1123+
Selects the lowest point of the series.
11221124

11231125
#### Plot.selectMaxX(*options*)
11241126

1125-
1127+
Selects the right-most point of the series.
11261128

11271129
#### Plot.selectMaxY(*options*)
11281130

1129-
1131+
Selects the highest point of the series.
1132+
11301133

11311134
### Stack
11321135

11331136
[<img src="./img/stack.png" width="320" height="198" alt="a stacked area chart of revenue by category">](https://observablehq.com/@data-workflows/plot-stack)
11341137

11351138
[Source](./src/transforms/stack.js) · [Examples](https://observablehq.com/@data-workflows/plot-stack)
11361139

1140+
TODO stack intro
1141+
11371142
#### Plot.stackY(_options_)
11381143

11391144
Creates new channels **y1** and **y2**, obtained by stacking the original **y** channel for data points that share a common **x** (and possibly **z**) value. A new **y** channel is also returned, which lazily computes the middle value of **y1** and **y2**. The input **y** channel defaults to a constant 1, resulting in a count of the data points.

0 commit comments

Comments
 (0)