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

Force-directed layout graph for nicer UX #85

Open
prrao87 opened this issue Feb 20, 2024 · 5 comments
Open

Force-directed layout graph for nicer UX #85

prrao87 opened this issue Feb 20, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@prrao87
Copy link
Member

prrao87 commented Feb 20, 2024

Is there a reason we aren't implementing the force-directed layout by default? G6 has this feature. Computationally speaking, can't we force-limit the number of nodes displayed (say 100) and have the UI dynamically update the layout using the force-directed algorithm?

Pretty much every other graph visualizer does this and it really does look nice from a user perspective as they're studying the graph structure.

@prrao87 prrao87 added the enhancement New feature or request label Feb 20, 2024
@mewim
Copy link
Member

mewim commented Feb 21, 2024

Actually we have enabled force-directed layout (

) and it indeed prevents nodes overlapping when the graph is initially rendered, but I think your request is to have the force-directed layout dynamically recomputed when a node is dragged around. This does not seem to be G6's default behavior but I think there should be a way to implement that.

@mewim mewim self-assigned this Feb 21, 2024
@mewim
Copy link
Member

mewim commented Feb 22, 2024

#86 Enable dynamic re-layout on drag, but it is not very smooth... it might need additional tweaking later.

@prrao87
Copy link
Member Author

prrao87 commented Feb 25, 2024

@mewim I think it's really smooth and wonderful! Is there anything in particular you noticed that isn't smooth? I see it working great on my end.

@prrao87
Copy link
Member Author

prrao87 commented Feb 25, 2024

Actually, now that I test it some more, it doesn't do the layout as clean as it maybe could. There are some edges/nodes that are still overlapping once the layout is computed. No worries, this is still a great step up in how it looks, imo.

@mewim
Copy link
Member

mewim commented Feb 26, 2024

It seems to have something to do with the parameter settings for the force-direct layout algorithm. I tweaked it a bit but have not got an optimal outcome yet.

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

No branches or pull requests

2 participants