Using dash to to visualize a network graph algorithm

Hi,

I’m looking for a way to visualize a network graph algorithm in Python and was wondering if Dash + networkx is a viable framework for it.

What I need to do is to draw a network graph and manipulate it.

The changes are initiated on the server side. The client is only supposed to observes the graphical visualization of the changes in the network graph.

I was thinking about using a queue of events to communicate between the thread running the algorithm and the thread rendering the visualization.

My questions are:

  1. Is it possible to make changes to a network graph in a callback? (stuff like add/remove vertices, change vertices’ size, color, add/remove edges, etc.).

  2. Can such a change (e.g. remove a vertex and connected edges) be handled without having to render/redraw the whole graph from scratch?

  3. Is it possible to trigger a callback when the rendering of some changes has been completed (in order to display changes chronologically on the client side).

  4. Is this a good idea in general…?

Thanks,
Tal.

Hi @trax72 Tal,
Welcome to the community, I’m not too familiar with networkx but I don’t see a reason why it couldn’t be incorporated with Dash. I’ve worked with Dash Cytoscape before, where you can remove connected edges or nodes, but I think the graph would need to be redrawn.

Hi Adam,

Did you mean the graph would need to be redrawn?

Tal

correct. sorry. I meant redrawn.