@maxgraph/core
    Preparing search index...

    Class EdgeStyle

    Provides various edge styles to be used as the values for edgeStyle in a cell style.

    The following example sets the default edge style to ElbowConnector:

    const style = stylesheet.getDefaultEdgeStyle();
    style.edgeStyle = EdgeStyle.ElbowConnector;

    To write a custom edge style, create a function as follows. In the example below, a right angle is created using a point on the horizontal center of the target vertex and the vertical center of the source vertex. The code checks if that point intersects the source vertex and makes the edge straight if it does. The point is then added into the result array, which acts as the return value of the function.

    const MyStyle = (state, source, target, points, result) => {
    if (source && target) {
    const pt = new Point(target.getCenterX(), source.getCenterY());

    if (mathUtils.contains(source, pt.x, pt.y)) {
    pt.y = source.y + source.height;
    }

    result.push(pt);
    }
    };

    The new edge style can then be registered in the StyleRegistry as follows:

    StyleRegistry.putValue('myEdgeStyle', MyStyle);
    

    The custom edge style above can now be used in a specific edge as follows:

    style.edgeStyle = 'myEdgeStyle';
    

    The key of the StyleRegistry entry for the function should be used in the CellState.edgeStyle values, unless GraphView.allowEval is true. In this case, you can also use the 'MyStyle'` string for the value in the cell style above.

    The custom EdgeStyle can be used for all edges in the graph as follows:

    const style = graph.getStylesheet().getDefaultEdgeStyle();
    style.edgeStyle = MyStyle;

    It can also be used directly when setting the value of the edgeStyle key in a style of a specific edge as follows:

    style.edgeStyle = MyStyle;
    
    Index

    Constructors

    Properties

    ElbowConnector: EdgeStyleFunction = ElbowConnectorFunction

    Uses either SideToSide or TopToBottom depending on the horizontal flag in the cell style. SideToSide is used if horizontal is true or unspecified.

    EntityRelation: EdgeStyleFunction = EntityRelationFunction

    Implements an entity relation style for edges (as used in database schema diagrams). At the time the function is called, the result array contains a placeholder (null) for the first absolute point, that is, the point where the edge and source terminal are connected. The implementation of the style then adds all intermediate waypoints except for the last point, that is, the connection point between the edge and the target terminal. The first ant the last point in the result array are then replaced with Point that take into account the terminal's perimeter and next point on the edge.

    CellState that represents the edge to be updated.

    CellState that represents the source terminal.

    CellState that represents the target terminal.

    List of relative control points.

    Array of Point that represent the actual points of the edge.

    Loop: EdgeStyleFunction = LoopFunction

    Implements a self-reference, aka. loop.

    ManhattanConnector: EdgeStyleFunction = ManhattanConnectorFunction

    ManhattanConnector code is based on code from https://github.com/mwangm/mxgraph-manhattan-connector

    Implements router to find the shortest route that avoids cells using manhattan distance as metric.

    OrthConnector: EdgeStyleFunction = OrthogonalConnectorFunction

    Implements a local orthogonal router between the given cells.

    CellState that represents the edge to be updated.

    CellState that represents the source terminal.

    CellState that represents the target terminal.

    List of relative control Points.

    Array of Points that represent the actual points of the edge.

    SegmentConnector: EdgeStyleFunction = SegmentConnectorFunction

    Implements an orthogonal edge style. Use EdgeSegmentHandler as an interactive handler for this style.

    CellState that represents the edge to be updated.

    CellState that represents the source terminal.

    CellState that represents the target terminal.

    List of relative control points.

    Array of Point that represent the actual points of the edge.

    SideToSide: EdgeStyleFunction = SideToSideFunction

    Implements a vertical elbow edge.

    TopToBottom: EdgeStyleFunction = TopToBottomFunction

    Implements a horizontal elbow edge.