ChrisDelClea / streamlit-agraph

A Streamlit Graph Vis
MIT License
387 stars 52 forks source link

"directed" parameter is not working #34

Closed ViniciusgCaetano closed 1 year ago

ViniciusgCaetano commented 1 year ago

Setting directed equals True or False results in the arrowheads being showed in the graph.

ViniciusgCaetano commented 1 year ago

`import streamlit as st from streamlit_agraph import agraph, Node, Edge, Config

st.title('Opa')

nodes = [] edges = []

nodes.append(Node(id="A1", size=5) ) # includes **kwargs

nodes.append( Node(id="A2", size=5) )

edges.append( Edge(source="A1", label="", target="A2", type="-"

**kwargs

               )
        ) 

config = Config(directed=False, width=1000, height=1000,

**kwargs

            ) 

return_value = agraph(nodes=nodes, edges=edges, config=config, )`

Results on that

image

The result should be a line without the arrowhead

ChrisDelClea commented 1 year ago

Hey @ViniciusgCaetano ,

did you figure it out yet? Actually it took me a few secs to figure it out myself. The solution is actually quite simple. Just pass edges configs to the config with "arrows":"none".

config = Config(width=750, height=750, edges={"arrows":"none"} ) 

If it solves your problem, feel free to close the issue.