Options
All
  • Public
  • Public/Protected
  • All
Menu

Extends mxGraphLayout to implement a radial tree algorithm. This layout is suitable for graphs that have no cycles (trees). Vertices that are not connected to the tree will be ignored by this layout.

example
var layout = new mxRadialTreeLayout(graph);
layout.execute(graph.getDefaultParent());

Hierarchy

Index

Constructors

constructor

Properties

angleOffset

angleOffset: number

The initial offset to compute the angle position.

default

0.5

autoRadius

autoRadius: boolean

Specifies if the radios should be computed automatically

default

false

graph

graph: mxGraph

Reference to the enclosing mxGraph.

levelDistance

levelDistance: number

Holds the levelDistance.

default

120

nodeDistance

nodeDistance: number

Holds the nodeDistance.

default

10

parent

parent: mxCell

The parent cell of the layout, if any

rootx

rootx: number

The X co-ordinate of the root cell

default

0

rooty

rooty: number

The Y co-ordinate of the root cell

default

0

row

row: mxCell[]

Array of vertices on each row

rowMaxCenX

rowMaxCenX: number[]

Variable: rowMaxCenX

Array of x coordinate of rightmost vertex of each row

rowMaxX

rowMaxX: number[]

Array of rightmost x coordinate of each row

rowMinCenX

rowMinCenX: number[]

Array of x coordinate of leftmost vertex of each row

rowMinX

rowMinX: number[]

Array of leftmost x coordinate of each row

rowRadi

rowRadi: number[]

Array of y deltas of each row behind root vertex, also the radius in the tree

sortEdges

sortEdges: boolean

Specifies if edges should be sorted according to the order of their opposite terminal cell in the model.

default

false

useBoundingBox

useBoundingBox: boolean

Boolean indicating if the bounding box of the label should be used if its available. Default is true.

Methods

arrangeGroups

  • arrangeGroups(cells: mxCell[], border?: number, topBorder?: number, rightBorder?: number, bottomBorder?: number, leftBorder?: number): mxCell[]

calcRowDims

  • calcRowDims(row: number[], rowNum: number): void
  • Recursive function to calculate the dimensions of each row

    Parameters

    • row: number[]

      Array of internal nodes, the children of which are to be processed.

    • rowNum: number

      Integer indicating which row is being processed.

    Returns void

execute

  • Function: execute

    Implements <mxGraphLayout.execute>.

    If the parent has any connected edges, then it is used as the root of the tree. Else, <mxGraph.findTreeRoots> will be used to find a suitable root node within the set of children of the given parent.

    Parameters:

    Parameters

    • parent: mxCell

      mxCell whose children should be laid out.

    • Optional root: mxCell

      Optional mxCell that will be used as the root of the tree.

    Returns void

getConstraint

  • getConstraint(key: string, cell: mxCell, edge?: mxCell, source?: boolean): any
  • Returns the constraint for the given key and cell. The optional edge and source arguments are used to return inbound and outgoing routing- constraints for the given edge and vertex. This implementation always returns the value for the given key in the style of the given cell.

    Parameters

    • key: string

      Key of the constraint to be returned.

    • cell: mxCell

      mxCell whose constraint should be returned.

    • Optional edge: mxCell

      Optional mxCell that represents the connection whose constraint should be returned. Default is null.

    • Optional source: boolean

      Optional boolean that specifies if the connection is incoming or outgoing. Default is null.

    Returns any

getGraph

getParentOffset

getVertexBounds

isAncestor

  • isAncestor(parent: mxCell, child: mxCell, traverseAncestors?: boolean): boolean

isEdgeIgnored

  • isEdgeIgnored(edge: mxCell): boolean

isVertexIgnored

  • isVertexIgnored(vertex: mxCell): boolean

isVertexMovable

  • isVertexMovable(cell: mxCell): boolean

moveCell

  • moveCell(cell: mxCell, x: number, y: number): void
  • Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg. index) so that the outcome of the layout will position the vertex as close to the point (x, y) as possible.

    Empty implementation.

    Parameters

    • cell: mxCell

      mxCell which has been moved.

    • x: number

      X-coordinate of the new cell location.

    • y: number

      Y-coordinate of the new cell location.

    Returns void

setEdgePoints

setEdgeStyleEnabled

  • setEdgeStyleEnabled(edge: mxCell, value: any): void

setOrthogonalEdge

  • setOrthogonalEdge(edge: mxCell, value: any): void

setVertexLocation

  • Sets the new position of the given cell taking into account the size of the bounding box if useBoundingBox is true. The change is only carried out if the new location is not equal to the existing location, otherwise the geometry is not replaced with an updated instance. The new or old bounds are returned (including overlapping labels).

    Parameters

    • cell: mxCell

      mxCell whose geometry is to be set.

    • x: number

      Integer that defines the x-coordinate of the new location.

    • y: number

      Integer that defines the y-coordinate of the new location.

    Returns mxRectangle

traverse

  • Traverses the (directed) graph invoking the given function for each visited vertex and edge. The function is invoked with the current vertex and the incoming edge as a parameter. This implementation makes sure each vertex is only visited once. The function may return false if the traversal should stop at the given vertex.

    Example:

    (code) mxLog.show(); var cell = graph.getSelectionCell(); graph.traverse(cell, false, function(vertex, edge) { mxLog.debug(graph.getLabel(vertex)); }); (end)

    Parameters

    • vertex: mxCell

      mxCell that represents the vertex where the traversal starts.

    • Optional directed: boolean

      Optional boolean indicating if edges should only be traversed from source to target. Default is true.

    • Optional func: Function

      Visitor function that takes the current vertex and the incoming edge as arguments. The traversal stops if the function returns false.

    • Optional edge: mxCell

      Optional mxCell that represents the incoming edge. This is null for the first step of the traversal.

    • Optional visited: mxDictionary<any>

      Optional mxDictionary of cell paths for the visited cells.

    Returns void

Generated using TypeDoc