libavoid-js
    Preparing search index...

    Interface ShapeConnectionPin

    A point on a shape or junction that connectors attach to. Created by shape.addPin / junction.addPin and removed with its shape or junction. To remove a single pin, call its delete(), which takes effect immediately.

    interface ShapeConnectionPin {
        delete(): void;
        "[dispose]"(): void;
        isDeleted(): boolean;
        isAliasOf(other: Handle): boolean;
        setConnectionCost(cost: number): void;
        position(): Point;
        directions(): number;
        setExclusive(exclusive: boolean): void;
        isExclusive(): boolean;
        updatePosition(position: PointLike): void;
    }

    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

    • Sets the cost (≥ 0) of attaching a connector to this pin. Among pins of the same class, cheaper pins are chosen first; without costs, the router chooses only by the length of the resulting route.

      Parameters

      • cost: number

      Returns void

      TypeError if cost is not a finite number, RangeError if it is negative.

    • Position on the parent shape's current polygon, or the junction's position.

      Returns Point

    • Directions connectors may leave the pin in.

      Returns number

    • Sets whether only one connector may attach to this pin; further connectors to the same class then use other pins. By default, pins with specific directions are exclusive and pins with ConnDirAll are not.

      Parameters

      • exclusive: boolean

      Returns void

    • Whether only one connector may attach to this pin; see setExclusive().

      Returns boolean

    • Moves a shape's pin. position is a new offset from the shape's top-left corner, interpreted like x/y of ShapeRef.addPin: a fraction of the size if the pin was created as proportional. Only for pins of shapes: a junction's pin is always at the junction's position.

      Parameters

      Returns void

      TypeError for a junction's pin.