DOT (그래프 서술 언어)

위키백과, 우리 모두의 백과사전.

DOT그래프 서술 언어이다. DOT 그래프의 파일 확장자는 gv 또는 dot이다. 2007년 이전의 마이크로소프트 워드 버전에 사용된 dot 확장자와의 혼동을 피하기 위해 gv 확장자가 선호된다.[1]

문법[편집]

그래프 종류[편집]

무방향 그래프[편집]

An undirected graph
 // The graph name and the semicolons are optional
 graph graphname {
     a -- b -- c;
     b -- d;
 }

방향 그래프[편집]

A directed graph
 digraph graphname {
     a -> b -> c;
     b -> d;
 }

속성[편집]

A graph with attributes
 graph graphname {
     // This attribute applies to the graph itself
     size="1,1";
     // The label attribute can be used to change the label of a node
     a [label="Foo"];
     // Here, the node shape is changed.
     b [shape=box];
     // These edges both have different line properties
     a -- b -- c [color=blue];
     b -- d [style=dotted];
     // [style=invis] hides a node.
   }

주석 처리[편집]

 // This is a single line comment.
 /* This is a
    multiple line
    comment. */
 # Lines like this are also ignored.

단순 예시[편집]

 graph ethane {
     C_0 -- H_0 [type=s];
     C_0 -- H_1 [type=s];
     C_0 -- H_2 [type=s];
     C_0 -- C_1 [type=s];
     C_1 -- H_3 [type=s];
     C_1 -- H_4 [type=s];
     C_1 -- H_5 [type=s];
 }

각주[편집]

  1. “File extension .dot or .gv?”. 《marc.info》. 2011년 3월 8일에 확인함. 

외부 링크[편집]