Skip to content
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

Getting the coordinates on a graph #470

Open
EmmaShredda opened this issue Apr 23, 2024 · 1 comment
Open

Getting the coordinates on a graph #470

EmmaShredda opened this issue Apr 23, 2024 · 1 comment

Comments

@EmmaShredda
Copy link

I'm really banging my head against the wall here. I can't for the life of me figure out how to get the graph coordinates from any other .js file. Like I simply want to add a node at the center of my screen, no matter where I am in the graph, but everything I try just keeps adding the node to 0,0.

@daniel-lewis-ab
Copy link

In case you haven't got it yet.

LGraphNode.prototype.pos is a Float32[] where you have x, y from the top left of the barely visible blue box (0,0). The provided number needs to be a valid number (not suffixed with 'px') as per HTMLCanvas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants