Skip to content

Commit b216b5e

Browse files
authored
docs: 文档日常更新 & 网站导航增加周边生态 (#2509)
* docs: 文档增加贡献者 & 增加水波图的博客文章软链 * docs: 网站导航增加周边生态 & 补充面积图特性demo
1 parent 50999c3 commit b216b5e

20 files changed

+220
-26
lines changed

docs/manual/plots/area.en.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: Area
33
order: 5
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">
@@ -110,4 +118,12 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/360c3eae-0c73-46f0-a982-4746a609
110118

111119
🎨 For an overview of the area plot options see the [API reference](/en/docs/api/plots/area)
112120

121+
## Area features
122+
123+
### Add median line annotations
124+
125+
- Add a median line to the area plot by using `annotations`.
126+
127+
<playground path="component/annotation/demo/area-with-line-annotation.ts" rid="area-line-annotations"></playground>
128+
113129
</div>

docs/manual/plots/area.zh.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
title: 面积图
33
order: 5
4+
contributors:
5+
[{ author: '新茗', github: 'visiky', avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg' }]
46
---
57

68
<div class="manual-docs">
@@ -96,8 +98,10 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/360c3eae-0c73-46f0-a982-4746a609
9698
data,
9799
xField: 'timePeriod',
98100
yField: 'value',
99-
xAxis: {
100-
range: [0, 1],
101+
meta: {
102+
timePeriod: {
103+
range: [0, 1],
104+
},
101105
},
102106
});
103107
area.render();
@@ -110,4 +114,12 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/360c3eae-0c73-46f0-a982-4746a609
110114

111115
🎨 面积图详细的配置参考 [API 文档](/zh/docs/api/plots/area)
112116

113-
</div>
117+
## 面积图特性
118+
119+
### 添加中位线标注
120+
121+
- 通过 `annotations` 可以给面积图增加图表标注
122+
123+
<playground path="component/annotation/demo/area-with-line-annotation.ts" rid="area-line-annotations"></playground>
124+
125+
</div>

docs/manual/plots/bar.en.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: Bar
33
order: 3
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/bar.zh.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: 条形图
33
order: 3
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/column.en.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: Column
33
order: 1
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/column.zh.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: 柱状图
33
order: 1
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/gauge.en.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: Gauge
33
order: 6
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/gauge.zh.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: 仪表盘
33
order: 6
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/line.en.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: Line
33
order: 0
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/line.zh.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: 折线图
33
order: 0
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/liquid.en.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
---
22
title: Liquid
33
order: 10
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
13+
514
<div class="manual-docs">
615

716
<div data-card-type="block" data-lake-card="table" id="pLwYV" class="">
@@ -76,4 +85,8 @@ In addition to the built-in shapes, the liquid plot also supports custom graphic
7685

7786
<playground path='progress-plots/liquid/demo/outline-style.ts' rid='rect2'></playground>
7887

79-
</div>
88+
</div>
89+
90+
## Blog posts
91+
92+
- [如何绘制一个星星形状的水波图 🌟](https://www.yuque.com/antv/g2plot/vww7eq#zK8bt)

docs/manual/plots/liquid.zh.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: 水波图
33
order: 10
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">
@@ -78,3 +86,7 @@ liquidPlot.render();
7886
<playground path='progress-plots/liquid/demo/outline-style.ts' rid='rect2'></playground>
7987

8088
</div>
89+
90+
## 博客文章
91+
92+
- [如何绘制一个星星形状的水波图 🌟](https://www.yuque.com/antv/g2plot/vww7eq#zK8bt)

docs/manual/plots/scatter.en.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: Scatter
33
order: 20
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/scatter.zh.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: 散点图
33
order: 20
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
513

614
<div class="manual-docs">

docs/manual/plots/waterfall.en.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
---
22
title: Waterfall
33
order: 9
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
13+
514
<div class="manual-docs">
615

716
<div data-card-type="block" data-lake-card="table" id="pLwYV" class="">

docs/manual/plots/waterfall.zh.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
---
22
title: 瀑布图
33
order: 9
4+
contributors:
5+
[
6+
{
7+
author: '新茗',
8+
github: 'visiky',
9+
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
10+
},
11+
]
412
---
13+
514
<div class="manual-docs">
615

716
<div data-card-type="block" data-lake-card="table" id="pLwYV" class="">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { Area } from '@antv/g2plot';
2+
3+
fetch('https://gw.alipayobjects.com/os/bmw-prod/1d565782-dde4-4bb6-8946-ea6a38ccf184.json')
4+
.then((res) => res.json())
5+
.then((data) => {
6+
const plot = new Area('container', {
7+
data,
8+
padding: 'auto',
9+
xField: 'Date',
10+
yField: 'scales',
11+
meta: {
12+
Date: {
13+
range: [0.02, 0.98],
14+
},
15+
},
16+
yAxis: {
17+
grid: null,
18+
},
19+
smooth: true,
20+
annotations: [
21+
{
22+
type: 'line',
23+
/** 起始位置 */
24+
start: ['min', 'median'],
25+
/** 结束位置 */
26+
end: ['max', 'median'],
27+
text: {
28+
content: '中位线',
29+
position: 'right',
30+
offsetY: 18,
31+
style: {
32+
textAlign: 'right',
33+
},
34+
},
35+
style: {
36+
lineWidth: 0.5,
37+
lineDash: [4, 4],
38+
},
39+
},
40+
],
41+
});
42+
43+
plot.render();
44+
});

examples/component/annotation/demo/line-annotation.ts

-18
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,6 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/1d565782-dde4-4bb6-8946-ea6a38cc
1515
},
1616
smooth: true,
1717
annotations: [
18-
{
19-
type: 'line',
20-
/** 起始位置 */
21-
start: ['min', 'median'],
22-
/** 结束位置 */
23-
end: ['max', 'median'],
24-
text: {
25-
content: '中位线',
26-
position: 'right',
27-
offsetY: 18,
28-
style: {
29-
textAlign: 'right',
30-
},
31-
},
32-
style: {
33-
lineDash: [4, 4],
34-
},
35-
},
3618
{
3719
type: 'line',
3820
/** 起始位置 */

examples/component/annotation/demo/meta.json

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
},
1313
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*d8s-RrJb-xcAAAAAAAAAAAAAARQnAQ"
1414
},
15+
{
16+
"filename": "area-with-line-annotation.ts",
17+
"title": {
18+
"zh": "带中位线标注的面积图",
19+
"en": "Area with line annotation"
20+
},
21+
"screenshot": "https://gw.alipayobjects.com/zos/antfincdn/xSfk26S6da/2415772d-efc8-462a-846c-155dc15eb8cb.png"
22+
},
1523
{
1624
"filename": "line-annotation1.ts",
1725
"title": {

0 commit comments

Comments
 (0)