【发布时间】:2017-05-19 13:40:03
【问题描述】:
我正在处理一个包含大量节点的大图,这些节点以点 dot -Tsvg graph.gv -o graph.svg 呈现。
为了保持概览,我“明确”定义了我在图表开头使用的所有节点。
现在我正在寻找一种方法来确保仅使用那些“显式”定义的节点,并且不会在边缘定义上获得“隐式”创建的节点(例如节点名称中的拼写错误)。
下图的渲染不应该工作或在渲染时警告我使用了“隐式”节点。
graph main_graph {
// explicit node definition
node1[style=filled, color=grey];
node2[style=filled, color=grey];
node3[style=filled, color=grey];
subgraph graph1 {
edge [color=red,penwidth=2]
node0 -- node2; //node0 implicitly defined
}
subgraph graph2 {
edge [color="blue",penwidth=2]
node2 -- node3;
node1 -- node3;
}
}
【问题讨论】: