I'm planning on a project and in this project, I'm thinking about using networkx and pyvis to visualize it. one thing we want our network to have is to hide the subgraphs. for example, if we have a network like this:
first image
clicking on x should result in the following graph:
clicking on x
anyone knows if this is possible with networkx and pyvis (with addition tools if necessary)?
Related
I am trying to create network graph visualization. I could achieve that using graphviz. However, it is rather static (with zoom-in/out functionality)
I wish to make it interactive using python i.e. search edges (through search box) between 2 distant nodes & highlight them explicitly. Once analyzed - reset diagram back to normal state (using reset button).
For ex. in below graph I wish to find path between 1 to 5 & highlight possible combinations of edges.
1----2----6
| |
3--- 4----5
I checked How to Highlight any given path in pyvis network graph visualization? but not matching expectations. I tried searching plotly/graphviz/gravis/pyvis but no luck. If someone has come across this already may I request for some pointers/information ? Thanks in advance.
Hi i am creating an interactive graph in Pyvis with more than 200 nodes and i want to add a search bar functionality, so i can have the chance to add in the search bar the node name and that it will be selected in the graph.
Does anyone had anything like this?
I am currently working on the same thing. One tool I have used in the past is a software called Gephi. It allows you to load in a node and edges table which can then be displayed in an html through sigma.js. If you find anything for pyvis let me know :)
I am trying to generate a network graph for 200+ nodes and 300+ edges using networkx using python from a file. I was able to generate and plot the graph using matplotlib in my Juypter Notebook, but its not looking good and nodes are so tightly packed.
Is there any other python package help to generate network graph ??.
My aim is to generate graph for whole data set so that I can find dependency between nodes.
If nodes being too close together is the issue, try using the draw_spring()function of networkx.
https://networkx.github.io/documentation/networkx-2.0/reference/generated/networkx.drawing.nx_pylab.draw_spring.html#networkx.drawing.nx_pylab.draw_spring
It simulates what would happen if each edge were a spring and the network were picked up and spun around, seperating the nodes, especially the ones which are not connected via many paths.
If this does not work initially, you can use the parameters of the function that draw_spring() wraps, the spring_layout() function. Try adjusting the k value parameter. This should allow you to manipulate the rough distance between nodes.
https://networkx.github.io/documentation/networkx-2.0/reference/generated/networkx.drawing.layout.spring_layout.html#networkx.drawing.layout.spring_layout
Alternatively, there are additional draw functions you might find more useful than draw_spring(). You can find them in the draw section here: https://networkx.github.io/documentation/networkx-2.0/reference/drawing.html
I can recommend using Netwulf. Input a networkx.Graph object to netwulf.visualize, and launch the visualization in a new browser window. The result and data can be posted back to Python.
Disclaimer: I co-author Netwulf.
Suppose I have to create a graph with 15 nodes and certain nodes. Instead of feeding the nodes via coding, can the draw the nodes and links using mouse on a figure? Is there any way to do this interactively?
No.
Sorry. In principle it could be possible to create a GUI which interfaces with networkx (and maybe some people have), but it's not built directly into networkx.
I am trying to depict the relationship of different data entities with my ETL (extraction transformation loading) pipeline. The final output is a large directed graph. So far I am using Python to extract data relationship. Pydot helps me generate svg file which I can open up using a browser. The graph that I generate is static.
Pydot lets me setup tooltip and allows me to link other html pages with nodes or edges. I am looking for more than that.
A small portion of the graph is shown below
I want to do several things with this graph.
Every node can have several attributes (including name). It is not possible for me to display those attributes because of paucity of space. But as users mouse over (or do other mouse based action) I would like those attributes to show up as "floating" table which user can dismiss if not interested.
Not all node attributes are integer or strings. It can be graphs as well. For example for one of the nodes I may have a bar chart showing how often this data entity is getting loaded in last 7 days. I would like that bar chart to float over as the user moves (clicks) mouse over that node. Currently I am using matplotlib to generate bar / pie charts associated (please see above) with nodes. I link those diagrams with my original directed graph using setURL in pydot. But the user experience is not great since it takes user over to a new page.
I am happy with node layout etc that I get by default from Pydot/GraphViz. I prefer not to do everything from ground up unless it is absolutely necessary.
Ability to highlight only certain part of the graph based on query in node or edge attributes
I read this forum and came across several options in response to questions similar to mine.
gephi
igraph (I played around with igraph which lets me query by vertex
or edge. I couldn't figure out how I can make my final graph
interactive based on user input e.g. floating table on mouse over of
a node etc)
Javascript libraries - sigma.js, arbor.js, d3.js nodebox
networkX
nodebox
I have Python skill but quite novice on Javascript side. I would like to know from experts what can be my best bet (from functionality and ease of use point of view). A browser based solution is preferred.
Any suggestion / help will be really appreciated.
Thanks
Abhijit
Try NetworkX. Node attributes can be anything hashable, so that addresses (at least) your first two bullets.
You will still be using matplotlib to generate the charts. I don't know of a better solution than that.