I am about to finish my master thesis in Bioinformatics and
stumbled above Streamlit on Medium - Not sure if I should ask here or on Github:
Is there any integration with CytoscapeJS planned in the near future?
Right now my web app is Plotly-Dash based + utilizing the Dash-Cytoscape Plugin
but I would love to rewrite it in Streamlit.
Hi @IvoLeist - welcome to the community and congrats on finishing your thesis! Just looking at Cytoscape.js and that is a really interesting library. We do have support for GraphViz but I get you don’t necessarily want to change all of your chart types. While Cytoscape.js is not in the near future, I’m adding it as a feature request so you can track when it is integrated. Also we are thinking about our plugin architecture to make it possible for users to create their own plugins, so you could weigh in there as well. Best of luck on the masters and your app - would love to see it if you do end up making it in Streamlit!
This is very WIP and also I won’t immediately have the bandwith to push this, but if anyone wants to help on this I’m ready to lend a hand .
Also if you’re using Cytoscape.js, do tell us about your use cases + code samples, here or in the Github project so we see how to orient the roadmap for this.
PS: while my component uses the bidirectional Streamlit component template, it looks like most graphs don’t need data collected back to Streamlit so for that, if you know how to map your Cytoscape.js data to some clean HTML with Cytoscape.js loaded from CDN in a single string, you could just put this string in st.html. I wrote 2 examples of this for loading Lottie animations using Jinja and loading MaterialUI table. If you need help on this we can talk about this here too.
I’ve been working on improving the concept of a Cytoscape.js component for Streamlit, and I just finished an initial version (0.0.1) of a bidirectional component. More precisely, the component returns the element (node or edge) id tapped by the user, so that now we can trigger other visualizations based on the interaction with the network.
Since my knowledge in web development is very weak and my time is limited, instead of using a react template I chose to go for the reactless one. Despite being more verbose, I can directly use the original Cytoscape.js library, which has a ton of useful functions. To be honest, I really wanted to do a react component and collaborate with @andfanilo, but the react framework seemed quite complex.
I published the component as a package in pipy test repository here and the GitHub repository has use instructions. Don’t expect it to work without bugs as I didn’t test it extensively and I have close to 0 experience in this field haha. But for simple networks that I tested, it worked. If you find bugs, please report it on the issues page.
For the next steps (help is very much appreciated), I would like to:
Create a dashboard example where the bidirectional communication is utilized.
Expand the package to support another very useful use case, where tapping a node expands the network to show the node’s neighborhood.
Thank you so much for the contribution (and the callout ), especially if it’s your very first venture into the frontend world. Honestly I think you took the better approach for your use cases, with vanillaJS it looks like it will be much easier to integrate Cytoscape plugins or rely on any online resources. My time with React + Cytoscape was a liiitttle bit painful I have to say, because in this specific case it was hard to map vanilla JS code to its React counterpart, which is why I did not go further on this road…
Definitely update the Components Tracker and add a line for your component.
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.