chart = {
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("fill", "none")
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round");
const gradient = DOM.uid();
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
svg
.append("linearGradient")
.attr("id", gradient.id)
.attr("gradientUnits", "userSpaceOnUse")
.attr("x1", 0)
.attr("y1", height - margin.bottom)
.attr("x2", 0)
.attr("y2", margin.top)
.selectAll("stop")
.data(d3.ticks(0, 1, 10))
.join("stop")
.attr("offset", (d) => d)
.attr("stop-color", color);
svg
.append("path")
.datum(blossoms.filter(line.defined()))
.attr("stroke", "#ccc")
.attr("d", line);
svg
.append("path")
.datum(blossoms)
.attr("stroke", gradient)
.attr("stroke-width", 1.5)
.attr("d", line);
return svg.node();
}