Skip to content

defaultNodeMass returns NaN  #18

@hillar

Description

@hillar

defaultNodeMass returns NaN and Node mass should be a number is thrown

return 1 + links.length / 3.0;

seems that links does not have length but size, as newer graph.getLinks does not return array anymore

as a temporary workaround nodeMass function in physicsSettings helps..

nodeMass : (nodeId) => {
  const links = graph.getLinks(nodeId);
  if (links && links.length) return 1 + links.length / 3.0;
  else if (links && links.size) return 1 + links.size / 3.0;
  else return 1
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions