leaderLine

Returns the line from a mark to a label that has been carried away from it, or null when the two are close enough that no line is wanted.

@internote/canvas-sdkFunction
On this page
import { leaderLine } from '@internote/canvas-sdk';

The line starts clear of the mark's own ink and stops at the edge of the label's box, so it points at the words without touching either. null when the line would be shorter than the gaps at its ends.

#Signature

(
    placement: LabelBoxPlacement,
    anchorX: number,
    anchorY: number,
    u: number,
    clear?: number,
): {
    x1: number;
    y1: number;
    x2: number;
    y2: number;
} | null

#Parameters

placement
Where the label's box is.
anchorX
The mark's x, in pixels.
anchorY
The mark's y, in pixels.
u
The environment's scale factor.
clear
How far from the anchor the line begins, for a mark bigger than a dot. MARK_RADIUS times u by default.

Declared in packages/canvas-sdk/src/geometry/leader.ts:51.

Last updated