I am not familiar with cytoscape or Java, so I do not know if there is a way to define a node size which depend on node's degree.
Currently I am using the following:
cytoscapeobj.set_style(
[
{
'selector':node,
'style': {
'font-family': 'helvetica',
'font-size': '20px',
'label': 'data(id)'
}
},
{
'selector': 'edge',
'style': {
'font-family': 'helvetica',
'font-size': '20px',
'width' : 'mapData(weight)' # it is actually not working
}
},
{
'selector': 'node[Degree>0]',
'style': {
'width': '100px',
'height': '100px'
}
},
{
'selector': 'node[Degree>1]',
'style': {
'width': '150px',
'height': '150px'
}
},
{
'selector': 'node[Degree>2]',
'style': {
'width': '200px',
'height': '200px'
}
}
]
)
I have thousands of nodes, some of them has degree 1 (most of them), then I have nodes with degree 2, 3, 4, 5 ,... 100, ...
It would be not easy to add a selector for each of them.
Do you know if there is an easier way to plot any node's degree?