libavoid-js
    Preparing search index...

    Interface ConnRef

    A connector between two ends, routed around obstacles. Created by router.addConnector.

    interface ConnRef {
        delete(): void;
        "[dispose]"(): void;
        isDeleted(): boolean;
        isAliasOf(other: Handle): boolean;
        id(): number;
        setSource(end: ConnEndLike): void;
        setDest(end: ConnEndLike): void;
        displayRoute(): Point[];
        setRoutingCheckpoints(checkpoints: readonly CheckpointLike[]): void;
        routingCheckpoints(): Checkpoint[];
        setCallback(callback: ConnRefCallback): void;
        routingType(): ConnTypeValue;
        setRoutingType(type: ConnTypeValue): void;
        setHateCrossings(value: boolean): void;
        doesHateCrossings(): boolean;
        hasValidRoute(): boolean;
        hasCrossingObstacles(): boolean;
    }

    Hierarchy (View Summary)

    Index
    • For the router: frees it and everything added to it. For other objects: removes the object. Shapes, junctions and connectors are removed through their router, like router.deleteShape(shape), with the same restrictions; a pin is removed from its shape or junction immediately. Everything the object owns goes with it. Using the object afterwards throws.

      Returns void

    • True once the object was freed, whether by its own delete() or by deleting its owner (e.g. a pin's shape, or the router).

      Returns boolean

    • The unique id: options.id given when it was added, or one assigned by the router.

      Returns number

    • The current route from source to destination, as a new array. Updated by processTransaction().

      Returns Point[]

    • Sets points the route must pass through, in order. A checkpoint inside an obstacle is skipped. Replaces the previous checkpoints; pass [] to remove them. Takes effect at the next processTransaction().

      Parameters

      Returns void

    • Sets a function called each time processTransaction() re-routes this connector, e.g. to redraw it. Replaces the previous callback.

      Parameters

      Returns void

    • How the connector is routed: ConnType_PolyLine (straight segments in any direction) or ConnType_Orthogonal (horizontal and vertical segments only).

      Returns ConnTypeValue

    • Sets how the connector is routed. If the router does not support the type (see the RouterFlag values given to the Router constructor), it uses a type it supports instead. Takes effect at the next processTransaction().

      Parameters

      Returns void

      TypeError or RangeError if type is not a ConnType value.

    • Stores a flag that currently has no effect on routing(will be fixed in future versions, now it is just a part of designed public API). To make routes avoid crossings, set the crossingPenalty routing parameter.

      Parameters

      • value: boolean

      Returns void

      libavoid: ConnRef::setHateCrossings stores the flag, but the router never reads it.

    • The flag set by setHateCrossings().

      Returns boolean

    • False if the router found no route and fell back to a straight line between the ends, e.g. because obstacles block every path or pin directions rule them out. A valid route may still cross obstacles: see hasCrossingObstacles(). Meaningful after processTransaction().

      Returns boolean

    • True if the current route crosses at least one obstacle. Meaningful after processTransaction().

      Returns boolean