import { Insets, LayoutRect, MeasureText, ThemeContext } from '../../../shared/kernel'; import { FontOptions, Pixels } from '../../../shared/options'; /** Label placements relative to a rectangle (bar, histogram, waterfall…). */ export type RectLabelPlacement = 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' | 'inner-top' | 'inner-bottom' | 'inner-left' | 'inner-right' | 'inner-top-left' | 'inner-top-right' | 'inner-bottom-left' | 'inner-bottom-right'; export interface PlacedRectLabel { x: number; y: number; align: CanvasTextAlign; baseline: CanvasTextBaseline; inside: boolean; } /** Font of a value label: series options over the theme default. */ export interface LabelFont { size: number; weight: string; family: string; } export declare function labelFont(options: FontOptions | undefined, theme: ThemeContext): LabelFont; /** * Room the labels of rectangular marks ask for outside the plot rect. Labels * placed inside their rectangle never reach further than the mark itself, so * only the outer placements count. */ export declare function rectLabelOverflow(marks: Array<{ rect: LayoutRect; text: string; }>, placement: RectLabelPlacement, font: LabelFont, plot: LayoutRect, measureText: MeasureText): Insets; /** Label coordinates and alignment; center and inner-… are inside the rectangle. */ export declare function placeRectLabel(placement: RectLabelPlacement, rect: { x: number; y: number; width: number; height: number; }, inset?: Pixels): PlacedRectLabel;