力引导布局

力引导算法主要应用与复杂网络可视化。力引导布局最早由Peter Dades在1984年的“启发式画图算法”文章中提出。目的是减少布局中边的交叉,尽量保持边长一致。主要引入库伦斥力和胡克弹力,考虑阻尼衰减(这就是为什么我们拉动力引导图,它能很快稳定回来的原因)。事先定义好图里的点,边的权重等信息,力引导图可以根据实时状态自动完成很好的聚类,方便地看出点之间的亲疏关系。

作者:神经夜专
链接:https://www.zhihu.com/question/28825558/answer/92200669
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

D3.js官网:http://d3js.org/
D3.js github:https://github.com/d3/d3
力导向图(Force-Directed Graph),是绘图的一种算法。在二维或三维空间里配置节点,节点之间用线连接,称为连线。各连线的长度几乎相等,且尽可能不相交。节点和连线都被施加了力的作用,力是根据节点和连线的相对位置计算的。根据力的作用,来计算节点和连线的运动轨迹,并不断降低它们的能量,最终达到一种能量很低的安定状态。

https://bl.ocks.org/mbostock/4062045

Force-Directed Graph

<iframe sandbox="allow-popups allow-scripts allow-forms allow-same-origin" src="https://bl.ocks.org/mbostock/raw/4062045/5916d145c8c048a6e3086915a6be464467391c62/" marginwidth="0" marginheight="0" scrolling="no" style="width: 960px; border-width: 1px; border-style: solid; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-image: initial; height: 600px;"></iframe>

Open

This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.

Compare this display to a force layout with curved links, a force layout with fisheye distortion and a matrix diagram.

http://echarts.baidu.com/examples/editor.html?c=graph-force

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,151评论 0 10
  • 前几天,边奶娃儿边刷微信的我发现又一条娱乐圈的消息被刷屏了“又一当红花旦——白百合被爆出轨网红男模”最近明星被曝出...
    da6cc65b8364阅读 3,517评论 0 1