viewof oneDimensionBrushes = {
const brush_svg = d3.create('svg')
.attr('height', height)
.attr('width', width);
const g1 = brush_svg.append('g').attr('transform', 'translate(0,0)').attr('class', 'oned-brushes')
const g2 = brush_svg.append('g').attr('transform', 'translate(300,0)').attr('class', 'oned-brushes');
const g3 = brush_svg.append('g').attr('transform', 'translate(600,0)').attr('class', 'oned-brushes');
g1.append('rect').attr('height', height).attr('width', rectangleWidth).attr('fill', 'none').attr('stroke', 'red');
g2.append('rect').attr('height', height).attr('width', rectangleWidth).attr('fill', 'none').attr('stroke', 'red');
g3.append('rect').attr('height', height).attr('width', rectangleWidth).attr('fill', 'none').attr('stroke', 'red');
const brushGroups = brush_svg.selectAll('.oned-brushes')
let activeBrush = null;
let activeBrushNode = null;
brushGroups.each(function(){
const selection = d3.select(this);
const brush = d3.brushY()
.extent([[0,0], [rectangleWidth, height]])
.on('start', function () {
if (activeBrush && selection !== activeBrushNode) {
activeBrushNode.call(activeBrush.move, null);
}
activeBrush = brush;
activeBrushNode = selection;
});
selection.call(brush);
return selection;
})
return brush_svg.node()
}