{
const proj = d3.geoAlbersUsa()
let sldl = topojson.mesh(joint_topojson, joint_topojson.objects.sldl)
let sldls = topojson.feature(joint_topojson, joint_topojson.objects.sldl)
let redlines = topojson.feature(joint_topojson, joint_topojson.objects.redlines)
proj.fitExtent([[0, 0], [width, width*.66]], redlines)
const ctx = canvas.getContext("2d")
ctx.clearRect(0, 0, width, width)
const path = d3.geoPath().projection(proj).context(ctx)
ctx.globalAlpha = .5
ctx.lineWidth = 5
ctx.strokeStyle = "grey"
ctx.beginPath()
path(sldl)
ctx.stroke()
for (let feature of redlines.features) {
ctx.beginPath()
ctx.fillStyle = HOLC_bootstrap[feature.properties.holc_grade]
path(feature)
ctx.fill()
}
ctx.fillStyle = "rgba(0, 0, 0, .6)"
ctx.font = 'bold 32px sans-serif'
for (let feature of sldls.features) {
const centroid = proj(d3.geoCentroid(feature))
ctx.fillText(+feature.properties.SLDLST, centroid[0], centroid[1])
}
}