@samatawy/diagrams
    Preparing search index...

    Class ZOrder

    Handles z-ordering of nodes and layers in the diagram. This class is used by DiagramEditView to implement the z-ordering methods. The ZOrder class provides methods to reorder nodes and layers based on a specified action (bring forward, send backward, bring to front, send to back). It operates on the current selection of nodes or a specific layer/node as needed. The class ensures that any changes to the z-ordering are properly tracked for undo functionality and that the diagram is re-rendered to reflect the changes.

    Index

    Constructors

    • Creates an instance of ZOrder and attaches it to a DiagramView (e.g., DiagramEditView). This allows the ZOrder instance to manipulate the layers and nodes of the host diagram when reordering.

      Parameters

      • host: DiagramView

        The DiagramView instance to attach to, which provides access to the diagram's layers, selection, and rendering methods.

      Returns ZOrder

    Methods

    • Reorders the currently selected nodes based on the specified action. Changes are made to the attached host's layers and nodes, and the diagram is re-rendered to reflect the new z-ordering.

      Parameters

      • action: ZOrderAction

        The z-order action to perform (bring forward, send backward, bring to front, send to back).

      Returns void

    • Reorders the specified layer based on the given action. Changes are made to the attached host's layers, and the diagram is re-rendered to reflect the new z-ordering.

      Parameters

      • layer: string | ILayer

        The target layer or layer ID to reorder.

      • action: ZOrderAction

        The z-order action to perform (bring forward, send backward, bring to front, send to back).

      Returns void

    • Reorders the specified node based on the given action, confined within its layer. Changes are made to the attached host's layers, and the diagram is re-rendered to reflect the new z-ordering.

      Parameters

      • node: string | INode

        The target node or node ID to reorder.

      • action: ZOrderAction

        The z-order action to perform (bring forward, send backward, bring to front, send to back).

      Returns void