|
|
|
|
@ -17,6 +17,18 @@ svg.selectAll("circle")
|
|
|
|
|
.data(dataset)
|
|
|
|
|
.enter()
|
|
|
|
|
.append("circle")
|
|
|
|
|
.attr("cx", d => d[0])
|
|
|
|
|
.attr("cy", d => d[1])
|
|
|
|
|
.attr("r", 5);
|
|
|
|
|
.attr("cx", pt => pt[0])
|
|
|
|
|
.attr("cy", pt => pt[1])
|
|
|
|
|
.attr("r", 5);
|
|
|
|
|
|
|
|
|
|
// create label for each point
|
|
|
|
|
svg.selectAll("text")
|
|
|
|
|
.data(dataset)
|
|
|
|
|
.enter()
|
|
|
|
|
.append("text")
|
|
|
|
|
.text(pt => `${pt[0]},${pt[1]}`)
|
|
|
|
|
.attr("x", pt => pt[0])
|
|
|
|
|
.attr("y", pt => pt[1])
|
|
|
|
|
.attr("font-family", "sans-serif")
|
|
|
|
|
.attr("font-size", "11px")
|
|
|
|
|
.attr("fill", "red");
|