antvis / layout

Layout algorithms for graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FruchtermanLayout 需要加一个引力系数

mizy opened this issue · comments

现在引力系数是由画布面积和点数量决定的,而且和斥力系数公用一个。。。导致没法分开调节
https://github.com/antvis/layout/blob/master/src/layout/fruchterman.ts#L195

建议 加一个引力系数 attractive 在这里*common
https://github.com/antvis/layout/blob/master/src/layout/fruchterman.ts#L195
或者在
https://github.com/antvis/layout/blob/master/src/layout/fruchterman.ts#L267
这里加个 node.x *= scaleKey,整体缩放,让画布里的点尺寸可以适应
(gpu的也希望同步加些调节参数)

anyone 看下能否优化下将配置尽量能都暴露出来