製作gephi的存檔格式gexf時,假如要加入時間軸顯示的話,必須注意幾個點:
1.宣告要有動態的時間軸
在graph這行要宣告要有時間軸的設定
<graph defaultedgetype="directed" timeformat="double" timerepresentation="timestamp" mode="dynamic">
沒有時間軸的話是這樣子的
<graph defaultedgetype="directed" mode="static">
注意timestamp、dynamic這兩個關鍵字。
2.宣告哪一個參數要加入時間軸
接著設定時間軸是設在哪個參數,由於時間軸只能有一個參數,所以在<graph>之後,<nodes>之前要先宣告,如下面內容:
<attributes class="node">
<attribute id="show" title="show" type="integer" mode="dynamic"></attribute>
<attribute id="category0" title="category0" type="string" mode="static"></attribute>
<attribute id="category1" title="category1" type="string" mode="static"></attribute>
<attribute id="category2" title="category2" type="string" mode="static"></attribute>
</attributes>
「mode="dynamic"」是跟時間軸關聯的參數,type實際上不限定,也不見得一定要有實際內容。其他則設為「mode="static"」。
3.在<node>中做相關設定
在<node>中,<attvalues>之前,加入timestamp,這個是實際上node是否顯示在時間軸上的依據。
<spells>
<spell timestamp="1915.0"></spell>
<spell timestamp="1921.0"></spell>
</spells>
至於<attributes>中宣告「mode="dynamic"」的參數(範例的show),影響的是後續的appearance,不影響node顯示。
4.<attvalues>中設定dynamic參數的寫法如下:
<attvalues>
<attvalue for="category" value="keywords"></attvalue>
<attvalue for="show" value="10" timestamp="1915.0"></attvalue>
<attvalue for="show" value="10" timestamp="1921.0"></attvalue>
<attvalue for="show" value="10" timestamp="1925.0"></attvalue>
<attvalue for="show" value="10" timestamp="1927.0"></attvalue>
<attvalue for="show" value="10" timestamp="1928.0"></attvalue>
<attvalue for="show" value="10" timestamp="1929.0"></attvalue>
<attvalue for="show" value="10" timestamp="1931.0"></attvalue>
</attvalues>
只要在<spells>後的<attvalues>加上timestamp的參數即可。
留言
張貼留言