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-sdkOn 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
placementWhere the label's box is.
anchorXThe mark's x, in pixels.
anchorYThe mark's y, in pixels.
uThe environment's scale factor.
clearHow 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.