These properties affect the styling of an edge’s line:

http://js.cytoscape.org/#style/edge-line

interface Edge {
    arrow-scale?: PropertyValueEdge<number>;
    color?: PropertyValue<EdgeSingular, string>;
    control-point-distance?: PropertyValueEdge<number>;
    control-point-distances?: PropertyValueEdge<string | number | number[]>;
    control-point-step-size?: PropertyValueEdge<number>;
    control-point-weight?: PropertyValueEdge<number>;
    control-point-weights?: PropertyValueEdge<string | number | number[]>;
    curve-style?: PropertyValueEdge<
        | "segments"
        | "haystack"
        | "straight"
        | "bezier"
        | "unbundled-bezier"
        | "taxi">;
    display?: PropertyValue<EdgeSingular, "none" | "element">;
    edge-distances?: PropertyValueEdge<"intersection" | "node-position">;
    events?: PropertyValue<EdgeSingular, "yes" | "no">;
    font-family?: PropertyValue<EdgeSingular, string>;
    font-size?: PropertyValue<EdgeSingular, string | number>;
    font-style?: PropertyValue<EdgeSingular, FontStyle>;
    font-weight?: PropertyValue<EdgeSingular, FontWeight>;
    haystack-radius?: PropertyValueEdge<number>;
    label?: PropertyValue<EdgeSingular, string>;
    line-cap?: PropertyValueEdge<"square" | "butt" | "round">;
    line-color?: PropertyValueEdge<string>;
    line-dash-offset?: PropertyValueEdge<number>;
    line-dash-pattern?: PropertyValueEdge<number>[];
    line-fill?: PropertyValueEdge<"solid" | "linear-gradient" | "radial-gradient">;
    line-gradient-stop-colors?: PropertyValueEdge<string>[];
    line-gradient-stop-positions?: PropertyValueEdge<number>[];
    line-height?: PropertyValue<EdgeSingular, number>;
    line-opacity?: PropertyValueEdge<number>;
    line-style?: PropertyValueEdge<LineStyle>;
    loop-direction?: PropertyValueEdge<string>;
    loop-sweep?: PropertyValueEdge<string>;
    mid-source-arrow-color?: PropertyValueEdge<string>;
    mid-source-arrow-fill?: PropertyValueEdge<ArrowFill>;
    mid-source-arrow-shape?: PropertyValueEdge<ArrowShape>;
    mid-target-arrow-color?: PropertyValueEdge<string>;
    mid-target-arrow-fill?: PropertyValueEdge<ArrowFill>;
    mid-target-arrow-shape?: PropertyValueEdge<ArrowShape>;
    min-zoomed-font-size?: PropertyValue<EdgeSingular, number>;
    opacity?: PropertyValue<EdgeSingular, number>;
    overlay-color?: PropertyValueEdge<string>;
    overlay-opacity?: PropertyValueEdge<number>;
    overlay-padding?: PropertyValueEdge<string | number>;
    segment-distances?: PropertyValueEdge<string | number | number[]>;
    segment-weights?: PropertyValueEdge<string | number | number[]>;
    source-arrow-color?: PropertyValueEdge<string>;
    source-arrow-fill?: PropertyValueEdge<ArrowFill>;
    source-arrow-shape?: PropertyValueEdge<ArrowShape>;
    source-distance-from-node?: PropertyValueEdge<number>;
    source-endpoint?: PropertyValue<EdgeSingular, string>;
    source-label?: PropertyValue<EdgeSingular, string>;
    source-text-margin-x?: PropertyValue<EdgeSingular, number>;
    source-text-margin-y?: PropertyValue<EdgeSingular, number>;
    source-text-offset?: PropertyValue<EdgeSingular, number>;
    source-text-rotation?: PropertyValue<EdgeSingular, number | "none" | "autorotate">;
    target-arrow-color?: PropertyValueEdge<string>;
    target-arrow-fill?: PropertyValueEdge<ArrowFill>;
    target-arrow-shape?: PropertyValueEdge<ArrowShape>;
    target-distance-from-node?: PropertyValueEdge<number>;
    target-endpoint?: PropertyValue<EdgeSingular, string>;
    target-label?: PropertyValue<EdgeSingular, string>;
    target-text-margin-x?: PropertyValue<EdgeSingular, number>;
    target-text-margin-y?: PropertyValue<EdgeSingular, number>;
    target-text-offset?: PropertyValue<EdgeSingular, number>;
    target-text-rotation?: PropertyValue<EdgeSingular, number | "none" | "autorotate">;
    taxi-direction?: PropertyValueEdge<
        | "auto"
        | "vertical"
        | "downward"
        | "upward"
        | "horizontal"
        | "rightward"
        | "leftward">;
    taxi-turn?: PropertyValueEdge<string | number | number[]>;
    taxi-turn-min-distance?: PropertyValueEdge<string | number>;
    text-background-color?: PropertyValue<EdgeSingular, string>;
    text-background-opacity?: PropertyValue<EdgeSingular, number>;
    text-background-padding?: PropertyValue<EdgeSingular, string>;
    text-background-shape?: PropertyValue<EdgeSingular, "rectangle" | "roundrectangle">;
    text-border-color?: PropertyValue<EdgeSingular, string>;
    text-border-opacity?: PropertyValue<EdgeSingular, number>;
    text-border-style?: PropertyValue<EdgeSingular, LineStyle>;
    text-border-width?: PropertyValue<EdgeSingular, number>;
    text-events?: PropertyValue<EdgeSingular, "yes" | "no">;
    text-halign?: PropertyValue<EdgeSingular, "center" | "left" | "right">;
    text-justification?: PropertyValue<EdgeSingular,
        | "auto"
        | "center"
        | "left"
        | "right">;
    text-margin-x?: PropertyValue<EdgeSingular, number>;
    text-margin-y?: PropertyValue<EdgeSingular, number>;
    text-max-width?: PropertyValue<EdgeSingular, string>;
    text-opacity?: PropertyValue<EdgeSingular, number>;
    text-outline-color?: PropertyValue<EdgeSingular, string>;
    text-outline-opacity?: PropertyValue<EdgeSingular, number>;
    text-outline-width?: PropertyValue<EdgeSingular, string | number>;
    text-overflow-wrap?: PropertyValue<EdgeSingular, "whitespace" | "anywhere">;
    text-rotation?: PropertyValue<EdgeSingular, number | "none" | "autorotate">;
    text-transform?: PropertyValue<EdgeSingular, TextTranformation>;
    text-valign?: PropertyValue<EdgeSingular, "center" | "top" | "bottom">;
    text-wrap?: PropertyValue<EdgeSingular, "none" | "wrap" | "ellipsis">;
    transition-delay?: number;
    transition-duration?: number;
    transition-property?: string;
    transition-timing-function?: TransitionTimingFunction;
    visibility?: PropertyValue<EdgeSingular, "hidden" | "visible">;
    width?: PropertyValueEdge<string | number>;
    z-compound-depth?: PropertyValue<EdgeSingular,
        | "auto"
        | "top"
        | "bottom"
        | "orphan">;
    z-index?: PropertyValue<EdgeSingular, number>;
    z-index-compare?: PropertyValue<EdgeSingular, "auto" | "manual">;
}

