@onesy/ui-react
Version:
UI for React
133 lines (132 loc) • 6.13 kB
TypeScript
import React from 'react';
import { TColorValues } from '@onesy/style-react';
import { ISurface } from '../Surface/Surface';
import { IStyle, IElementAny, IElement, IValueBreakpoints, IPropsAny, IColor } from '../types';
export declare type IChartValueValues = Array<any>;
export declare type IItemValue = {
value: number;
label: number;
percentage: number;
axis: 'x' | 'y';
props?: any;
};
export declare type IChartValue = {
color?: IColor;
tone?: TColorValues;
name?: string;
style?: IStyle;
percentage?: string | number;
values: IChartValueValues | Array<IChartValueValues>;
};
export declare type IChart = ISurface & {
title?: IElementAny;
subtitle?: IElementAny;
values?: Array<IChartValue>;
defs?: IElement;
pre?: IElement;
elements?: Array<{
item: IChartValue;
element?: IElement;
elements?: IElement;
}>;
names?: {
x?: string;
y?: string;
[property: string]: string;
};
nameX?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
nameY?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
tooltip?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
tooltipIndividually?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
tooltipCloseOnMouseLeave?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
elementTooltip?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
guidelines?: 'both' | 'vertical' | 'horizontal' | Partial<Record<IValueBreakpoints, 'both' | 'vertical' | 'horizontal'>>;
guidelinesAppend?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
guidelinesDisplayInactive?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
animate?: boolean;
animateTimeout?: number;
additionalLines?: IElement;
legend?: 'auto' | false | IElement | Partial<Record<IValueBreakpoints, 'auto' | false | IElement>>;
legendManageVisibility?: boolean;
legendPosition?: 'top' | 'bottom';
labels?: 'auto' | false | Array<{
value?: number;
label?: string | number;
}> | Partial<Record<IValueBreakpoints, 'auto' | false | Array<{
value?: number;
label?: string | number;
}>>>;
labelsX?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
labelsY?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
labelDecimalPlaces?: number | Partial<Record<IValueBreakpoints, number>>;
labelsAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
labelsYAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
labelsXAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
marks?: 'auto' | false | Array<{
value?: number;
}> | Partial<Record<IValueBreakpoints, 'auto' | false | Array<{
value?: number;
}>>>;
marksX?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
marksY?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
marksAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
marksYAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
marksXAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
grid?: 'auto' | false | Array<{
value?: number;
}> | Partial<Record<IValueBreakpoints, 'auto' | false | Array<{
value?: number;
}>>>;
gridX?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
gridY?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
gridAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
gridYAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
gridXAutoNumber?: number | Partial<Record<IValueBreakpoints, number>>;
points?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
pointsVisibility?: 'hover' | 'visible' | 'hidden' | Partial<Record<IValueBreakpoints, 'hover' | 'visible' | 'hidden'>>;
borders?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
borderStart?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
borderLeft?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
borderEnd?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
borderRight?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
borderTop?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
borderBottom?: boolean | Partial<Record<IValueBreakpoints, boolean>>;
minX?: number | Partial<Record<IValueBreakpoints, number>>;
maxX?: number | Partial<Record<IValueBreakpoints, number>>;
minY?: number | Partial<Record<IValueBreakpoints, number>>;
maxY?: number | Partial<Record<IValueBreakpoints, number>>;
minMaxPadding?: number | Partial<Record<IValueBreakpoints, number>>;
minPadding?: number | Partial<Record<IValueBreakpoints, number>>;
maxPadding?: number | Partial<Record<IValueBreakpoints, number>>;
minPaddingX?: number | Partial<Record<IValueBreakpoints, number>>;
minPaddingY?: number | Partial<Record<IValueBreakpoints, number>>;
maxPaddingX?: number | Partial<Record<IValueBreakpoints, number>>;
maxPaddingY?: number | Partial<Record<IValueBreakpoints, number>>;
minMax?: any;
noMain?: boolean;
tooltipRender?: (values: IChartValue) => any;
tooltipGroupRender?: (groups: Array<IChartValue>, groupsSorted: string[]) => any;
labelRender?: (value: IItemValue) => any;
labelResolve?: (value: number, axes: 'x' | 'y', item: IChartValue, version?: 'group' | 'individual') => string;
onUpdateRects?: (rects: {
wrapper: DOMRect;
svg: DOMRect;
}) => any;
SvgProps?: IPropsAny;
TypeProps?: IPropsAny;
TitleProps?: IPropsAny;
SubtitleProps?: IPropsAny;
PathProps?: IPropsAny;
PointsProps?: IPropsAny;
PointProps?: IPropsAny;
HeaderProps?: IPropsAny;
AppendProps?: IPropsAny;
AdditionalLineProps?: IPropsAny;
AdditionalLinesProps?: IPropsAny;
LegendProps?: IPropsAny;
LegendItemProps?: IPropsAny;
GuidelineProps?: IPropsAny;
WrapperProps?: IPropsAny;
};
declare const Chart: React.FC<IChart>;
export default Chart;