in src/UXClient/Components/LineChart/LineChart.ts [836:879]
private brushBrush () {
var handleHeight = this.getHandleHeight();
this.brushElem.selectAll('.handle')
.attr('height', handleHeight)
.attr('y', (this.chartHeight - handleHeight) / 2);
if (!d3.event.sourceEvent){
return;
}
if (d3.event.sourceEvent && d3.event.sourceEvent.type === 'mousemove') {
this.brushElem.select(".selection").attr("visibility", "visible");
//check boundary conditions for width of the brush
if (d3.event.selection[1] - d3.event.selection[0] < this.minBrushWidth) {
return;
} else {
this.brushElem.selectAll(".handle").attr("visibility", "visible");
}
}
if (this.surpressBrushTimeSet == true) {
this.surpressBrushTimeSet = false;
return;
}
if (!d3.event.selection) return;
if (this.contextMenu)
this.contextMenu.hide();
if (this.brushContextMenu)
this.brushContextMenu.hide();
var newBrushStartPosition = d3.event.selection[0];
var newBrushEndPosition = d3.event.selection[1];
if (newBrushStartPosition != this.brushStartPosition) {
this.brushStartTime = this.x.invert(d3.event.selection[0]);
this.brushStartPosition = newBrushStartPosition;
}
if (newBrushEndPosition != this.brushEndPosition) {
this.brushEndTime = this.x.invert(d3.event.selection[1]);
this.brushEndPosition = newBrushEndPosition;
}
if (this.chartOptions.brushMoveAction) {
this.chartOptions.brushMoveAction(this.brushStartTime, this.brushEndTime);
}
}