Skip to content

Add ability to pass custom styles to nodes and edges#61

Closed
numericOverflow wants to merge 2 commits into
AlrasheedA:mainfrom
numericOverflow:feature-custom_styles
Closed

Add ability to pass custom styles to nodes and edges#61
numericOverflow wants to merge 2 commits into
AlrasheedA:mainfrom
numericOverflow:feature-custom_styles

Conversation

@numericOverflow

Copy link
Copy Markdown

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 style constructor.

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.
@numericOverflow

Copy link
Copy Markdown
Author

I'm canceling this PR because I realized I accidentally mixed 2 commits in it. Submitting a new clean PR with just the changes for this one.

Replaced with #62

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.

1 participant