我在 d3plus 环上工作,我只需要显示环中的主要连接。
<!doctype html>
<meta charset="utf-8">
<script src="http://www.d3plus.org/js/d3.js"></script>
<script src="http://www.d3plus.org/js/d3plus.js"></script>
<div id="viz"></div>
<script>
var connections = [ {"source": "alpha", "target": "beta"},
{"source": "alpha", "target": "gamma"},
{"source": "beta", "target": "delta"},
{"source": "beta", "target": "epsilon"},
{"source": "zeta", "target": "gamma"},
{"source": "theta", "target": "gamma"},
{"source": "eta", "target": "gamma"} ]
var visualization = d3plus.viz()
.container("#viz") // container DIV to hold the visualization
.type("rings") // visualization type
.edges(connections) // list of node connections
.focus("alpha") // ID of the initial center node
.draw() // finally, draw the visualization!
Gamma
选择时,应显示Alpha
, Zeta
, Theta
& 。Eta
我尝试了.color
使用.color(String|Function|Object)
接受key secondary
值的方法color
。如何写这个表达式?请访问 D3 Plus 文档