1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
hscale=0.5;
a, b, c[pos=0.4, relative=b], d, e;
parallel [layout=one_by_one] {
a->b;
};
#this symbol extends above its target, so the target itself has to be
#shifted down to make room for the symbol. This is possible with
#one_by_one_merge
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
#here we automatically switch to one_by_one_merge, because it would
#result in the same layout as one_by_one_merge, but allows shifting
#the parallel blocks down (to make room for an aligned symbol's top).
parallel [layout=one_by_one_merge] {
c->d;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
#Do the same thing in a nested parallel blocks, with one column.
{
parallel [layout=one_by_one] {
a->b;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
#still no problem: the parent parallel blocks has only one column,
#one_by_one_merge is still equivalent to one_by_one
parallel [layout=one_by_one_merge] {
c->d;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
};
#Do the same thing in a nested parallel blocks, with two columns, one empty
{
parallel [layout=one_by_one] {
a->b;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
#still no problem: the parent parallel blocks has only one non-empty column,
#one_by_one_merge is still equivalent to one_by_one
parallel [layout=one_by_one_merge] {
c->d;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
} {
};
#Do the same thing in a nested parallel blocks, with two columns, one too short
{
parallel [layout=one_by_one] {
a->b;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
#Still good, by the time the second column reaches the height of the symbol above,
#it is drained and removed, so when we start laying out the below, there is only
#one column and we switch to one_by_one.
[layout=one_by_one_merge] {
c->d;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
} {
defstyle emptybox [color=red];
e--e;e--e;e--e;e--e;
};
#Do the same thing in a nested parallel blocks, with two columns
{
parallel [layout=one_by_one] {
a->b;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
#not good: by the time we get here, we still have one green box left, so we do
#one_by_one_merge & cannot cater for the symbol's top afterwards.
[layout=one_by_one_merge] {
c->d;
};
symbol rectangle around [distance=10, color=aqua,50, line.radius=5, line.color=blue];
} {
defstyle emptybox [color=green-50];
e--e;e--e;e--e;e--e;e--e;
};
|