Hierarchy (view full)

Properties

arrow-scale? color? control-point-distance? control-point-distances? control-point-step-size? control-point-weight? control-point-weights? curve-style? display? edge-distances? events? font-family? font-size? font-style? font-weight? haystack-radius? label? line-cap? line-color? line-dash-offset? line-dash-pattern? line-fill? line-gradient-stop-colors? line-gradient-stop-positions? line-height? line-opacity? line-style? loop-direction? loop-sweep? mid-source-arrow-color? mid-source-arrow-fill? mid-source-arrow-shape? mid-target-arrow-color? mid-target-arrow-fill? mid-target-arrow-shape? min-zoomed-font-size? opacity? overlay-color? overlay-opacity? overlay-padding? segment-distances? segment-weights? source-arrow-color? source-arrow-fill? source-arrow-shape? source-distance-from-node? source-endpoint? source-label? source-text-margin-x? source-text-margin-y? source-text-offset? source-text-rotation? target-arrow-color? target-arrow-fill? target-arrow-shape? target-distance-from-node? target-endpoint? target-label? target-text-margin-x? target-text-margin-y? target-text-offset? target-text-rotation? taxi-direction? taxi-turn? taxi-turn-min-distance? text-background-color? text-background-opacity? text-background-padding? text-background-shape? text-border-color? text-border-opacity? text-border-style? text-border-width? text-events? text-halign? text-justification? text-margin-x? text-margin-y? text-max-width? text-opacity? text-outline-color? text-outline-opacity? text-outline-width? text-overflow-wrap? text-rotation? text-transform? text-valign? text-wrap? transition-delay? transition-duration? transition-property? transition-timing-function? visibility? width? z-compound-depth? z-index? z-index-compare?

