🤖 Merge PR #47295 [react-svg-radar-chart] Fix issue with optional option props being required and improve docs by @afmotta

Fix issue with optional option props being required.
Improve docs.
This commit is contained in:
Alberto Francesco Motta 2020-09-24 16:41:44 +02:00 committed by GitHub
parent a54888ec50
commit 7df1be7bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
// Type definitions for react-svg-radar-chart 1.2
// Project: https://github.com/Spyna/react-svg-radar-chart
// Definitions by: Lukas Tutkus <https://github.com/luksys5>
// Alberto Francesco Motta <https://github.com/afmotta>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.5
@ -16,6 +17,8 @@ export interface ChartData {
export interface ChartOptionsProps {
/**
* set size
*
* overwritten by size prop on component
* @default 300
*/
size?: number;
@ -52,21 +55,25 @@ export interface ChartOptionsProps {
/** custom viewBox */
setViewBox?: (options: ChartOptionsProps) => number;
/** custom smoothing fn */
smoothing: (points: ReadonlyArray<[]>) => string;
axisProps: () => { className: string };
scaleProps: () => {
smoothing?: (points: ReadonlyArray<[]>) => string;
/** custom axis props */
axisProps?: () => { className: string };
/** custom scale props */
scaleProps?: () => {
className: string;
fill: string;
};
shapeProps: () => { className: string };
/** custom shape props */
shapeProps?: () => { className: string };
/** custom captions props */
captionProps: () => {
captionProps?: () => {
className: string;
textAnchor: string;
fontSize: number;
fontFamily: string;
};
dotProps: () => {
/** custom dot props */
dotProps?: () => {
className: string;
};
}
@ -80,4 +87,4 @@ export interface ChartProps {
options?: ChartOptionsProps;
}
export default class RadarChart extends React.Component<ChartProps> { }
export default class RadarChart extends React.Component<ChartProps> {}