Skip to content

Commit 84d9ece

Browse files
committed
Merge branch 'fil/brush-dataless' into fil/brush-x
# Conflicts: # src/interactions/brush.js
2 parents 85228d4 + f611a5c commit 84d9ece

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
@@ -172,10 +172,7 @@ export class Brush extends Mark {
172172
const d = n.__data__;
173173
return (fx === undefined || d?.x === fx) && (fy === undefined || d?.y === fy);
174174
});
175-
if (!node)
176-
throw new Error(
177-
fx === undefined && fy === undefined ? "No brush node found" : "No brush node found for the specified facet"
178-
);
175+
if (!node) return;
179176
const [px1, px2] = [x1, x2].map(this._applyX).sort(ascending);
180177
const [py1, py2] = [y1, y2].map(this._applyY).sort(ascending);
181178
select(node).call(

0 commit comments

Comments
 (0)