3

我正在尝试动画删除树节点。当我在不同的树形图之间移动时,我似乎无法让过渡正常工作。我目前有这样的代码

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

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

可能吗?难道我做错了什么?

4

1 回答 1

1

你的意思是selection.attr("transform", …)

于 2012-05-09T16:58:58.977 回答