import React from 'react'; import { UnknownProperties, Intergalactic } from 'intergalactic/core'; import { PatternsConfig } from './Pattern'; type RadianData = { /** * Text label on the end of radian. */ label: string; /** * Radian key. Radian, which `key` is equal to `activeKey` is displayed as active. */ key: string; /** * Size of the cap (filled circle on the end of the radian). * @default 16 */ capSize?: number; /** * Icon, that displayed in the cap of the active radian (usage example `icon: UserM`). */ icon?: React.FC; /** * Color of radian's line, cap and label. * @default #008FF8 */ color?: string; /** * Color of icon. * @default #fff */ iconColor?: string; /** * Size of icon. * @default 16 */ iconSize?: number; }; /** @deprecated */ export interface IRadialTreeProps extends RadialTreeProps, UnknownProperties { } export type RadialTreeProps = { /** * List of radians. `{ label: string; key: string; capSize?: number; icon?: React.FC; color?: string; iconColor?: string; iconSize?: number; }` */ data?: RadianData[]; /** * Angel (in rads) that rotates chart. 0 means that first radian is exactly on top vertical line. * @default 0 */ angleOffset?: number; /** * Duration of appear and update animation. * @default 300 */ duration?: number; /** * Gap between the chart center and radians start point. * @default 50 */ centralMargin?: number; /** * Gap around text label. * @default 2 */ labelMargin?: number; /** * Color of all radian's line, cap and label. * @default #008FF8 */ color?: string; /** * Size of the cap (filled circle on the end of the radian). * @default 16 */ capSize?: number; /** * Icon, that displayed in the cap of the active radian (usage example `icon: UserM`). */ icon?: React.FC; /** * Color of icon. * @default #fff */ iconColor?: string; /** * Size of icon. * @default 16 */ iconSize?: number; /** * Text size in radians' labels. 1.5x is used as default text size of center text. * @default 14 */ textSize?: number; /** * Used to define the active radian in controlled way. Active radian is highlighted with inreased cap size. */ activeKey?: string | null; onActiveKeyChange?: (activeKey: string | null) => void; /** * Default value for `activeKey` property. */ defaultActiveKey?: string | null; /** Enables element transparency */ transparent?: boolean; }; /** @deprecated */ export interface IRadialTreeRadianProps extends RadialTreeRadianProps, UnknownProperties { } export type RadialTreeRadianProps = RadialTreeProps & { radiansCount?: number; textWidth?: number; onRadianClick?: (key: string) => (event: React.MouseEvent) => void; }; /** @deprecated */ export interface IRadialTreeRadianInteractiveAreaProps extends RadialTreeRadianInteractiveAreaProps { } export type RadialTreeRadianInteractiveAreaProps = { x1?: number; y1?: number; x2?: number; y2?: number; strokeWidth?: number; }; /** @deprecated */ export interface IRadialTreeRadianLineProps extends RadialTreeRadianLineProps, UnknownProperties { } export type RadialTreeRadianLineProps = { x1?: number; y1?: number; x2?: number; y2?: number; stroke?: string; transparent?: boolean; ['data-radial-animation']?: `${string}-line`; ['data-radian-index']?: number; }; type RadialTreeRadianLineAsProps = IRadialTreeRadianLineProps & { Element: React.FC<{ render: string; transparent: boolean; } & React.SVGProps>; styles: React.CSSProperties; resolveColor: (color?: string) => string; }; declare const Line: React.FC; /** @deprecated */ export interface IRadialTreeRadianCapProps extends RadialTreeRadianCapProps, UnknownProperties { } export type RadialTreeRadianCapProps = { x?: number; y?: number; radius?: number; color?: string; transparent?: boolean; ['data-radial-animation']?: `${string}-cap-circle`; ['data-radian-index']?: number; /** Enables charts patterns that enhances charts accessibility */ patterns?: PatternsConfig; }; type RadialTreeRadianCapAsProps = RadialTreeRadianCapProps & { Element: React.FC<{ render: React.FC | string; transparent: boolean; patternKey?: string; pattern?: boolean; } & React.SVGProps>; styles: React.CSSProperties; resolveColor: (color?: string) => string; }; declare const Cap: React.FC; /** @deprecated */ export interface IRadialTreeRadianIconProps extends RadialTreeRadianIconProps, UnknownProperties { } export type RadialTreeRadianIconProps = { x?: number; y?: number; iconSize?: number; color?: string; ['data-radial-animation']?: `${string}-cap-icon`; ['data-radian-index']?: number; isActive?: boolean; transparent?: boolean; }; type RadialTreeRadianIconAsProps = IRadialTreeRadianIconProps & { Element: React.FC<{ render: string | React.FC; transparent: boolean; } & React.SVGProps>; x: number; y: number; iconSize: number; styles: React.CSSProperties; tag?: React.FC; }; declare const Icon: React.FC; /** @deprecated */ export interface IRadialTreeRadianLabelProps extends RadialTreeRadianLabelProps, UnknownProperties { } export type RadialTreeRadianLabelProps = { x?: number; y?: number; color?: string; textSize?: number; ['data-radial-animation']?: `${string}-label`; ['data-radian-index']?: number; label?: string; isHorizontal?: boolean; angle?: number; transparent?: boolean; }; type RadialTreeRadianLabelAsProps = IRadialTreeRadianLabelProps & { Element: React.FC<{ render: string; } & React.SVGProps>; Children: React.FC; styles: React.CSSProperties; x: number; y: number; angle: number; textSize: number; resolveColor: (color?: string) => string; }; declare const Label: React.FC; /** @deprecated */ export interface IRadialTreeTitleProps extends RadialTreeTitleProps, UnknownProperties { } export type RadialTreeTitleProps = { x?: number; y?: number; textSize?: number; ['data-radial-animation']?: `${string}-label`; color?: string; }; type IntergalacticD3Component = ((props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive; declare const RadialTree: ((props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<"g", "g", RadialTreeProps, {}, {}> & { Title: IntergalacticD3Component<'text', RadialTreeTitleProps>; Radian: IntergalacticD3Component<'g', RadialTreeRadianProps> & { Line: IntergalacticD3Component<'line', RadialTreeRadianLineProps>; Cap: IntergalacticD3Component<'circle', RadialTreeRadianCapProps>; Icon: IntergalacticD3Component<'g', RadialTreeRadianIconProps>; Label: IntergalacticD3Component<'text', RadialTreeRadianLabelProps>; }; }; export default RadialTree;