Thursday, 15 July 2010

javascript - d3.js pack layout circles are overlapping -



javascript - d3.js pack layout circles are overlapping -

i have problem d3.js pack layout. circles overlapping, , don't have thought why...

i used code example:

http://mbostock.github.com/d3/talk/20111116/pack-hierarchy.html

and work:

http://projekty.bron.it/d3-circles-all/

as see overlapping create diagram unusable.

i attempted implemented same circle packing illustration , had overlapping circles, too. me problem cause fact info parent nodes had 0 children , size 0. 1 time changed parent nodes empty array of children correctly formatted leaves, problem went away.

bad overlapping before info structure:

root = {name:"root", children:[ {name:"badchildlessparent", children:[]}, {name:"parentnodewithchild", children:[{name:"a leaf",size=50}]} ] }

nicely packing after info structure:

root = {name:"root", children:[ {name:"fixedit_now_child", size=1} , {name:"parentnodewithchild", children:[{name:"a leaf",size=50}]} ] }

javascript d3.js overlap circle-pack

No comments:

Post a Comment