Skip to main content
100%

dynamic pack

✓ Published0🌍 Public
11Cr18Ni9
Last edited Sep 30, 2019
Created on Sep 30, 2019

This interactive pack layout uses a circle-packing algorithm from D3 v4 to represent a hierarchical tree. Users can drag nodes to merge them, right-click on the canvas to add new nodes, or right-click on a node to delete it along with its descendants. The underlying `rData` tree object updates dynamically, and all changes are rendered as animated SVG elements. The implementation relies on custom `d3.drag` behaviors and the `d3.pack` layout.

AI-generated description
  • Drgging a node and move it to another one will merge those two nodes.

  • Right click on blank canvas will generate a new node.

  • Right click on a node will remove this node and it's descendents nodes if it contains children.

  • rData is hierarchy tree object and it will changed accrodingly with this pack tree.

  • 拖拽一个节点并靠近另一个将会使得这两个节点融合;

  • 右键单击空白区域产生新的节点;

  • 右键单击节点将删除该节点及其包含的子节点;

  • rData 是一个树对象,其会随着节点的增加和减少而变化。

mit Licensed

Similar vizzes