function chart(eases) {
const line = d3.line();
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
.style("max-width", `${width}px`)
.style("overflow", "visible");
svg.append("g")
.attr("fill", "none")
.attr("stroke", "black")
.attr("stroke-width", 1.5)
.attr("stroke-linecap", "round")
.selectAll("path")
.data(eases)
.join("path")
.attr("stroke-width", (e, i) => i < eases.length - 1 ? 0.25 : null)
.attr("d", e => line(d3.ticks(0, 1, width).map(t => [x(t), y(e(t))])));
svg.append("g")
.call(xAxis)
.call(g => g.append("text")
.attr("x", width - margin.right)
.attr("y", -3)
.attr("fill", "currentColor")
.attr("font-weight", "bold")
.text("t"));
svg.append("g")
.call(yAxis)
.call(g => g.select(".tick:last-of-type text").clone()
.attr("x", 3)
.attr("text-anchor", "start")
.attr("font-weight", "bold")
.text("t′"));
return svg.node();
}