Hi Guys; hope everyone is doing well.
Im trying to use that awesome sigma.js exporter thing to put a gephi graph on a web page. http://sigmajs.org/. But I cant really figure it out. Before i used the gexf-js by raphv and eduramiba (thanks guys). And on their github page they put an easy to follow index.html file that was, well... easy to follow and told me how to put this javascript thing in the body of a web page. https://github.com/raphv/gexf-js/blob/master/index.html.
So i was just wondering if a similar index.html file exists for the simga.js exporter? I know it's probably very easy for most of you, but I my skills in coding and syntax and stuff are rather n00bish. Any help would be most appreciated. Thanks again!
Weezy F Baybay
sigma.js index.html example file
Re: sigma.js index.html example file
Hey again!
I was just like you since I don't practice javascript so I was not very sure how to make it work.
But that's quite simple, and with some help from the creator of sigmajs that worked fine. See the result here:
http://www.clementlevallois.net/datavizmap/index.php
To do the same, you need to have your own server, I assume you have one?
If so, you simply
- unzip the file attached to this post on your server
- upload your gexf file to the data folder
- in the file "index.html", replace the name of the existing gexf file by yours.
=>that is the line that says: sigInst.parseGexf('data/datavizmap.gexf');
=> replace "datavizmap.gexf" by the name of your file.
- that's it!
Good luck!
Best,
Clement
[EDIT: of course, change the rest of the index.html file where I wrote my own stuff, and put any text you like instead!]
I was just like you since I don't practice javascript so I was not very sure how to make it work.
But that's quite simple, and with some help from the creator of sigmajs that worked fine. See the result here:
http://www.clementlevallois.net/datavizmap/index.php
To do the same, you need to have your own server, I assume you have one?
If so, you simply
- unzip the file attached to this post on your server
- upload your gexf file to the data folder
- in the file "index.html", replace the name of the existing gexf file by yours.
=>that is the line that says: sigInst.parseGexf('data/datavizmap.gexf');
=> replace "datavizmap.gexf" by the name of your file.
- that's it!
Good luck!
Best,
Clement
[EDIT: of course, change the rest of the index.html file where I wrote my own stuff, and put any text you like instead!]
- Attachments
-
- example sigmaJS.zip
- (197.89KiB)Downloaded 1239 times
- WeezyF
- Posts:48
- Joined:03 May 2012 02:29 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: sigma.js index.html example file
shazamm!!! http://zackdesario.com/friends/
Last edited by WeezyF on 10 Jul 2013 03:36, edited 1 time in total.
- WeezyF
- Posts:48
- Joined:03 May 2012 02:29 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: sigma.js index.html example file
Now to build upon that... Would it be possible to use the sigma.js.ForcedAtlas2 script on a .gexf file (or another type of data file). I looked in the code found hurr (http://sigmajs.org/examples/random_clusters.html ) and he seems to have the ForceAtlas algo running on randomly generated nodes. So, would we be able to use this same algo, but have it run on nodes in a data file we upload?
All suggestions welcome;
zzz
All suggestions welcome;
zzz
-
- Posts:2
- Joined:18 Jun 2012 22:59 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: sigma.js index.html example file
Hi, I am trying to do this locally, but am having issues with the graph showing up. I downloaded your example zip and kept everything as is, so are nodes supposed to show up as you have defined in your datavizmap.gexf? Because I am seeing an empty screen like so:seinecle wrote:Hey again!
I was just like you since I don't practice javascript so I was not very sure how to make it work.
But that's quite simple, and with some help from the creator of sigmajs that worked fine. See the result here:
http://www.clementlevallois.net/datavizmap/index.php
To do the same, you need to have your own server, I assume you have one?
If so, you simply
- unzip the file attached to this post on your server
- upload your gexf file to the data folder
- in the file "index.html", replace the name of the existing gexf file by yours.
=>that is the line that says: sigInst.parseGexf('data/datavizmap.gexf');
=> replace "datavizmap.gexf" by the name of your file.
- that's it!
Good luck!
Best,
Clement
[EDIT: of course, change the rest of the index.html file where I wrote my own stuff, and put any text you like instead!]
Re: sigma.js index.html example file
The problem might be with the fact that you run it locally. Try on the server side and see what happens!
-
- Posts:2
- Joined:18 Jun 2012 22:59 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: sigma.js index.html example file
Thanks for the reply. I actually don't have a server of my own, but I am curious as to why it would run on the server side and not locally. Would you mind elaborating?
-
- Posts:1
- Joined:21 Jun 2012 07:04 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: sigma.js index.html example file
I too have the same issue as 'raphytaffy' has.
why we need the server when we want to run it in locally
(if its mandatory which server we required?)
i am on the train track i must get out of this things done
thanks in advance if any solutions
why we need the server when we want to run it in locally
(if its mandatory which server we required?)
i am on the train track i must get out of this things done
thanks in advance if any solutions
- WeezyF
- Posts:48
- Joined:03 May 2012 02:29 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: sigma.js index.html example file
Has anyone figured out how to use the sigma.js forceAtlas2 plugin with data that is not randomly generated... (ie; a gexf file...); http://sigmajs.org/examples/random_clusters.html
in the first few lines of the plugin code is where they randomly generate the nodes..
instead of randomly generated, can we just pass in data from our own graph..?
in the first few lines of the plugin code is where they randomly generate the nodes..
instead of randomly generated, can we just pass in data from our own graph..?
// Generate a random graph with :
// . N nodes
// . E edges
// . C clusters
// . d the proportion of edges that connect two nodes
// from the same cluster
var i, N = 500, E = 3000, C = 5, d = 0.5, clusters = [];
for(i = 0; i < C; i++){
clusters.push({
'id': i,
'nodes': [],
'color': 'rgb('+Math.round(Math.random()*256)+','+
Math.round(Math.random()*256)+','+
Math.round(Math.random()*256)+')'
});
}
for(i = 0; i < N; i++){
var cluster = clusters[(Math.random()*C)|0];
sigInst.addNode('n'+i,{
'x': Math.random(),
'y': Math.random(),
'size': 0.5+4.5*Math.random(),
'color': cluster['color'],
'cluster': cluster['id']
});
cluster.nodes.push('n'+i);
}
for(i = 0; i < E; i++){
if(Math.random() < 1-d){
sigInst.addEdge(i,'n'+(Math.random()*N|0),'n'+(Math.random()*N|0));
}else{
var cluster = clusters[(Math.random()*C)|0], n = cluster.nodes.length;
sigInst.addEdge(i,cluster.nodes[Math.random()*n|0],cluster.nodes[Math.random()*n|0]);
}
}