[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) 2011-03-23T16:18:05+01:00 https://www.forum-gephi.org/app.php/feed/topic/764 2011-03-23T16:18:05+01:002011-03-23T16:18:05+01:00 https://www.forum-gephi.org/viewtopic.php?t=764&p=2853#p2853 <![CDATA[Re: Adding extra variables to NodeData, can it be done?]]> Statistics:Posted by mbastian — 23 Mar 2011 16:18


]]>
2011-03-22T20:39:59+01:002011-03-22T20:39:59+01:00 https://www.forum-gephi.org/viewtopic.php?t=764&p=2848#p2848 <![CDATA[Re: Adding extra variables to NodeData, can it be done?]]> Statistics:Posted by galwarion — 22 Mar 2011 20:39


]]>
2010-11-08T16:20:24+01:002010-11-08T16:20:24+01:00 https://www.forum-gephi.org/viewtopic.php?t=764&p=1899#p1899 <![CDATA[Re: Adding extra variables to NodeData, can it be done?]]>
Now where would be the best place to put these addColumns in
You have to call this once only, you can also use hasColumn() method and for instanc eonly add the column if it doesn't exist already.
My last question is this, say I created my own attribute, like what's happening here, only with doubles. Would it appear on the "Choose a rank parameter" dropdown menu? Or are the list of available rankings set in stone during import?
All numerical attributes (float, double, integer, ...) are automatically available through ranking, you don't have to do anything. Once added as a column, Ranking can use it.

Statistics:Posted by mbastian — 08 Nov 2010 16:20


]]>
2010-11-07T16:26:50+01:002010-11-07T16:26:50+01:00 https://www.forum-gephi.org/viewtopic.php?t=764&p=1897#p1897 <![CDATA[Re: Adding extra variables to NodeData, can it be done?]]>
Now where would be the best place to put these addColumns in? If they get called more than once then Gephi throws an error.

CODE:

AttributeModel attModel = Lookup.getDefault().lookup(AttributeController.class).getModel();attModel.getNodeTable().addColumn("diseased", AttributeType.BOOLEAN);
My last question is this, say I created my own attribute, like what's happening here, only with doubles. Would it appear on the "Choose a rank parameter" dropdown menu? Or are the list of available rankings set in stone during import?

Statistics:Posted by Mountaineer — 07 Nov 2010 16:26


]]>
2010-11-07T10:46:32+01:002010-11-07T10:46:32+01:00 https://www.forum-gephi.org/viewtopic.php?t=764&p=1896#p1896 <![CDATA[Re: Adding extra variables to NodeData, can it be done?]]>
You can easily add data to nodes by using attributes:

CODE:

nodedata.getAttributes.setValue("diseased", true )
Don't forget to first define the new column:

CODE:

AttributeModel attModel = Lookup.getDefault().lookup(AttributeController.class).getModel();attModel.getNodeTable().addColumn("diseased", AttributeType.BOOLEAN);

Statistics:Posted by mbastian — 07 Nov 2010 10:46


]]>
2010-11-07T05:21:04+01:002010-11-07T05:21:04+01:00 https://www.forum-gephi.org/viewtopic.php?t=764&p=1895#p1895 <![CDATA[[SOLVED] Adding extra variables to NodeData, can it be done?]]>
I am trying to add a extra variable to the NodeData class, along with appropriate get/set functions. However Gephi crashes the moment such a function is called. Netbeans does not indicate any errors with recognizing the method, and the following code snippet inside DHNSEventBridge compiles fine.

CODE:

    public void simulate() // called when selected from the right click menu    {        this.graph = graphController.getModel().getHierarchicalGraphVisible();        ModelImpl[] selectedNodeModels = engine.getSelectedObjects(AbstractEngine.CLASS_NODE);        for (ModelImpl metaModelImpl : selectedNodeModels)        {            NodeData nodeData = (NodeData) metaModelImpl.getObj();            nodeData.setColor(0, 1, 0);            nodeData.setDiseased(true);  // Causes Gephi to crash        }   }
What would cause Gephi to crash from this? Does it have something to do with the nature of metaModelImpl?

Thank you

Statistics:Posted by Mountaineer — 07 Nov 2010 05:21


]]>