drawConstructors = (selector) => {
const poly = regularPolygon.regularPolygon()
.center(50,50)
.radius(45)
.edges(4)
.rotation(Math.PI / 4);
const drawConstructor = (polyId, newPolygon) => {
const polyPath = selector.select(`#${polyId}`);
polyPath.append("path")
.attr("d", poly.path())
.attr("class", "polygon");
polyPath.append("path")
.attr("d", newPolygon.path())
.attr("fill", "maroon");
}
drawConstructor("radius", poly.radius(30));
drawConstructor("center", poly.center(45,55));
drawConstructor("edges", poly.edges(3));
drawConstructor("rotation", poly.rotation(0));
}