d3.js:如何创建“力导向图簇” [英] d3.js: how to create "force-directed graph clusters"
问题描述
我一直在探索d3.js库,特别是强制定向图的创建。我仔细阅读了Bostock等人的论文,注意到我想要创建的图形的精确类型,基本上是一个用彩色编码区域围绕羽毛组的力图。
I've been exploring the d3.js library, and especially the force directed graph creation. I perused the paper on it by Bostock et al, and noticed the precise type of graph I'm trying to create, basically a force directed graph with color coded regions surrounding groups of a feather.
这是第三列,第二行,这里,标记为强制有向图集群的插图:
http://vis.stanford.edu/papers/d3
It's the illustration on 3rd column, 2nd row, here, labelled "force-directed graph clusters": http://vis.stanford.edu/papers/d3
此处的代码生成基本图形:
< a href =http://mbostock.github.com/d3/ex/force.html =nofollow> http://mbostock.github.com/d3/ex/force.html
the code here generates the basic graph: http://mbostock.github.com/d3/ex/force.html
我的问题是:动态生成区域多边形的代码是什么?
My question is: what is the code to dynamically generate the region polygons?
推荐答案
您可以尝试将示例船体代码与力节点集成。
You could try integrating the example hull code with the force nodes.
Hull:
http://bl.ocks.org/mbostock/4341699
强制布局:
http://bl.ocks.org/mbostock/1021841
这是我在评论中提供的答案:
This is the answer I provided in the comments:
http://bl.ocks.org/donaldh/2920551
这篇关于d3.js:如何创建“力导向图簇”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!