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

Persist hand-made layout #16

Open
naugtur opened this issue Jan 29, 2015 · 6 comments
Open

Persist hand-made layout #16

naugtur opened this issue Jan 29, 2015 · 6 comments

Comments

@naugtur
Copy link
Contributor

naugtur commented Jan 29, 2015

Moving a node makes it stick in one place.

Maybe there's a way to store that information, JSON.stringifyand put in the local storage.
From there there's only one step to printing the string to console and allowing user to put it in a file which would be loaded and interpreted every time the graph is drawn, so you can have some of the graph nodes maintain order between browsers and machines (assuming the file goes to the repository as documentation)

@auchenberg
Copy link
Owner

Makes good sense. Would be great if someone had time to hack a prototype of this.

@naugtur
Copy link
Contributor Author

naugtur commented Jan 29, 2015

That's what I plan to do, but I might need you to point me to where the fixed position data is.

@auchenberg
Copy link
Owner

Dumping the coordinates in local storage would be just fine. Maybe a JSON blob for each "report", so we would need to generate a unique id for each report.

@naugtur
Copy link
Contributor Author

naugtur commented Jan 29, 2015

I get it, but I was asking where to look for the data. If you could point me to a method that fetches the coords of nodes that would be a nice kickstart for my work.

@naugtur
Copy link
Contributor Author

naugtur commented Feb 3, 2015

I've got a proof of concept. I know how to do that.
Now the question is: what should be the unique-enough id of a graph?
My initial idea was to use a hash of all module names, but then you lose the layout if dependencies change. So the code that generates html should say what the identification is. Project folder maybe?

@auchenberg
Copy link
Owner

Yeah, I would hash the folder-path, and use that as the key?

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

No branches or pull requests

2 participants