Main Page | 最近更改 | 編輯本頁 | 頁面歷史

可列印版 | 免責聲明 | 隱私政策

未登入
登入 | 幫助
 

graphviz

出自DebianWiki

graphviz是一個圖形抽象化的軟體,由AT&T所開發。您可以透過編輯dot language,表達節點的特性與節點之間的關係,就可以輕鬆的畫出一張關係圖出來,可以應用在網頁設計(SiteMap)、軟體工程、網路、資料庫...等。是個畫程式流程圖、ER 圖、關係圖不可多得的好幫手。現已支援中文UTF-8。

安裝graphviz

#apt-get install graphviz 

簡單的畫ER model範例,使用中文必須指定TTF字型路徑,fontsize可不指定。 用/**/括起來的部份為註解。

graph G{

        /*設定node基本屬性*/
        node[shape=box,fontname="/usr/share/fonts/truetype/fireflysung.ttf",fontsize=12];course;institude;student;許功蓋;
        node[shape=diamond,style=filled,color=yellow,fontsize=12];"C-I";"I-S";"C-S";
        node[shape=ellipse,style=filled,color=lightgrey,fontsize=12];s_id;s_name;s_major;c_id;c_name;i_id;i_name;


        /*設定node之間的關係*/
        course--"C-I";
        "C-I"--institude;
        institude--"I-S";
        "I-S"--student;
        course--"C-S";
        "C-S"--student;

        /*node DB attribute*/
        student--s_id;
        student--s_name;
        student--s_major;

        course--c_id;
        course--c_name;

        institude--i_id;
        institude--i_name;

        institude--許功蓋 [fontname="/usr/share/fonts/truetype/fireflysung.ttf",label="測試",fontsize=12];

        fontname="/usr/share/fonts/truetype/fireflysung.ttf"
        label = "\n\n用Graphviz做的第一個ER model圖\n支援UTF-8喔!";
        fontsize=12;
}

此種ER model為無向性,所以使用graphviz 內的neato來產生png圖檔,支援的圖檔格式很多。

neato -Tpng neatotest.dot -o neatotest.png

範例產生的ER model圖檔

http://www.graphviz.org - graphviz 官方網站,內有豐富說明文件與範例。

取自"http://wiki.debian.org.tw/index.php/graphviz"

本頁面已經被瀏覽6,541次。 這頁的最後修訂在 2006年4月10日 (星期一) 12:44。 本站的全部文本內容在GNU Free Documentation License 1.2之條款下提供。


[Main Page]
Main Page
社區
近期活動
最近更改
隨機頁面
幫助
贊助

編輯本頁
討論本頁
頁面歷史
鏈入頁面
鏈出更改

特殊頁面
錯誤報告