public class RadialLayout extends MultiStageLayout
layering strategies
. Some potential applications include
visualization of social networks, data clustering and bioinformatics.
Sample output of the layout algorithm with default settings and one center node
Sample output of the layout algorithm with straight-line edges and five center nodes using CenterNodesPolicy.CUSTOM
policy
There are different center nodes policies
that can be applied in order to determine the
nodes that will be placed in the center (single center node) or on the innermost circle (more than one center node). The
distribution of the nodes to the circles is specified by a layering strategy
.
The edges are routed based on the
edge routing strategy
. Note that the edge routing cannot always prevent node-edge
overlaps.
The minimum distance between nodes of the same circle is specified using
MinimumNodeToNodeDistance
. If there are too many nodes assigned to a
circle, the radius of the particular circle will be increased until all nodes fit onto it.
The distance between consecutive layers is specified using LayerSpacing
. The radii of
the circles are a multiple of this spacing value. If the layer spacing is 0
, the radii are chosen such that all
nodes fit on their corresponding circles. A minimum layer distance is specified by
MinimumLayerDistance
.
Modifier and Type | Class and Description |
---|---|
static class |
RadialLayout.NodeInfo
Info object used for retrieving information about each node from the layout algorithm.
|
Modifier and Type | Field and Description |
---|---|
static NodeDpKey<RadialLayout.NodeInfo> |
NODE_INFO_DPKEY
A
DataAcceptor key for publishing the circle ID and sector data
For each node, the ID of the circle and data regarding the circular sector on which it was placed will be stored. |
Constructor and Description |
---|
RadialLayout()
Creates a new
RadialLayout instance with the default settings. |
Modifier and Type | Method and Description |
---|---|
void |
applyLayoutCore(LayoutGraph graph)
Calculates a radial arrangement for the given graph.
|
Object |
getCenterNodesDpKey()
Gets the
IDataProvider key used for looking up the selected nodes that should be placed in the center. |
CenterNodesPolicy |
getCenterNodesPolicy()
Gets the policy that determines which nodes are selected as roots of the (virtual) tree for the layout process and are
set in the center of the circles.
|
EdgeBundling |
getEdgeBundling()
Gets the
EdgeBundling instance that defines the settings of the edge bundling feature. |
EdgeRoutingStrategy |
getEdgeRoutingStrategy()
Gets the edge routing strategy.
|
LayeringStrategy |
getLayeringStrategy()
Gets the layering strategy that determines how nodes are distributed into different layers.
|
double |
getLayerSpacing()
Gets the spacing between two consecutive circles (layers).
|
double |
getMaximumChildSectorAngle()
Gets the maximum sector angle around a node within which the node's children will be placed.
|
double |
getMinimumBendAngle()
Gets the minimum bend angle (in degrees) between two adjacent edge segments.
|
double |
getMinimumLayerDistance()
Gets the minimum distance between two circles.
|
double |
getMinimumNodeToNodeDistance()
Gets the minimum distance between two neighboring nodes of the same circle.
|
boolean |
isNodeLabelConsiderationEnabled()
Gets whether or not node labels are taken into account when calculating node positions.
|
void |
setCenterNodesDpKey(Object value)
Sets the
IDataProvider key used for looking up the selected nodes that should be placed in the center. |
void |
setCenterNodesPolicy(CenterNodesPolicy value)
Sets the policy that determines which nodes are selected as roots of the (virtual) tree for the layout process and are
set in the center of the circles.
|
void |
setEdgeRoutingStrategy(EdgeRoutingStrategy value)
Sets the edge routing strategy.
|
void |
setLayeringStrategy(LayeringStrategy value)
Sets the layering strategy that determines how nodes are distributed into different layers.
|
void |
setLayerSpacing(double value)
Sets the spacing between two consecutive circles (layers).
|
void |
setMaximumChildSectorAngle(double value)
Sets the maximum sector angle around a node within which the node's children will be placed.
|
void |
setMinimumBendAngle(double value)
Sets the minimum bend angle (in degrees) between two adjacent edge segments.
|
void |
setMinimumLayerDistance(double value)
Sets the minimum distance between two circles.
|
void |
setMinimumNodeToNodeDistance(double value)
Sets the minimum distance between two neighboring nodes of the same circle.
|
void |
setNodeLabelConsiderationEnabled(boolean value)
Sets whether or not node labels are taken into account when calculating node positions.
|
void |
setOrientationLayoutEnabled(boolean value)
Sets whether or not the
ILayoutStage that modifies the orientation of the layout is
activated. |
appendStage, applyLayout, checkNodeSize, disableAllStages, getComponentLayout, getHideGroupsStage, getLabeling, getLayoutOrientation, getOrientationLayout, getParallelEdgeRouter, getSelfLoopRouter, getSubgraphLayout, isComponentLayoutEnabled, isHideGroupsStageEnabled, isLabelingEnabled, isOrientationLayoutEnabled, isParallelEdgeRouterEnabled, isSelfLoopRouterEnabled, isSubgraphLayoutEnabled, prependStage, removeStage, setComponentLayout, setComponentLayoutEnabled, setHideGroupsStage, setHideGroupsStageEnabled, setLabeling, setLabelingEnabled, setLayoutOrientation, setOrientationLayout, setParallelEdgeRouter, setParallelEdgeRouterEnabled, setSelfLoopRouter, setSelfLoopRouterEnabled, setSubgraphLayout, setSubgraphLayoutEnabled
public static final NodeDpKey<RadialLayout.NodeInfo> NODE_INFO_DPKEY
DataAcceptor
key for publishing the circle ID and sector data
For each node, the ID of the circle and data regarding the circular sector on which it was placed will be stored.
IDataProvider
is registered with this key, information about circle ID and sector data will be dropped.RadialLayout.NodeInfo
provided
by the IDataProvider
registered with this key. It is only intended to publish information after the layout has
been calculated.public RadialLayout()
RadialLayout
instance with the default settings.public void applyLayoutCore(LayoutGraph graph)
applyLayoutCore
in class MultiStageLayout
graph
- the input graphpublic Object getCenterNodesDpKey()
IDataProvider
key used for looking up the selected nodes that should be placed in the center.IllegalArgumentException
- if the specified key is null
center node policy
is set to
CenterNodesPolicy.CUSTOM
.LayoutKeys.AFFECTED_NODES_DPKEY
. The selected nodes are placed in the center.IDataProvider
key for the selection of center nodessetCenterNodesDpKey(Object)
public CenterNodesPolicy getCenterNodesPolicy()
IllegalArgumentException
- if an invalid center node policy is givenCenterNodesPolicy.WEIGHTED_CENTRALITY
. The node determined using weighted centrality is placed in the center.setCenterNodesPolicy(CenterNodesPolicy)
public EdgeBundling getEdgeBundling()
EdgeBundling
instance that defines the settings of the edge bundling feature.
The specified EdgeBundling
defines global bundling properties. Settings for individual edges can be defined by
assigning an EdgeBundleDescriptor
to an edge using a IDataProvider
registered with key
EdgeBundling.EDGE_BUNDLE_DESCRIPTOR_DPKEY
.
default bundle descriptor
which has bundling
enabled.hierarchic layering strategy
is
selected.EdgeBundling
instance defining the edge bundling setuppublic EdgeRoutingStrategy getEdgeRoutingStrategy()
IllegalArgumentException
- if an invalid edge routing strategy is setEdgeRoutingStrategy.ARC
. The edges will be routed as arcs.setEdgeRoutingStrategy(EdgeRoutingStrategy)
public LayeringStrategy getLayeringStrategy()
All nodes of a given layer will be placed on the same circle.
IllegalArgumentException
- if an invalid layering strategy is setLayeringStrategy.BFS
. The layers are determined using BFS.setLayeringStrategy(LayeringStrategy)
public double getLayerSpacing()
The spacing is a non-negative value, where 0
means that no spacing is considered.
The radius of each circle will be a multiple of this value.
IllegalArgumentException
- if the spacing value is negativesetLayerSpacing(double)
public double getMaximumChildSectorAngle()
Based on the location of a given node, the sector of its children that lie on the next outer layer is described by this angle. The vertex of the angle is located in the center of the node while its sides point away from the inner circles. The child nodes are placed inside this angle. If there is not enough space, the radius of the child circle is increased.
IllegalArgumentException
- if the sector angle is negative or greater than 360
degrees[0,360]
setMaximumChildSectorAngle(double)
public double getMinimumBendAngle()
The minimum bend angle is defined to be a value between 0
and 90
degrees.
IllegalArgumentException
- if the given minimum bend angle is negative or greater than 90
[0,90]
setMinimumBendAngle(double)
public double getMinimumLayerDistance()
IllegalArgumentException
- if the minimum layer distance is negativesetMinimumLayerDistance(double)
public double getMinimumNodeToNodeDistance()
IllegalArgumentException
- if the given minimum distance is negativesetMinimumNodeToNodeDistance(double)
public boolean isNodeLabelConsiderationEnabled()
Thereby, possible node/node label or node label/node label overlaps are prevented.
layout orientation
is set to LayoutOrientation.TOP_TO_BOTTOM
(which is the default). Changing the layout
orientation for an undirected layout algorithm like the RadialLayout
doesn't make sense.false
. Node labels are not considered.true
if node labels are considered, false
otherwisesetNodeLabelConsiderationEnabled(boolean)
public void setCenterNodesDpKey(Object value)
IDataProvider
key used for looking up the selected nodes that should be placed in the center.IllegalArgumentException
- if the specified key is null
center node policy
is set to
CenterNodesPolicy.CUSTOM
.LayoutKeys.AFFECTED_NODES_DPKEY
. The selected nodes are placed in the center.value
- the IDataProvider
key for the selection of center nodesgetCenterNodesDpKey()
public void setCenterNodesPolicy(CenterNodesPolicy value)
IllegalArgumentException
- if an invalid center node policy is givenCenterNodesPolicy.WEIGHTED_CENTRALITY
. The node determined using weighted centrality is placed in the center.value
- one of the predefined center node policiesgetCenterNodesPolicy()
public void setEdgeRoutingStrategy(EdgeRoutingStrategy value)
IllegalArgumentException
- if an invalid edge routing strategy is setEdgeRoutingStrategy.ARC
. The edges will be routed as arcs.value
- the edge routing strategygetEdgeRoutingStrategy()
public void setLayeringStrategy(LayeringStrategy value)
All nodes of a given layer will be placed on the same circle.
IllegalArgumentException
- if an invalid layering strategy is setLayeringStrategy.BFS
. The layers are determined using BFS.value
- one of the predefined layering strategiesgetLayeringStrategy()
public void setLayerSpacing(double value)
The spacing is a non-negative value, where 0
means that no spacing is considered.
The radius of each circle will be a multiple of this value.
IllegalArgumentException
- if the spacing value is negativevalue
- the spacing valuegetLayerSpacing()
public void setMaximumChildSectorAngle(double value)
Based on the location of a given node, the sector of its children that lie on the next outer layer is described by this angle. The vertex of the angle is located in the center of the node while its sides point away from the inner circles. The child nodes are placed inside this angle. If there is not enough space, the radius of the child circle is increased.
IllegalArgumentException
- if the sector angle is negative or greater than 360
degreesvalue
- the maximum sector angle in degrees from the interval [0,360]
getMaximumChildSectorAngle()
public void setMinimumBendAngle(double value)
The minimum bend angle is defined to be a value between 0
and 90
degrees.
IllegalArgumentException
- if the given minimum bend angle is negative or greater than 90
value
- an angle from the interval [0,90]
getMinimumBendAngle()
public void setMinimumLayerDistance(double value)
IllegalArgumentException
- if the minimum layer distance is negativevalue
- the non-negative distance between two circlesgetMinimumLayerDistance()
public void setMinimumNodeToNodeDistance(double value)
IllegalArgumentException
- if the given minimum distance is negativevalue
- a non-negative distancegetMinimumNodeToNodeDistance()
public void setNodeLabelConsiderationEnabled(boolean value)
Thereby, possible node/node label or node label/node label overlaps are prevented.
layout orientation
is set to LayoutOrientation.TOP_TO_BOTTOM
(which is the default). Changing the layout
orientation for an undirected layout algorithm like the RadialLayout
doesn't make sense.false
. Node labels are not considered.value
- true
if node labels are considered, false
otherwiseisNodeLabelConsiderationEnabled()
public void setOrientationLayoutEnabled(boolean value)
ILayoutStage
that modifies the orientation of the layout is
activated.setOrientationLayoutEnabled
in class MultiStageLayout
LayoutOrientation.TOP_TO_BOTTOM
, the orientation of the layout will not be
modified.OrientationLayout
has no significant
effect.true
. The orientation ILayoutStage
is activated.value
- true
if the stage that modifies the orientation is activated, false
otherwiseMultiStageLayout.isOrientationLayoutEnabled()
,
MultiStageLayout.setOrientationLayout(com.yworks.yfiles.layout.ILayoutStage)
,
MultiStageLayout.setLayoutOrientation(com.yworks.yfiles.layout.LayoutOrientation)
,
OrientationLayout