Home Wiki Blog Forum GEXF.net

Gephi forums

Community support

How to make node colors change over time?

Evolution and dynamics on networks in Gephi: UI, data formats, algorithms...

How to make node colors change over time?

Postby gryang11 » 03 Jul 2012 04:17

Hi, I would like to change colors of nodes over time. Is it possible to make it as a dynamic gexf file?
Thanks in advance.
gryang11
 
Posts: 8
Joined: 20 Jun 2012 10:52

Re: How to make node colors change over time?

Postby eduramiba » 03 Jul 2012 15:13

Hi,
You can achieve something similar by using the apply continuously option in ranking (small button next to apply), and making it use a dynamic number column. Then, when you move the timeline with this option enabled, color will change according to the column value at that interval.

If you wanted to use directly a list of colors, it is not possible yet I think, but could be implemented as a plugin that uses 3 dynamic columns as r,g,b.

Eduardo
Life... is like a grapefruit. It's orange and squishy, and has a few pips in it, and some folks have half a one for breakfast.
User avatar
eduramiba
Gephi Code Manager
 
Posts: 579
Joined: 22 Mar 2010 16:30
Location: Zaragoza, Spain

Re: How to make node colors change over time?

Postby gryang11 » 04 Jul 2012 05:07

eduramiba wrote:Hi,
You can achieve something similar by using the apply continuously option in ranking (small button next to apply), and making it use a dynamic number column. Then, when you move the timeline with this option enabled, color will change according to the column value at that interval.

If you wanted to use directly a list of colors, it is not possible yet I think, but could be implemented as a plugin that uses 3 dynamic columns as r,g,b.

Eduardo


Thank you very much! That makes a large difference already! :lol: Looking forward to new version. There is still much room to improve.
gryang11
 
Posts: 8
Joined: 20 Jun 2012 10:52

Re: How to make node colors change over time?

Postby ltsmash » 11 Sep 2012 13:18

Hi All,

Quick question on the dynamic number column. whenever i try to make this dynamic integer column in the data laboratory tab and try to fill in some entries, the values just disappear. can you guys give me an example of values this column can take.

Cheers,
Lorcan
ltsmash
 
Posts: 8
Joined: 10 Sep 2012 13:39

Re: How to make node colors change over time?

Postby eduramiba » 12 Sep 2012 19:14

Hi Lorcan,
Check this page for dynamic types syntax https://gephi.org/users/supported-graph ... readsheet/

Eduardo
Life... is like a grapefruit. It's orange and squishy, and has a few pips in it, and some folks have half a one for breakfast.
User avatar
eduramiba
Gephi Code Manager
 
Posts: 579
Joined: 22 Mar 2010 16:30
Location: Zaragoza, Spain

Re: How to make node colors change over time?

Postby ltsmash » 18 Sep 2012 12:46

Hi Eduardo,

Thanks for the link. I was able to create a dynamic integer column in the gephi data laboratory tab. I was unfortunately unable to use the ranking tab and the apply continuously button to get the nodes to change colour. Below is some sample code that I am trying to use. The code along with the timeline feature deletes and creates nodes and links and would be useful for new gephi users to copy and paste just to get the hang of gephi and the timeline feature. When I imported the gexf file into gephi, I created a dynamic integer column called "Degree" in the data laboratory tab. I just entered one value into this new column for the "Leonard" node just to test with the value "<[2.0,3.0,1];[4.0,5.0,3]> and when I tried apply continuously in ranking I had no luck. Are my values for this column ok or should have I included this column somewhere in my code below before importing into Gephi.

Thanks again for your kind patience and help,
Lorcan

<gexf xmlns="http://www.gexf.net/1.2draft" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd" version="1.2">
<meta lastmodifieddate="2009-03-20">
<creator>Gexf.net</creator>
<description>A Web network changing over time</description>
</meta>
<graph mode="dynamic" defaultedgetype="directed" timeformat="numeric">
<attributes class="node" mode="static">
</attributes>
<attributes class="node" mode="dynamic">
</attributes>
<nodes>
<node id="0" label="Leonard" start="2">
</node>
<node id="1" label="Sheldon">
</node>
<node id="2" label="Raj">
<spells>
<spell end="1"/>
<spell start="3" end="8"/>
</spells>
</node>
<node id="3" label="Howard">
<spells>
<spell end="1"/>
<spell start="2" end="6"/>
</spells>
</node>
<node id="4" label="Penny">
<spells>
<spell end="1"/>
<spell start="6" end="8"/>
</spells>
</node>
</nodes>
<edges>
<edge id="0" source="0" target="1" start="2"/>
<edge id="1" source="0" target="2" start="4" end="8"/>
<edge id="2" source="1" target="0" start="2"/>
<edge id="3" source="2" target="1" start="5" end="8"/>
<edge id="4" source="0" target="3" start="2" end="8"/>
<edge id="5" source="1" target="4" start="7" end="8"/>
</edges>
</graph>
</gexf>

##Comment-don't copy this
Copy and paste the code above to a text file. Save as test.txt or whatever name you like. Exit. Go into my documents or wherever you saved the file and rename as "test.gexf" and click to open and it should open in Gephi.
ltsmash
 
Posts: 8
Joined: 10 Sep 2012 13:39

Re: How to make node colors change over time?

Postby eduramiba » 18 Sep 2012 20:55

Hi,
I tried that data and apply continuosly with size ranking worked fine.
What steps are you exactly following?

Remember to enable auto apply in ranking, set a small timeline window and move it or hit play.

Eduardo.
Life... is like a grapefruit. It's orange and squishy, and has a few pips in it, and some folks have half a one for breakfast.
User avatar
eduramiba
Gephi Code Manager
 
Posts: 579
Joined: 22 Mar 2010 16:30
Location: Zaragoza, Spain

Re: How to make node colors change over time?

Postby ltsmash » 19 Sep 2012 10:41

Hi Eduardo,

Good news, I have the re-sizing of nodes working now. I think the problem that I had before was the sizes I had chosen. I chose for the sizes for the Leonard node to change from 1 to 4 which compared to the rest of nodes was hardly noticeable when I ran timeline. I decided to have the changes go from 1 to 100 and it works fine now.

Cheers again,

Lorcan
ltsmash
 
Posts: 8
Joined: 10 Sep 2012 13:39


Return to Dynamics

Who is online

Users browsing this forum: No registered users and 2 guests