How To Change Colors, Based on Edge Direction?

Screenshots, Vectorial Preview and printable exports
Post Reply [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
Rodger22
Posts:25
Joined:22 Jun 2013 18:02
Location:Canada
Contact:
How To Change Colors, Based on Edge Direction?

Post by Rodger22 » 27 Jul 2013 19:35

Dear Experts,

I have a small Neo4j graph with parents and children that I've imported into Gephi.

parent -> child -> grandchild


So far, all the edges are directional,
one direction only, PARENT_OF.


Given a single child node,
is there a way to set the edges to different colors?

One color for the parents.
One color for the grandchildren.

If so, what is the secret?


Thanks a lot!

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: How To Change Colors, Based on Edge Direction?

Post by seinecle » 30 Jul 2013 08:36

Hi,

Interesting. I personally don't see a way to do that directly from the Gephi GUI. That will involve data wrangling, but you can do specify an edge color directly in the network file describing your graph. The gexf format (primer: http://gexf.net/1.2draft/gexf-12draft-primer.pdf) provides a color attribute for edges:

Code: Select all

<edge ... >
   <viz:color r="157" g="213" b="78"/>
</edge>
Best,

Clement

Rodger22
Posts:25
Joined:22 Jun 2013 18:02
Location:Canada
Contact:

Re: How To Change Colors, Based on Edge Direction?

Post by Rodger22 » 31 Jul 2013 19:57

Thanks for responding. No wonder I couldn't figure it out.

Perhaps the Gephi team can add this feature to an upcoming version.

I'm thinking similar to an Excel macro.
If <0 -> color of cell is red.

In Gephi,

If direction->, color of edge is blue
If <-direction, color is green

Elseif no direction, color is red

Make sense?

Post Reply
[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
[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