Properties

arrow-scale?: PropertyValueEdge<number>

The size of the arrow.

color?: PropertyValue<EdgeSingular, string>

The colour of the element’s label.

control-point-distance?: PropertyValueEdge<number>

A single value that overrides "control-point-step-size" with a manual value. Because it overrides the step size, bezier edges with the same value will overlap. Thus, it’s best to use this as a one- off value for particular edges if need be.

control-point-distances?: PropertyValueEdge<string | number | number[]>

A series of values that specify for each control point the distance perpendicular to a line formed from source to target, e.g. -20 20 - 20.

control-point-step-size?: PropertyValueEdge<number>

From the line perpendicular from source to target, this value specifies the distance between successive bezier edges.

control-point-weight?: PropertyValueEdge<number>

A single value that weights control points along the line from source to target. The value usually ranges on [0, 1], with 0 towards the source node and 1 towards the target node — but larger or smaller values can also be used.

control-point-weights?: PropertyValueEdge<string | number | number[]>

A series of values that weights control points along a line from source to target, e.g. 0.25 0.5 0.75. A value usually ranges on [0, 1], with 0 towards the source node and 1 towards the target node — but larger or smaller values can also be used.

curve-style?: PropertyValueEdge<
    | "segments"
    | "haystack"
    | "straight"
    | "bezier"
    | "unbundled-bezier"
    | "taxi">

The curving method used to separate two or more edges between two nodes; may be

  • haystack (default, very fast, bundled straight edges for which loops and compounds are unsupported),
  • bezier(bundled curved edges),
  • unbundled - bezier(curved edges for use with manual control points), or
  • segments (a series of straight lines). Note that haystack edges work best with ellipse, rectangle, or similar nodes. Smaller node shapes, like triangle, will not be as aesthetically pleasing. Also note that edge arrows are unsupported for haystack edges.
display?: PropertyValue<EdgeSingular, "none" | "element">

Whether to display the element; may be element for displayed or none for not displayed. Note that a "display: none" bezier edge does not take up space in its bundle.

edge-distances?: PropertyValueEdge<"intersection" | "node-position">

With value intersection (default), the line from source to target for "control-point-weight" is from the outside of the source node’s shape to the outside of the target node’s shape.With value node- position, the line is from the source position to the target position. The "node-position" option makes calculating edge points easier — but it should be used carefully because you can create invalid points that intersection would have automatically corrected.

events?: PropertyValue<EdgeSingular, "yes" | "no">

Whether events should occur on an element (e.g.tap, mouseover, etc.).

  • For "no", the element receives no events and events simply pass through to the core/viewport.
font-family?: PropertyValue<EdgeSingular, string>

A comma-separated list of font names to use on the label text.

font-size?: PropertyValue<EdgeSingular, string | number>

A CSS font style to be applied to the label text. https://developer.mozilla.org/en-US/docs/Web/CSS/font-style

A CSS font weight to be applied to the label text.

haystack-radius?: PropertyValueEdge<number>

A value between 0 and 1 inclusive that indicates the relative radius used to position haystack edges on their connected nodes. The outside of the node is at 1, and the centre of the node is at 0.

label?: PropertyValue<EdgeSingular, string>

The text to display for an element’s label.

line-cap?: PropertyValueEdge<"square" | "butt" | "round">

The cap of the edge's line.

line-color?: PropertyValueEdge<string>

