{
const svg = d3.create("svg").attr("width", width).attr("height", height);
svg
.append("rect")
.attr("width", width)
.attr("height", height)
.attr("fill", "#334");
const g = svg.append("g");
g.selectAll(".postureLines")
.data(postureData)
.enter()
.append("path")
.attr("d", (d) => lineGen(d))
.attr("stroke-width", 1)
.attr("stroke", (d) =>
d3.interpolateViridis(
d3.scaleLinear().domain([0, 0.5])(d[0].value - d[1].value)
)
)
.attr("fill", "none")
.attr("opacity", 0.25)
.on("mouseover", (e, d) =>
d3
.select(e.target)
.raise()
.transition()
.attr("opacity", 1)
.attr("stroke-width", 2)
)
.on("mouseout", (e, d) =>
d3
.select(e.target)
.lower()
.transition()
.attr("opacity", 0.25)
.attr("stroke-width", 1)
);
return svg.node();
}