Skip to content

Commit b3db506

Browse files
committed
fix links
1 parent 608fa7c commit b3db506

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/data/api.data.ts

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ function getHref(name: string, path: string): string {
6464
}
6565
case "marks/crosshair":
6666
return "interactions/crosshair";
67+
case "marks/brush":
68+
return "interactions/brush";
6769
case "transforms/basic": {
6870
switch (name) {
6971
case "filter":

docs/interactions/brush.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Plot.plot({
5151

5252
The brush transform is similar to the [pointer](./pointer.md) transform: it interactively filters the mark’s index to show a subset of the data, and re-renders the mark as the selection changes. Since the mark is lazily rendered during interaction, it is fast: only the visible elements are rendered as needed. And, like the filter and select transforms, unfiltered channel values are incorporated into default scale domains.
5353

54-
The brush transform supports both one- and two-dimensional brushing modes. The two-dimensional mode, [brush](#brush-options-1), is used above and is suitable for scatterplots and the general case: it allows the user to define a rectangular region by clicking on a corner (_e.g._ the top-left corner) and dragging the pointer to the bottom-right corner. The one-dimensional modes, [brushX](#brushx-options) and [brushY](#brushy-options), in contrast only consider one dimension; this is desirable when a chart has a “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.
54+
The brush transform supports both one- and two-dimensional brushing modes. The two-dimensional mode, [brush](#brush), is used above and is suitable for scatterplots and the general case: it allows the user to define a rectangular region by clicking on a corner (_e.g._ the top-left corner) and dragging the pointer to the bottom-right corner. The one-dimensional modes, [brushX](#brushX) and [brushY](#brushY), in contrast only consider one dimension; this is desirable when a chart has a “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.
5555

5656
The brush transform emits an [*input* event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event) whenever the selection changes, and sets the value of the plot element to the selected data. This allows you to use a plot as an [Observable view](https://observablehq.com/@observablehq/views) (viewof), or to register an *input* event listener to react to brushing.
5757

@@ -82,26 +82,26 @@ The selection extent is an object with properties *x*: [x1, x2] for brushX, *y*:
8282

8383
For details on the user interface (including touch events, pointer events and modifier keys), see [d3-brush](https://github.com/d3/d3-brush).
8484

85-
## brush(*options*)
85+
## brush(*options*) {#brush}
8686

8787
```js
8888
Plot.dot(penguins, Plot.brush({x: "culmen_length_mm", y: "culmen_depth_mm"}))
8989
```
9090

9191
Applies the brush render transform to the specified *options* to filter the mark index such that the points whose sensitive surface intersect with the brushed region the point closest to the pointer is rendered; the mark will re-render interactively in response to brush events.
9292

93-
## brushX(*options*)
93+
## brushX(*options*) {#brushX}
9494

9595
```js
9696
Plot.tip(aapl, Plot.pointerX({x: "Date", y: "Close"}))
9797
```
9898

99-
Like [brush](#brush-options-1), except the determination of the intersection exclusively considers the *x* (horizontal↔︎) position; this should be used for plots where *x* is the dominant dimension, such as the binned quantitative dimension in a histogram, or the categorical dimension of a bar chart.
99+
Like [brush](#brush), except the determination of the intersection exclusively considers the *x* (horizontal↔︎) position; this should be used for plots where *x* is the dominant dimension, such as the binned quantitative dimension in a histogram, or the categorical dimension of a bar chart.
100100

101-
## brushY(*options*)
101+
## brushY(*options*) {#brushY}
102102

103103
```js
104104
Plot.tip(alphabet, Plot.pointerY({x: "frequency", y: "letter"}))
105105
```
106106

107-
Like [brush](#brush-options-1), except the determination of the intersection exclusively considers the *y* (vertical↕) position; this should be used for plots where *y* is the dominant dimension.
107+
Like [brush](#brush), except the determination of the intersection exclusively considers the *y* (vertical↕) position; this should be used for plots where *y* is the dominant dimension.

0 commit comments

Comments
 (0)