{
const svg = d3.create("svg").attr("width", width).attr("height", height);
svg
.append("svg:defs")
.append("svg:marker")
.attr("id", "triangle")
.attr("refX", 5)
.attr("refY", 0)
.attr("markerWidth", 3)
.attr("markerHeight", 3)
.attr("markerUnits", "strokeWidth")
.attr("orient", "auto")
.attr("viewBox", "0 -5 10 10")
.append("path")
.attr("d", "M0,-5L10,0L0,5")
.style("fill", "#934C93");
svg
.selectAll("line")
.data(coords)
.enter()
.append("line")
.attr("stroke", "#934C93")
.attr("stroke-width", 1)
.attr("marker-end", "url(" + window.location + "#triangle)")
.attr("x1", (d) => d.lon)
.attr("y1", (d) => d.lat)
.attr("x2", (d) => d.lon + d.u)
.attr("y2", (d) => d.lat + d.v);
return svg.node();
}