@samatawy/diagrams
    Preparing search index...

    Class SelectionBasics

    Provides basic selection logic for determining which nodes are selected based on a rectangular selection area. It supports both "include" mode (nodes fully inside the rectangle) and "touch" mode (nodes that intersect or are touched by the rectangle). The selection process takes into account the visibility of layers and samples points within the rectangle to find nodes that may be partially covered. This utility can be used in diagram editors to implement selection tools that allow users to select multiple nodes by dragging a selection box. The methods are designed to work with the diagram's coordinate system and grid to ensure accurate selection behavior.

    Index

    Constructors

    Methods

    • Returns the nodes within or touched by the specified rectangular area based on the selection mode.

      Parameters

      • diagram: SelectionDiagram

        The diagram containing the nodes and layers.

      • rect: IRect

        The rectangular area to check for node selection.

      • mode: "include" | "touch"

        The selection mode, either 'include' (nodes fully inside) or 'touch' (nodes intersecting).

      Returns INode[]

      An array of nodes that match the selection criteria.