{
const bars = d3.select(barChart)
.select("g#bars")
.selectAll("rect")
.data(sorted);
const lines = d3.select(lineChart)
.select("g#lines")
.selectAll("path")
.data(grouped);
const debug = html`<p>${bars.size()} bars selected</p>`;
bars.on("mouseover", function(d) {
d3.select(this)
.transition()
.style("fill", "lightseagreen");
lines.filter(e => e[0] == d[0])
.raise()
.transition()
.style("stroke", "lightseagreen")
.style("stroke-width", "3px");
d3.select(debug).text(`Bar: ${d[0]}`);
});
bars.on("mouseout", function(d) {
d3.select(this)
.transition()
.style("fill", "lightgray");
lines.filter(e => e[0] == d[0])
.raise()
.transition()
.style("stroke", "lightgray")
.style("stroke-width", "1px");
});
return debug;
}