Search code examples
javascriptscaled3.jstransitiontreemap

Is it possible to transition the removal of a node on a treemap in d3?


I'm trying to animate the removal of a tree node. As I move between different treemaps, I can't seem to get the transition to work ok. I currently have code like this

cell.exit()
  .transition()
    .duration(500)
    .call(animateCellRemove)
  .remove();

function animateCellRemove(selection) {
  selection
    .attr('scale', function(d) {
      return "scale(" + d.dx/2 + "," + d.dy/2 +")";
    });
}

Is it possible? Am I doing something wrong?


Solution

  • Did you mean selection.attr("transform", …)?