-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
希望增加斥力布局自定义demo #2239
Comments
ForceGraph方法可以使用这个, 因为demo里的方法是直接通过svg来塞数据的, 所以我这边直接返回simulation来tick function ForceGraph({
} ` |
现在基本实现功能了,就是每次tick才能改变位置,数据库100就已经很卡了,尝试只改变position也很卡,作者有什么办法吗 |
@yaojin2070 tick 执行太频繁了,可以考虑增加一个节流器。 |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
功能描述
https://observablehq.com/@d3/disjoint-force-directed-graph?collection=@d3/d3-force
希望能出一个连接上的demo, 我看了force的源码, forceSimulation这个自定义文档说是Object类型, 但是我看源码, 如果不传, 使用的是d3.forceSimulation(), 但是要使用斥力, 我看都是需要使用这个的吧, 我不怎么懂d3
,
链接上的demo是需要使用
d3的.force("x", d3.forceX())
.force("y", d3.forceY()), 而不使用源码里面的center()
所以我想自己用d3实现, 可是不行, 斥力的范围很小
ForceGraph方法就是demo链接上的方法, 最终效果只能这样
还有一个问题就是tick方法会多次执行, 我不却不断地formJSON, 会导致页面非常卡, 是否可以只改变节点的位置?, 这样下来无法实现拖动的时候, 再次重新渲染, 就是拖动某个节点, 其他节点会变动,有个动画的效果
需要做的需求是动态的增删数据用拓扑图显示, 因为有编辑功能, 所有考虑使用x6, 不想单独使用g6来实现, 作者帮忙看看,码字不易
琢磨了2天, 实在实现不出来了
期望解决方案
希望出demo的功能
The text was updated successfully, but these errors were encountered: