-
-
Save jacomyal/2209633 to your computer and use it in GitHub Desktop.
/* | |
Add the function to the public prototype : | |
*/ | |
sigma.publicPrototype.outDegreeToSize = function() { | |
this.iterNodes(function(node){ | |
node.size = node.outDegree; | |
}).draw(); | |
}; | |
/* | |
Of course, it works as well with node.degree and node.inDegree. | |
How to test it: | |
1. Open any sigma example - http://sigmajs.org/examples.html | |
2. Open a console - http://bit.ly/GVshi6 | |
3. Enter the previous code | |
4. Try it on the first sigma.js instance on the page: | |
sigma.instances[1].outDegreeToSize(); | |
Also, if you want to choose the minimum/maximum node sizes: | |
sigma.instances[1].graphProperties({ | |
minNodeSize: 1, | |
maxNodeSize: 3 | |
}); | |
*/ |
Hi,
can we get pagerank, Closeness Centrality, Eigenvector Centrality of nodes ?
Thanks
I'd also be interested in hgillh request
Hi,
sigma.publicPrototype.outDegreeToSize = function() {
this.iterNodes(function(node){
node.size = node.outDegree;
}).draw();
};
/*
Of course, it works as well with node.degree and node.inDegree.
How to test it:
- Open any sigma example - http://sigmajs.org/examples.html
- Open a console - http://bit.ly/GVshi6
- Enter the previous code
- Try it on the first sigma.js instance on the page:
sigma.instances[1].outDegreeToSize();
Also, if you want to choose the minimum/maximum node sizes:
sigma.instances[1].graphProperties({
minNodeSize: 1,
maxNodeSize: 3
});
I need working example for ""outDegreeToSize"" plz help me every thing else is working fine with Sigma.js plz give me the even the shortest example but give me the one which is working i will modify it accordingly... waiting for reply..
By example i mean like other example on sigma.js they are so helpfull put this code in one of this example and post it here .. thats all i want... Thanx in advance...
Did this change with v1.0.0? I am opening examples/basic.html but I am getting one error. I will post what I do.
First, I am trying sigma.instances()
, but this method is not working without id:
TypeError: Object #<Object> has no method 'extends'
This is throwing an error:"sigma.publicPrototype is undefined".What to do?
I see and understand your point.
Anyway the library is working perfectly now about
inDegree
andoutDegree
attributes, thanks a lot for all the time you spent dealing with me!Valerio