JSFiddle - React, Tailwind, and code Playground

by CoolBlue

HTML

<div class="vis"></div>
<div id="log"></div>

CSS

#log {white-space: pre;}

JavaScript

d3.scale.category10().range().reduce(function(o, c, i){
    return o //.transition().duration(500)
        .transition().duration(500).ease("linear")
        .each("start", function(d,i){console.log("start " + i)})
    .style({background: c}).text(["c",i,c].join("\t"))
}, d3.select(".vis").append("div").append("p")
     .style({background: "red", opacity: 0.6}).text("red cx")
)

    .call(function(s){
    console.log("cleanup")
    s.transition().style({background: "green"}).text("green cy")
})