Skip to content
  1. API
  2. Types

EdgeAttributes

Type: object

Default values indicate the system values (when an edge has not been assigned any value for that attribute).

Properties

  • adjustAnchors(optional) boolean[=true] If true, the edge's extremities' badges and shape will be taken into account when displaying it. Edges that ends with an arrow will stop at the node's badge/corner.

  • color(optional) Color|"source"|"target"[="grey"] Color of the edge

  • detectable(optional) boolean[=true] Indicates if the edge is detectable by the mouse.

  • halo(optional) object|Color If not an object, alias to halo.color

    • color(optional) Color[=null] Color of the halo
    • scalingMethod(optional) ScalingMethod[="fixed"] Indicates if the halo width should be multiplied by the zoom when the edge is displayed.
    • width(optional) PixelSize[=10] Width of the halo, in pixels
  • layer(optional) LayerValue[=0] Z-index of the node. Integer value between -1 and 3.

  • minVisibleSize(optional) number[=0] If the edge width on screen is less than this value, it will not be displayed

  • opacity(optional) OpacityValue[=1] Opacity of the edge. 0 = transparent, 1 = opaque.

  • outline(optional) object|boolean If not an object, alias to outline.enabled

    • color(optional) Color[="rgba(0, 0, 0, 0.36)"] Color of the outline
    • enabled(optional) boolean[=false] Indicates if the outline should be visible
    • minVisibleSize(optional) number[=0] If the edge width on screen is less than this value, the outline will ne be shown
  • pulse(optional) object

    • duration(optional) number[=1000] Lifespan of one pulse ripple (milliseconds).
    • enabled(optional) boolean[=false] If true, shows animated pulse around the edge.
    • endColor(optional) Color[="rgba(0, 0, 0, 0)"] End color of the pulse
    • endRatio(optional) number[=2] Where the pulse ends, relative to the edge width (2 = 2x width of the edge)
    • interval(optional) number[=800] Interval between two pulses (milliseconds).
    • startColor(optional) Color[="rgba(0, 0, 0, 0.6)"] Starting color of the pulse
    • startRatio(optional) number[=1] Where the pulse starts, relative to the edge width (1 = at the edge border)
    • width(optional) number[=50] Width of the pulse in pixels
  • scalingMethod(optional) ScalingMethod[="scaled"] Indicates if the edge width should be multiplied by the zoom when the edge is displayed.

  • shape(optional) object|PredefinedEdgeShape

  • stroke(optional) object

    • color(optional) Color|"inherit"[="inherit"] Color of the edge stroke. If it is "inherit", uses the same color as for the body.
    • minVisibleSize(optional) number[=0] If the edge width on screen is less than this value, the stroke will not be displayed
    • width(optional) PixelSize[=0] Stroke width, in pixels.
  • strokeWidth(optional) PixelSize Alias for stroke.width

  • text(optional) object|TextContent If not an object, alias to text.content

    • adjustAngle(optional) boolean[=true] In case the edge is shorter than the text, indicates if the text should be displayed horizontally. Only works for non-scaled texts.

    • align(optional) TextAlign[="center"] Alignment of the text (for multi-line texts)

    • backgroundColor(optional) Color|"inherit"[=null] Background color of the text

    • color(optional) Color[="black"] Color of the text

    • content(optional) TextContent[=null] Text to display

    • font(optional) string[="Arial"] Font used to display the text

    • margin(optional) PixelSize[=2] Space between the text and the edge, in pixels. Ignored if text.position is "centered".

    • maxLineLength(optional) number[=0] If > 1, lines that have more characters than this value will be split across multiple lines. Affects both primary and secondary texts.

    • minVisibleSize(optional) PixelSize[=4] If the edge width on screen is less than this value, the text will not be shown

    • padding(optional) PixelSize[=2] Space between the text and its background's edge, in pixels

    • position(optional) EdgeTextPosition[="shifted"] Text position relative to the edge: centered or shifted. Centered places the text on top of the edge and ignores margin

    • scale(optional) number[=1] Text size relative to the edge width

    • scaling(optional) boolean[=false] Indicates if the size property (false) or the scale property (true) must be used to compute the text size

    • secondary(optional) object|TextContent If not an object, alias to text.secondary.content

      • align(optional) TextAlign[="center"] Alignment of the secondary text (for multi-line texts)
      • backgroundColor(optional) Color|"inherit"[=null] Background color of the secondary text
      • color(optional) Color[="black"] Color of the secondary text
      • content(optional) TextContent[=null] Text to display under the primary text
      • font(optional) string[="Arial"] Font used to display the secondary text
      • margin(optional) PixelSize[=2] Space between the secondary text and the edge
      • minVisibleSize(optional) PixelSize[=4] If the edge width on screen is less than this value, the secondary text will not be shown
      • padding(optional) PixelSize[=2] Space between the secondary text and its background's edge, in pixels
      • scale(optional) number[=0.8] Secondary text size (relative to the edge width)
      • size(optional) PixelSize[=12] Secondary text size (in pixels)
      • style(optional) FontStyle[="normal"] Secondary text style
    • size(optional) PixelSize[=12] Text size (in pixels)

    • style(optional) FontStyle[="normal"] Style applied to the text

  • width(optional) PixelSize[=1] Width of the edge (graph space)