Commit c98fa719 authored by jim chen's avatar jim chen Committed by niko

修改错误的图表文档. 增加几处漏写的文档 (#308)

* 增加AvatarList d.ts说明文件

* 修改 axis的链接 , g2修改了新的官网

* AvatarList 增加判断是否为必须属性

* 删除无用的空行.  优化格式

* 修改错误的图表文档. 增加几处漏写的文档

* 添加图表的 描述文件chart.d.ts

* 改了个错别字!

* 增加CountDown d.ts描述文件

* 增加 DescriptionList  d.ts描述文件
parent 2dfe10fd
import React from "react";
export interface BarProps {
title: string | React.ReactNode;
color?: string;
margin?: [number, number, number, number];
height: number;
data: Array<{
x: string;
y: number;
}>;
autoLabel?: boolean;
}
export default class Bar extends React.Component<BarProps, any> {}
import React from "react";
export interface ChartCardProps {
title: string | React.ReactNode;
action?: React.ReactNode;
total?: React.ReactNode | number;
footer?: React.ReactNode;
contentHeight: number;
avatar?: React.ReactNode;
}
export default class ChartCard extends React.Component<ChartCardProps, any> {}
import React from "react";
export interface FieldProps {
label: string | React.ReactNode;
value: string | React.ReactNode;
}
export default class Field extends React.Component<FieldProps, any> {}
import React from "react";
export interface GaugeProps {
title: string | React.ReactNode;
color?: string;
height: number;
bgColor?: number;
percent: number;
}
export default class Gauge extends React.Component<GaugeProps, any> {}
import React from "react";
// g2已经更新到3.0
// 不带的写了
export interface Axis {
title: any;
line: any;
gridAlign: any;
labels: any;
tickLine: any;
grid: any;
}
export interface MiniAreaProps {
color?: string;
height: number;
borderColor?: string;
line?: boolean;
animate?: boolean;
xAxis?: Axis;
yAxis?: Axis;
data: Array<{
x: number;
y: number;
}>;
}
export default class MiniArea extends React.Component<MiniAreaProps, any> {}
import React from "react";
export interface MiniBarProps {
color?: string;
height: number;
data: Array<{
x: number;
y: number;
}>;
}
export default class MiniBar extends React.Component<MiniBarProps, any> {}
import React from "react";
export interface MiniProgressProps {
target: number;
color?: string;
strokeWidth: number;
percent: number;
}
export default class MiniProgress extends React.Component<
MiniProgressProps,
any
> {}
import React from "react";
export interface PieProps {
animate?: boolean;
color?: string;
height: number;
hasLegend?: boolean;
margin?: [number, number, number, number];
percent?: number;
data?: Array<{
x: string;
y: number;
}>;
total?: string;
title?: string | React.ReactNode;
tooltip?: boolean;
valueFormat?: (value: string) => string;
subTitle?: string | React.ReactNode;
}
export default class Pie extends React.Component<PieProps, any> {}
import React from "react";
export interface RadarProps {
title?: string | React.ReactNode;
height: number;
margin?: [number, number, number, number];
hasLegend?: boolean;
data: Array<{
name: string;
label: string;
value: string;
}>;
}
export default class Radar extends React.Component<RadarProps, any> {}
import React from "react";
export interface TagCloudProps {
data: Array<{
name: string;
value: number;
}>;
height: number;
}
export default class TagCloud extends React.Component<TagCloudProps, any> {}
import React from "react";
export interface TimelineChartProps {
data: Array<{
x: string;
y1: string;
y2: string;
}>;
titleMap: { y1: string; y2: string };
height?: number;
}
export default class TimelineChart extends React.Component<
TimelineChartProps,
any
> {}
import React from "react";
export interface WaterWaveProps {
title: string | React.ReactNode;
color?: string;
height: number;
percent: number;
}
export default class WaterWave extends React.Component<WaterWaveProps, any> {}
export { default as numeral } from "numeral";
export { default as ChartCard } from "./ChartCard";
export { default as Bar } from "./Bar";
export { default as Pie } from "./Pie";
export { default as Radar } from "./Radar";
export { default as Gauge } from "./Gauge";
export { default as MiniArea } from "./MiniArea";
export { default as MiniBar } from "./MiniBar";
export { default as MiniProgress } from "./MiniProgress";
export { default as Field } from "./Field";
export { default as WaterWave } from "./WaterWave";
export { default as TagCloud } from "./TagCloud";
export { default as TimelineChart } from "./TimelineChart";
declare const yuan: (value: number | string) => string;
export { yuan };
...@@ -22,7 +22,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -22,7 +22,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
| total | 数据总量 | ReactNode \| number | - | | total | 数据总量 | ReactNode \| number | - |
| footer | 卡片底部 | ReactNode | - | | footer | 卡片底部 | ReactNode | - |
| contentHeight | 内容区域高度 | number | - | | contentHeight | 内容区域高度 | number | - |
| avatar | 右侧图标 | React.ReactNode | - |
### MiniBar ### MiniBar
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
...@@ -76,7 +76,9 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -76,7 +76,9 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
| percent | 占比 | number | - | | percent | 占比 | number | - |
| tooltip | 是否显示 tooltip | boolean | true | | tooltip | 是否显示 tooltip | boolean | true |
| valueFormat | 显示值的格式化函数 | function | - | | valueFormat | 显示值的格式化函数 | function | - |
| subTitle | 图表子标题 | ReactNode\|string | - | | title | 图表标题 | ReactNode|string | - |
| subTitle | 图表子标题 | ReactNode|string | - |
| total | 图标中央的总数 | string | - |
### Radar ### Radar
...@@ -86,6 +88,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -86,6 +88,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| hasLegend | 是否显示 legend | boolean | `false` | | hasLegend | 是否显示 legend | boolean | `false` |
| margin | 图表内部间距 | array | \[24, 30, 16, 30\] | | margin | 图表内部间距 | array | \[24, 30, 16, 30\] |
| data | 图标数据 | array<{name,label,value}> | - |
### Gauge ### Gauge
...@@ -94,7 +97,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -94,7 +97,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
| title | 图表标题 | ReactNode\|string | - | | title | 图表标题 | ReactNode\|string | - |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| color | 图表颜色 | string | `#2F9CFF` | | color | 图表颜色 | string | `#2F9CFF` |
| bgColor | 图表北京颜色 | string | `#F0F2F5` | | bgColor | 图表背景颜色 | string | `#F0F2F5` |
| percent | 进度比例 | number | - | | percent | 进度比例 | number | - |
### WaterWave ### WaterWave
...@@ -110,7 +113,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -110,7 +113,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| |----------|------------------------------------------|-------------|-------|
| tags | 标题 | Array<name, value\> | - | | data | 标题 | Array<name, value\> | - |
| height | 高度值 | number | - | | height | 高度值 | number | - |
### TimelineChart ### TimelineChart
......
import React from "react";
export interface CountDownProps {
format?: (time: number) => void;
target: Date | number;
onEnd?: () => void;
style?: React.CSSProperties;
}
export default class CountDown extends React.Component<CountDownProps, any> {}
...@@ -12,3 +12,4 @@ Simple CountDown Component. ...@@ -12,3 +12,4 @@ Simple CountDown Component.
|----------|------------------------------------------|-------------|-------| |----------|------------------------------------------|-------------|-------|
| format | Formatter of time | Function(time) | | | format | Formatter of time | Function(time) | |
| target | Target time | Date | - | | target | Target time | Date | - |
| onEnd | Countdown to the end callback | funtion | -|
...@@ -13,3 +13,4 @@ order: 3 ...@@ -13,3 +13,4 @@ order: 3
|----------|------------------------------------------|-------------|-------| |----------|------------------------------------------|-------------|-------|
| format | 时间格式化显示 | Function(time) | | | format | 时间格式化显示 | Function(time) | |
| target | 目标时间 | Date | - | | target | 目标时间 | Date | - |
| onEnd | 倒计时结束回调 | funtion | -|
import React from "react";
export interface DescriptionListProps {
layout?: "horizontal" | "vertical";
col?: number;
title: React.ReactNode;
gutter?: number;
size?: "large" | "small";
}
declare class Description extends React.Component<
{
term: React.ReactNode;
},
any
> {}
export default class DescriptionList extends React.Component<
DescriptionListProps,
any
> {
static Description: typeof Description;
}
...@@ -19,7 +19,7 @@ order: 4 ...@@ -19,7 +19,7 @@ order: 4
| col | 指定信息最多分几列展示,最终一行几列由 col 配置结合[响应式规则](/components/DescriptionList#响应式规则)决定 | number(0 < col <= 4) | 3 | | col | 指定信息最多分几列展示,最终一行几列由 col 配置结合[响应式规则](/components/DescriptionList#响应式规则)决定 | number(0 < col <= 4) | 3 |
| title | 列表标题 | ReactNode | - | | title | 列表标题 | ReactNode | - |
| gutter | 列表项间距,单位为 `px` | number | 32 | | gutter | 列表项间距,单位为 `px` | number | 32 |
| size | 列表型号,可以设置为 `large` `small` | string | - | | size | 列表型号,可以设置为 `large` `small` | Enum{'large', 'small'} | - |
#### 响应式规则 #### 响应式规则
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment