Skip to content

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

Open

Description

@gratach

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 }
]);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions