@samatawy/diagrams
    Preparing search index...

    Interface IDiagram

    IDiagram defines the main interface for a diagram, which includes nodes, layers, and a grid. It also includes methods for managing nodes and layers, as well as serialization and deserialization of the diagram. The diagram serves as the central data structure that holds all the information about the nodes, layers, and their relationships.

    interface IDiagram {
        id: string;
        nodes: INode[];
        groups?: IGroup[];
        layers: ILayer[];
        sheet_id?: string;
        background?: FillStyle;
        meta?: Record<string, unknown>;
        grid?: IGrid;
        node(id: string): INode | undefined;
        write(serializer: ISerializer): any;
        read(json: any, serializer: ISerializer): Promise<IDiagram>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    id: string

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

    nodes: INode[]

    An array of nodes that belong to the diagram, which represent the entities and elements that can be connected and manipulated within the diagram.

    groups?: IGroup[]

    An optional array of groups that belong to the diagram, which can be used to organize nodes into visual collections. Grouped nodes maintain their relative positions.

    layers: ILayer[]

    An array of layers that belong to the diagram, which can be used to organize nodes into different visual layers.

    sheet_id?: string

    An optional identifier for the sheet associated with the diagram, which can be used to apply specific styles and configurations to the diagram's nodes and connections.

    background?: FillStyle

    An optional background fill style for the diagram, which can be used to set the background color or gradient of the diagram area.

    meta?: Record<string, unknown>

    An optional metadata object for the diagram, which can be used to store additional information about the diagram that is not part of its core structure. This can include custom properties, annotations, or any other relevant data that is not related to diagram rendering.

    grid?: IGrid

    An optional grid configuration for the diagram, which defines the properties of the grid used for aligning and snapping nodes.

    Methods