hexNew2 = {
const p = [(600/2),(400/2)]
const i = [35,80]
const hexGridData = filDat2;
const hexColors = {5: "rgba(0, 224, 135, 0.4)", 50: "rgba(0, 168, 224, 0.8)", 200: "rgba(135, 0, 224, 0.9)"}
const hexPos = (d) => [(p[0]+d[0]),(p[1]+d[1])]
const coords = [[i[0], i[1]],[i[0]-i[0], (i[1]*.75)],[(i[0]-i[0]), (i[1]*.25)],
[i[0], (i[1]-i[1])],[i[0]*2, i[1]*.25], [i[0]*2, i[1]*.75]];
const coordsInit = [[i[0]+10, i[1]-10],[i[0]-i[0]+10, (i[1]*.75)-10],[(i[0]-i[0]+10), (i[1]*.25)-10],
[i[0], (i[1]-i[1])],[i[0]*2, i[1]*.25], [i[0]*2, i[1]*.75]];
const element = this || scrollSVG(html`<svg width=${width} height=${svgHeight}></svg>`)
const svg = d3.select(element).select('svg')
const t = svg.transition().duration(1000)
const g = svg.selectAll('g')
.data(hexGridData, d => d.id)
.join(
enter => {
const g = enter.append('g')
.attr('opacity', 0)
.attr('transform', (d, i) => `translate(${hexPos(d.translate)})`)
g.selectAll('svg')
.data(hexGridData, d => d)
.attr('faksdsde', d => console.log('fakeski'))
.join('path')
.attr('opacity', 0.3)
.attr('d', `M${coords.join("L")}Z`)
.attr('fill', d => hexColors[d.score] || "rgba(0, 224, 135, 0.3)")
.attr('fill-opacity', 0.5)
.attr('stroke', 'white')
.attr('stroke-width', 2)
.transition(t)
//.attr('transform', (d, i) => `translate(${hexPos(d.coords)})`)
//.attr('d', `M${coords.join("L")}Z`)
//.attr('fill', d => hexColors[d.score] || "rgba(0, 224, 135, 0.3)")
console.log('enter')
svg.append("text")
.attr("x", (width / 2))
.attr("y", 35)
.style("font-size", "4px")
.transition()
.duration(2000)
.attr("text-anchor", "bottom")
.style("font-size", "22px")
.attr("font-family", "palatino linotype")
.text("Michigan Regions Covid Data")
g.append('text')
.attr('text-anchor', 'middle')
.attr('dy', '0')
.style('font-size', '.7em')
.style('font-style', 'italic')
//.attr('transform', (d, i) => `translate(${hexPos(d.coords)})`)
.text(d => d.score)
// .text(d => _.truncate(d.title, {length: 20}))
return g
},
update => update,
exit => {
exit.transition(t)
.attr('opacity', 0)
.remove()
console.log('exit')
}
)
g.transition(t)
// // // after the flowers have been entered, animate its opacity to 1
.attr('opacity', 0.5)
.attr('test', d => console.log(d))
// .attr('d', `M${coordsInit.join("L")}Z`)
.attr('transform', (d, i) => `translate(${hexPos(d.coords)})`)
//return element
}