legend = html`<svg font-family="Arial" font-size="14" width=1000 height=100>
<text font-size="12" x=0 y=14>Votes in county-level victory margin</text>
<g transform="translate(0,20)">
<text font-size="11" x=110 y=14><100</text>
${
colorScale.winnerMarginThresholds.map((d, i) => `<text font-size="11" x=${160+50*i} y=14>${d3.format(',.0f')(d)}+</text>`)
}
</g>
<g transform="translate(0,40)">
<text x=0 y=14>Ryan Zinke</text>
${
colorScale.zinkeColors.map((color, i) => {
return `<rect x=${100+50*i} y=0 height=18 width=50 fill="${color}"/>`
})
}
</g>
<g transform="translate(0,60)">
<text x=0 y=14>Al Olszewski</text>
${
colorScale.olszewskiColors.map((color, i) => {
return `<rect x=${100+50*i} y=0 height=18 width=50 fill="${color}"/>`
})
}
</g>
<g transform="translate(0,80)">
<text font-size=12 font-style="italic" x=0 y=14>GOP candidates Mary Todd, Matt Jette and Mitch Heuer didn't win any of the district's counties</text>
</g>
<svg>`