mardi 18 novembre 2014

Pack layout with reuse path


Vote count:

0




I'm working on a visualization of data with d3js and pack layout. My data looks like this:



0
/ | \
/ | \
1 5 3
\ | |
\ | |
4 /
| /
2


I've made a fiddle demo to show my problem:


The 1st (in red) layout looks good : I use data in variable root2 formatted by hand for the pack layout (can see the sent data in the console index:326).


But I haven't data in my program, I have data like a three : all nodes then all links (variable root). So I have a little loop in order to storage data in good format:



for (i in root[2].Arcs){
var d = root[1].Nodes[root[2].Arcs[i].D];
var s = root[1].Nodes[root[2].Arcs[i].S];
if (!d.children){
d.children = [];
}
d.children.push(s);
}


I display in the console the result (index:327).


For me : both printed element in console are the same, but not the render of layout.



<circle class="node 4"
transform="translate(11634.404099868603,28034.82236625894)"
r="8688.691138657245"
style="fill: rgb(245, 143, 143);">
</circle>
<circle class="node node--leaf 2"
transform="translate(862652.7522706593,2043823.2815445256)"
r="610141.3501389856"
style="fill: rgb(248, 95, 95);">
</circle>


I don't understand why there is this kind of value for translate and radius...


Any idea why the 2 graphs don't display same things ?


Thank you



asked 36 secs ago







Pack layout with reuse path

Aucun commentaire:

Enregistrer un commentaire