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

Bug: Central gravity force does not depend on mass in the correct way #1963

Open
gratach opened this issue May 22, 2023 · 0 comments · May be fixed by #1966
Open

Bug: Central gravity force does not depend on mass in the correct way #1963

gratach opened this issue May 22, 2023 · 0 comments · May be fixed by #1966

Comments

@gratach
Copy link

gratach commented May 22, 2023

Bug in vis.network:

When there are nodes with small mass they are pulled relatively stronger to the centre of gravity.
The central force should be proportional to the mass of the node.

In this example node 1 is heavier than node 3 with its satellites. However node 3 with its satellites gets pulled to the centre of gravity.

var nodes = new vis.DataSet([
{ id: 1, label: "Node 1", size: 20, mass: 2},
{ id: 2, label: "Node 2", size: 20, mass: 1},
{ id: 3, label: "Node 3", size: 20, mass: 1},

{ id: 4, shape: "dot", size: 5, mass: 0.1},
{ id: 5, shape: "dot", size: 5, mass: 0.1},
{ id: 6, shape: "dot", size: 5, mass: 0.1},
{ id: 7, shape: "dot", size: 5, mass: 0.1},
]);
var edges = new vis.DataSet([
{ from: 1, to: 2 },
{ from: 2, to: 3 },

{ from: 3, to: 4},
{ from: 3, to: 5 },
{ from: 3, to: 6 },
{ from: 3, to: 7 }
]);

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

Successfully merging a pull request may close this issue.

1 participant