Dojo Diagrammer suporta gráficos aninhados, ou seja,
ele pode renderizar gráficos contendo nós que são gráficos.
Um gráfico que é um nó em outro gráfico é chamado de subgráfico.
Os links que conectam nós de diferentes subgráficos são chamados de
links entre gráficos. Na Layout hierárquico recursivo no gráfico aninhado com
estilo de link polilinha, todos os links vermelhos são links
entre gráficos e todos os links pretos são links normais. Isto é explicado detalhadamente
em Layouts Aninhados.
Hierarchical layout can treat a nested graph at once,
placing all nested nodes and routing all links including the intergraph
links.
To enable recursive mode:
Use este método:
layout.setRecursiveLayoutMode(enable);
Recursive layout mode requires that all subgraphs are
laid out in the same style. For example, they must all use the same
flow direction. This happens automatically when you do not specify
individual layouts per subgraph. If different layout styles are needed
for each subgraph, you must specify an individual layout per subgraph.
Para obter detalhes, consulte
Recursão Avançada: Combinando Layouts Diferentes em um Gráfico
Aninhado.
In this case, hierarchical layout cannot route the intergraph
links and you must use a Link Layout algorithm to route the intergraph
links.

Layout hierárquico recursivo no gráfico aninhado com
estilo de link polilinha

Layout hierárquico recursivo no gráfico aninhado com
estilo de link ortogonal
Setting layout parameters in recursive mode
In recursive layout mode, the hierarchical layout is
attached to the top-level graph. Os parâmetros de layout globais devem ser configurados nesta instância de layout. Os parâmetros de layout por nó ou por link devem ser configurados da seguinte maneira:
var sublayout = new ibm_ilog.graphlayout.hierarchical.HierarchicalLayout(); subgraph.setNodeLayout(sublayout); // The configuration of per node or per link parameters must be // done after attaching the layout to the subgraph sublayout.setSpecNodeLevelIndex(node, 5);
This means that layout parameters per node or per link
cannot be set on the top-level layout, but must be set on the sublayout
that lays out the subgraph.
Layout constraints in recursive layout mode work only
between nodes that belong to the same subgraph. Constraints among
nodes of different subgraphs are ignored. The concepts EAST, WEST,
NORTH, SOUTH of extremity constraints are interpreted relative to
the subgraph, not relative to the global graph. Similarly to the layout
parameters per node or per link, the constraint must be installed
at the layout instance of the subgraph of the node.
// node1, node2 is directly contained in subgraph var sublayout = topLevelLayout.getRecursiveLayout().getLayout(subgraph); sublayout.addConstraint(new ibm_ilog.graphlayout.SameLevelConstraint(node1, node2));
Swim lane constraints do not work in recursive layout
mode at all.