Is it possible to translate node removal on treemap in d3?

I am trying to animate node tree deletion. When I switch between different treemaps, I cannot get the switch to work normally. I currently have code similar to 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?

+3
source share
1 answer

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

+1
source

All Articles