I am writing a generator plugin using 0.8 alpha. I need to access information about a NodeDraft such as its ID and those stored in the AttributeTable, but can't figure out a way to do this. I need this information to decide whether to add an EdgeDraft between a pair of DraftNodes.
I saw this post about NodeDraft attributes: http://forum.gephi.org/viewtopic.php?f= ... =nodedraft
and tried to use GraphModel to get the information but only got "Null Pointer Exception".
Currently I had to create my own Node class to store the information, which is a bit annoying.
How to get the info of a NodeDraft in a Generator plugin?
- mbastian
- Gephi Architect
- Posts:728
- Joined:10 Dec 2009 10:11
- Location:San Francisco, CA [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: How to get the info of a NodeDraft in a Generator plugin
NodeDraft is design to set values, and NodeDraftGetter to get values. It's two separate interfaces, but implemented by the same class in the implementation, so you can simply cast your NodeDraft into NodeDraftGetter and use getId() or getAttributeRow() to access attributes.
At this stage of Import, there is nothing in GraphModel. Draft elements are only appended to the GraphModel once the import (or generator) is validated by the user. This is quite useful, as cancelling an import is straightforward in the code.
At this stage of Import, there is nothing in GraphModel. Draft elements are only appended to the GraphModel once the import (or generator) is validated by the user. This is quite useful, as cancelling an import is straightforward in the code.
-
- Posts:11
- Joined:18 Mar 2011 12:28 [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: How to get the info of a NodeDraft in a Generator plugin
Thanks! I knew there would be something like the NodeDraftGetter, but just couldn't quite find it
Is there a way to get the list of NodeDraft/EdgeDraft added to ContainerLoader?
Is there a way to get the list of NodeDraft/EdgeDraft added to ContainerLoader?
- mbastian
- Gephi Architect
- Posts:728
- Joined:10 Dec 2009 10:11
- Location:San Francisco, CA [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: How to get the info of a NodeDraft in a Generator plugin
Cast the ContainerLoader to ContainerUnloader
There could be some limitations though, let us know what is your use case
There could be some limitations though, let us know what is your use case