tags:

views:

48

answers:

1

Why is graphviz drawing two arrows from uncap_spike to peel, and why is it drawing peel to the right of hang?

I want uncap_spike -> peel -> hang -> spike, in that order, with one edge between each.

alt text

digraph hangers {
    compound=true
    fontname="Gill Sans"

    node [fontname="Gill Sans" shape=box fillcolor=white style="rounded, filled"]
    edge [fontname="Gill Sans"]

    subgraph cluster_prep {
        style="filled"
        label=Prep

        gather [shape=Mrecord label="{gather | EtOH swab\nvented tubing}"]
        uncap_bottle   [label="uncap bottle"]
        uncap_spike [label="uncap spike"]
        swab [shape=Mrecord label="{swab EtOH | wait 30 seconds for sterility}"]
        gather -> uncap_bottle -> swab -> uncap_spike
        {rank=same gather uncap_bottle swab uncap_spike}
    }

    subgraph cluster_hang {
        style=filled
        label=Hang

        {rank=same peel hang}

    }

    {rank=same uncap_spike -> peel -> hang -> spike -> prime}

    hang -> rip [color=firebrick]
    rip [label="eyelet\nripped" style="filled" shape=octagon regular fontcolor=white
     fontsize=10 width=.5 fixedsize color=firebrick fillcolor=firebrick ]

    swab -> not_sterile [color=firebrick]
    not_sterile [label="not\nsterile" style="filled" shape=octagon regular fontcolor=white
     fontsize=10 width=.5 fixedsize color=firebrick fillcolor=firebrick ]


}
A: 

I think that the rank=same might be confusing. Are you using it to keep everything horizontally? In that case there is an attribute (rankdir?) that you can apply to the entire graph instead.

Anders Abel
I get a different problem when I try rankdir=LR:http://grab.by/33o7Why is spike ABOVE hang instead of to the right?
dmd
IIRC there are ways to specify the drawing size of the and they might have default values, trying to keep it on one page (of whatever size it is). There is also an attribute (but I don't remember the name) that can be used to specify the minium level difference between two nodes that can help in your rankdir=LR situation.
Anders Abel