Skip to content

Commit 84b0976

Browse files
committed
Merge branch 'fil/brush-dataless' into fil/brush-across-facets
2 parents 27319ef + f611a5c commit 84b0976

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

docs/interactions/brush.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The **brush mark** renders a two-dimensional [brush](https://d3js.org/d3-brush)
2525
:::plot hidden
2626
```js
2727
Plot.plot({
28-
marks: ((brush) => (d3.timeout(() => d3.select(brush._brushNodes[0]).call(brush._brush.move, [[100, 60], [300, 200]])), [
28+
marks: ((brush) => (d3.timeout(() => brush.move({x1: 36, x2: 48, y1: 15, y2: 20})), [
2929
Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", stroke: "species"}),
3030
brush
3131
]))(Plot.brush())

src/interactions/brush.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ export class Brush extends Mark {
138138
const d = n.__data__;
139139
return (fx === undefined || d?.x === fx) && (fy === undefined || d?.y === fy);
140140
});
141-
if (!node)
142-
throw new Error(
143-
fx === undefined && fy === undefined ? "No brush node found" : "No brush node found for the specified facet"
144-
);
141+
if (!node) return;
145142
const px1 = this._applyX(x1);
146143
const px2 = this._applyX(x2);
147144
const py1 = this._applyY(y1);

0 commit comments

Comments
 (0)