private renderXAxis()

in packages/timebrush/src/TimeBrush.ts [643:681]


    private renderXAxis(height: number) {
        this.xAxis
            .attr("transform", `translate(0,${height})`)
            .call(d3.svg.axis().scale(this.x).orient("bottom").ticks(this.dimensions.width / TICK_WIDTH));


        this.xAxis
            .selectAll(".tick")
            .call((dateTicks) => {
                setTimeout(() => {
                    // Removes all overlapping/offscreen thangies
                    const svgInfo = (this.svg.node() as Element).getBoundingClientRect();
                    for (let j = 0; j < dateTicks[0].length; j++) {
                        const c = dateTicks[0][j] as Element;
                        let n = dateTicks[0][j + 1] as Element;
                        const cRect = c && c.getBoundingClientRect();
                        let nRect = n && n.getBoundingClientRect();
                        if (cRect &&
                            (Math.floor(cRect.right) > Math.ceil(svgInfo.right) ||
                                Math.ceil(cRect.left) < Math.floor(svgInfo.left))) {
                            d3.select(c).remove();
                            continue;
                        }
                        if (!cRect || !nRect) {
                            continue;
                        }
                        while (Math.floor(cRect.right) > Math.ceil(nRect.left)) {
                            d3.select(n).remove();
                            j++;
                            n = dateTicks[0][j + 1] as Element;
                            nRect = n && n.getBoundingClientRect();
                            if (!n) {
                                break;
                            }
                        }
                    }
                }, 50);
            });
    }