I'm trying to get selection values for a one-dimensional brush, but it's hard for me to figure out what should be the argument for d3.brushSelection (). I see that the documentation says that the argument must be node, but I don’t know exactly what that means. Is this supposed to be the specific HTML element that the brush is invoked on, or the svg element that contains the brush? I have tried both and both return null.
var xBrush = d3.brushX()
.extent([[0,0], [xWidth,xHeight]])
.on("brush", brushed);
xChart.append("g")
.attr("class", "brush")
.call(xBrush);
If so, how do I create my brush, how can I get the selection value? Thank.
source
share