Questions tagged [pyvis]

96 questions
1
vote
1 answer

How to serve a pyvis graph with fastapi?

I wonder what is the best way to serve a pyvis network with FastAPI? This iteractive graph was generated with pyvis and is stored in an html file and then displayed as an interactive tool in JupyterLab. I would like to serve it as part of a…
Soerendip
  • 7,684
  • 15
  • 61
  • 128
1
vote
1 answer

Can you specify a bidirectional edge in a NetworkX digraph?

I'd like to be able to draw a NetworkX graph connecting characters from the movie "Love, Actually" (because it's that time of the year in this country), and specifying how each character "relates" to the other in the story. Certain relationships…
Lou
  • 2,200
  • 2
  • 33
  • 66
1
vote
2 answers

How to select menu in pyvis network?

I want to visualize network with selection different nodes. For better understanding the problem attached this code. from pyvis.network import Network G = nx.Graph() rels = [ ["Fred", "George"], ["Harry", "Rita"], ["Fred", "Ginny"], …
1
vote
0 answers

Change color of the node in Pyvis Network when it gets clicked on

I'm creating a network visualization in python using Pyvis. I can create the graph as I want with no problem, but when I run my script and get the html file as output, I want the nodes to change colors when I click on them and I can't achieve that.…
TomasC8
  • 161
  • 1
  • 7
1
vote
1 answer

How to make edge in networkx a button?

I want that when I press on an edge, a windows with info will pop up. How to do that? Is it possible? Example of my code: my_graph = networkx.Graph() to_print = set() for network_profile in network_profiles: for connected_profile in…
Daniel Vazana
  • 134
  • 1
  • 6
1
vote
1 answer

Plotting multi-edge directed graphs using pyvis in a way that shows all edges separately

Note: This post is directly related to this one, except that I am looking for a solution in pyvis. I would like to plot a directed graph with multiedges, that is, each pair of nodes is connected with two edges in opposite directions. In order to…
Johannes Wiesner
  • 1,006
  • 12
  • 33
1
vote
1 answer

Change graph layout (aka. node positioning algorithm) in pyvis

When using networkx.draw() it is possible to specify different node positioning algorithms that change the graph layout using the pos keyword argument. For example: import networkx as nx import matplotlib.pyplot as plt # create a graph G =…
Johannes Wiesner
  • 1,006
  • 12
  • 33
1
vote
1 answer

Edge of the graph is not selected

To plot the graph, I use the following code: from pyvis.network import Network import csv got_net = Network(height='900px', width='100%', bgcolor='#222222', font_color='white') got_net.barnes_hut() with open('test.csv', 'r') as csvfile: …
Alex Rebell
  • 465
  • 3
  • 15
1
vote
1 answer

PyVis Graph shows some nodes colour as green and some as yellow even though the nodes are assigned with colour green

I have generated a PyVis graph but the graph output has just one problem and seems i can't find the reason and lost to no ideas anymore, i am not sure if it is a bug in PyVis drawing or I have made an error in generating the graph. Please advise, i…
1
vote
0 answers

Save network image from Pyvis python

I have a network created through Pyvis library: nt = Network('900px', '900px') nt.from_nx(N) nt.show('plot.html') Where N is a network from Networkx library. In the last line I create an html file with the plot of the network but when I open it I…
Fabio
  • 61
  • 5
1
vote
1 answer

Interactive Pyvis Diagram Search function

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…
1
vote
0 answers

Arrow head shape in Python pyvis

I am using the Python pyvis library to plot a directed graph. Is there a way to make arrowheads behave properly when we increase the size of the edges? Currently, they look like this: https://i.stack.imgur.com/k7mgb.png And I would like the point of…
Chiara
  • 11
  • 1
1
vote
2 answers

Python, networkx, pyvis: How do you change the node label font size

I have been struggling with a simple question. How to change the label size for a certain type of node? My nodes are switches and their ports. I wish to have nodes that are switches to have their labels in a larger size font than the port nodes. I…
1
vote
0 answers

PyVis: visually cluster based on edge weight

I am trying to visually cluster nodes in a network based on the weight of their edges: nodes with high edge weight should be close by in the 2d Euclidean space of the output image. I built my network with NetworkX and converted it to PyVis in order…
Thomas Tiotto
  • 379
  • 1
  • 3
  • 12
1
vote
1 answer

Option to save the edited Pyvis network html graph file

I am using Python module pyvis to plot a network graph. Like manytimes, the initial graph is cluttered for the nodes, so i do the node moves to make it clean and better. After that i save the HTML file. When i reopen the HTML file again, the node…
SPA
  • 21
  • 4