Dynamic Network Graph Plot

I am trying to create a dynamic network graph plot with a Bokeh Server. I have some code that creates the initial state of the graph and I have created a function to update the plot but it is not updating.

Code: https://github.com/BryceWayne/Networkxxx.git

The idea was to have each node move via some stochastic process and have the plot update. The issue is that it does not update the plot but I believe it is updating the points.

The best practice for Bokeh apps is always to make the smallest change possible. This commonly translates concretely as: update properties of existing objects, don’t replace entire objects. And here specifically, I would suggest starting by updating graph.layout_provider.graph_layout with new data, rather than creating an entire new StaticLayoutProvider.

I also am not sure why you are manually adding graph to renderers in every callback (it’s already in renderers).

1 Like

Thanks Bryan. This was a quick fix. Thanks for the tip

1 Like