"turn off" the brush?

2,013 views
Skip to first unread message

jerome cukier

unread,
May 12, 2012, 8:06:02 PM5/12/12
to d3-js
Hi,
so I get the idea of how to create a brush and use brushstart/brush/
brushend to do wonderful things with the selection.
On another thread there was a discussion that brushes preempts all
other mouse events.
so is there a way to turn off brushing, ie to revert an element to
before .call(brush) was used?
cheers
jerome

Mike Bostock

unread,
May 12, 2012, 9:36:28 PM5/12/12
to d3...@googlegroups.com
You could remove the brush element (e.g., selectAll(".brush").remove),
or you could select it and set the style display: none or
pointer-events: none.

Mike

Mike Travers

unread,
Jul 19, 2012, 2:13:13 PM7/19/12
to d3...@googlegroups.com
Hi, I'm trying to address the same issue (I have a scatter matrix, and I would like to put titles on the points that popup on hover, but the brush control interferes with that).

I have found that there are no elts of class "brush", but there are of class "background". This:
  d3.selectAll(".background").style("pointer-events", "none")
Seems to almost do the trick, but the brush controls are left in a weird half-working state.

Advice appreciated, I don't really understand the event model well enough to tell what is going on.

{}

marc fawzi

unread,
Jul 19, 2012, 3:29:57 PM7/19/12
to d3...@googlegroups.com
Hmm. I think this is may be the same issue I'm having with a stacked area. When I place custom tooltips by adding title element to each path the tooptip pops up on an area much large than that covered by the path... or maybe that's a different problem 

Mike Bostock

unread,
Jul 19, 2012, 3:56:46 PM7/19/12
to d3...@googlegroups.com
You typically specify the "brush" class (or whatever class you prefer) when you add the brush. If you don't specify a class, then there won't be any elements with that class.

Mike
Reply all
Reply to author
Forward
0 new messages