{
var points = d3.map(bs19cell, (loc) => [xscale(loc.X), yscale(loc.Y)]);
var hull = d3.polygonHull(points);
var line = d3.line().curve(d3.curveLinearClosed);
var svg = d3.create("svg").attr("width", 500).attr("height", 500);
var selection = svg.append("g").attr("fill", "grey").attr("stroke", "green");
selection
.append("polyline")
.attr("points", ...hull)
.attr("stroke", "white");
selection
.append("text")
.attr("x", xscale(100))
.attr("y", yscale(100))
.attr("stroke", "")
.attr("fill", "green")
.attr("stroke-width", 1)
.text("Area: sq pixels");
bslocations.forEach((d) =>
selection
.append("circle")
.attr("cx", xscale(d.X))
.attr("cy", yscale(d.Y))
.attr("stroke", "red")
.attr("r", 2)
);
selection
.append("polygon")
.attr("points", hull)
.attr("stroke", "red")
.attr("fill", "grey")
.attr("opacity", 0.2);
selection
.append("text")
.text("Hello sendil")
.attr("x", xscale(0))
.attr("y", yscale(0))
.attr("fill", "blue")
.attr("stroke", "green");
return svg.node();
}