Type Alias DucPointBinding

DucPointBinding: {
    elementId: DucBindableElement["id"];
    fixedPoint: FixedPoint | null;
    focus: number;
    gap: PrecisionValue;
    head: DucHead | null;
    point: { index: number; offset: number } | null;
}

Type declaration

  • elementId: DucBindableElement["id"]
  • fixedPoint: FixedPoint | null

    Represents a fixed point inside the bound element, defined as a normalized coordinate. This value is an array [x, y], where:

    • x (0.0 - 1.0) → The horizontal position inside the element (0 = left, 1 = right).

    • y (0.0 - 1.0) → The vertical position inside the element (0 = top, 1 = bottom). Unlike focus, fixedPoint ensures that the arrow stays pinned to a precise location inside the element, regardless of resizing or movement.

    • If fixedPoint is null, focus is used instead, meaning the arrow will attach dynamically to the edge.

    • If fixedPoint is set, it overrides focus, keeping the arrow attached to the exact specified point inside the element.

  • focus: number

    Determines where along the edge of the bound element the arrow endpoint should attach. This value ranges from -1 to 1:

    • -1 → Attaches to the far left (for horizontal edges) or top (for vertical edges).
    • 0 → Attaches to the exact center of the edge.
    • 1 → Attaches to the far right (for horizontal edges) or bottom (for vertical edges).

    Focus ensures that the arrow dynamically adjusts as the bound element moves, resizes, or rotates.

  • gap: PrecisionValue

    The gap distance between the bound element and the binding element.

  • head: DucHead | null
  • point: { index: number; offset: number } | null

    Represents a point within a DucLinearElement.

    The offset ranges from -1 to 1:

    • 0 corresponds to the actual point.
    • -1 and 1 represent the percentage of the distance between the point at index and the previous or next point in the points array, respectively.