39 lines
873 B
TypeScript
39 lines
873 B
TypeScript
export type ChartsTextBaseline = 'hanging' | 'central' | 'auto' | 'text-after-edge' | 'text-before-edge';
|
|
export type ChartsTextAnchor = 'start' | 'middle' | 'end';
|
|
export interface ChartsTextStyle extends React.CSSProperties {
|
|
angle?: number;
|
|
/**
|
|
* The text baseline
|
|
* @default 'central'
|
|
*/
|
|
dominantBaseline?: ChartsTextBaseline;
|
|
/**
|
|
* The text anchor
|
|
* @default 'middle'
|
|
*/
|
|
textAnchor?: ChartsTextAnchor;
|
|
}
|
|
export interface GetWordsByLinesParams {
|
|
/**
|
|
* Text displayed.
|
|
*/
|
|
text: string;
|
|
/**
|
|
* Style applied to text elements.
|
|
*/
|
|
style?: ChartsTextStyle;
|
|
/**
|
|
* If `true`, the line width is computed.
|
|
* @default false
|
|
*/
|
|
needsComputation?: boolean;
|
|
}
|
|
export declare function getWordsByLines({
|
|
style,
|
|
needsComputation,
|
|
text
|
|
}: GetWordsByLinesParams): {
|
|
width: number;
|
|
height: number;
|
|
text: string;
|
|
}[]; |