supervision-js
    Preparing search index...

    Interface LabelDrawInstruction

    Renderer-neutral label drawing instruction.

    interface LabelDrawInstruction {
        rect: Rect;
        text: string;
        textStyle?: LabelTextStyle;
        background?: LabelBackgroundStyle;
        offsetX?: number;
        offsetY?: number;
        placement?: LabelPlacement;
        layout?: (
            bounds: Readonly<TopLeftRect>,
            viewportScale: number,
        ) => {
            x: number;
            y: number;
            background?: Pick<LabelBackgroundStyle, "topCornersOnly">;
        };
    }
    Index
    rect: Rect
    text: string
    textStyle?: LabelTextStyle
    offsetX?: number
    offsetY?: number
    placement?: LabelPlacement
    layout?: (
        bounds: Readonly<TopLeftRect>,
        viewportScale: number,
    ) => {
        x: number;
        y: number;
        background?: Pick<LabelBackgroundStyle, "topCornersOnly">;
    }

    Translate the measured, padded label after default placement. Bounds and returned x/y use media pixels; viewportScale maps media to display pixels. Both web and native renderers use the returned position for text and background. Return finite coordinates; invalid positions throw RangeError. Dimensions remain measured by the renderer. The optional background flag overrides corner rounding for this layout only.