2017-05-18 2 views
0

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; 
    } 
} 

답변

1

공식적인 지원이 없습니다.

다음과 같이 팁을 사용했습니다. 은 GraphVIZ 버전 2.40.1 (20161225.0304) : 암시 노드

graph main_graph { 

    // explicit node definition 
    node1[style=filled, color=grey]; 
    node2[style=filled, color=grey]; 
    node3[style=filled, color=grey]; 

    // ---- lower boundary of explicit node definition ---- 
    // default node attribute used for the detection of implicit node definition 
    node[label="IMPLICITLY-DEFINED"] 

    subgraph graph1 { 
    edge [color=red,penwidth=2] 
    node0 -- node2; //node0 implicitly defined 
    } 

    subgraph graph2 { 
    edge [color="blue",penwidth=2] 
    node2 -- node3; 
    node1 -- node3; 
    } 
} 

2에 대한

1. 추가 표시가 암시 적으로 정의 노드

$ dot -Tplain graph.gv | awk '/IMPLICITLY-DEFINED/{print $2}' 
node0 

테스트 버전의 마크 찾기 MacOS에서

+0

좋은 해결 방법처럼 보입니다. 나는 주말에 다른 것을 확인하기 위해 열어 둘 것입니다. r 아이디어를 찾은 다음 가장 좋은 대답을 수락하십시오. – RonaldFindling