Skip to content

Commit e9d5d8c

Browse files
committed
fixes
1 parent 62d8985 commit e9d5d8c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/marks/brush.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import {brush as brusher, brushX as brusherX, brushY as brusherY, create, extent} from "d3";
2-
import {filter} from "../defined.js";
3-
import {Mark, identity, first, second} from "../mark.js";
2+
import {identity, first, second} from "../options.js";
3+
import {Mark} from "../plot.js";
4+
45
const {max, min} = Math;
56

67
const defaults = {};
8+
79
export class Brush extends Mark {
810
constructor(data, {x = first, y = second, selection, onbrush, ...options} = {}) {
911
super(
@@ -20,7 +22,7 @@ export class Brush extends Mark {
2022
this.onbrush = onbrush;
2123
}
2224
render(
23-
I,
25+
index,
2426
{x, y},
2527
{x: X, y: Y, picker: J},
2628
{marginLeft, width, marginRight, marginTop, height, marginBottom}
@@ -37,7 +39,6 @@ export class Brush extends Mark {
3739
.extent(bounds)
3840
.on("start brush end", (event) => {
3941
const {type, selection, sourceEvent} = event;
40-
let index = filter(I, X, Y);
4142
if (selection) {
4243
if (X) {
4344
const [x0, x1] = Y ? [selection[0][0], selection[1][0]] : selection;
@@ -64,13 +65,13 @@ export class Brush extends Mark {
6465
}
6566
}
6667
});
67-
68+
6869
g.call(brush);
69-
70+
7071
/* 🌶 async
7172
* wait for the ownerSVGElement to:
7273
* - send the first signal
73-
* - register the multiple brushes (for faceting)
74+
* - register the multiple brushes (for faceting)
7475
*/
7576
setTimeout(() => {
7677
const svg = g.node().ownerSVGElement;
@@ -101,7 +102,7 @@ export class Brush extends Mark {
101102
}
102103
}
103104
}, 1);
104-
105+
105106
return g.node();
106107
}
107108
}

0 commit comments

Comments
 (0)