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

Add automatic buffer between nodes #19

Open
davekinkead opened this issue Jun 27, 2019 · 4 comments
Open

Add automatic buffer between nodes #19

davekinkead opened this issue Jun 27, 2019 · 4 comments

Comments

@davekinkead
Copy link
Owner

When a node is added or moved, a minimum buffer between them should be applied so that there is no overlap/collision between nodes.

My first thought would be to iteratively move each node away from the map centre by the amount of overlap + some buffer (say 25px).

#pseudocode 
after node add or move
  while map.overlap? 
    nodes.map => node.overlap?
      node.padout
@geoffreyd
Copy link
Contributor

@davekinkead I've started looking at this, and while there are some simple scenarios, there are also some layouts that become rather complicated.

image

For instance, if I were to try and pad out the highlighted moving out from the center will end up drawing all of those nodes out into rather long horizontal layout (rather than a smarter algorithm moving them vertically.

How do you feel about pulling in a constraint based layout engine, such as Springy (which gives good control over custom rendering)
(Cola looks better, but much harder to integrate with)

I understand that this would remove some of the custom layouts that users may have spent time on, but we could have an "auto-layout" button that triggers it once, and then lets the user go from there, or a checkbox that turns it on/off.

@davekinkead
Copy link
Owner Author

Force directed was what I was thinking of rather than layering in rows & columns. What is the performance hit from something like springy?

@geoffreyd
Copy link
Contributor

I've spent a little time investigating this, performance wise is not an issue, what's been more of an issue is trying to integrate your graph with its graph.
This is something I'd love to show you what I've got and talk about options going forward.

@davekinkead
Copy link
Owner Author

Sounds good @geoffreyd did you want to chat around 4pm your time tomorrow?

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