graphic = () => {
const svg = d3.select(DOM.svg(201, 522)).style("overflow", "visible")
const g = svg.selectAll("g")
.data([
["arc", [[40, 81], [200, 81]]],
["cat", [[40, 201], [200, 201]]],
["quad", [[40, 321], [200, 321]]],
["cubic", [[40, 441], [200, 441]]]
])
.join("g")
g.append("polyline")
.attr("points", d => swoopy[d[0]](...d[1], offset, precision))
.attr("fill", "none")
.attr("stroke", "black");
if (pearls) {
g.selectAll("circle")
.data(d => swoopy[d[0]](...d[1], offset, precision))
.join("circle")
.attr("cx", d => d[0])
.attr("cy", d => d[1])
.attr("fill", "white")
.attr("r", 1)
.attr("stroke", "black")
}
g.append("text")
.attr("font-size", 12)
.attr("text-anchor", "end")
.attr("transform", d => `translate(${d[1][0]})`)
.attr("x", -8)
.text(d => d[0]);
return svg.node();
}