Closed mef closed 10 years ago
my 2 cents: most sigma users don't need these features, so they should be provided as plugins.
How about naming: sigma.statistics.hits and sigma.statistics.louvain?
This would indeed be nice to see such a plugin. I cannot tell you whether it should belong to core or not but coding the plugin would absolutely not be in vain.
@sheymann I see that you're one of the authors of the implementation of HITS algorithm in Gephi. I have based my code on yours. Does it seem acceptable for you to have this plugin, port of your java code, licensed under the same terms of sigma.js' license, or is it considered as a modification of Gephi's code, and should remain under Gephi's dual-license?
Hello @mef,
Unfortunately the Gephi implementation has too many issues, therefore I recommend to write your own algorithm from scratch. Anna, a Google Summer of Code student has performed some testing that are available here, see section 11.
Great test cases. I'm adding them to sigma's qunit to validate the plugin.
Is there any further documentation I could refer to as the base of the test cases?
If I remember well, it's based on the original paper of J. Kleinberg, Authoritative Sources in a Hyperlinked Environment.
Any pointers to creating plugins (maybe also re: porting older versions from sigma to newer ver) would be helpful too. I'd love to help gets some more algorithms in but it's slow going. At least by the end of it I could write something up from a n00b perspective ;-)
@mef best wishes on this one!
thanks @spatialguru.
You should have a look at the code of existing plugins, together with the examples in order to get an idea of how to write some.
I'm also just getting with sigma.js, but here's what I have found out.
The basis structure of a plugin is like this:
;(function(undefined) {
'use strict';
if (typeof sigma === 'undefined')
throw 'sigma is not declared';
// Initialize package:
sigma.utils.pkg('sigma.myPluginNs');
/**
* sigma.myPluginNs.myFunction constructor.
*/
sigma.myPluginNs.myConstructor = function() {
// Access public and private methods
// and attributes of the sigma instance
// via `this`
this.myPluginFunction = function(params) {
// features go here
}
}
}).call(window)
access from your client code with:
var whatever = new sigma.myPluginNs.myConstructor();
// execute plugin function
var result = whatever.myPluginFunction()
An alternative technique, if you just need to extend the graph model, is to use sigma.classes.graph.addMethod
, cf. first part of the neighborhood plugin code
P.S.: If you're interested by HITS statistics, you can have a look here: https://github.com/jacomyal/sigma.js/pull/329
Thanks - I think my main challenge is around understanding how much I need to know about the web workers being used by FA2 algorithm :)
On Jul 5, 2014, at 12:04, mef notifications@github.com wrote:
thanks @spatialguru.
You should have a look at the code of existing plugins, together with the examples in order to get an idea of how to write some.
I'm also just getting with sigma.js, but here's what I have found out.
The basis structure of a plugin is like this:
;(function(undefined) { 'use strict';
if (typeof sigma === 'undefined') throw 'sigma is not declared';
// Initialize package: sigma.utils.pkg('sigma.myPluginNs');
/**
- sigma.myPluginNs.myFunction constructor. */ sigma.myPluginNs.myConstructor = function() { // Access public and private methods // and attributes of the sigma instance // via
this
this.myPluginFunction = function(params) { // features go here } }}).call(window) access from your client code with:
var whatever = new sigma.myPluginNs.myConstructor(); // execute plugin function var result = whatever.myPluginFunction()
An alternative technique, if you just need to extend the graph model, is to use sigma.classes.graph.addMethod, cf. first part of the neighborhood plugin code
P.S.: If you're interested by HITS statistics, you can have a look here: #329
— Reply to this email directly or view it on GitHub.
@spatialguru
What do yo need to know about them? What is your goal? Maybe I can help you.
Is there any naming convention for the plugins?
Design guidelines would also be useful, so that plugins respect the same API style as core sigma...
I need to implement new graph algorithms like HITS or Louvain method for community detection.
P.S.: congrats on the 1.0 rewrite, sigma really looks much more easy to customize now, and greatly documented !