Django and interactive graphical / network visualization

I am creating a Django application and want to have a visualization of a social network. I am looking for a library that can draw a diagram structure / network data, but also make it interactive. I would like to be able to click on a node and get the information from that node that will be displayed (name, network, etc.) Somewhere else on the page

So far, I have found python-graph and graphviz to be very powerful visualization tools, but they create static images, so you cannot click on them. I also found this topic

JavaScript Chart Visualization Library

in which there were many offers, but some of them relate to graphs, as in diagrams, and not to graphs, as in social network diagrams. Some of them are very old, and some of them are interactive only in that the node can be dragged and moved elsewhere on the canvas. I don’t care that the user can change the graph, I just want the node object to transfer data with it, which can be displayed somewhere.

Any suggestions?

+6
source share
3 answers

I like d3 . Here is an example of a force-oriented diagram (often used to display social networks).

It would be fairly easy to add the kind of click processing you are looking for as an example of the d3 power.

+1
source

I did something similar using PyGraphviz . You can save the graph as SVG and display the SVG on your website. Then you can use something like jQuery SVG to attach handlers to nodes.

I implemented a more flexible solution and serialized all nodes and edges in JSON format and sent it to the site. Then I draw a graph using Raphaël . This solution is cross-browser compatible and very flexible.

+5
source

Checkout is also a django-netjsongraph .

+1
source

Source: https://habr.com/ru/post/905849/


All Articles