Skip to content

Commit 6495cab

Browse files
committed
Merge branch 'fil/brush-dataless' into fil/brush+tip
2 parents a49628f + f611a5c commit 6495cab

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

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
@@ -123,10 +123,7 @@ export class Brush extends Mark {
123123
const d = n.__data__;
124124
return (fx === undefined || d?.x === fx) && (fy === undefined || d?.y === fy);
125125
});
126-
if (!node)
127-
throw new Error(
128-
fx === undefined && fy === undefined ? "No brush node found" : "No brush node found for the specified facet"
129-
);
126+
if (!node) return;
130127
const px1 = this._applyX(x1);
131128
const px2 = this._applyX(x2);
132129
const py1 = this._applyY(y1);

0 commit comments

Comments
 (0)