The colour of the edge’s line.

line-dash-offset?: PropertyValueEdge<number>

The dashed line offset.

line-dash-pattern?: PropertyValueEdge<number>[]

The dashed line pattern which specifies alternating lengths of lines and gaps.

line-fill?: PropertyValueEdge<"solid" | "linear-gradient" | "radial-gradient">

The filling style of the edge's line.

line-gradient-stop-colors?: PropertyValueEdge<string>[]

The colors of the gradient stops.

line-gradient-stop-positions?: PropertyValueEdge<number>[]

The positions of the gradient stops. If not specified (or invalid), the stops will divide equally.

line-height?: PropertyValue<EdgeSingular, number>

The line height of multiline text, as a relative, unitless value. It specifies the vertical spacing between each line. With value 1 (default), the lines are stacked directly on top of one another with no additional whitespace between them. With value 2, for example, there is whitespace between each line equal to the visible height of a line of text.

line-opacity?: PropertyValueEdge<number>

The opacity of the edge’s line and arrow. Useful if you wish to have a separate opacity for the edge label versus the edge line. Note that the opacity value of the edge element affects the effective opacity of its line and label subcomponents.

Value between 0 and 1 inclusive.

The style of the edge’s line.

loop-direction?: PropertyValueEdge<string>

Determines the angle that loops extend from the node in cases when the source and target node of an edge is the same. The angle is specified from the 12 o’clock position and it progresses clockwise for increasing positive values. The default is -45deg (extending to the upper left).

loop-sweep?: PropertyValueEdge<string>

Determines the angle between the leaving and returning edges in loops. Positive values result in clockwise looping and negative values result in counter-clockwise looping. Default is -90deg.

mid-source-arrow-color?: PropertyValueEdge<string>

The colour of the edge’s "mid-source" arrow.

mid-source-arrow-fill?: PropertyValueEdge<ArrowFill>

The fill state of the edge’s mid-source arrow.

mid-source-arrow-shape?: PropertyValueEdge<ArrowShape>

The shape of the edge’s mid-source arrow.

mid-target-arrow-color?: PropertyValueEdge<string>

The colour of the edge’s "mid-target" arrow.

mid-target-arrow-fill?: PropertyValueEdge<ArrowFill>

The fill state of the edge’s mid-target arrow.

mid-target-arrow-shape?: PropertyValueEdge<ArrowShape>

The shape of the edge’s mid-target arrow.

min-zoomed-font-size?: PropertyValue<EdgeSingular, number>

If zooming makes the effective font size of the label smaller than this, then no label is shown.Note that because of performance optimisations, the label may be shown at font sizes slightly smaller than this value.

This effect is more pronounced at larger screen pixel ratios.However, it is guaranteed that the label will be shown at sizes equal to or greater than the value specified.

opacity?: PropertyValue<EdgeSingular, number>

The opacity of the element, ranging from 0 to 1. Note that the opacity of a compound node parent affects the effective opacity of its children.

overlay-color?: PropertyValueEdge<string>

The colour of the overlay.

overlay-opacity?: PropertyValueEdge<number>

The opacity of the overlay.

overlay-padding?: PropertyValueEdge<string | number>

The area outside of the element within which the overlay is shown.

segment-distances?: PropertyValueEdge<string | number | number[]>

A series of values that specify for each segment point the distance perpendicular to a line formed from source to target, e.g. -20 20 - 20.

segment-weights?: PropertyValueEdge<string | number | number[]>

A series of values that weights segment points along a line from source to target, e.g. 0.25 0.5 0.75.A value usually ranges on [0, 1], with 0 towards the source node and 1 towards the target node — but larger or smaller values can also be used.

source-arrow-color?: PropertyValueEdge<string>

The colour of the edge’s source arrow.

source-arrow-fill?: PropertyValueEdge<ArrowFill>

The fill state of the edge’s source arrow.

source-arrow-shape?: PropertyValueEdge<ArrowShape>

The shape of the edge’s source arrow.

source-distance-from-node?: PropertyValueEdge<number>

The distance the edge ends from its source.

source-endpoint?: PropertyValue<EdgeSingular, string>

