-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cytoscape.js raises errors when used with Bokeh 3.x/ Panel 1.0 #3133
Comments
There is a running version of the app here that you can use for exploration HF Space: https://huggingface.co/spaces/MarcSkovMadsen/panel-cytoscape-issue |
Cytoscape works very well in data science systems like Jupyter and Plotly/Dash. It's a shame that, prima facie, Holoviz has compatibility issues given their architectural decisions. You could be very well correct that Holoviz's use of shadow DOM is a part of the problem. If that's the case, then effectively Holoviz has placed a potential integration burden for every external library that might be used in that system. If the Holoviz community is interested in support for new features in Cytoscape -- like shadow DOM support -- we do accept pull requests. If you find any minimally reproducible issues (i.e. without Holoviz, forked from the JSbin example), you're welcome to post them to the issue tracker. For instance, you could test your shadow DOM hypothesis in a minimal example. |
Thanks for the feedback 👍 |
I might not have explained very it very well. Its actually Bokeh that took the decission to use ShadowRoot. Simply because styling of Bokeh, Jupyter, VS Code, Colab and other Python frameworks often dont work well together. Panel and HoloViz has taken the decission to build on top of Bokeh. Panel is supporting many, many JS libraries. Cytoscape is the first JS library that to my knowledge show signs of not working inside shadowRoot.
|
I was able to remove the "isHeadless" error by adding data and applying layout after initialization. |
By and large, web components are a technology that hasn’t really taken off in comparison with other methods (e.g. React). It’s analogous to the old ideas around the semantic web: Great in theory, but nearly nobody used it and it wasn’t without its downsides.
That’s great that you have a workaround. It’s a bit suspect, though, since it seems as though your component might not be mounting at the proper time. Anyway, best of luck with your project. |
This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions. |
Environment
To get everything installed in your Python environment
Context
HoloViz Panel is a very popular open source, free and NumFocus sponsored Python data app framework. Its used by scientists and business users in Jupyter Notebooks and Editors like VS Code and PyCharm to explore and share their data and models.
In holoviz/panel#5195 a user of Panel reports that he was using cytoscape.js just fine with Panel 0.14.4/ Bokeh 2.4.3. But not with Panel 1.x./ Bokeh 3.x.
The big change is that in Panel 1.x/ Bokeh 3.x components are rendered inside shadow root.
I'm a simply a user of and contributor to Panel with minimal front end skills. I'm just trying to help the user. I believe that the issues below are related to cytoscape.js in some way. My hypothesis is that cytoscape.js does not work well inside the shadow root?
I hope that as a minimum you can help us understand the issue. If you can fix the issue on cytoscape.js side or give us enough understanding of the issue to solve the issue on the Panel side it would be much appreciated. Thanks.
Minimum Reproducible Example
In a terminal install Panel
Add the below code to a
script.py
file.In a terminal run
Open the app in your browser at http://localhost:5006/script.
As you can see in the video below
cytoscape-issues.mp4
Desired behaviour
I would expect cytospace.js to be to not raise errors and the mouse clicks to work as they should.
For reviewers
Reviewers should ensure that the following tasks are carried out for incorporated issues:
master
,unstable
, and1.1.x
if the current release is 1.2).bug
, if necessary.The text was updated successfully, but these errors were encountered: