Test graphviz: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 62: | Line 62: | ||
</graphviz> | </graphviz> | ||
[[ | |||
<graphviz> | |||
digraph G { | |||
// Nodes outside the subgraph | |||
A; B; | |||
// Define a subgraph | |||
subgraph cluster_0 { | |||
label = "Cluster 1"; // Label for the subgraph | |||
color = blue; // Border color of the cluster | |||
style = dashed; // Dashed border | |||
C; D; // Nodes in the subgraph | |||
} | |||
// Connect nodes | |||
A -> C; | |||
C -> D; | |||
D -> B; | |||
} | |||
</graphviz> | |||
<graphviz> | |||
digraph G { | |||
// Define a regular subgraph | |||
subgraph { | |||
node [shape=box, style=filled, color=lightgrey]; // Shared style for all nodes | |||
E; F; G; // Nodes in the subgraph | |||
} | |||
E -> F; | |||
F -> G; | |||
} | |||
</graphviz> | |||
<graphviz> | |||
graph G { | |||
// Set global node attributes to plaintext | |||
node [shape=plaintext]; | |||
// Define nodes without edges | |||
A; | |||
B; | |||
C; | |||
D; | |||
} | |||
</graphviz> | |||
<graphviz> | |||
graph{ | |||
node [shape=plaintext]; | |||
rankdir=LR; | |||
splines=curved; | |||
动物 -- {猫 狗 蛇} | |||
猫 -- {三花猫 狸花猫 美短猫} | |||
狗 -- {哈巴狗 狮子狗 泰迪狗} | |||
蛇 -- {眼镜蛇 蝮蛇 五步蛇} | |||
三花猫 -- {美国品种 中国品种} | |||
中国品种 -- {承德养殖厂 寿光养殖厂} | |||
} | |||
</graphviz> | |||
<graphviz> | |||
graph { | |||
splines=curved; | |||
node [shape=plaintext]; // Plain text only | |||
edge [arrowhead=none]; // Remove arrows | |||
动物 -- 猫; | |||
动物 -- 狗; | |||
动物 -- 蛇; | |||
猫 -- {三花猫 狸花猫 美短猫}; | |||
} | |||
</graphviz> |
Latest revision as of 17:30, 16 January 2025