[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
Gephi forumsPlease post new questions on facebook group too (https://www.facebook.com/groups/gephi) 2016-06-01T20:56:57+01:00 https://forum-gephi.org/app.php/feed/topic/5247 2016-06-01T20:56:57+01:002016-06-01T20:56:57+01:00 https://forum-gephi.org/viewtopic.php?t=5247&p=12647#p12647 <![CDATA[Re: Adding attribute latitude and longitude]]>

CODE:

Table table = Lookup.getDefault().lookup(Table.class);table = graphModel.getNodeTable();table.addColumn("latitude", Double.class);table.addColumn("longitude", Double.class);..............Node v1 = graphModel.factory().newNode(source);v1.setLabel(source);v1.setAttribute("latitude", 34.56);v1.setAttribute("longitude", 22.34);

Statistics:Posted by gsthakur — 01 Jun 2016 20:56


]]>
2016-05-31T08:12:19+01:002016-05-31T08:12:19+01:00 https://forum-gephi.org/viewtopic.php?t=5247&p=12623#p12623 <![CDATA[Re: Adding attribute latitude and longitude]]>
You need to use setAttribute of elements (nodes and edges). https://gephi.org/gephi/0.9.1/apidocs/o ... ement.html

Statistics:Posted by eduramiba — 31 May 2016 08:12


]]>
2016-05-31T02:15:27+01:002016-05-31T02:15:27+01:00 https://forum-gephi.org/viewtopic.php?t=5247&p=12621#p12621 <![CDATA[Adding attribute latitude and longitude]]>
I am unable to add them using the Java API.

current snapshot of the code looks below. I want to add two attributes to this code.

CODE:

// Init a project - and therefore a workspaceProjectController pc = Lookup.getDefault().lookup(ProjectController.class);pc.newProject();Workspace workspace = pc.getCurrentWorkspace();// Get a graph model - it exists because we have a workspaceGraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel();                Node v1 = graphModel.factory().newNode(source);        v1.setLabel(source);

Statistics:Posted by gsthakur — 31 May 2016 02:15


]]>