Neo4j Visualization Library
    Preparing search index...

    Interface Relationship

    A relationship inside the graph visualization.

    interface Relationship {
        caption?: string;
        captionAlign?: "top" | "bottom" | "center";
        captionHtml?: HTMLElement;
        captions?: StyledCaption[];
        captionSize?: number;
        color?: string;
        disabled?: boolean;
        from: string;
        hovered?: boolean;
        id: string;
        overlayIcon?: { position?: number[]; size?: number; url: string };
        selected?: boolean;
        to: string;
        type?: string;
        width?: number;
    }

    Hierarchy

    • GraphElement
      • Relationship
    Index
    caption?: string

    The text to display on the node or relationship.

    If both caption and captions are provided, captions takes precedence. To provide multiple captions with custom styles, use the captions property. Captions are only visible when using the 'canvas' renderer.

    Node.html and Node.icon for labelling nodes with the WebGL renderer.

    captionAlign?: "top" | "bottom" | "center"

    The caption align. Has no affect on self-referring relationships.

    captionHtml?: HTMLElement

    The DOM element to display on top of a relationship caption.

    The captionSize and captionAlign properties will affect the position and height of the html container element.

    captions?: StyledCaption[]

    Multiple captions with individual text styles.

    Only drawn by the 'canvas' renderer. For a single unstyled caption use caption.

    captionSize?: number

    The caption text size.

    color?: string

    The color of the graph element.

    disabled?: boolean

    Whether or not the current node or relationship is disabled.

    from: string

    Node id where the relationship starts from.

    hovered?: boolean

    Whether or not the current node or relationship is hovered.

    id: string

    The id of the current node or relationship. Ids need to be unique across all nodes and relationships. Ids need to be strings and cannot be empty.

    overlayIcon?: { position?: number[]; size?: number; url: string }

    An icon to be displayed anywhere on top of the graph element. Icons are expected to be square. Works with both renderers.

    Type Declaration

    • Optionalposition?: number[]

      The position of the icon relative to the node or relationship. The position is a percentage of the node or relationship size. [1, 1] is the bottom right corner of the node or relationship. [-1, -1] is the top left corner of the node or relationship.

      [0, 0], the center of the node or relationship.

    • Optionalsize?: number

      The size of the icon relative to the node size or relationship caption size. The size is a percentage of the node size or relationship caption size.

      1, the same size as the node size or relationship caption size.

    • url: string

      The url to the icon.

    selected?: boolean

    Whether or not the current node or relationship is selected.

    to: string

    Node id where the relationship points to.

    type?: string

    The relationship type.

    width?: number

    The width of the relationship.