Vertical alignment

Hello everybody. This question will sound silly to someone, but I’m not experienced enough to solve it.
I need to vertically align some nodes (in the example they are named a, b, c and d).
Another node has to be but aside of one of them without distorting the vertical arrangement.
The minimal script is:

digraph {

rankdir="LR"
//rankdir="TB"

//main nodes
a
b
c
d

//let nodes lay vertically in a nice column
a->b->c->d

//secondary node
secondary [style=filled fillcolor=yellow]
{rank = same; a; b; c; d}
b->secondary

//all is good until here when using rankdir="LR"
//unfortunately rankdir="TB" is required by other graph elements

// I would like the yellow node to sit politely on the side the "c" node 
//without messing with the {a, b, c, d} perfect vertical alignment
//using just DOT engine

}

I’ve tried several solutions, but the vertical alignment always gets distorted: what solution am I missing? Thanks

Here you go,

  • no guarantees on a b c d, but should stay vertical
  • b secondary will stay nailed to same rank
digraph V {
rankdir="TB"

// main nodes
// let nodes lay vertically in a nice column
{
  node [group=xyz]  // not required, but it may help as you add nodes
  a->b->c->d
}
secondary [style=filled fillcolor=yellow]
{  rank=same
    b->secondary
}
// I would like the yellow node to sit politely on the side the "c" node 
//without messing with the {a, b, c, d} perfect vertical alignment
//using just DOT engine
}

Great! I was sure to be missing something.
Simply I didn’t think about imposing “rank=same” to and edge.
Many thanks.

F