Specifies the endpoint of the source side of the edge

source-label?: PropertyValue<EdgeSingular, string>

The text to display for an edge’s source label.

source-text-margin-x?: PropertyValue<EdgeSingular, number>

(For the source label of an edge.)

source-text-margin-y?: PropertyValue<EdgeSingular, number>

(For the source label of an edge.)

source-text-offset?: PropertyValue<EdgeSingular, number>

For the source label of an edge, how far from the source node the label should be placed.

source-text-rotation?: PropertyValue<EdgeSingular, number | "none" | "autorotate">

(For the source label of an edge.)

target-arrow-color?: PropertyValueEdge<string>

The colour of the edge’s target arrow.

target-arrow-fill?: PropertyValueEdge<ArrowFill>

The fill state of the edge’s target arrow.

target-arrow-shape?: PropertyValueEdge<ArrowShape>

The shape of the edge’s target arrow.

target-distance-from-node?: PropertyValueEdge<number>

The distance the edge ends from its target.

target-endpoint?: PropertyValue<EdgeSingular, string>

Specifies the endpoint of the target side of the edge

target-label?: PropertyValue<EdgeSingular, string>

The text to display for an edge’s target label.

target-text-margin-x?: PropertyValue<EdgeSingular, number>

(For the target label of an edge.)

target-text-margin-y?: PropertyValue<EdgeSingular, number>

(For the target label of an edge.)

target-text-offset?: PropertyValue<EdgeSingular, number>

For the target label of an edge, how far from the target node the label should be placed.

target-text-rotation?: PropertyValue<EdgeSingular, number | "none" | "autorotate">

(For the target label of an edge.)

taxi-direction?: PropertyValueEdge<
    | "auto"
    | "vertical"
    | "downward"
    | "upward"
    | "horizontal"
    | "rightward"
    | "leftward">

The main direction of the edge, the direction starting out from the source node; may be one of:

  • auto: Automatically use vertical or horizontal, based on whether the vertical or horizontal distance is largest.
  • vertical: Automatically use downward or upward, based on the vertical direction from source to target.
  • downward: Bundle outgoers downwards.
  • upward: Bundle outgoers upwards.
  • horizontal: Automatically use righward or leftward, based on the horizontal direction from source to target.
  • rightward: Bundle outgoers righwards.
  • leftward: Bundle outgoers leftwards.
taxi-turn?: PropertyValueEdge<string | number | number[]>

The distance along the primary axis where the first turn is applied.

  • This value may be an absolute distance (e.g. '20px') or it may be a relative distance between the source and target (e.g. '50%').
  • A negative value may be specified to indicate a distance in the oppostite, target to source direction (e.g. '-20px').
  • Note that bundling may not work with an explicit direction (upward, downward, leftward, or rightward) in tandem with a turn distance specified in percent units.
taxi-turn-min-distance?: PropertyValueEdge<string | number>

The minimum distance along the primary axis that is maintained between the nodes and the turns.

  • This value only takes on absolute values (e.g. '5px').
  • This property makes the taxi edge be re-routed when the turns would be otherwise too close to the source or target. As such, it also helps to avoid turns overlapping edge endpoint arrows.
text-background-color?: PropertyValue<EdgeSingular, string>

A colour to apply on the text background.

text-background-opacity?: PropertyValue<EdgeSingular, number>

The opacity of the label background; the background is disabled for 0 (default value).

text-background-padding?: PropertyValue<EdgeSingular, string>

The padding provides visual spacing between the text and the edge of the background.

text-background-shape?: PropertyValue<EdgeSingular, "rectangle" | "roundrectangle">

The shape to use for the label background.

text-border-color?: PropertyValue<EdgeSingular, string>

The colour of the border around the label.

text-border-opacity?: PropertyValue<EdgeSingular, number>

The width of the border around the label; the border is disabled for 0 (default value).

text-border-style?: PropertyValue<EdgeSingular, LineStyle>

The style of the border around the label.

text-border-width?: PropertyValue<EdgeSingular, number>

The width of the border around the label.

text-events?: PropertyValue<EdgeSingular, "yes" | "no">

