I’m excited to share with you a new custom component for Streamlit: st-link-analysis, a tool for visualizing and interacting with graphs directly within your Streamlit apps.
Why I created this component
While there are several options available for visualizing graphs, I wanted a more interactive solution that offers the following within the frontend part:
Easily switch to fullscreen mode for a more immersive visualization (especially important for link analysis tasks).
Refresh the layout dynamically without needing to rerun the backend.
View detailed information about nodes and edges directly within the visualization
Exporting data along with positions to JSON.
I plan to continue to work on it every once in while to address any reported issues and add additional features (e.g. hide/show nodes).
You can find the full demo code in the examples directory of the main repository. For instance, the code for the node styles selectbox can be found here.
Yes, of course. Streamlit makes this easy. You can use a text_input field and update the graph data based on its value. Feel free to give it a try, and let me know if you encounter any difficulties.
I’m happy to share some recent updates to the st-link-analysis component. Here’s a quick overview of what’s new and improved:
Key New Features
Node Actions (Expand / Remove)
You can now enable node removal and expansion by passing True to the enable_node_actions parameter. Removal can be triggered by a delete keydown or a remove button click, while expansion occurs on a double-click or expand button click. When these events are triggered, the event details and selected node IDs are sent back to the Streamlit app as the component’s return value.
View Control Bar
A new viewbar frontend component has been added for zooming, fitting, and centering the view, making it easier to navigate your graphs.
Extended Layouts
Added support for fcose and cola cytoscape layouts.
Thanks for this component. Been using it for an analysis and I love how simplified it is. Question. Is there a layout that always shows the graph from Left to right or from Top to bottom, similar to what Graphviz does?
I am using it to analyse business processes and it would be nice to look at a process from either left to right or top to bottom.
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.