Specification in CSS for nested graphs

In a diagram component, a recursive layout instance is used internally and is called automatically when needed. In Rogue Wave®  JViews Diagrammer, the handling of nested graphs is thus completely automatic.
Layout renderers perform the layout of nested graphs. The node layout renderer performs the arrangement of the nodes, and depending on the layout style, also the reshaping of the normal links (for example, in Hierarchical or Tree Layout). The link layout renderer performs the arrangement of the links, in particular of the intergraph links. The label layout renderer places all labels in the nested graph.
Note
If the nested graph has intergraph links, the link layout renderer must be enabled, otherwise the intergraph links will not be routed at all.

Same layout style everywhere

By default, layout renderers apply the same layout style to all subgraphs. The following example shows a specification in CSS that applies the Tree layout to all subgraphs.
SDM {
    GraphLayout: "true";
    LinkLayout: "true";
}

GraphLayout {
    graphLayout: "Tree";
}

LinkLayout {
    layoutMode: "LONG_LINKS";
    interGraphLinksMode: "true";
    combinedInterGraphLinksMode: "false";
}
This example specifies that the Tree layout algorithm is applied to all nodes and links. The Link layout algorithm is applied only to the intergraph links, not to the normal links. The IlvLinkLayout instance is in mode LONG_LINKS , because intergraph links are often very long.
If you change the specification in the LinkLayout section to:
interGraphLinksMode: "true";
combinedInterGraphLinksMode: "true";
the Link layout algorithm is applied to both normal links and intergraph links.
If you change the specification in the LinkLayout section to:
interGraphLinksMode: "false";
the Link layout algorithm is applied only to normal links, not to intergraph links. The intergraph links are in this case not routed at all. Of course, this is useful only if the graph does not contain any intergraph links.
Since the link layout renderer can reuse the Hierarchical layout as the link layout, the specification is slightly more comfortable, as shown in the following example:
SDM {
    GraphLayout: "true";
    LinkLayout: "true";
}

GraphLayout {
    graphLayout: "Hierarchical";
}

LinkLayout {
    hierarchical: "true";
    interGraphLinksMode: "true";
}
If the hierarchical flag of the link layout renderer is set to true , the normal links are routed by the Hierarchical layout. However, the intergraph links are routed by an instance of IlvLinkLayout, independent from the combinedInterGraphLinksMode setting.

Individual layout styles per subgraph

It is possible to specify the graph layout style for each subgraph individually. To do so, you need to create a style rule that selects the corresponding subgraph, like this:
#subgraph15 {
    GraphLayout: "@#sublayout15";
}

Subobject#sublayout15 {
    class: "ilog.views.graphlayout.tree.IlvTreeLayout";
    flowDirection: "Right";
... further parameters of Tree layout ...
}
In the SDM model, the subgraph with ID “ subgraph15 ” is selected by the first rule. The rule specifies that an object with ID “ sublayout15 ” must be created. The name sublayout15 is arbitrary and has the only purpose of distinguishing it from all other objects. The second rule selects the object “ sublayout15 ” that must be created, and specifies that this is a Tree layout. As result, a Tree layout is applied to the subgraph.
If the layout of an individual subgraph uses only default parameters, it can be specified in a shorter way, because no parameters need to be set:
#subgraph15 {
    GraphLayout: "Tree";
}
Note
Specifying hierarchical: "true" for the link layout works only if no individual layout styles are specified per subgraph. It works only if the entire nested graph is laid out by Hierarchical layout.