Skip to content

Commit

Permalink
adds exit animation for text boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed May 24, 2016
1 parent a3990ad commit 6cd5025
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/box.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export default function(data = []) {

const boxes = select.selectAll(".d3plus-text-box").data(data, id);

boxes.exit().remove();
boxes.exit().transition().delay(duration).remove();

boxes.exit().selectAll("tspan").transition().duration(duration)
.attr("opacity", 0);

boxes.enter().append("text")
.attr("class", "d3plus-text-box")
Expand Down

0 comments on commit 6cd5025

Please sign in to comment.