murongqimiao / DAG-diagram

VUE plugin for DAG graph , u can use it 4 flow diagram or machine learning visualization
https://murongqimiao.github.io/DAG-diagram/#/example
MIT License
402 stars 124 forks source link

support auto layout ? #17

Open zzwar2009 opened 4 years ago

zzwar2009 commented 4 years ago

first of all , thanks for your great work, it inspire me a lot , and I maybe write a react version according to your sourcecode.

my question is : if the node has no position(posi_x,posi_y) attribute , now can the diagram support auto layout ?

murongqimiao commented 4 years ago

Hello bro~ ! In my personal opinion , to put position attr in FE, is not appropriate ~ well well well 刚才看到你github里是中文commit 就直接中文回复你吧.... 一般来说,数据是后端产生的, 数据清洗 -> 生成节点关系 -> 对应生成前端坐标即可~ 如果前端写布局逻辑也没那么复杂~ 可以自己尝试一下~ 可以加qq群我们一起讨论 大概思路是把节点分级, 同级节点x轴坐标一致~ 同列节点y轴坐标一致即可~