import * as React from 'react'; import { ReactElement, ReactNode, SVGProps } from 'react'; import { RenderableText, TextAnchor, TextVerticalAnchor } from './Text'; import { DataKey, PolarViewBoxRequired, TrapezoidViewBox, ViewBox } from '../util/types'; import { ZIndexable } from '../zIndex/ZIndexLayer'; import { CartesianLabelPosition } from '../cartesian/getCartesianPosition'; /** * @inline */ export type LabelContentType = ReactElement | ((props: Props) => RenderableText | ReactElement); type PolarLabelPosition = 'insideStart' | 'insideEnd' | 'end'; /** * @inline */ export type LabelPosition = CartesianLabelPosition | PolarLabelPosition; /** * @inline */ export type LabelFormatter = (label: RenderableText) => RenderableText; interface LabelProps extends ZIndexable { /** * The box of viewing area. Used for positioning. * If undefined, viewBox will be calculated based on surrounding context. */ viewBox?: ViewBox; parentViewBox?: ViewBox; /** * Function to customize how content is serialized before rendering. * * This should return a renderable text - something that the {@link Text} component can render. * Typically, a string or number. * Custom components are not supported here - use the `content` prop instead. */ formatter?: LabelFormatter; /** * The value of label can be set as children or as the `value` prop * * @example