{
const body = html`<div></div>`
let div = d3.select(body)
.selectAll("div")
.data([4, 8, 15, 16, 23, 42])
.join("div")
.text(d => d);
div = div.data([1, 2, 4, 8, 16, 32], (d, i, nodes) => {
console.log("d: ", d);
return d;
});
const t = div.transition()
.duration(5000);
div
.join(
enter => enter.append("div")
.text(d => d)
.attr("style", "color: green"),
update => update
.attr("style", "color: gray"),
exit => exit
.attr("style", "color: gray")
.call(exit => exit.transition(t)
.attr("style", "color: red")
.remove())
)
return body
}