visjs / vis-network

:dizzy: Display dynamic, automatically organised, customizable network views.

Home Page:https://visjs.github.io/vis-network/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PhysicsEngine Undefined gravitySolver; Appears PhysicsEngine init() is never called.

Sciumo opened this issue · comments

commented

Appears PhysicsEngine init() is never called.
Versions:
"vis": "^4.21.0-EOL",
"vis-data": "^7.1.6",
"vis-network": "^9.1.6",
"vis-timeline": "^7.7.2"

Usage in a React application:
import { Network, Data } from "vis-network";
graph: Data // assigned elsewhere
network = new Network(visJsRef.current, graph );

Error:

this.gravitySolver.solve();
PhysicsEngine.js:377 Uncaught TypeError: Cannot read properties of undefined (reading 'solve')
at PhysicsEngine2.physicsStep (PhysicsEngine.js:377:24)
at PhysicsEngine2.physicsTick (PhysicsEngine.js:450:12)
at PhysicsEngine2._stabilizationBatch (PhysicsEngine.js:784:12)
at PhysicsEngine.js:744:27

commented

Passing in options={} fixes, but it is supposedly optional.

#1968 (comment)

This resolved my problem 👍🏽