このページは2007年 10月 18日, 01:26に更新されました by BrigetteK

Graphviz

From $1

This library contains functions for generating graphs. See attached files for documentation on the graph notation.  関連リンク: Extension Overview, DekiScript Overview, Extension Demos.

Assembly: mindtouch.deki.services
SID: http://services.mindtouch.com/deki/d...07/06/graphviz

Configuration:

Before the Graphviz service can be used, it must be configured with the locations of the required Graphviz applications.  Graphviz applications can be downloaded here.  VM users with SSH access can simply type apt-get install graphviz (paths are all prefixed with /usr/bin/: e.g., /usr/bin/dot, /usr/bin/neato, etc.).

Config Key Description
dot-path Path to dot application.
neato-path Path to neato application.
twopi-path Path to twopi application
circo-path Path to circo application.

Functions:
  1. graphviz.circo
  2. graphviz.dot
  3. graphviz.neato
  4. graphviz.twopi

graphviz.circo(graph : str) : uri

Generate graph using CIRCO layout.

Parameters:

Name Type Description
graph
str
Graph description.

Samples:


Output

To generate a simple "Hello World" graph using CIRCO layout:

{{ graphviz.circo("digraph G { Hello -> World }") }}

./GraphvizCirco1.JPG

To generate a state-transition diagram using CIRCO layout:

