[recharts] Improve Label props (#20016)

* Fix typo and is required

* Add new viewbox type

* Change tp correct contributor github link
This commit is contained in:
Roy Xue
2017-09-25 16:56:50 -07:00
committed by Mohamed Hegazy
parent ff00c165b3
commit c4cb9b4d0a
+15 -7
View File
@@ -2,7 +2,7 @@
// Project: http://recharts.org/
// Definitions by: Maarten Mulders <https://github.com/mthmulders>
// Raphael Mueller <https://github.com/rapmue>
// Roy Xue <https://github.com/xljroy>
// Roy Xue <https://github.com/royxue>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -664,10 +664,18 @@ export interface TextProps extends Partial<CSSStyleDeclaration> {
export class Text extends React.Component<TextProps> { }
export interface ViewBox {
x: number;
y: number;
width: number;
height: number;
x?: number;
y?: number;
width?: number;
height?: number;
}
export interface PolarViewBox {
cx?: number;
cy?: number;
innerRadius?: number;
outerRadius?: number;
startAngle?: number;
endAngle?: number;
}
export interface Coordinate {
x: number;
@@ -713,13 +721,13 @@ export interface TreemapProps {
}
export interface Label {
viewBox?: ViewBox;
viewBox?: ViewBox | PolarViewBox;
formatter?: RechartsFunction;
value: string | number;
position?: PositionType;
offset?: number;
content?: React.ReactElement<any> | RechartsFunction;
chilren: any;
children?: any;
}
export class Treemap extends React.Component<TreemapProps> { }