[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
Gephi forums •Writing GEXF for dynamic graphs using Toolkit
Page 1 of 1

Writing GEXF for dynamic graphs using Toolkit

Posted: 02 Jun 2013 18:05
by richie.kavanagh
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

Re: Writing GEXF for dynamic graphs using Toolkit

Posted: 02 Jun 2013 22:20
by eduramiba
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

Re: Writing GEXF for dynamic graphs using Toolkit

Posted: 02 Jun 2013 23:07
by richie.kavanagh
Argh! Perfect Eduardo. Thanks very much for your help. Gephi folks, put this in the tutorials!

Richie

Re: Writing GEXF for dynamic graphs using Toolkit

Posted: 06 Jun 2013 10:30
by seinecle
Duly noted, Richie! :-)

Re: Writing GEXF for dynamic graphs using Toolkit

Posted: 05 Aug 2013 20:31
by Rodger22
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!

Re: Writing GEXF for dynamic graphs using Toolkit

Posted: 14 Aug 2013 14:53
by eduramiba
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

Re: Writing GEXF for dynamic graphs using Toolkit

Posted: 03 Dec 2013 10:25
by imenMegd
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

Re: Writing GEXF for dynamic graphs using Toolkit

Posted: 31 Aug 2016 19:03
by reticent23
Hi all....can anybody repost test.zip? i need it for creating dynamic graphs in java plz........Thanks in advance..

Re: Writing GEXF for dynamic graphs using Toolkit

Posted: 01 Sep 2016 08:50
by eduramiba
Hi, attachments were lost but you have toolkit examples here https://github.com/gephi/gephi-toolkit-demos