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

How to display nodes together that are identical #352

Open
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM opened this issue May 20, 2024 · 1 comment
Open

Comments

@MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

Hello, I would like to group and display nodes based on the type of the link. For example, a link with type 1 will display nodes on the left, and a link with type 0 will display nodes on the right. May I know which attribute value should I use to set the node partition to display together? I hope to receive your answer
1716187218335

@vasturiano
Copy link
Owner

You could approach this in multiple ways, if you want to achieve such a layout. If your graph is completely acyclical you could take advantage of the built-in DAG layout mode, via .dagMode('lr'). Just make sure the direction of your links follow a left-to-right orientation in your graph data. Here's an example using the DAG mode: https://vasturiano.github.io/force-graph/example/tree/

Alternatively, you could use an additional clustering force, like d3-force-cluster, to group your nodes into meaningful spatial clusters.

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