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

Apply Custom Style to Cytoscape Network #15

Closed
cannin opened this issue Jul 6, 2021 · 7 comments
Closed

Apply Custom Style to Cytoscape Network #15

cannin opened this issue Jul 6, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@cannin
Copy link
Owner

cannin commented Jul 6, 2021

These links may help apply a custom style to the network.

@cannin cannin added the enhancement New feature or request label Jul 6, 2021
@cannin
Copy link
Owner Author

cannin commented Jul 6, 2021

@thepritam

This post:
https://stackoverflow.com/questions/14298096/how-to-automate-load-export-operation-in-cytoscape

has the command to load vizmap from path:
vizmap load file file="[full path to .xml style file]"

@thepritam
Copy link
Collaborator

@cannin @ozgunbabur I can apply the style programmatically from the format/JSON file. I have only added the border styles and node styles for the network. The following is a sample network after applying the styles.
programstyle

@thepritam
Copy link
Collaborator

The following repositories are helpful for creating the style.

StEMAPApp

https://github.com/RBVI/StEMAPApp

stringApp

https://github.com/RBVI/stringApp

@cannin
Copy link
Owner Author

cannin commented Jul 12, 2021

@thepritam thanks, but are you sure the CausalPath style was applied? One obvious problem I see is that the arrowheads are black (black arrowheads are nowhere in the CausalPath style see #13)

@thepritam
Copy link
Collaborator

@cannin I have applied the CausalPath styles for now I have considered the all-nodes color, all-nodes border color, and also the edge color. Now, I am aware that the edge tip color should be of green color but there is not function in the library that could change the edge tip color. Although I can change the edge color by using the RGB color code you provided.

@thepritam
Copy link
Collaborator

I have asked about the edge tip color formatting in the Cytoscape app development.
The following link describes my query:
https://groups.google.com/u/1/g/cytoscape-app-dev/c/lycOc00M-dg

@thepritam
Copy link
Collaborator

@cannin I am able to change the edge tip color on my own.
Below is the sample code. This property is not normally defined. So, we have to get the property class from the RenderingEngineManager. Many properties are not defined. And it is the way to do so.

 VisualLexicon lex = cyServiceRegistrar.getService(RenderingEngineManager.class).getDefaultVisualLexicon();
        VisualProperty targetedgecolor = lex.lookup(CyEdge.class,"EDGE_TARGET_ARROW_UNSELECTED_PAINT");

        vs.setDefaultValue(targetedgecolor,Greencolor);

@cannin cannin closed this as completed Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants