Reputation: 71
I'm trying to use vis.js
to render a Network Visualization using React. For that, I've been following the guide from James Tharpe: https://www.jamestharpe.com/react-visjs/. However, the follwing errors are raised...
Please check out my code on this repo:
https://github.com/murilobellatini/try-vis-network
Can you guys help me get this code working?
Thanks!
Upvotes: 6
Views: 4590
Reputation: 573
I used the react version of Vis js.
npm install --save react-visjs-timeline
and it is working properly
Upvotes: -2
Reputation: 149
I've been facing the same issue. Add options
in the Network
constructor.
useEffect(() => {
const network =
container.current &&
new Network(container.current, { nodes, edges }, options);
}, [container, nodes, edges]);
full working stack: https://stackblitz.com/edit/react-e1pbxf?file=src/Graph.js
Try remove options
. And it'll say Cannot read the property 'solve' of undefined.
Upvotes: 7