graphviz - уменьшить расстояние между узлами внутри кластера (но держать их выровненными) - PullRequest
1 голос
/ 30 апреля 2020

У меня сейчас есть этот кластер:

imag1.

описать следующим образом:

    subgraph cluster_Step0 {
    compound=true;
    style=filled;
    color=blue;

    start_Step0[color=black, fontsize=8, width=0.3, style=filled, shape=point];
    ver_Step0[color=green, fontsize=10, width=4, height=1, style=filled, shape=rectangle];
    action_Step0[color=red, fontsize=10, width=4, height=1, style=filled, shape=rectangle];
    end_Step0[color=white, fontsize=8, width=0.3, style=filled, shape=point];

    // Align
    start_Step0, ver_Step0, action_Step0, end_Step0 [group = Step0]

    // Connection within the node

    start_Step0 -> ver_Step0;
    ver_Step0 -> action_Step0;
    action_Step0 -> end_Step0;

    // node label
    label = "Step0";

    // VERIFICATION in node
    ver_Step0[label="<>"]

    // ACTION in node
    action_Step0[label="PRECONDITION"]
    }

. Я хочу сделать график значительно более «плотным». как-то так:

Fig2

Я пробовал с ranksep, но ничего не двигалось. Какие-либо предложения? ТНХ

1 Ответ

1 голос
/ 30 апреля 2020

Я добавил graph [ranksep=.1], и он произвел это:
enter image description here
Вы добавили атрибут ranksep на уровне графика?

digraph {
  graph [ranksep=.1]
   subgraph cluster_Step0 {
    compound=true;
    style=filled;
    color=blue;

    start_Step0[color=black, fontsize=8, width=0.3, style=filled, shape=point];
    ver_Step0[color=green, fontsize=10, width=4, height=1, style=filled, shape=rectangle];
    action_Step0[color=red, fontsize=10, width=4, height=1, style=filled, shape=rectangle];
    end_Step0[color=white, fontsize=8, width=0.3, style=filled, shape=point];

    // Align
    start_Step0, ver_Step0, action_Step0, end_Step0 [group = Step0]

    // Connection within the node

    start_Step0 -> ver_Step0;
    ver_Step0 -> action_Step0 
    action_Step0 -> end_Step0;

    // node label
    label = "Step0";

    // VERIFICATION in node
    ver_Step0[label="<>"]

    // ACTION in node
    action_Step0[label="PRECONDITION"]
    }
}
...