@samatawy/diagrams
    Preparing search index...

    Interface IConnection

    The IConnection interface defines the properties of a connection between nodes in the diagram, including the source and target anchors, arrow styles, and readiness state. It represents the relationships between nodes and is used to determine how nodes are connected and rendered in the diagram.

    interface IConnection {
        id: string;
        type: string;
        owner: IDiagram;
        points: IPoint[];
        text?: string;
        style_class?: string;
        textStyle?: TextStyle;
        image_id?: string;
        image_mode?: ImageMode;
        image_padding?: number;
        image_align?: ImageAlign;
        ready?: boolean;
        locked?: boolean;
        locked_aspect?: boolean;
        hollow?: boolean;
        invisible?: boolean;
        strokeStyle?: StrokeStyle;
        fillStyle?: FillStyle;
        shadowStyle?: ShadowStyle;
        opacity?: number;
        angle?: number;
        geometry?: Record<string, string | number | boolean>;
        specific?: Record<string, unknown>;
        meta?: Record<string, unknown>;
        from?: IConnectionAnchor;
        to?: IConnectionAnchor;
    }

    Hierarchy (View Summary)

    Index

    Properties

    id: string

    The unique identifier of the node, which is used to reference the node within the diagram and for serialization purposes.

    type: string

    The type of the node, which can be used to determine how the node is rendered and interacted with.

    owner: IDiagram

    A reference to the diagram that owns this node, which allows the node to access diagram-level information and functionality. This is typically set when the node is added to a diagram but not serialized.

    points: IPoint[]

    The points that define the geometry of the node, which can be used for rendering and for determining how connections attach to the node.

    text?: string

    The text content of the node, which can be displayed within the node's bounding box.

    style_class?: string

    The optional class name of the node, which can be used to apply specific styles or behaviors to the node based on its class.

    textStyle?: TextStyle

    The text style properties of the node, which can be used to control the appearance of the node's text, including font, size, color, alignment, and baseline.

    image_id?: string

    The ID of the image source stored in the diagram-level image_assets dictionary.

    image_mode?: ImageMode

    The mode for rendering the image within the node, which can be:

    • 'contain': The image is scaled to fit within the node's area while maintaining its aspect ratio.
    • 'cover': The image is scaled to cover the node's area while maintaining its aspect ratio.
    • 'pattern': The image is repeated to fill the node's area, creating a pattern effect.
    • 'fit': The image is drawn once within the node's bounding box, without scaling.
    • 'none': The image is not rendered within the node.
    image_padding?: number

    The padding in pixels between the image and the node's borders, used when mode is 'contain'.

    image_align?: ImageAlign

    Alignment of the image within the node, used when mode is 'contain'.

    ready?: boolean

    Indicates whether the node is ready to be rendered, which can be used to control the creation process and ensure that all necessary information is available before finalizing creation.

    locked?: boolean

    Indicates whether the node is locked, which can be used to prevent any modifications to the node's properties or geometry.

    locked_aspect?: boolean

    Indicates whether the node's aspect ratio is locked, which can be used to maintain the original proportions of the node when resizing.

    hollow?: boolean

    Indicates whether the whole area of the node is selectable or only its border.

    invisible?: boolean

    Indicates whether the node is invisible, which can be used to control the rendering style of the node.

    strokeStyle?: StrokeStyle

    The stroke style of the node, which can be used to control the color and pattern of the node's border.

    fillStyle?: FillStyle

    The fill style of the node, which can be used to control the color and pattern of the node's interior.

    shadowStyle?: ShadowStyle

    The shadow style of the node, which can be used to apply a shadow effect to the node.

    opacity?: number

    The opacity of the node, from 0 (fully transparent) to 100 (fully opaque). Defaults to 100 when not set.

    angle?: number

    The rotation angle of the node, which can be used to rotate the node around its center.

    geometry?: Record<string, string | number | boolean>

    An optional geometry object that can store additional geometric properties of the node, such as width, height, or other custom measurements. This can be used to extend the node's geometry beyond the basic points and provide more detailed control over its shape and size. The geometry object is a key-value map where keys are property names and values can be numbers, strings, or booleans. This allows for flexible storage of various geometric attributes that may be relevant to the node's rendering or interaction.

    specific?: Record<string, unknown>

    An optional specific object that can store additional properties specific to the node's type, allowing for customization and extension of the node's functionality but not related to its geometry.

    meta?: Record<string, unknown>

    An optional metadata object for the node, which can be used to store additional information about the node. This can include custom properties, annotations, or any other relevant data that is not related to the node's appearance.

    The source anchor of the connection, which specifies where the connection starts on the source node. It includes information about the node, handle, and optional offsets.

    The target anchor of the connection, which specifies where the connection ends on the target node. It includes information about the node, handle, and optional offsets.