5

I've got masses of network information held in a SQLite database. I want to draw a diagram based on this information in the style a network diagram.

I want it to be interactive, in a sense that at the highest level only network range communication can be seen, and as you move deeper into the diagram you begin to see individual nodes (switches, routers, firewalls, hosts, servers, etc) all linked together.

I'd like this process to be as smooth as possible, allowing you to zoom in using the scroll wheel in a location of the diagram and it expands as you do so. Allowing you to then click and drag around the map. However I'd like to get basics down first, so thinking that I should start with drawing the diagram in HTML and have hyper-links for nodes allowing the user to move around and deeper into the diagram using a browser.

It is also crucial that the user would be able to able to capture their view as a still image, which I'd guess would be far more easily done in HTML.

To get to the point I'm asking where I might start to do this. I've looked at PyQT, Graphviz, outputting to HTML etc. I'm just trying to decide what to use and generally how to go about doing this. I'm reasonably good with Python but I am open to suggestion of other languages.

If you guys think Python can do this, which Python? 2.7 or 3? I've been considering making a move to 3 for a while, is it time?

Thanks in advance!

Kirell
  • 9,228
  • 4
  • 46
  • 61
user3078629
  • 139
  • 1
  • 2
  • 9

3 Answers3

2

The important thing here is that you want something dynamic and that can be captured by the user.

My answer will be fairly similar to this question.

Export your graph to a standard format such as GEXF and use a Javascript graph drawing library to make your graph interactive such as: SigmaJs, or VivaGraphJs.

The big advantage is that you can script your graph to respond to user event such as zoom, save as a picture or display information dynamically about nodes and edges, etc.

To resume:

Concerning the python version, it is really dependent on other libraries you may use. For scientific use, I wouldn't recommend to switch to Py3k but for anything else you're good to go.

Community
  • 1
  • 1
Kirell
  • 9,228
  • 4
  • 46
  • 61
2

I've faced in the past something similar to your problem. We have tons of routers documented in a MySQL database. We actually use Racktables and that tool stores all the information in such a way.

At one point we needed to plot networking topologies. If you want, please have a look at this:

https://notedisabbia.wordpress.com/2016/06/17/first-blog-post/

https://github.com/RackTables/racktables-contribs/tree/master/python-graph-topology

The first link is a blog I've written in order to explain what my python program (second link) does in terms of connecting to Racktables, gathering information and plotting network diagrams.

Hope this helps.

Cheers,

Lucas

Lucas Aimaretto
  • 1,399
  • 1
  • 22
  • 34
0

I would recommend looking at library d3graph. It does not allow you to zoom using the scroll wheel but does have other features like breaking edges. More information can be found in this blog.

erdogant
  • 1,544
  • 14
  • 23