【问题标题】:Is it possible to transition the removal of a node on a treemap in d3?是否可以在 d3 中转换树形图上的节点的删除?
【发布时间】:2012-05-09 16:20:16
【问题描述】:

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

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

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

有可能吗?我是不是做错了什么?

【问题讨论】:

    标签: javascript scale d3.js transitions treemap


    【解决方案1】:

    你是说selection.attr("transform", …)吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-21
      • 1970-01-01
      • 2017-11-27
      • 1970-01-01
      相关资源
      最近更新 更多