[TODO] Selectable multiple attributes/colour per node
-
- Posts:14
- Joined:03 Feb 2012 19:49 [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
Sorry to create this topic, I posted in the original thread above 3 days ago but my posts still have not appeared?
I am a computer science student working on a project where I need to display a graph in which nodes have different colours. I am very willing to implement this feature but will need some guidance as to how to integrate these changes into gephi. I already have code that will split the nodes into halfs, thirds etc as I implemented the same thing for JUNG, but gephi is much prettier and faster at running layout algorithms than JUNG so I want to migrate.
Presumable this is the class i need to modify/extend?
https://github.com/gephi/gephi/blob/mas ... derer.java
But I also need to be able to store the data in a way the software will support etc. which I will need some guidance in implementing in the correct places.
Again, sorry for the repeat topic but I'd like to get on with it!
I am a computer science student working on a project where I need to display a graph in which nodes have different colours. I am very willing to implement this feature but will need some guidance as to how to integrate these changes into gephi. I already have code that will split the nodes into halfs, thirds etc as I implemented the same thing for JUNG, but gephi is much prettier and faster at running layout algorithms than JUNG so I want to migrate.
Presumable this is the class i need to modify/extend?
https://github.com/gephi/gephi/blob/mas ... derer.java
But I also need to be able to store the data in a way the software will support etc. which I will need some guidance in implementing in the correct places.
Again, sorry for the repeat topic but I'd like to get on with it!
- 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: [TODO] Selectable multiple attributes/colour per node
Hi,
Where to store the colors would depend on your plugin objectives.
One option you might want to use could be storing all the colors components in a column with a number list type. This would let users of the plugin adapt the amount of colors to split the node (or even percentages optionally).
But this is just some idea, using table columns is not the only option. You could store your colors data anywhere you want, like a map contained in the workspace lookup that links each node to a set of colors, if that adapts in a better way to your needs.
Eduardo
Where to store the colors would depend on your plugin objectives.
One option you might want to use could be storing all the colors components in a column with a number list type. This would let users of the plugin adapt the amount of colors to split the node (or even percentages optionally).
But this is just some idea, using table columns is not the only option. You could store your colors data anywhere you want, like a map contained in the workspace lookup that links each node to a set of colors, if that adapts in a better way to your needs.
Eduardo
-
- Posts:14
- Joined:03 Feb 2012 19:49 [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: [TODO] Selectable multiple attributes/colour per node
Hi, thanks for the pointers, I will gave this a go tomorrow.
An admin could merge these threads maybe? Sorry to be a nuisance!
An admin could merge these threads maybe? Sorry to be a nuisance!
-
- Posts:14
- Joined:03 Feb 2012 19:49 [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: [TODO] Selectable multiple attributes/colour per node
Today I tried to run the plugin bootcamp to get to grips with how plugins work, but the code will not compile and I'm not sure why. I have followed the instructions to the letter, and can get the standard gephi to compile with no issues, but not the plugin bootcamp. I forked, cloned and opened up in Netbeans (7.1) fine, but when I try to compile I get an error.
suite line 184:
build line 163 -> 174:
Is there something I have down wrong? Else can I somehow incorporate these examples into my working full gephi build? I'm not used to working on such huge projects!
http://wiki.gephi.org/index.php/Plugin_ ... minutes%29
I am going to follow this guide to attempt to learn how to do it, hopefully it will be helpful!
Thanks
Code: Select all
platform.download:
Using harness folder C:\Users\James\gephi-plugins-bootcamp/harness
branding:
Building zip: C:\Users\James\gephi-plugins-bootcamp\build\cluster\core\locale\core_gephi.jar
Building zip: C:\Users\James\gephi-plugins-bootcamp\build\cluster\modules\locale\org-netbeans-core-windows_gephi.jar
files-init:
release:
build:
org.gephi.plugins.example.exporter.taskdefs:
org.gephi.plugins.example.exporter.common-init:
org.gephi.plugins.example.exporter.projectized-common.basic-init:
org.gephi.plugins.example.exporter.basic-init:
org.gephi.plugins.example.exporter.files-init:
org.gephi.plugins.example.exporter.nbm-license-init:
org.gephi.plugins.example.exporter.build-init:
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\gephi
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\platform
Scanning for modules in suite C:\Users\James\gephi-plugins-bootcamp
org.gephi.plugins.example.exporter.init:
org.gephi.plugins.example.exporter.up-to-date:
org.gephi.plugins.example.exporter.compile:
org.gephi.plugins.example.exporter.jar-prep:
org.gephi.plugins.example.exporter.jar:
org.gephi.plugins.example.exporter.netbeans-extra:
org.gephi.plugins.example.exporter.module-xml-regular:
org.gephi.plugins.example.exporter.module-xml-autoload:
org.gephi.plugins.example.exporter.module-xml-eager:
org.gephi.plugins.example.exporter.javahelp:
org.gephi.plugins.example.exporter.module-auto-deps:
org.gephi.plugins.example.exporter.release:
org.gephi.plugins.example.exporter.chmod-executables:
org.gephi.plugins.example.exporter.verify-class-linkage:
0 file(s) have been successfully validated.
org.gephi.plugins.example.exporter.netbeans:
Generating information for Auto Update...
org.gephi.plugins.example.filter.taskdefs:
org.gephi.plugins.example.filter.common-init:
org.gephi.plugins.example.filter.projectized-common.basic-init:
org.gephi.plugins.example.filter.basic-init:
org.gephi.plugins.example.filter.files-init:
org.gephi.plugins.example.filter.nbm-license-init:
org.gephi.plugins.example.filter.build-init:
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\gephi
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\platform
Scanning for modules in suite C:\Users\James\gephi-plugins-bootcamp
org.gephi.plugins.example.filter.init:
org.gephi.plugins.example.filter.up-to-date:
org.gephi.plugins.example.filter.compile:
org.gephi.plugins.example.filter.jar-prep:
org.gephi.plugins.example.filter.jar:
org.gephi.plugins.example.filter.netbeans-extra:
org.gephi.plugins.example.filter.module-xml-regular:
org.gephi.plugins.example.filter.module-xml-autoload:
org.gephi.plugins.example.filter.module-xml-eager:
org.gephi.plugins.example.filter.javahelp:
org.gephi.plugins.example.filter.module-auto-deps:
org.gephi.plugins.example.filter.release:
org.gephi.plugins.example.filter.chmod-executables:
org.gephi.plugins.example.filter.verify-class-linkage:
0 file(s) have been successfully validated.
org.gephi.plugins.example.filter.netbeans:
Generating information for Auto Update...
org.gephi.plugins.example.importer.taskdefs:
org.gephi.plugins.example.importer.common-init:
org.gephi.plugins.example.importer.projectized-common.basic-init:
org.gephi.plugins.example.importer.basic-init:
org.gephi.plugins.example.importer.files-init:
org.gephi.plugins.example.importer.nbm-license-init:
org.gephi.plugins.example.importer.build-init:
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\gephi
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\platform
Scanning for modules in suite C:\Users\James\gephi-plugins-bootcamp
org.gephi.plugins.example.importer.init:
org.gephi.plugins.example.importer.up-to-date:
org.gephi.plugins.example.importer.compile:
org.gephi.plugins.example.importer.jar-prep:
org.gephi.plugins.example.importer.jar:
org.gephi.plugins.example.importer.netbeans-extra:
org.gephi.plugins.example.importer.module-xml-regular:
org.gephi.plugins.example.importer.module-xml-autoload:
org.gephi.plugins.example.importer.module-xml-eager:
org.gephi.plugins.example.importer.javahelp:
org.gephi.plugins.example.importer.module-auto-deps:
org.gephi.plugins.example.importer.release:
org.gephi.plugins.example.importer.chmod-executables:
org.gephi.plugins.example.importer.verify-class-linkage:
0 file(s) have been successfully validated.
org.gephi.plugins.example.importer.netbeans:
Generating information for Auto Update...
org.gephi.plugins.example.layout.taskdefs:
org.gephi.plugins.example.layout.common-init:
org.gephi.plugins.example.layout.projectized-common.basic-init:
org.gephi.plugins.example.layout.basic-init:
org.gephi.plugins.example.layout.files-init:
org.gephi.plugins.example.layout.nbm-license-init:
org.gephi.plugins.example.layout.build-init:
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\gephi
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\platform
Scanning for modules in suite C:\Users\James\gephi-plugins-bootcamp
org.gephi.plugins.example.layout.init:
org.gephi.plugins.example.layout.up-to-date:
org.gephi.plugins.example.layout.compile:
org.gephi.plugins.example.layout.jar-prep:
org.gephi.plugins.example.layout.jar:
org.gephi.plugins.example.layout.netbeans-extra:
org.gephi.plugins.example.layout.module-xml-regular:
org.gephi.plugins.example.layout.module-xml-autoload:
org.gephi.plugins.example.layout.module-xml-eager:
org.gephi.plugins.example.layout.javahelp:
org.gephi.plugins.example.layout.module-auto-deps:
org.gephi.plugins.example.layout.release:
org.gephi.plugins.example.layout.chmod-executables:
org.gephi.plugins.example.layout.verify-class-linkage:
0 file(s) have been successfully validated.
org.gephi.plugins.example.layout.netbeans:
Generating information for Auto Update...
org.gephi.plugins.example.panel.taskdefs:
org.gephi.plugins.example.panel.common-init:
org.gephi.plugins.example.panel.projectized-common.basic-init:
org.gephi.plugins.example.panel.basic-init:
org.gephi.plugins.example.panel.files-init:
org.gephi.plugins.example.panel.nbm-license-init:
org.gephi.plugins.example.panel.build-init:
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\gephi
Scanning for modules in C:\Users\James\gephi-plugins-bootcamp\stable\gephi\platform
Scanning for modules in suite C:\Users\James\gephi-plugins-bootcamp
C:\Users\James\gephi-plugins-bootcamp\harness\suite.xml:184: The following error occurred while executing this line:
C:\Users\James\gephi-plugins-bootcamp\harness\build.xml:174: No dependent module org.gephi.perspective.api
BUILD FAILED (total time: 2 seconds)
Code: Select all
<subant target="netbeans" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false">
Code: Select all
<parseprojectxml
project="."
publicpackagesproperty="public.packages"
friendsproperty="friends"
javadocpackagesproperty="module.javadoc.packages"
moduledependenciesproperty="module.dependencies"
moduleclasspathproperty="module.classpath"
publicpackagejardir="${public.package.jar.dir}"
moduleprocessorclasspathproperty="module.processor.classpath"
modulerunclasspathproperty="module.run.classpath"
classpathextensionsproperty="class.path.extensions"
>
http://wiki.gephi.org/index.php/Plugin_ ... minutes%29
I am going to follow this guide to attempt to learn how to do it, hopefully it will be helpful!
Thanks
- 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: [TODO] Selectable multiple attributes/colour per node
Hi,
My mistake. I updated the Gephi JARs but forgot to commit them. Thanks a lot for finding that.
I pushed them so it should work now. Sorry about that.
My mistake. I updated the Gephi JARs but forgot to commit them. Thanks a lot for finding that.
I pushed them so it should work now. Sorry about that.
-
- Posts:14
- Joined:03 Feb 2012 19:49 [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: [TODO] Selectable multiple attributes/colour per node
Hi, thanks for fixing that, I have made some progress today but have hit a problem with getting the data.
I have stored my data in a column loaded from a graphML file. The column is called colourList, and contains a string of the format "colour1,colour2,colour3,etc" where the colours are rgb int values. What I want to do is read the string so I can pull out the values and use them to colour the nodes, however I'm not sure how to go about getting the data. I tried doing
but it returns null. How should I go about linking to this data in the column?
Thanks, James
I have stored my data in a column loaded from a graphML file. The column is called colourList, and contains a string of the format "colour1,colour2,colour3,etc" where the colours are rgb int values. What I want to do is read the string so I can pull out the values and use them to colour the nodes, however I'm not sure how to go about getting the data. I tried doing
Code: Select all
String colourList = item.getData("colourList");
Thanks, James
- 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: [TODO] Selectable multiple attributes/colour per node
Hi James,Ferretti wrote:Hi, thanks for fixing that, I have made some progress today but have hit a problem with getting the data.
I have stored my data in a column loaded from a graphML file. The column is called colourList, and contains a string of the format "colour1,colour2,colour3,etc" where the colours are rgb int values. What I want to do is read the string so I can pull out the values and use them to colour the nodes, however I'm not sure how to go about getting the data. I tried doing
but it returns null. How should I go about linking to this data in the column?Code: Select all
String colourList = item.getData("colourList");
Thanks, James
item.getData is used for getting data stored in the item in the item builder.
To get data from the columns of a NodeItem you have to use some code like this:
Code: Select all
Node n=(Node) item.getSource();
n.getNodeData().getAttributes().getValue("colourList")
-
- Gephi Community Manager
- Posts:964
- Joined:09 Dec 2009 14:41 [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: [TODO] Selectable multiple attributes/colour per node
Wow! Could it be packaged to a plugin?
- 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: [TODO] Selectable multiple attributes/colour per node
That's awesome! A plugin would be great.
Does it render with pdf and svg too?
Eduardo
Does it render with pdf and svg too?
Eduardo