Skip to content

Commit bdafeb0

Browse files
lxfu1liufu.lf
and
liufu.lf
authored
docs: 统一通用文档样式 (#1470)
* docs: 统一通用文档样式 * docs: 文档修改 Co-authored-by: liufu.lf <[email protected]>
1 parent 3c10eb5 commit bdafeb0

16 files changed

+420
-228
lines changed

docs/common/axis.en.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,13 @@ interface ComponentAnimateCfg {
174174
readonly delay?: number;
175175
}
176176
// 配置参考
177-
animateOption: {
178-
appear: ComponentAnimateCfg;
179-
update: ComponentAnimateCfg;
180-
enter: ComponentAnimateCfg;
181-
leave: ComponentAnimateCfg;
177+
{
178+
animateOption: {
179+
appear: ComponentAnimateCfg;
180+
update: ComponentAnimateCfg;
181+
enter: ComponentAnimateCfg;
182+
leave: ComponentAnimateCfg;
183+
}
182184
}
183185
```
184186

docs/common/axis.zh.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,13 @@ interface ComponentAnimateCfg {
174174
readonly delay?: number;
175175
}
176176
// 配置参考
177-
animateOption: {
178-
appear: ComponentAnimateCfg;
179-
update: ComponentAnimateCfg;
180-
enter: ComponentAnimateCfg;
181-
leave: ComponentAnimateCfg;
177+
{
178+
animateOption: {
179+
appear: ComponentAnimateCfg;
180+
update: ComponentAnimateCfg;
181+
enter: ComponentAnimateCfg;
182+
leave: ComponentAnimateCfg;
183+
}
182184
}
183185
```
184186

docs/common/chart-methods.en.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#### render() 📌
2+
3+
<description>**必选** </description>
4+
5+
功能描述:渲染图表。
6+
7+
默认配置:``
8+
9+
#### update()
10+
11+
<description>**可选** </description>
12+
13+
功能描述:更新图表配置项,配置覆盖,不会做差异比对。
14+
15+
默认配置:``
16+
17+
使用示例:
18+
19+
```ts
20+
plot.update({
21+
...currentConfig,
22+
legend: false,
23+
});
24+
```
25+
26+
#### changeData()
27+
28+
<description>**可选** </description>
29+
30+
功能描述:更新图表数据。`update()`方法会导致图形区域销毁并重建,如果只进行数据更新,而不涉及其他配置项更新,推荐使用本方法。。
31+
32+
默认配置:``
33+
34+
使用示例:
35+
36+
```ts
37+
plot.changeData(newData);
38+
```

docs/common/chart-methods.zh.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#### render() 📌
2+
3+
<description>**必选** </description>
4+
5+
功能描述:渲染图表。
6+
7+
默认配置:``
8+
9+
#### update()
10+
11+
<description>**可选** </description>
12+
13+
功能描述:更新图表配置项,配置覆盖,不会做差异比对。
14+
15+
默认配置:``
16+
17+
使用示例:
18+
19+
```ts
20+
plot.update({
21+
...currentConfig,
22+
legend: false,
23+
});
24+
```
25+
26+
#### changeData()
27+
28+
<description>**可选** </description>
29+
30+
功能描述:更新图表数据。`update()`方法会导致图形区域销毁并重建,如果只进行数据更新,而不涉及其他配置项更新,推荐使用本方法。。
31+
32+
默认配置:``
33+
34+
使用示例:
35+
36+
```ts
37+
plot.changeData(newData);
38+
```

docs/common/label.en.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212

1313
示例代码:
1414

15-
```js
16-
label: {
17-
style: {
18-
fill: 'red',
19-
opacity: 0.6,
20-
fontSize: 24
21-
},
22-
rotate: true
15+
```ts
16+
{
17+
label: {
18+
style: {
19+
fill: 'red',
20+
opacity: 0.6,
21+
fontSize: 24
22+
},
23+
rotate: true
24+
}
2325
}
2426
```

docs/common/label.zh.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212

1313
示例代码:
1414

15-
```js
16-
label: {
17-
style: {
18-
fill: 'red',
19-
opacity: 0.6,
20-
fontSize: 24
21-
},
22-
rotate: true
15+
```ts
16+
{
17+
label: {
18+
style: {
19+
fill: 'red',
20+
opacity: 0.6,
21+
fontSize: 24
22+
},
23+
rotate: true
24+
}
2325
}
2426
```

docs/common/line-style.en.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@
1414

1515
示例代码:
1616

17-
```js
18-
xAxis: {
19-
grid: {
20-
line: {
21-
style: {
22-
stroke: 'black',
23-
lineWidth: 2,
24-
lineDash: [4, 5],
25-
strokeOpacity: 0.7,
26-
shadowColor: 'black',
27-
shadowBlur: 10,
28-
shadowOffsetX: 5,
29-
shadowOffsetY: 5,
30-
cursor: 'pointer'
17+
```ts
18+
{
19+
xAxis: {
20+
grid: {
21+
line: {
22+
style: {
23+
stroke: 'black',
24+
lineWidth: 2,
25+
lineDash: [4, 5],
26+
strokeOpacity: 0.7,
27+
shadowColor: 'black',
28+
shadowBlur: 10,
29+
shadowOffsetX: 5,
30+
shadowOffsetY: 5,
31+
cursor: 'pointer'
32+
}
3133
}
3234
}
3335
}

docs/common/line-style.zh.md

+16-14
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@
1414

1515
示例代码:
1616

17-
```js
18-
xAxis: {
19-
grid: {
20-
line: {
21-
style: {
22-
stroke: 'black',
23-
lineWidth: 2,
24-
lineDash: [4, 5],
25-
strokeOpacity: 0.7,
26-
shadowColor: 'black',
27-
shadowBlur: 10,
28-
shadowOffsetX: 5,
29-
shadowOffsetY: 5,
30-
cursor: 'pointer'
17+
```ts
18+
{
19+
xAxis: {
20+
grid: {
21+
line: {
22+
style: {
23+
stroke: 'black',
24+
lineWidth: 2,
25+
lineDash: [4, 5],
26+
strokeOpacity: 0.7,
27+
shadowColor: 'black',
28+
shadowBlur: 10,
29+
shadowOffsetX: 5,
30+
shadowOffsetY: 5,
31+
cursor: 'pointer'
32+
}
3133
}
3234
}
3335
}

docs/common/shape-style.en.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
示例代码:
1919

20-
```js
20+
```ts
21+
{
2122
pointStyle: {
2223
fill: 'red',
2324
fillOpacity: 0.5,
@@ -31,4 +32,5 @@
3132
shadowOffsetY: 5,
3233
cursor: 'pointer'
3334
}
35+
}
3436
```

docs/common/shape-style.zh.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
示例代码:
1919

20-
```js
20+
```ts
21+
{
2122
pointStyle: {
2223
fill: 'red',
2324
fillOpacity: 0.5,
@@ -31,4 +32,5 @@
3132
shadowOffsetY: 5,
3233
cursor: 'pointer'
3334
}
35+
}
3436
```

docs/common/text-style.en.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@
2222

2323
示例代码,以 label.style 配置为例:
2424

25-
```js
26-
label: {
27-
style:{
28-
fontSize: 80,
29-
fontWeight: 300,
30-
textAlign: 'center',
31-
textBaseline: 'middle',
32-
shadowColor: 'white',
33-
shadowBlur: 10,
25+
```ts
26+
{
27+
label: {
28+
style:{
29+
fontSize: 80,
30+
fontWeight: 300,
31+
textAlign: 'center',
32+
textBaseline: 'middle',
33+
shadowColor: 'white',
34+
shadowBlur: 10,
35+
}
3436
}
3537
}
3638
```

docs/common/text-style.zh.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@
2222

2323
示例代码,以 label.style 配置为例:
2424

25-
```js
26-
label: {
27-
style:{
28-
fontSize: 80,
29-
fontWeight: 300,
30-
textAlign: 'center',
31-
textBaseline: 'middle',
32-
shadowColor: 'white',
33-
shadowBlur: 10,
25+
```ts
26+
{
27+
label: {
28+
style:{
29+
fontSize: 80,
30+
fontWeight: 300,
31+
textAlign: 'center',
32+
textBaseline: 'middle',
33+
shadowColor: 'white',
34+
shadowBlur: 10,
35+
}
3436
}
3537
}
3638
```

docs/common/tooltip.en.md

+19-22
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,18 @@
143143

144144
默认配置: ``
145145

146-
```js
147-
/** 通用对象 */
148-
export interface LooseObject {
149-
[key: string]: any;
150-
}
146+
```ts
151147
/** Tooltip 内容框的 css 样式定义 */
152-
export interface TooltipDomStyles {
153-
'g2-tooltip'?: LooseObject;
154-
'g2-tooltip-title'?: LooseObject;
155-
'g2-tooltip-list'?: LooseObject;
156-
'g2-tooltip-list-item'?: LooseObject;
157-
'g2-tooltip-marker'?: LooseObject;
158-
'g2-tooltip-value'?: LooseObject;
159-
'g2-tooltip-name'?: LooseObject;
148+
{
149+
domStyles: {
150+
'g2-tooltip'?: object;
151+
'g2-tooltip-title'?: object;
152+
'g2-tooltip-list'?: object;
153+
'g2-tooltip-list-item'?: object;
154+
'g2-tooltip-marker'?: object;
155+
'g2-tooltip-value'?: object;
156+
'g2-tooltip-name'?: object;
157+
}
160158
}
161159
```
162160

@@ -176,13 +174,12 @@ export interface TooltipDomStyles {
176174

177175
默认配置:``
178176

179-
```js
180-
const config = {
181-
tooltip: {
182-
customContent: (title, data) => {
183-
return `<div>${title}</div>`
184-
};
185-
}
186-
}
187-
177+
```ts
178+
{
179+
tooltip: {
180+
customContent: (title, data) => {
181+
return `<div>${title}</div>`;
182+
};
183+
}
184+
}
188185
```

0 commit comments

Comments
 (0)