dependo icon indicating copy to clipboard operation
dependo copied to clipboard

Persist hand-made layout

Open naugtur opened this issue 11 years ago • 6 comments

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)

naugtur avatar Jan 29 '15 09:01 naugtur

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

auchenberg avatar Jan 29 '15 09:01 auchenberg

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

naugtur avatar Jan 29 '15 09:01 naugtur

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.

auchenberg avatar Jan 29 '15 09:01 auchenberg

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 avatar Jan 29 '15 11:01 naugtur

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?

naugtur avatar Feb 03 '15 22:02 naugtur

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

auchenberg avatar Feb 05 '15 09:02 auchenberg