public drawCursorText()

in ui/src/Map.tsx [249:278]


    public drawCursorText(gridDimensions: any, svg: Selection<d3.BaseType, {}, null, undefined>, coords: number[]) {

        const xOffset = gridDimensions.width - 120;
        const yOffset = gridDimensions.height + 30;

        let textbox = svg.selectAll("g.cursortextbox")
            .data(["CursorTextbox"]);

        textbox = textbox.enter()
            .append("svg:g")
            .attr("class", "cursortextbox")
            .attr("transform", (d: string) => {
                return "translate(" + xOffset + "," + yOffset + ")";
            }).merge(textbox);

        const text = textbox.selectAll("text.cursortext")
            .data([coords]);

        text.enter()
            .append("svg:text")
            .attr("class", "cursortext")
            .attr("x", 12)
            .attr("dy", ".31em")
            .merge(text)
            .text((coordinates: any) => {
                return "X:" + coordinates[0].toFixed(3) + ", Y:" + coordinates[1].toFixed(3);
            });

        return text;
    }