You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-29Lines changed: 32 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1609,6 +1609,38 @@ Like [Plot.mapY](#plotmapymap-options), but applies the window map method with t
1609
1609
1610
1610
The select transform derives a filtered mark index; it does not affect the mark’s data or channels. It is similar to the basic [filter transform](#transforms) except that provides convenient shorthand for pulling a single value out of each series. The data are grouped into series using the *z*, *fill*, or *stroke* channel in the same fashion as the [area](#area) and [line](#line) marks.
1611
1611
1612
+
#### Plot.select(*selector*, *options*)
1613
+
1614
+
Selects the points of each series selected by the *selector*, which can be specified either as a function which receives as input the index of the series, or as a {key: value} object with exactly one key representing a channel and the value being a function which receives as inputs the index of the series and the channel or the shorthand “min” and “max” which respectively select the least and greatest points for the specified channel.
1615
+
1616
+
For example, to select the point within each series that is the closest to the median of the *y* channel:
Selects the first point of each series according to input order.
@@ -1633,35 +1665,6 @@ Selects the rightmost point of each series.
1633
1665
1634
1666
Selects the highest point of each series.
1635
1667
1636
-
### Plot.select(*selector*, *options*)
1637
-
1638
-
Selects the points of each series selected by the *selector*, which can be specified either as a function which receives as input the index of the series, or as a key: value object with exactly one key representing a channel, and the value being a function which receives as inputs the index of the series and the channel or the short-hand "min" and "max" which respectively select the least and greatest points for the specified channel.
1639
-
1640
-
For example, to select the point within each series that is the closest to the median of the *y* channel:
[<imgsrc="./img/stack.png"width="320"height="198"alt="a stacked area chart of revenue by category">](https://observablehq.com/@observablehq/plot-stack)
0 commit comments