score:1

Accepted answer

You can achieve this effect with chained transitions that scale in one dimension:

.on("click", function() {
        d3.select(this)
            .transition().duration(1000)
            .attr("transform", "scale(0,1)")
            .transition().duration(1000)
            .attr("transform", "scale(1,1)")
            .text("foo");
    });

Complete example here.


Related Query

More Query from same tag