Whether events should occur on an element if the label receives an event; may be yes or no. You may want a style applied to the text on active so you know the text is activatable.

text-halign?: PropertyValue<EdgeSingular, "center" | "left" | "right">

The vertical alignment of a node’s label.

text-justification?: PropertyValue<EdgeSingular,
    | "auto"
    | "center"
    | "left"
    | "right">

The justification of multiline (wrapped) labels; may be left, center, right, or auto (default). The auto value makes it so that a node’s label is justified along the node — e.g. a label on the right side of a node is left justified.

text-margin-x?: PropertyValue<EdgeSingular, number>

A margin that shifts the label along the x- axis.

text-margin-y?: PropertyValue<EdgeSingular, number>

A margin that shifts the label along the y- axis.

text-max-width?: PropertyValue<EdgeSingular, string>

The maximum width for wrapped text, applied when "text-wrap" is set to wrap. For only manual newlines (i.e.\n), set a very large value like 1000px such that only your newline characters would apply.

text-opacity?: PropertyValue<EdgeSingular, number>

The opacity of the label text, including its outline.

text-outline-color?: PropertyValue<EdgeSingular, string>

The colour of the outline around the element’s label text.

text-outline-opacity?: PropertyValue<EdgeSingular, number>

The opacity of the outline on label text.

text-outline-width?: PropertyValue<EdgeSingular, string | number>

The size of the outline on label text.

text-overflow-wrap?: PropertyValue<EdgeSingular, "whitespace" | "anywhere">

The characters that may be used for possible wrapping locations when a line overflows text-max-width; may be whitespace (default) or anywhere. Note that anywhere is suited to CJK, where the characters are in a grid and no whitespace exists. Using anywhere with text in the Latin alphabet, for example, will split words at arbitrary locations.

text-rotation?: PropertyValue<EdgeSingular, number | "none" | "autorotate">

A rotation angle that is applied to the label.

  • Rotations are clockwise.
  • For edges, the special value autorotate can be used to align the label to the edge.
  • For nodes, the label is rotated along its anchor point on the node, so a label margin may help for some usecases.
  • The special value none can be used to denote 0deg.
  • Rotations works best with left-to-right text.

A transformation to apply to the label text.

text-valign?: PropertyValue<EdgeSingular, "center" | "top" | "bottom">

The vertical alignment of a node’s label.

text-wrap?: PropertyValue<EdgeSingular, "none" | "wrap" | "ellipsis">

A wrapping style to apply to the label text; may be

  • "none" for no wrapping (including manual newlines ) or
  • "wrap" for manual and/ or autowrapping.
  • "ellipsis" to truncate the string and append
transition-delay?: number

The length of the delay in seconds before the transition occurs (e.g. 250ms).

transition-duration?: number

The length of the transition in seconds(e.g. 0.5s).

transition-property?: string

A comma separated list of style properties to animate in this state.

transition-timing-function?: TransitionTimingFunction

An easing function that controls the animation progress curve (a visualisation of easings serves as a reference).

visibility?: PropertyValue<EdgeSingular, "hidden" | "visible">

Whether the element is visible; may be visible or hidden. Note that a "visibility : hidden" bezier edge still takes up space in its bundle.

width?: PropertyValueEdge<string | number>

The width of an edge’s line.

z-compound-depth?: PropertyValue<EdgeSingular,
    | "auto"
    | "top"
    | "bottom"
    | "orphan">

May be bottom, orphan, auto (default), or top. The first drawn is bottom, the second is orphan, which is the same depth as the root of the compound graph, followed by the default of auto which draws in depth order from root to leaves of the compound graph. The last drawn is top. It does not usually make sense to set this value for non-compound graphs.

z-index?: PropertyValue<EdgeSingular, number>

An integer value that affects the relative draw order of elements. In general, an element with a higher "z-index" will be drawn on top of an element with a lower "z-index". Note that edges are under nodes despite "z-index", except when necessary for compound nodes.

z-index-compare?: PropertyValue<EdgeSingular, "auto" | "manual">

May be auto (default) or manual. The auto setting draws edges under nodes, whereas manual ignores this convention and draws solely based on the z-index value.