just wanted to share my brand new streamlit-agraph component with you.
It is an interactive graph visualization component. In the future I might make it more customizable.
If you have any ideas how to improve it, leave a comment bellow, or send me a mssage.
Also if you are intersted in collaborating on this, give me a ping.
At this point I’d also like to thank Tim (@tc1 ) for the nice tutorial.
You pinpointed exactly the process and what was necessary to know,
to get the job done.
Next, I want to include images for each node and a sidebar for the customization of properties. However - here comes my special requirement - is it possible to do this in a sidebar on the right side of the app?
Some sidebar extention á la st.sidebar(align=“right”) or so would be nice.
It would be great too, if one could open/close the sidebar with a little button á la st.sidebar(mode=“dynamic” and default = static.
Hi @chris_klose – thanks for sharing this, it’s really cool. Should you be able to pass in an edge weight to have thicker edges between nodes? I’ve tried doing it, but it appears they all draw the same thickness.
Here is how I’m creating the nodes / edges:
for i, r in d.head(300).iterrows():
nodes.append(Node(id=r['player'], size=400))
nodes.append(Node(id=r['team'], size=400, svg=r['team_img']))
edges.append(Edge(source=r['team'], target=r['player'], weight=r['cnt']) )
HI @chris_klose many thanks for this wonderful component!
I am currently using it to display extracted relations in NLP and I am wondering if it’s possible to add/generate a sort of colour legend to identify every node accordigly.
Something like: blue node for entity 1, green node for relations, yellow node for entity 2.
@aaroncolesmith I see, guess pyvis is a good alternative these days.
Is it possible to show pictures/Icons inside the node?
Ofc the app looks quite fancy too !
Hi @chris_klose , many thanks for your reply and sorry for getting back to you after so many days.
Unfortunately my javascript skill are too basic to help you in any meaningful way but I have found a “solution” to my problem by appending additional nodes with colour and id information and specifying x and y coordinates so that they always appear in the top-left corner.
thanks for this interesting question.
I think as of today, there is no explicit way to specifiy bi-directinal graphs.
You can modify if you want to have a direct or undirected graph with directed=True or directed=False
to have arrowheads or not.
As a work-around you could simply pass the directed=True in the configs in the link section (if a recall right) and add links in both directions edge(A,B) and edge(B,A) so you would get it done.
Just don’t know if it looks that nice, cauz labels would overlap.
thanks for your question .
So far agraph-component does not support any query language out-of-the-box.
What you can do ofc is to use the python package for it and just pass over the results to agraph.
All you have to do for that is to write a small wrapper that converts your gremlin graph to the input-format required by agraph-component.
If I can help you on any specific example let me know.
I’m new to graph, so glad to see such a great component! And wondering is there any possibility that I can use Streamlit-agraph with neo4j or with py2neo?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.