mapbaytest2canvas = {
const canvas = d3.create("canvas").node()
canvas.width = width
canvas.height = height
const ctx = canvas.getContext("2d")
let projection = d3.geoAlbersUsa()
.fitSize([width, height], california)
let path = d3.geoPath(projection)
.context(ctx)
ctx.strokeStyle = "#111"
ctx.lineWidth = 1
ctx.beginPath()
path(westCoast)
ctx.stroke()
let sx = (ne[0] - nw[0]) / testPixels.width
let sy = (sw[1] - ne[1]) / testPixels.height
hexdata2.forEach(d => {
ctx.fillStyle = colorPM1(d.v)
let lnglat = mercator.invert([d.x * sx + nw[0], d.y * sy + nw[1]])
let a = projection([round(lnglat[0]), round(lnglat[1])])
let p = alb([round(lnglat[0]), round(lnglat[1])])
if(p[0] > 0 && p[0] < width && p[1] > 0 && p[1] < height)
ctx.fillRect(a[0], a[1], 5, 5)
})
return canvas
}