public render()

in src/visualComponent/sparkline/dotsComponent.ts [67:103]


    public render(options: IDotsComponentRenderOptions): void {
        const {
            x,
            y,
            points,
            viewport,
            settings,
        } = options;

        const xScale: DataRepresentationScale = x.scale
            .copy()
            .range([0, viewport.width]);

        const yScale: DataRepresentationScale = y.scale
            .copy()
            .range([viewport.height, 0]);

        const dotSelection: Selection<any, IDataRepresentationPoint, any, any> = this.element
            .selectAll(this.dotSelector.selectorName)
            .data(points.filter((point: IDataRepresentationPoint) => {
                return point && isValueValid(point.y);
            }));

        dotSelection
            .exit()
            .remove();

        dotSelection
            .enter()
            .append("circle")
            .classed(this.dotSelector.className, true)
            .merge(dotSelection)
            .attr("cx", (point: IDataRepresentationPoint) => xScale.scale(point.x))
            .attr("cy", (point: IDataRepresentationPoint) => yScale.scale(point.y))
            .attr("r", settings.getRadius())
            .style("fill", settings.color);
    }