29

我想用以下代码对一些节点进行分组

digraph dataflow {
    subgraph pipeline {
        relations;
        synonyms;
        articles;
    }
    subgraph lucene {
        index;
        search;
    }
    training_data - > index;
    relations - > search;
    synonyms - > index;
    articles - > index;
    training_data - > evaluation;
}

但 dot 不关心子图:

示例点图

4

1 回答 1

48

尝试在您的子图前加上“cluster_”:

digraph dataflow {
    subgraph cluster_pipeline {
        relations;
        synonyms;
        articles;
    }
    subgraph cluster_lucene {
        index;
        search;
    }
    training_data -> index;
    relations -> search;
    synonyms -> index;
    articles -> index;
    training_data -> evaluation;
}
于 2012-07-11T14:43:23.160 回答