{{graphviz.circo("digraph finite_state_machine {
	rankdir=LR;
	size=\"8,5\"
	node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
	node [shape = circle];
	LR_0 -> LR_2 [ label = \"SS(B)\" ];
	LR_0 -> LR_1 [ label = \"SS(S)\" ];
	LR_1 -> LR_3 [ label = \"S($end)\" ];
	LR_2 -> LR_6 [ label = \"SS(b)\" ];
	LR_2 -> LR_5 [ label = \"SS(a)\" ];
	LR_2 -> LR_4 [ label = \"S(A)\" ];
	LR_5 -> LR_7 [ label = \"S(b)\" ];
	LR_5 -> LR_5 [ label = \"S(a)\" ];
	LR_6 -> LR_6 [ label = \"S(b)\" ];
	LR_6 -> LR_5 [ label = \"S(a)\" ];
	LR_7 -> LR_8 [ label = \"S(b)\" ];
	LR_7 -> LR_5 [ label = \"S(a)\" ];
	LR_8 -> LR_6 [ label = \"S(b)\" ];
	LR_8 -> LR_5 [ label = \"S(a)\" ];
}") }}

./GraphvizCirco2.JPG

To an entity-relation diagram using CIRCO layout:

­{{graphviz.circo("graph ER {
	node [shape=box]; course; institute; student;
	node [shape=ellipse]; {node [label=\"name\"] name0; name1; name2;}
		code; grade; number;
	node [shape=diamond,style=filled,color=lightgrey]; \"C-I\"; \"S-C\"; \"S-I\";
	name0 -- course;
	code -- course;
	course -- \"C-I\" [label=\"n\",len=1.00];
	\"C-I\" -- institute [label=\"1\",len=1.00];
	institute -- name1;
	institute -- \"S-I\" [label=\"1\",len=1.00];
	\"S-I\" -- student [label=\"n\",len=1.00];
	student -- grade;
	student -- name2;
	student -- number;
	student -- \"S-C\" [label=\"m\",len=1.00];
	\"S-C\" -- course [label=\"n\",len=1.00];
}") }}

./GraphvizCirco3.JPG


graphviz.dot(graph : str) : uri

Generate graph using DOT layout.

Parameters:

Name Type Description
graph
str
Graph description.

Samples:


Output

To generate a simple "Hello World" graph using DOT layout:

{{ graphviz.dot("digraph G { Hello -> World }") }}

./GraphvizDot1.JPG

To generate a state-transition diagram using DOT layout:

{{graphviz.dot("digraph finite_state_machine {
	rankdir=LR;
	size=\"8,5\"
	node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
	node [shape = circle];
	LR_0 -> LR_2 [ label = \"SS(B)\" ];
	LR_0 -> LR_1 [ label = \"SS(S)\" ];
	LR_1 -> LR_3 [ label = \"S($end)\" ];
	LR_2 -> LR_6 [ label = \"SS(b)\" ];
	LR_2 -> LR_5 [ label = \"SS(a)\" ];
	LR_2 -> LR_4 [ label = \"S(A)\" ];
	LR_5 -> LR_7 [ label = \"S(b)\" ];
	LR_5 -> LR_5 [ label = \"S(a)\" ];
	LR_6 -> LR_6 [ label = \"S(b)\" ];
	LR_6 -> LR_5 [ label = \"S(a)\" ];
	LR_7 -> LR_8 [ label = \"S(b)\" ];
	LR_7 -> LR_5 [ label = \"S(a)\" ];
	LR_8 -> LR_6 [ label = \"S(b)\" ];
	LR_8 -> LR_5 [ label = \"S(a)\" ];
}") }}

./GraphvizDot2.JPG

To an entity-relation diagram using DOT layout:

 ­{{graphviz.dot("graph ER {
	node [shape=box]; course; institute; student;
	node [shape=ellipse]; {node [label=\"name\"] name0; name1; name2;}
		code; grade; number;
	node [shape=diamond,style=filled,color=lightgrey]; \"C-I\"; \"S-C\"; \"S-I\";
	name0 -- course;
	code -- course;
	course -- \"C-I\" [label=\"n\",len=1.00];
	\"C-I\" -- institute [label=\"1\",len=1.00];
	institute -- name1;
	institute -- \"S-I\" [label=\"1\",len=1.00];
	\"S-I\" -- student [label=\"n\",len=1.00];
	student -- grade;
	student -- name2;
	student -- number;
	student -- \"S-C\" [label=\"m\",len=1.00];
	\"S-C\" -- course [label=\"n\",len=1.00];
}") }}

./GraphvizDot3.JPG


graphviz.neato(graph : str) : uri

Generate graph using NEATO layout.

Parameters:

Name Type Description
graph
str
Graph description.

Samples:


Output

To generate a simple "Hello World" graph using NEATO layout:

{{ graphviz.neato("digraph G { Hello -> World }") }}

./GraphvizNeato1.JPG

To generate a state-transition diagram using NEATO layout:

{{graphviz.neato("digraph finite_state_machine {
	rankdir=LR;
	size=\"8,5\"
	node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
	node [shape = circle];
	LR_0 -> LR_2 [ label = \"SS(B)\" ];
	LR_0 -> LR_1 [ label = \"SS(S)\" ];
	LR_1 -> LR_3 [ label = \"S($end)\" ];
	LR_2 -> LR_6 [ label = \"SS(b)\" ];
	LR_2 -> LR_5 [ label = \"SS(a)\" ];
	LR_2 -> LR_4 [ label = \"S(A)\" ];
	LR_5 -> LR_7 [ label = \"S(b)\" ];
	LR_5 -> LR_5 [ label = \"S(a)\" ];
	LR_6 -> LR_6 [ label = \"S(b)\" ];
	LR_6 -> LR_5 [ label = \"S(a)\" ];
	LR_7 -> LR_8 [ label = \"S(b)\" ];
	LR_7 -> LR_5 [ label = \"S(a)\" ];
	LR_8 -> LR_6 [ label = \"S(b)\" ];
	LR_8 -> LR_5 [ label = \"S(a)\" ];
}") }}

./GraphvizNeato2.JPG

To an entity-relation diagram using NEATO layout:

­{{graphviz.neato("graph ER {
	node [shape=box]; course; institute; student;
	node [shape=ellipse]; {node [label=\"name\"] name0; name1; name2;}
		code; grade; number;
	node [shape=diamond,style=filled,color=lightgrey]; \"C-I\"; \"S-C\"; \"S-I\";
	name0 -- course;
	code -- course;
	course -- \"C-I\" [label=\"n\",len=1.00];
	\"C-I\" -- institute [label=\"1\",len=1.00];
	institute -- name1;
	institute -- \"S-I\" [label=\"1\",len=1.00];
	\"S-I\" -- student [label=\"n\",len=1.00];
	student -- grade;
	student -- name2;
	student -- number;
	student -- \"S-C\" [label=\"m\",len=1.00];
	\"S-C\" -- course [label=\"n\",len=1.00];
}") }}

./GraphvizNeato3.JPG


graphviz.twopi(graph : str) : uri

Generate graph using TWOPI layout.

Parameters:

Name Type Description
graph
str
Graph description.

Samples:


Output

To generate a simple "Hello World" graph using TWOPI layout:

{{ graphviz.twopi("digraph G { Hello -> World }") }}

./GraphvizTwopi1.JPG

To generate a state-transition diagram using TWOPI layout:

{{graphviz.twopi("digraph finite_state_machine {
	rankdir=LR;
	size=\"8,5\"
	node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
	node [shape = circle];
	LR_0 -> LR_2 [ label = \"SS(B)\" ];
	LR_0 -> LR_1 [ label = \"SS(S)\" ];
	LR_1 -> LR_3 [ label = \"S($end)\" ];
	LR_2 -> LR_6 [ label = \"SS(b)\" ];
	LR_2 -> LR_5 [ label = \"SS(a)\" ];
	LR_2 -> LR_4 [ label = \"S(A)\" ];
	LR_5 -> LR_7 [ label = \"S(b)\" ];
	LR_5 -> LR_5 [ label = \"S(a)\" ];
	LR_6 -> LR_6 [ label = \"S(b)\" ];
	LR_6 -> LR_5 [ label = \"S(a)\" ];
	LR_7 -> LR_8 [ label = \"S(b)\" ];
	LR_7 -> LR_5 [ label = \"S(a)\" ];
	LR_8 -> LR_6 [ label = \"S(b)\" ];
	LR_8 -> LR_5 [ label = \"S(a)\" ];
}") }}

./GraphvizTwopi2.JPG

To an entity-relation diagram using TWOPI layout:

­{{graphviz.twopi("graph ER {
	node [shape=box]; course; institute; student;
	node [shape=ellipse]; {node [label=\"name\"] name0; name1; name2;}
		code; grade; number;
	node [shape=diamond,style=filled,color=lightgrey]; \"C-I\"; \"S-C\"; \"S-I\";
	name0 -- course;
	code -- course;
	course -- \"C-I\" [label=\"n\",len=1.00];
	\"C-I\" -- institute [label=\"1\",len=1.00];
	institute -- name1;
	institute -- \"S-I\" [label=\"1\",len=1.00];
	\"S-I\" -- student [label=\"n\",len=1.00];
	student -- grade;
	student -- name2;
	student -- number;
	student -- \"S-C\" [label=\"m\",len=1.00];
	\"S-C\" -- course [label=\"n\",len=1.00];
}") }}

./GraphvizTwopi3.JPG
ファイルサイズ日付添付したユーザ 
 dotguide.pdf
Guide to using Dot's native notation
208.68 kB2006年 11月 9日, 08:38SteveBアクション
 GraphvizCirco1.JPG
説明なし
3.99 kB2007年 10月 17日, 22:29BrigetteKアクション
 GraphvizCirco2.JPG
説明なし
21.88 kB2007年 10月 17日, 22:29BrigetteKアクション
 GraphvizCirco3.JPG
説明なし
29.62 kB2007年 10月 17日, 22:29BrigetteKアクション
 GraphvizDot1.JPG
説明なし
3.99 kB2007年 10月 17日, 22:40BrigetteKアクション
 GraphvizDot2.JPG
説明なし
29.46 kB2007年 10月 17日, 22:40BrigetteKアクション
 GraphvizDot3.JPG
説明なし
25.45 kB2007年 10月 17日, 22:40BrigetteKアクション
 GraphvizNeato1.JPG
説明なし
3.78 kB2007年 10月 17日, 22:45BrigetteKアクション
 GraphvizNeato2.JPG
説明なし
24.12 kB2007年 10月 17日, 22:45BrigetteKアクション
 GraphvizNeato3.JPG
説明なし
20.48 kB2007年 10月 17日, 22:45BrigetteKアクション
 GraphvizTwopi1.JPG
説明なし
3.82 kB2007年 10月 17日, 22:50BrigetteKアクション
 GraphvizTwopi2.JPG
説明なし
27.89 kB2007年 10月 17日, 22:50BrigetteKアクション
 GraphvizTwopi3.JPG
説明なし
26.54 kB2007年 10月 17日, 22:50BrigetteKアクション
 neatoguide.pdf
Guide to using Neato's native notation
95.28 kB2006年 11月 9日, 08:41SteveBアクション
コメント(0)
あなたはコメントを投稿するには ログイン しなければなりません。