2016-07-15 2 views
0

d3plus 링을 처리하고 링에서 기본 연결 만 표시해야합니다. Gamma이어서 선택 AlphaZetaTheta & Eta 표시되어야 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! 

. 나는 방법을 시도했다 .color .color(String|Function|Object) 사용 key secondary 값을 허용 color. 이 표현식을 작성하는 방법은 무엇입니까?

enter image description here

D3 Plus Documentation이 (가) 중심의 노드에 대한 보조 노드의 목록을 제가하려고했던 것을 달성하는 데 도움을 생성하는 코드를 주석 enter image description here

+0

필요한 동작은 무엇입니까? 이미지를 업로드 할 수 있습니까? –

+0

우리 [이 토론을 계속 채팅] (http://chat.stackoverflow.com/rooms/117387/discussion-between-gupteshwari-and-dragon-slayer)을 보자. – Gupteshwari

답변

1

를 표시해야합니다 Beta 클릭했습니다하시기 바랍니다. 주석 달린 줄보기

a = (angle-(s*children/2)+(s/2))+((s)*i) 
    d.d3plus.radians = a 
    d.d3plus.x = vars.width.viz/2 + ((secondaryRing) * Math.cos(a)) 
    d.d3plus.y = vars.height.viz/2 + ((secondaryRing) * Math.sin(a)) 
    //secondaries.push(d) THE LINE I COMMENTED AND GOT IT WORKING 
+0

d3plus.js를 다운로드하여 조정할 필요가있을 것입니다. 아니면 웹에서 스크립트를로드하고 나중에 동작을 조정할 수있는 방법이 있습니까? – MERose

관련 문제