viewof chart4 = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
let node = svg.node()
node.value = ""
svg.append("path")
.datum(california)
.attr("fill", "none")
.attr("stroke", "#777")
.attr("stroke-width", 0.5)
.attr("stroke-linejoin", "round")
.attr("d", d3.geoPath(projection));
svg.append("g")
.selectAll("path")
.data(fullhexbinmapped)
.join("path")
.attr("transform", d => `translate(${d.x},${d.y})`)
.attr("d", d => hexbin.hexagon())
.style("fill", d => {
let t = d.days.get(time2)
if(t)
return colorPM1(t.pm1)
return "#aaa"
})
.style("opacity", d => {
let t = d.days.get(time2)
if(t)
return opacityPM1(t.pm1)
return 0.05
})
.on("mouseover", (e,d) => {
let t = d.days.get(time2)
node.value = t
node.dispatchEvent(new CustomEvent("input", { bubbles: true }));
})
.append("title")
return node
}