Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

check for mass value of zero on vis.js Network nodes. #3133

@pontusvision

Description

@pontusvision

I was updating an old library to the latest vis.js network, when I spotted quite an odd behaviour, where only one node out of hundreds would appear. After a fair amount of debugging, I noticed that I was accidentally setting the mass some of the nodes to zero. This was causing havoc, with a NaN eventually as the x and y coords.

I've created the following jsfiddle to demonstrate it:
http://jsfiddle.net/1y8L119L/

Setting the mass to 1 or higher solves the issue; however, the code used to work with a mass of 0 back in version 4.3.0.

Please add the extra safety check to prevent the pain I have just had to go through on other distracted silly programmers that set the mass to zero.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions