水平放置集群,节点在外面

Horizontally placing clusters with node outside

我正在 Graphviz 中摆弄,试图制作架构图,但无论我尝试什么,dot 似乎总是想用最长的可能路径连接一些节点。

这是我希望它大致看起来如何的草图:

实际情况如下:

这里是有问题的代码:

digraph ngsys {
    graph [dpi = 300];
    rankdir="LR";
    subgraph cluster_client {
        style=filled;
        color=lightgrey;
        node [style=filled, color=white];
        ngcontroller -> ngmodel;
        ngmodel -> ngview;
        label="Client";
    }

    ngview -> user [style=dashed];
    user -> ngcontroller [style=dashed];

    subgraph cluster_server {
        style=filled;
        color=lightgrey;
        node [style=filled, color=white];
        apicontroller -> apimodel;
        label="Server";
    }
    ngcontroller -> apicontroller [label="REST", dir=both, style=dashed];

    ngmodel [label="NG-Model" shape=box];
    user [label="User"];
    ngview [label="NG-View", shape=box];
    ngcontroller [label="NG-Controler", shape=box];
    apicontroller [label="API-Controller", shape=box];
    apimodel [label="API-Model", shape=box];

}

我可以做些什么来使输出看起来更像草图吗?

稍微修改一下顺序:

    ngview -> ngmodel [dir=back];
    ngmodel -> ngcontroller [dir=back];

另一个小改动改善了外观:

    nodesep=1;
    ...
    ngview:s -> user [style=dashed];
    user -> ngcontroller:s [style=dashed];