Writing GEXF for dynamic graphs using Toolkit

Once it's running
Post Reply [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
richie.kavanagh
Posts:8
Joined:10 Jan 2012 21:23
[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
Writing GEXF for dynamic graphs using Toolkit

Post by richie.kavanagh » 02 Jun 2013 18:05

Hey all,
I'm going crazy here after several hours with Gephi and would really appreciate some help.
I'm trying to write Java code that will generate a dynamic graph in code and export it into GEXF using the toolkit. Ultimately this graph will be constructed by reading database tables.
I've looked at the Dynamic Graph and Manual graph examples in the toolkit and tried to hack a minimal example from them. The graph that's created has 50 nodes before I've even added any nodes in code!

I would be very grateful if somebody could provide code to demonstrate:
(1) instantiate a dynamic graph
(2) add/remove a node or edge with dynamic properties
(3) export to GEXF

I'm trying to justify use of Gephi for a client and I feel like I'm 'at the point where these simple stumbling blocks will force me to write it off altogether.

Richie

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Writing GEXF for dynamic graphs using Toolkit

Post by eduramiba » 02 Jun 2013 22:20

Hi,
If you initially have 50 nodes you are probably using a sample graph generator.

I attach a sample script showing the ways to work with the graph, attributes, dynamics and exporting.
Without comments and debug prints its pretty straightforward.

I hope it helps,
Eduardo
Attachments
Test.zip
(2.04KiB)Downloaded 575 times

richie.kavanagh
Posts:8
Joined:10 Jan 2012 21:23
[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: Writing GEXF for dynamic graphs using Toolkit

Post by richie.kavanagh » 02 Jun 2013 23:07

Argh! Perfect Eduardo. Thanks very much for your help. Gephi folks, put this in the tutorials!

Richie

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Writing GEXF for dynamic graphs using Toolkit

Post by seinecle » 06 Jun 2013 10:30

Duly noted, Richie! :-)

Rodger22
Posts:25
Joined:22 Jun 2013 18:02
Location:Canada
Contact:

Re: Writing GEXF for dynamic graphs using Toolkit

Post by Rodger22 » 05 Aug 2013 20:31

Hello Eduardo,

I'm just a java newbie, having taken an intensive java course for a few months.

I opened Netbeans, and pasted this test.java into it.

However, I get the errors:


...
Test.java:30: error: package org.gephi.data.attributes.api does not exist
import org.gephi.data.attributes.api.AttributeType;


I've got red flags on every:

import org.gephi*



Where and How do I get the org.gephi libraries to work?


Is there a link to show the baby steps for java dummies?


Thanks a lot!

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Writing GEXF for dynamic graphs using Toolkit

Post by eduramiba » 14 Aug 2013 14:53

Hi,
You need to add the gephi toolkit jar as a library in your Netbeans project.
Check this http://stackoverflow.com/questions/5893 ... n-netbeans

Eduardo

imenMegd
Posts:6
Joined:07 Oct 2013 10:09
[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: Writing GEXF for dynamic graphs using Toolkit

Post by imenMegd » 03 Dec 2013 10:25

hello,

thanks for the file test.zip. but i have a question what is the difference between creating a dynamic graph like this
Graph graph = gexf.getGraph();
graph.
setDefaultEdgeType(EdgeType.UNDIRECTED)
.setMode(Mode.DYNAMIC)
.setTimeType(TimeFormat.XSDDATETIME);

and the DynamicGraph.
And just more explication for the difference between dynamic and static graphs.

thanks for advance for responses

reticent23
Posts:8
Joined:22 May 2016 09:37
[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: Writing GEXF for dynamic graphs using Toolkit

Post by reticent23 » 31 Aug 2016 19:03

Hi all....can anybody repost test.zip? i need it for creating dynamic graphs in java plz........Thanks in advance..

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[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: Writing GEXF for dynamic graphs using Toolkit

Post by eduramiba » 01 Sep 2016 08:50

Hi, attachments were lost but you have toolkit examples here https://github.com/gephi/gephi-toolkit-demos

Post Reply
[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
[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