We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
Seems that when having children with different width, the calculated x positions are too far away. Or i don't get what i'm making wrong.
Here is a simple example. You can just copy&paste it in the npm runkit (https://npm.runkit.com/d3-flextree):
var d3Flextree = require("d3-flextree") const flextree = d3Flextree.flextree; const data = { "id": "26d536a3-879f-493c-af2e-3785a3e7bd5c", "size": [ 360, 409 ], "children": [ { "id": "e7e369db-ffd7-4b1a-a7d4-42a6d157c35c", "size": [ 460, 609 ], "children": [] }, { "id": "6a91d13d-dc13-45b9-8697-d105a443ac03", "size": [ 1103, 1298 ], "children": [] } ] }; const layout = flextree(); const tree = layout.hierarchy(data); layout(tree); tree.each(node => console.log(`(${node.x}, ${node.y})`));
These are the computed x/y positions of each node (printed from the console.log):
"(0, 0)" "(-551.5, 409)" "(230, 409)"
The calculated distance between the 2 children is 321.5 ((-551.5 + 460 - 230) * -1), but should be almost 0 because i don't have defined any spacings.
321.5
(-551.5 + 460 - 230) * -1
Or am I wrong?
Thanks for your help
The text was updated successfully, but these errors were encountered:
Ok, i get it. I think it's because the x position is the center of the element not the left position.
Sorry, something went wrong.
No branches or pull requests
Hi
Seems that when having children with different width, the calculated x positions are too far away. Or i don't get what i'm making wrong.
Here is a simple example. You can just copy&paste it in the npm runkit (https://npm.runkit.com/d3-flextree):
These are the computed x/y positions of each node (printed from the console.log):
The calculated distance between the 2 children is
321.5
((-551.5 + 460 - 230) * -1
), but should be almost 0 because i don't have defined any spacings.Or am I wrong?
Thanks for your help
The text was updated successfully, but these errors were encountered: