PriceLab / STP

Code and commentary from The Self-Taught Programmer, Althoff 2016: python + R
Apache License 2.0
1 stars 0 forks source link

javascript magic to assign node degree as an attribute to every node #15

Open paul-shannon opened 6 years ago

paul-shannon commented 6 years ago

@aishahmohamed98

run this in your javascript console when your graph is already displayed.

cy.nodes().map(function(node){node.data({degree: node.degree()})});

then make sure it worked, by selecting one node (a well-connected node, that is, one with high degree):

cy.nodes(":selected").data("degree");
aishahmohamed98 commented 6 years ago

just for clarification, you want me to write code thatll change thickness of node based on degrees?