legend = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, 60]);
for (let t of keys) {
svg.call(t);
}
svg
.append("g")
.selectAll("rect")
.data(candidates)
.join("rect")
.attr("fill", d=> scale(d).url())
.attr("stroke", "#111")
.attr("width", legendSize)
.attr("height", legendSize)
.attr("x", d=> candidates.indexOf(d)*(legendSize + 5))
.attr("y", 5)
return html`<div style='color:${color};'>${svg.node()}</div>`;
}