Giter VIP home page Giter VIP logo

gravis's Issues

gravis is not working with a subclass derived from a valid graph

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?

Edge length

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.
Example
Any reason why this is happening?

Arrow color

Is it possible to include a option to get arrow_color == edge_color?
Thanks,
Ely

Label inside node

Hello,

Is it possible to have the label of a node be written inside of it ?

On click: expanding nodes

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 symbols

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

legend

Needs legends for links/node based on size/width or color/shape.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.