How to make node colors change over time?

Evolution and dynamics on networks in Gephi: UI, data formats, algorithms...
Post Reply
gryang11
Posts: 8
Joined: 20 Jun 2012 09:52

How to make node colors change over time?

Post by gryang11 » 03 Jul 2012 03: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.

User avatar
eduramiba
Gephi Code Manager
Posts: 942
Joined: 22 Mar 2010 15:30
Location: Madrid, Spain

Re: How to make node colors change over time?

Post by eduramiba » 03 Jul 2012 14: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

gryang11
Posts: 8
Joined: 20 Jun 2012 09:52

Re: How to make node colors change over time?

Post by gryang11 » 04 Jul 2012 04: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.

ltsmash
Posts: 8
Joined: 10 Sep 2012 12:39

Re: How to make node colors change over time?

Post by ltsmash » 11 Sep 2012 12: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

User avatar
eduramiba
Gephi Code Manager
Posts: 942
Joined: 22 Mar 2010 15:30
Location: Madrid, Spain

Re: How to make node colors change over time?

Post by eduramiba » 12 Sep 2012 18:14

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

Eduardo

ltsmash
Posts: 8
Joined: 10 Sep 2012 12:39

Re: How to make node colors change over time?

Post by ltsmash » 18 Sep 2012 11: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.

User avatar
eduramiba
Gephi Code Manager
Posts: 942
Joined: 22 Mar 2010 15:30
Location: Madrid, Spain

Re: How to make node colors change over time?

Post by eduramiba » 18 Sep 2012 19: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.

ltsmash
Posts: 8
Joined: 10 Sep 2012 12:39

Re: How to make node colors change over time?

Post by ltsmash » 19 Sep 2012 09: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

bvecchip
Posts: 1
Joined: 29 Aug 2017 19:47

Re: How to make node colors change over time?

Post by bvecchip » 29 Aug 2017 19:54

I really appreciate the above posts and feel like I am close to achieve the same results.

I am trying to create a dynamic number for each of my nodes in order to change their color over time. I have tried several different data types when establishing this new column in my nodes table (integer, intervalinteger, intervalbytemap, string, etc). Which type of data column should a dynamic number ( ex: <[1, 5,0];[5,7,1]>) be placed under? Is there a way to code this directly into the gephi file?

User avatar
eduramiba
Gephi Code Manager
Posts: 942
Joined: 22 Mar 2010 15:30
Location: Madrid, Spain

Re: How to make node colors change over time?

Post by eduramiba » 29 Aug 2017 20:21

bvecchip wrote:
29 Aug 2017 19:54
I really appreciate the above posts and feel like I am close to achieve the same results.

I am trying to create a dynamic number for each of my nodes in order to change their color over time. I have tried several different data types when establishing this new column in my nodes table (integer, intervalinteger, intervalbytemap, string, etc). Which type of data column should a dynamic number ( ex: <[1, 5,0];[5,7,1]>) be placed under? Is there a way to code this directly into the gephi file?
Hi,
For dynamic numbers you should probably use IntervalIntegerMap or IntervalDoubleMap.
Then, use this data with the apply continuously button enabled for either ranking or partition.

I advice you to test it with latest 0.9.2 pre-release https://github.com/gephi/gephi#nightly-builds as it fixes stability issues

Post Reply