动态布局
此示例创建了一个自组织图,其中节点会自动以树状结构排列。主要特点包括:
🌐 This example creates a self-organizing graph where nodes position themselves automatically in a tree-like structure. Key features include:
- 节点创建:用户不是手动放置或连接节点,而是点击占位元素来添加新节点
- 多重交互点:通过点击节点添加子节点,将占位符转换为节点,或使用边上的“+”按钮在现有节点之间插入节点
- 智能布局算法:当图表发生变化时,由
d3-hierarchy提供支持的自动布局钩子会重新计算所有位置 - 平滑过渡:节点动画移动到它们的新位置,即使复杂性增加,也能保持视觉清晰
This is a Pro example. Get all pro examples, templates, 1:1 support from the xyflow team and prioritized Github issues with a React Flow Pro subscription.
关于此 Pro 示例
🌐 About this Pro Example
- 依赖:@xyflow/react 、d3-hierarchy
- 许可证:xyflow Pro 许可证
Last updated on