weasel API - v0.8.0
    Preparing search index...

    Interface LassoSelectDep

    Adapter dep for lassoSelectAction.

    Provides polygon-lasso hit-testing + selection read/write. Consumers that don't implement hitTestLasso can omit it; the action falls back to a bounding-box AABB test via hitTestArea.

    interface LassoSelectDep {
        getSelection(): string[];
        hitTestArea(
            bounds: { height: number; width: number; x: number; y: number },
        ): string[];
        hitTestLasso?(
            polygon: readonly { x: number; y: number }[],
            mode: "centers" | "intersect" | "enclosed",
        ): string[];
        setSelection(ids: string[]): void;
    }
    Index

    Methods

    • Return ids of nodes whose AABB overlaps the given rect (fallback).

      Parameters

      • bounds: { height: number; width: number; x: number; y: number }

      Returns string[]

    • Hit-test against a closed polygon (vertex order CW or CCW; last→first closing edge is implicit). Returns matching node ids. Optional — when absent, lassoSelectAction falls back to AABB via hitTestArea.

      Parameters

      • polygon: readonly { x: number; y: number }[]
      • mode: "centers" | "intersect" | "enclosed"

      Returns string[]