Options
All
  • Public
  • Public/Protected
  • All
Menu
example
var layout = new mxCompactTreeLayout(graph);
layout.execute(graph.getDefaultParent());

Hierarchy

Index

Constructors

constructor

Properties

alignRanks

alignRanks: boolean

Whether or not the tops of cells in each rank should be aligned across the rank

channelBuffer

channelBuffer: boolean

The size of the vertical buffer in the center of inter-rank channels where edge control points should not be placed.

edgeRouting

edgeRouting: boolean

Whether or not to apply the internal tree edge routing.

graph

graph: mxGraph

Reference to the enclosing mxGraph.

groupPadding

groupPadding: boolean

Padding added to resized parents.

default

10

groupPaddingBottom

groupPaddingBottom: boolean

Bottom padding added to resized parents.

default

0

groupPaddingLeft

groupPaddingLeft: boolean

Left padding added to resized parents.

default

0

groupPaddingRight

groupPaddingRight: boolean

Right padding added to resized parents.

default

0

groupPaddingTop

groupPaddingTop: boolean

Top padding added to resized parents.

default

0

horizontal

horizontal: boolean

Specifies the orientation of the layout.

default

true

invert

invert: boolean

Specifies if edge directions should be inverted.

default

false.

levelDistance

levelDistance: number

Holds the levelDistance.

default

10

maintainParentLocation

maintainParentLocation: boolean

Specifies if the parent location should be maintained, so that the top, left corner stays the same before and after execution of the layout. Default is false for backwards compatibility.

default

false

maxRankHeight

maxRankHeight: number[]

An array of the maximum height of cells (relative to the layout direction) per rank

minEdgeJetty

minEdgeJetty: boolean

The minimum distance for an edge jetty from a vertex.

moveTree

moveTree: boolean

Specifies if the tree should be moved to the top, left corner if it is inside a top-level layer.

default

false

node

The internal node representation of the root cell. Do not set directly , this value is only exposed to assist with post-processing functionality

nodeDistance

nodeDistance: number

Holds the nodeDistance.

default

20

parent

parent: mxCell

The parent cell of the layout, if any

parentsChanged

parentsChanged: {}

A set of the parents that need updating based on children process as part of the layout.

Type declaration

prefHozEdgeSep

prefHozEdgeSep: boolean

The preferred horizontal distance between edges exiting a vertex.

prefVertEdgeOff

prefVertEdgeOff: boolean

The preferred vertical offset between edges exiting a vertex.

resetEdges

resetEdges: boolean

Specifies if all edge points of traversed edges should be removed.

default

true

resizeParent

resizeParent: boolean

If the parents should be resized to match the width/height of the children. Default is true.

default

true

root

root: mxCell

The cell to use as the root of the tree

sortEdges

sortEdges: boolean

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

useBoundingBox

useBoundingBox: boolean

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

visited

visited: boolean

Specifies if the tree should be moved to the top, left corner if it is inside a top-level layer.

default

false

Methods

adjustParents

  • adjustParents(): void
  • Adjust parent cells whose child geometries have changed. The default implementation adjusts the group to just fit around the children with a padding.

    Returns void

apply

arrangeGroups

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

attachParent

  • attachParent(node: any, height: number): void

bridge

createLine

createNode

dfs

execute

findRankHeights

  • findRankHeights(node: any, rank: number): void
  • Stores the maximum height (relative to the layout direction) of cells in each rank

    Parameters

    • node: any
    • rank: number

    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

horizontalLayout

isAncestor

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

isEdgeIgnored

  • isEdgeIgnored(edge: mxCell): boolean

isHorizontal

  • isHorizontal(): boolean

isVertexIgnored

  • isVertexIgnored(vertex: mxCell): boolean

isVertexMovable

  • isVertexMovable(cell: mxCell): boolean

join

  • join(node: any): number

layout

  • layout(node: any): void

layoutLeaf

  • layoutLeaf(node: any): void

localEdgeProcessing

merge

  • merge(p1: any, p2: any): number

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

moveNode

  • moveNode(node: any, dx: number, dy: number): void

offset

  • offset(p1: number, p2: number, a1: number, a2: number, b1: number, b2: number): number

processNodeOutgoing

setCellHeights

  • setCellHeights(node: any, rank: number): void
  • Set the cells heights (relative to the layout direction) when the tops of each rank are to be aligned

    Parameters

    • node: any
    • rank: number

    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

sortOutgoingEdges

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

verticalLayout

Generated using TypeDoc