Interface StraightConnectorOptions

Options for a straight connector.

interface StraightConnectorOptions {
    alwaysRespectStubs?: boolean;
    constrain?: ConnectorPathConstrainment;
    cornerRadius?: number;
    cssClass?: string;
    gap?: number;
    hoverClass?: string;
    loopbackRadius?: number;
    midpoint?: number;
    slightlyWonky?: boolean;
    smooth?: boolean;
    smoothing?: number;
    smoothingType?: PathSmoothingType;
    stub?: number;
}

Hierarchy (view full)

Properties

alwaysRespectStubs?: boolean

Defaults to true, meaning always draw a stub of the desired length, even when the source and target elements are very close together. This only applies when constrain is set to PATH_CONSTRAIN_ORTHOGONAL.

Optional constraint on the direction path segments can travel in. Options are PATH_CONSTRAIN_NONE, PATH_CONSTRAIN_ORTHOGONAL (segments are vertical and/or horizontal lines) and PATH_CONSTRAIN_DIAGONAL (segments are vertical, horizontal, or 45 degree lines). You can also use PATH_CONSTRAIN_MANHATTAN as an alias for PATH_CONSTRAIN_ORTHOGONAL or PATH_CONSTRAIN_METRO as an alias for PATH_CONSTRAIN_DIAGONAL.

cornerRadius?: number

Optional radius to apply to corners. If you have set smooth:true this will be ignored.

cssClass?: string

Optional class to set on the element used to render the connector.

gap?: number

Defines a number of pixels between the end of the connector and its anchor point. Defaults to zero.

hoverClass?: string

Optional class to set on the element used to render the connector when the mouse is hovering over the connector.

loopbackRadius?: number

For a loopback connection (when constrain is set to orthogonal), the size of the loop.

midpoint?: number

The point to use as the halfway point between the source and target when constrain is set to orthogonal. Defaults to 0.5.

slightlyWonky?: boolean

If true, and a cornerRadius is set, the lines are drawn in such a way that they look slightly hand drawn. This effect was something we stumbled across, ie. a mistake, but it was charming in its own way so we decided to leave it in as an option.

smooth?: boolean

Whether or not to smooth the connector. Defaults to false. It is not recommended to use this in conjunction with orthogonal or diagonal constrain, as the line tends to take on a bit of a hand-drawn appearance. It's not without charm but it's also not for everyone.

smoothing?: number

The amount of smoothing to apply. The default is 0.15. Values that deviate too much from the default will make your lines look weird.

smoothingType?: PathSmoothingType

When smooth is true, what sort of smoothing to use. The options are PATH_SMOOTHING_CARDINAL_SPLINE, which approximates each junction with a cardinal spline, or PATH_SMOOTHING_BEZIER, which converts the path into a series of bezier segments. Bezier is the default.

stub?: number

Stub defines a number of pixels that the connector travels away from its element before the connector's actual path begins.

Version :