Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

How can I prevent edges from being drawn over each other in graphviz?

On my graph, any two edges between the same two nodes are drawn over each other without any gap between them whatsoever. Basically, they completely overlap and appear as a single edge.

Here's a picture.

What appears to be a single bidirectional edge between "leutkeni" and "mazatlanensis" are in fact two unidirectional arrows that have been rendered on top of each other.

Here's the code (I use the circo engine):

digraph {
    splines=true;
    esep=0.3
    mindist=1.4
    edge [len=2,fontsize=16,fontcolor=blue]
    node [fontsize=20,shape=circle,width=1.5]

    canaliferus -> nebulifer
    mazatlanensis -> canaliferus
    valliceps -> mazatlanensis
    houstonensis -> woodhousii
    nebulifer -> arenarum
    mazatlanensis -> nebulifer
    woodhousii -> houstonensis
    houstonensis -> americanus
    boreas -> canorus
    marmoreus -> mazatlanensis
    garmani -> regularis 
    boreas -> alvarius
    hemiophrys -> boreas
    hemiophrys -> mazatlanensis
    houstonensis -> terrestris
    punctatus -> marmoreus
    mazatlanensis -> marmoreus
    nebulifer -> peltacephalus
    woodhousii -> luetkeni
    paracnemis -> arenarum
    mazatlanensis -> valliceps
    boreas -> marmoreus
    brauni -> garmani
    americanus -> bocourti
    boreas -> mazatlanensis
    nebulifer -> luetkeni
    luetkeni -> cognatus
    woodhousii -> ictericus
    boreas -> alvarius
    arenarum -> nebulifer
    hemiophrys -> calamita
    terrestris -> viridis
    woodhousii -> punctatus
    nebulifer -> granulosus
    luetkeni -> mazatlanensis
    woodhousii -> calamita
    garmani -> brauni
    coccifer -> punctatus
    mazatlanensis -> luetkeni
    cognatus -> calamita
    speciosus -> canorus
    punctatus -> speciosus
    woodhousii -> coccifer
    americanus -> marmoreus
    nebulifer -> cognatus
    arenarum -> spinulosus
    regularis-> garmani
    woodhousii -> arenarum
    nebulifer -> canaliferus
    luetkeni -> nebulifer
    terrestris -> quercicus
    woodhousii -> viridis
    terrestris -> mazatlanensis
    coccifer -> nebulifer
    speciosus -> arenarum
    speciosus -> ibarrai
    terrestris -> woodhousii
    marmoreus -> beebei
    regularis -> speciosus
    hemiophrys -> americanus
    marinus -> paracnemis
    boreas -> viridis
    hemiophrys -> bufo
    canaliferus -> valliceps
    boreas -> ibarrai
    poeppigi -> marinus
    canorus -> marmoreus
    terrestris -> calamita
    coccifer -> luetkeni
    melanostictus -> coniferus
    guttaralis -> regularis 
    cognatus -> bocourti
    regularis -> speciosus
    nebulifer -> bocourti
    canorus -> stomaticus
    arunco -> valliceps
    canaliferus -> coccifer
    luetkeni -> microscaphus
    nebulifer -> ibarrai
    boreas -> bocourti
    hemiophrys -> cognatus
    boreas -> nebulifer
    woodhousii -> bocourti
    coccifer -> marmoreus
    regularis -> canaliferus
    regularis -> arenarum
    arenarum -> paracnemis
}

I have tried and can tell that the issue resolves itself when I set "splines=false" (there immediately appears some space between edges connecting the same nodes), but I need splines set at true because I need curved edges.

It is fixable with splines set at true?

question from:https://stackoverflow.com/questions/65642349/how-can-i-prevent-edges-from-being-drawn-over-each-other-in-graphviz

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

1 Answer

0 votes
by (71.8m points)

What version are you using? this problem is not on http://viz-js.com/ The trig I usual apply is to use a compass port on one of the edges e.g.

leutkeni:w->mazatlanensis


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...