When the brush is removed by clicking instead of dragging, an issue arises where the active selection does not reset. Any suggestions on how to fix this?
Any thoughts on addressing this issue?
Cheers!
// A function that manages a brush event and toggles the display of foreground lines.
function toggle_brush_parallel_chart() {
for(var i=0;i<dimensions.length;++i){
if(d3.event.target==y[dimensions[i]].brush) {
extents[i]=d3.event.selection.map(y[dimensions[i]].invert,y[dimensions[i]]);
}
}
foreground.style("display", function(d) {
return dimensions.every(function(p, i) {
if(extents[i][0]==0 && extents[i][0]==0) {
return true;
}
return extents[i][1] <= d[p] && d[p] <= extents[i][0];
}) ? null : "none";
});
}
http://plnkr.co/edit/RkWBgQ6oi584H3212WrM?p=preview
This scenario occurs when the brush is completely cleared at the beginning: