almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

How to call fit() function when network graph render in reactjs #4073

Open amithit opened 6 years ago

amithit commented 6 years ago

I have a graph component in React app,

<Graph
   graph={this.state.graph}
   options={graph_options}
   events={this.events}
/>

I hope to make it automatically zoom in/out when the graph changes, just like in vis.js document use network.fit()

But how I can call this fit method?

mariopnvds commented 5 years ago

Hello,

I am trying to implement a Network with ReactJS, everything is correct except the first render, I upload some JSON and hope that the network fits but it doesn't. It is zoomed and I can't see the full network, only a few nodes.

I would like to share an example but I really can't.

Any ideas of what is happening?

Thanks in advance!