private drawLinesStaticBeforeAnimation()

in src/visual.ts [1205:1242]


    private drawLinesStaticBeforeAnimation(limit: number) {
        let node: ClassAndSelector = Visual.Line,
            nodeParent: ClassAndSelector = Visual.LineContainer,
            rootSelection: Selection<any> = this.rootSelection;

        this.animationSelection = rootSelection.filter((d, index) => {
            return index === limit;
        }).select(nodeParent.selectorName).selectAll(node.selectorName).data((d: Series) => [d]);

        const animationSelectionMerged = this.animationSelection
            .enter()
            .append("path")
            .merge(this.animationSelection);
        animationSelectionMerged.classed(node.className, true);

        animationSelectionMerged
            .style("fill", "none")
            .style("stroke", (d: Series) => d.color)
            .style("stroke-width", (d: Series) => `${d.width}px`);

        animationSelectionMerged
            .attr("d", (d: Series) => {
                let flooredStart = this.animationHandler.flooredPosition.index;

                if (flooredStart === 0) {
                    this.moveAnimationDot(d.data[0]);
                    return this.lineX([]);
                } else {
                    let dataReduced: DataPoint[] = d.data.slice(0, flooredStart + 1);
                    this.moveAnimationDot(dataReduced[dataReduced.length - 1]);
                    return this.lineX(dataReduced);
                }
            });

        this.animationSelection
            .exit()
            .remove();
    }