Skip to content
  1. API
  2. Types

NodeAttributes

Type: object

Properties

  • badges(optional) object

    • bottomLeft(optional) Badge
    • bottomRight(optional) Badge
    • topLeft(optional) Badge
    • topRight(optional) Badge
  • color(optional) Color|Array<Color>[="grey"] Color of the node

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

  • draggable(optional) boolean[=true] Indicates if the node is draggable by the user

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

    • color(optional) Color[=null] Color of the halo
    • hideNonAdjacentEdges(optional) boolean[=false] If true, the halo hides edges which don't have at least one extremity with halo.hideNonAdjacentEdges to true.
    • scalingMethod(optional) ScalingMethod[="fixed"] Indicates if the halo width should be multiplied by the zoom when the node is displayed.
    • strokeColor(optional) Color[=null] Color of the stroke of the halo
    • strokeWidth(optional) PixelSize[=1] Width of the stroke of the halo
    • width(optional) PixelSize[=50] Width of the halo, in pixels
  • icon(optional) object|TextContent If not an object, alias for icon.content

    • color(optional) Color[="black"] Color used to display the icon text
    • content(optional) TextContent Text to display inside the icon
    • font(optional) string[="Arial"] Font used to display the icon text
    • minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the icon will not be shown
    • scale(optional) number[=0.7] Text size relative to the node diameter
    • style(optional) FontStyle[="normal"] Style applied to the icon.
  • image(optional) object|string|null If not an object, alias for image.url

    • fit(optional) boolean[=true] Indicates if the image should be rescaled to fit the node
    • minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the image will not be shown
    • scale(optional) number[=1] Size of the image relative to the node diameter
    • tile(optional) boolean[=false] If the image is smaller than the node, indicates if the image should be duplicated to fill the node. If true, fit will be considered to be false.
    • url(optional) string|null[=null] URL of the image to display
  • innerStroke(optional) object|Color|"inherit" If not an object, alias for innerStroke.color

    • color(optional) Color|"inherit"[="white"] Color of the node's inner stroke
    • minVisibleSize(optional) number[=12] If the node diameter on screen is less than this value, the inner stroke will not be shown
    • scalingMethod(optional) ScalingMethod[="fixed"] Indicates if the inner stroke width should be multiplied by the zoom when the node is displayed.
    • width(optional) PixelSize[=2] Width of the node's inner stroke
  • layer(optional) LayerValue[=0] Z-index of the node. Integer value between 1 and 3.

  • layoutable(optional) boolean[=true] Indicates if the node movable by the layout algorithm Some of the layouts (ForceLink) would take the non-movable nodes into account by making other nodes avoid them, others would just ignore them in calculations.

  • opacity(optional) OpacityValue[=1] Opacity of the node.

  • outerStroke(optional) object|Color|"inherit" If not an object, alias for outerStroke.color

    • color(optional) Color|"inherit"[=null] Color of the node's outer stroke
    • minVisibleSize(optional) number[=0] If the node diameter on screen is less than this value, the outer stroke will not be shown
    • scalingMethod(optional) ScalingMethod[="fixed"] Indicates if the outer stroke width should be multiplied by the zoom when the node is displayed.
    • width(optional) PixelSize[=5] Width of the node's outer stroke
  • outline(optional) object|boolean If not an object, alias for 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[=12] If the node diameter on screen is less than this value, the outline will ne be shown
  • pulse(optional) object|null

    • duration(optional) number[=1000] Lifespan of one pulse ripple (milliseconds).
    • enabled(optional) boolean[=false] If true, shows animated pulse around the node.
    • endColor(optional) Color[="rgba(0, 0, 0, 0)"] End color of the pulse
    • endRatio(optional) number[=2] Where the pulse ends, relative to the node size (2 = 2x size of the node)
    • 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 node size (1 = at the node's border)
    • width(optional) number[=50] Width of the pulse in pixels
  • radius(optional) PixelSize[=5] Indicates the radius of the node (graph size)

  • scalingMethod(optional) ScalingMethod[="scaled"] Indicates if the radius should be multiplied by the zoom when the node is displayed.

  • shape(optional) NodeShape[="circle"] Shape of the node

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

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

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

    • color(optional) Color|"inherit"[="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[=10] Additional space (in pixels) between the node and the text

    • 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) number[=24] If the node diameter 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) "right"|"left"|"top"|"bottom"|"center"[="bottom"] Position of the text relative to the node

    • scale(optional) number[=0.1] Text size relative to the node diameter

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

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

      • align(optional) TextAlign[="center"] Alignment of the secondary text (for multi-line texts)
      • backgroundColor(optional) Color|"inherit"|null[=null] Background color of the secondary text
      • color(optional) Color|"inherit"[="black"] Color of the secondary text
      • content(optional) TextContent[=null] Secondary text content. The secondary text is always displayed below the node.
      • font(optional) string[="Arial"] Font used to display the secondary text
      • margin(optional) PixelSize[=2] Space (in pixels) on top of the secondary text.
      • minVisibleSize(optional) number[=24] If the node diameter on screen is less than this value, the secondary text will not be shown
      • padding(optional) PixelSize[=2] Space (in pixels) between the text and its background's edge
      • scale(optional) number[=0.08] Secondary text size (relative to the node diameter)
      • size(optional) PixelSize[=10] 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

    • tip(optional) boolean[=true] Indicates if the margin between the text and the background should be filled with a small arrow pointing towards the node

  • x(optional) number[=0] X coordinate of the node (graph space)

  • y(optional) number[=0] Y coordinate of the node (graph space)