robert-haas / gravis Goto Github PK
View Code? Open in Web Editor NEWInteractive graph visualizations with Python and HTML/CSS/JS.
Home Page: https://robert-haas.github.io/gravis-docs/
License: Other
Interactive graph visualizations with Python and HTML/CSS/JS.
Home Page: https://robert-haas.github.io/gravis-docs/
License: Other
Here is a minimal example:
The following is working:
import igraph as ig
import gravis as gv
lnames = ['0', '1']
edgelist = [('0', '1')]
graph = ig.Graph(len(lnames), vertex_attrs={'name': lnames})
graph.add_edges(edgelist)
gv.vis(graph)
The following is not:
class mygraph(ig.Graph):
def __init__(self, lnames, edgelist):
super().__init__(len(lnames), vertex_attrs={'name': lnames})
self.add_edges(edgelist)
graph = mygraph(lnames, edgelist)
gv.vis(graph)
This returns
ValueError: The provided data seems not to be in a valid graph format.
Is there a workaround?
I am trying to create a network graph with different edge length. However, the edge length is not changing.
My code:
G = nx.Graph()
for i in range(df.shape[0]):
G.add_node(df.iloc[i,0], size=20, group='Compound', color='purple')
G.add_node(df.iloc[i,1], size=14, group='Target', color='red')
G.add_edge(df.iloc[i,0], df.iloc[i,1], weight=df.iloc[i,3])
figure = gv.d3(G, graph_height=1000, zoom_factor=1.5, show_details=False, show_details_toggle_button=False, show_menu = False, show_menu_toggle_button=True, node_hover_neighborhood=True, show_node_label=True, layout_algorithm_active=True)
I also tried using length instead of weight.
Any reason why this is happening?
Is it possible to include a option to get arrow_color == edge_color?
Thanks,
Ely
Hello,
Is it possible to have the label of a node be written inside of it ?
My graph roughly corresponds to a file system, i.e., the nodes of the graph are directories and files, and the edges correspond to the relation contains
, e.g., dir1 -contains-> dir2
, dir2 -contains-> file1
.
The total number of nodes is too large to show them all at once. This is why I would like to start with some top nodes of the hierarchy and expand a given node on click (to show its neighbours).
Would that be possible with gv.d3(...)
?
Is there any other "on click" response that is already implemented?
D3 has a set of symbols beyond the basic (circle, rectangle, hexagon). Is it possible to add a option to use these extra symbols?
Thanks,
Ely
If nodes/edges have associated time stamps, it would be great to have an animation of this over time, preferably with a slider and play/pause button.
Needs legends for links/node based on size/width or color/shape.
Is it possible to change the arrow style in directed graphs (something like adding an attribute for "arrowstyle", as is implemented in matplotlib https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.ArrowStyle.html)?
Thanks,
Neta
panel
has a pane that displays HTML,
that unfortunately does not work with gravis.
Might this be an easy fix?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.