in src/TornadoChartScrolling.ts [150:197]
private renderScrollbar(
brush: d3.BrushBehavior<any>,
brushGraphicsContext: Selection<any>,
brushX: number,
scrollbarHight: number,
onRender: (d3Selection: any, value: number) => void
): void {
let d3Event = () => require("d3-selection").event;
brush.on("brush", () => {
let d3Selection: Selection<any> = d3Event().selection;
window.requestAnimationFrame(() => onRender(d3Selection, 0));
});
this.root.on("wheel", () => {
let d3Selection: Selection<any> = d3Event().selection;
if (!this.isYScrollBarVisible) return;
let wheelEvent: any = d3.event; // Casting to any to avoid compilation errors
onRender(d3Selection, wheelEvent.deltaY);
});
brushGraphicsContext
.attr("transform", translate(brushX, 0))
.attr("drag-resize-disabled", "true");
brushGraphicsContext
.call(brush)
.call(brush.move, [0, scrollbarHight]);
// Disabling the zooming feature
brushGraphicsContext
.selectAll(".handle")
.remove();
brushGraphicsContext
.select(".background")
.remove();
brushGraphicsContext
.select(".overlay")
.remove();
brushGraphicsContext
.selectAll(".selection")
.style("fill-opacity", TornadoChartScrolling.ExtentFillOpacity)
.style("cursor", "default")
.style("display", null);
}