-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
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
return absolute x,y position of each node #81
Comments
I'd suggest looking at the layout.eachNode(function(node, point) {
console.log(node); // Original graph node
// The "point" is what the layout uses to track position/velocity/mass of a node
console.log(point.p.x);
console.log(point.p.y);
}); Point properties: Lines 611 to 617 in 559a400
Also, I usually transform the underlying "world" coordinates to screen coordinates separately to the layout algorithm. e.g. here's how it's done in springyui.js: Lines 63 to 69 in 559a400
|
That's so kind of you. thanks, let me try first |
@dhotson Does the springyui.js depends on springy.js? I didn't found |
Yep, that's right—you need to include springy.js first. |
hi, dhotson, I've tried to using your
|
Hey sorry, I'm not quite sure I'm following what you mean—what are you expecting to see here? |
Is there any API can return absolute x,y position of each node? I couldn't find it in
layout
The text was updated successfully, but these errors were encountered: