Template:Team:Bonn:Network
From 2013.igem.org
(Difference between revisions)
Line 524: | Line 524: | ||
} | } | ||
z= general.n.length*general.n.length*2; | z= general.n.length*general.n.length*2; | ||
- | general.width = general.width+z | + | general.width = general.width+z; |
general.height = general.height+z/2; | general.height = general.height+z/2; | ||
if(general.cwidth){ | if(general.cwidth){ | ||
Line 682: | Line 682: | ||
} | } | ||
} | } | ||
- | + | var height = new Array; | |
+ | var width = new Array; | ||
for(var x=0;x<general.n.length;x++) { | for(var x=0;x<general.n.length;x++) { | ||
var i = general.n[x]; | var i = general.n[x]; | ||
Line 689: | Line 690: | ||
nodeTitle[i] = document.getElementById("netNodeTitle"+i); | nodeTitle[i] = document.getElementById("netNodeTitle"+i); | ||
} else{ | } else{ | ||
+ | |||
+ | getElements(i); | ||
+ | if(content.childs =0) { | ||
+ | height = general.height/2; | ||
+ | width = general.width/2; | ||
+ | } else { | ||
+ | height = general.height; | ||
+ | width = general.width; | ||
+ | } | ||
node[i] = document.createElement("DIV"); | node[i] = document.createElement("DIV"); | ||
node[i].style.backgroundColor = "white"; | node[i].style.backgroundColor = "white"; | ||
Line 701: | Line 711: | ||
node[i].style.position = "absolute"; | node[i].style.position = "absolute"; | ||
if(general.n.length==1) { | if(general.n.length==1) { | ||
- | node[i].top = (node[general.mainnode].top-general.cheight/2) - Math.cos(Math.PI*(a*(x+1)+general.start)/180)*( | + | node[i].top = (node[general.mainnode].top-general.cheight/2) - Math.cos(Math.PI*(a*(x+1)+general.start)/180)*(height/2-general.cheight/2); |
} else { | } else { | ||
- | node[i].top = (node[general.mainnode].top-general.cheight/2) - Math.cos(Math.PI*(a*x+general.start)/180)*( | + | node[i].top = (node[general.mainnode].top-general.cheight/2) - Math.cos(Math.PI*(a*x+general.start)/180)*(height/2-general.cheight/2); |
} | } | ||
node[i].style.top = node[i].top +"px"; | node[i].style.top = node[i].top +"px"; | ||
if(general.n.length==1) { | if(general.n.length==1) { | ||
- | node[i].left = (node[general.mainnode].left-general.cwidth/2) + Math.sin(Math.PI*(a*(x+1)+general.start)/180)*( | + | node[i].left = (node[general.mainnode].left-general.cwidth/2) + Math.sin(Math.PI*(a*(x+1)+general.start)/180)*(width/2-general.cwidth/2); |
} else { | } else { | ||
- | node[i].left = (node[general.mainnode].left-general.cwidth/2) + Math.sin(Math.PI*(a*x+general.start)/180)*( | + | node[i].left = (node[general.mainnode].left-general.cwidth/2) + Math.sin(Math.PI*(a*x+general.start)/180)*(width/2-general.cwidth/2); |
} | } |
Revision as of 22:51, 1 October 2013