vasturiano / 3d-force-graph

3D force-directed graph component using ThreeJS/WebGL

Home Page:https://vasturiano.github.io/3d-force-graph/example/large-graph/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node border

2arch opened this issue · comments

commented

I have a problem where, if Im creating a new node that isn't linked to anything and i render it in the graph that already has a lot of connections ,then the node gets sent somewhere really far away, because of how the force graph works, and it becomes harder to locate the node.

how can i create like a spherical bounding box to keep the nodes contained, so they don't go flying out into space?

here's a picture depicting what I would like to accomplish:

image

@atlllas thanks for reaching out.

You could add an additional force: d3-force-limit that prevents nodes from exiting a given sized container.

In that force plugin the container is cubical not spherical, but maybe that suits your case. If not, you can use the same principle to build a spherical container custom force.