Closed mehdibalouchi closed 3 years ago
Hi, the position of elements in the viz is not something we track in neo4j-browser. What is the user goal here, why do you want this feature? It sounds like Neo4j Bloom is a better tool for you: https://neo4j.com/bloom/
I think I can relate to their request. I am building two graphs. One contains the real data I am extracting from a system, which I am building up a little at a time. The other documents the nodes and relationships I intend to have: the schema documented in advance. It's pretty complex, created in cypher-shell with several dozen nodes and relationships between them all. In Neo4j Browser I've color-coded the different types of nodes, and I've color-coded the arrows to show which ones are implemented so far in the real graph. I drag the nodes into a pleasing, understandable arrangement so that others can see where there are implied hierarchies and other relationships in a way they can relate to. Whenever I create more nodes and rels, I have to refresh the browser display. Then re-dragging the nodes to the useful arrangement takes several minutes.
So as the styling preserves the line sizes and colors, it would be cool to have it preserve the latest positions, maybe as an option. That way when I refresh the viz from the graph, the ones I've fixed in place would resume their positions, and newly created nodes would place themselves randomly near the nodes they relate to.
I realize this feature would NOT be useful for other types of graphs such as my real one based on real data. But for hand-drawn... er, hand-cypher'd graphs, it could be very helpful.
Yes, I played with Bloom, but so far I don't find it useful.
the position of elements in the viz is not something we track in neo4j-browser.
How can I do this? Where is the code that adjusts node positions? I cant't find that. I'm trying to find that part of code that adjusts the initial position of nodes in the visualization, so that maybe I can do some hacks and solve my problem.
Thanks for the additional input here, and a use case @rsworden59!
@mehdibalouchi: The layout is using d3's force layout and happens in this file: https://github.com/neo4j/neo4j-browser/blob/master/src/browser/modules/D3Visualization/lib/visualization/components/layout.js
it seems don't sloved yet ?
This is an interesting idea, but I'm afraid it to be a quite complex feature and not something we can prioritize implementing. If anyone wants to give it a shot and hack together a demo, we could perhaps reconsider
I want to save position of nodes in a visualization somehow and later restore those positions. consider the user gets a visualization and starts to move nodes on screen, he can
Export PNG
of the visualization. I want to make the user able to save the visualization he made somehow (in a file or something) and when he restores that, all nodes are in the position he saved. Is there any straight solution you guys can help me with?