The following global properties are valid on the nodeLayout and linkLayout objects
of a top-level graph or subgraph:
Property | Description |
---|---|
algorithm | The type of layout to perform. Valid values are: circular, forcedirected, grid, hierarchical, longlink, random, shortlink, basiclinkstyle, and tree. |
<client-side global property name> | The name of the property in the corresponding client-side layout class. All global properties of type number, boolean, point, and rectangle can be specified. |
This example sets values for two global properties with
a forcedirected layout:
"nodeLayout": { "algorithm":"forcedirected", "preferredLinkLength": 100, "respectNodeSizes": true },
In the graph posted to the server, the nodeLayout and linkLayout objects
can be present in any subgraph for which the client wants the layout
to be executed. It allows you to mix layout algorithms for different
subgraphs. It also allows you to apply the same algorithm with different
parameters, as in client-side graph layout. The absence of the nodeLayout or linkLayout objects
for a given graph or subgraph indicates that no node or link layout
needs to be executed for this graph or subgraph.
Hierarchical layout constraints
The client-side HierarchicalLayout provides an advanced
customization API using different types of constraints. In JSON, the constraints property
describes the constraints in an array, the elements of which are JSON
objects with the following properties:
Property | Description |
---|---|
name | The type of constraint. Valid values are: LevelRangeConstraint, GroupSpreadConstraint, RelativeLevelConstraint, ExtremityConstraint, RelativePositionConstraint, SameLevelConstraint, SideBySideConstraint, and SwimLaneConstraint. |
<client-side constraint property name> | The value of the constraint property. |
This example describes a constraint of the LevelRangeConstraint type:
"nodeLayout":{ "algorithm":"hierarchical", "constraints":[ { "name":"LevelRangeConstraint", "minLevel":0, "maxLevel":1, "nodes":[ { "id":"1" }, { "id":"2" } ] } ] ...
Note
Similarly to the client-side layout, the server-side
layout builds swimlane hierarchical layout constraints (HierarchicalSwimLaneConstraint) automatically from containers
of type SwimLane.
Circular layout clustering parameters
The client-side CircularLayout provides an API for specifying
clusters. In JSON, the clusterIds property
describes the clusters in an array, the elements of which are JSON
objects with the following properties:
Property | Description |
---|---|
name or number | The name or number of the cluster. The name property, of type String, is used for client-side clusters identified by the class CircularClusterName. The number property, of type integer, is used for client-side clusters identified by the class CircularClusterNumber. |
nodes | Array describing the nodes that belong to the given cluster. For each node, the following attributes are supported: id, index, and starCenter. |
This example describes a cluster of type CircularClusterName and
a cluster of type CircularClusterNumber:
"nodeLayout":{ "algorithm":"circular", "clusterIds":[ { "name":"first cluster", "nodes":[ { "id":"174", "index":33, "starCenter":true }, { "id":"190" } ] }, { "number":2, "nodes":[ { "id":"179" }, { "id":"187" } ] } ...