{
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const mv_labels = svg.append("g");
const max_vects = svg.append("g");
const elo_thermos = svg
.append("g")
.style("fill", "#FFFFFF")
.style("stroke", "#000000");
const ord_thermos = svg
.append("g")
.style("fill", "#FFFFFF")
.style("stroke", "#000000");
const elo_therm_fill = svg
.append("g")
.style("fill", "#a8590b")
.style("stroke", null);
const ord_therm_fill = svg
.append("g")
.style("fill", "#4B3A93")
.style("stroke", null);
const elo_points = svg.append("g");
const ord_points = svg.append("g");
svg
.style("font-family", "sans-serif")
.style("text-anchor", "start")
.style("font-weight", 900);
svg
.append("text")
.attr("x", x01(0))
.attr("y", margin.top)
.text(vector_str);
let mv = vector2macrovector(vector_str);
svg
.append("text")
.attr("x", x01(0.5))
.attr("y", margin.top + 32)
.text(mv);
svg
.append("text")
.attr("x", x01(0))
.attr("y", margin.top + 60)
.style("font-weight", 100)
.text(elo_scores[mv]);
svg
.append("text")
.attr("x", x.range()[1])
.attr("y", margin.top + 60)
.style("font-weight", 100)
.text(Math.round(10 * x.domain()[1]) / 10);
mv_labels
.selectAll("text")
.data(Object.entries(macro2object(mv)))
.join("text")
.attr("y", (d) => y_eq(d[0]) + y_eq.bandwidth() / 2)
.attr("x", margin.left)
.text((d) => d[1]);
elo_points
.selectAll("circle")
.data(point_data)
.join("circle")
.attr("cx", (d) => x(d[1].mode5))
.attr("cy", (d) => y_eq(d[0]) + y_eq.bandwidth() / 6)
.attr("r", 7)
.style("fill", d=> d[1]);
return svg.node();
}