Skip to content
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

Usage of classes #69

Open
Hehnk opened this issue Nov 21, 2020 · 1 comment
Open

Usage of classes #69

Hehnk opened this issue Nov 21, 2020 · 1 comment

Comments

@Hehnk
Copy link

Hehnk commented Nov 21, 2020

Hello,

first of all: Great work with this library!

Is there any way to use style classes with your library? So nodes styled differently based on the class selector associated to them? It would be especially interesting to be able to change these classes at run time and thereby change the look of the nodes.

Thanks for your help!
Cheers!

@daddycocoaman
Copy link

You can do that with the same cytoscape syntax as the regular cytoscape.js.
https://js.cytoscape.org/#selectors

Here's an example where I change the node image based on a node property, as well as change the colors of nodes and edges based on the current classes of the node which changes as the user interacts with them: https://github.com/daddycocoaman/BeaconGraph/blob/main/frontend/src/cy-config.js

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

No branches or pull requests

2 participants