Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
523 views
in Technique[技术] by (71.8m points)

dot - Prevent overlapping records using graphviz and neato

I am building a dot file to represent computer hardware and the physical connections to a network switch and displays. I have it looking ok when processed by the dot program but I think I really want it processed by neato to create a more "free form" picture as it starts to grom. Right now when I run my large file with neato, everything is overlapping.

I am trying to figure out the syntax on where to define the overlap attribute. Below is a subset of my dot file.

graph g {  
    node [shape=record,height=.1];  
    PC8[label="{{<GigE1>GigE1|<GigE2>GigE2}|{<name>PC8}|{<dvi1>dvi1|<dvi2>dvi2|<dvi3>dvi3|<dvi4>dvi4}}"];  
    PC9[label="{{<GigE1>GigE1|<GigE2>GigE2}|{<name>PC9}|{<dvi1>dvi1|<dvi2>dvi2|<dvi3>dvi3|<dvi4>dvi4}}"];
    C1[label = "{{<dvi1>dvi1}|{<name>C1}}"];  
    C2[label = "{{<dvi1>dvi1}|{<name>C2}}"];  
    C3[label = "{{<dvi1>dvi1}|{<name>C3}}"];  
    C4[label = "{{<dvi1>dvi1}|{<name>C4}}"];  
    D1[label = "{{<dvi1>dvi1}|{<name>D1}}"];  
    D2[label = "{{<dvi1>dvi1}|{<name>D2}}"];  
    "PC8":dvi1 -- "C1":dvi1;  
    "PC8":dvi2 -- "C2":dvi1;  
    "PC8":dvi3 -- "C3":dvi1;  
    "PC8":dvi4 -- "C4":dvi1;  
    "PC9":dvi1 -- "D1":dvi1;  
    "PC9":dvi2 -- "D2":dvi1;  
}
question from:https://stackoverflow.com/questions/1039785/prevent-overlapping-records-using-graphviz-and-neato

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Well, as with most questions...soon after I posted the I figured out the answer. I needed to add graph [overlap=false]; at the top of the file.

Do it like this:

graph g {
    overlap = false;

    node [shape=record,height=.1];
    /* ... */
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...