tick(){ const svg = d3.select(this.refs.myDiv); const t = svg.transition().duration(750) svg.selectAll('text') .data(this.randomLetters(), d => d) .join( enter => enter.append("text") .attr("fill", "green") .attr("x", (d, i) => i * 16) .attr("y", -30) .text(d => d) .call(enter => enter.transition(t) .attr("y", 0)), update => update .attr("fill", "black") .attr("y", 0) .call(update => update.transition(t) .attr("x", (d, i) => i * 16)), exit => exit .attr("fill", "brown") .call(exit => exit.transition(t) .attr("y", 30) .remove())) }
.selectAll("g") .data(data) .join( enter => enter
.selectAll('.bar') .data(data) .join( (enter) => enter
.join("path") .attr("d", feature => path(feature)) .on("click", feature => handleFeatureClick(feature))