Skip to content

Conversation

numericOverflow
Copy link

Add an additional (optional) arg for NodeStyle() and EdgeStyle() constructors to pass additional style args to cytoscape.js as a dictionary that is applied directly to component. This allows you to set style properties that are not set by one of the default parameters of the styles.

Example usage

NodeStyle("SKU", "blue", "name", "sku_icon", custom_styles={"width":5,"height":5})

or to change the width of an edge style:

EdgeStyle("QUOTES", caption='label', directed=True, custom_styles={"width":10})

Theoretically, this should allow you to pass any style(s) defined in cytoscape.js
https://js.cytoscape.org/#style

new dictionary arg "custom_styles" allows applying more styles not pre-defined by style constructors.
replaced edges with nodes in arg description
@numericOverflow
Copy link
Author

@AlrasheedA - Any thoughts on merging this PR?

@natalie-23-gill
Copy link

natalie-23-gill commented Oct 11, 2025

@AlrasheedA This would be very useful for a project I am working on. Can you confirm whether you are planning to merge it? Thank you for your work on this streamlit component!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants