Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 文档日常更新 & 网站导航增加周边生态 #2509

Merged
merged 2 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/manual/plots/area.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: Area
order: 5
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

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

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

## Area features

### Add median line annotations

- Add a median line to the area plot by using `annotations`.

<playground path="component/annotation/demo/area-with-line-annotation.ts" rid="area-line-annotations"></playground>

</div>
18 changes: 15 additions & 3 deletions docs/manual/plots/area.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: 面积图
order: 5
contributors:
[{ author: '新茗', github: 'visiky', avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg' }]
---

<div class="manual-docs">
Expand Down Expand Up @@ -96,8 +98,10 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/360c3eae-0c73-46f0-a982-4746a609
data,
xField: 'timePeriod',
yField: 'value',
xAxis: {
range: [0, 1],
meta: {
timePeriod: {
range: [0, 1],
},
},
});
area.render();
Expand All @@ -110,4 +114,12 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/360c3eae-0c73-46f0-a982-4746a609

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

</div>
## 面积图特性

### 添加中位线标注

- 通过 `annotations` 可以给面积图增加图表标注

<playground path="component/annotation/demo/area-with-line-annotation.ts" rid="area-line-annotations"></playground>

</div>
8 changes: 8 additions & 0 deletions docs/manual/plots/bar.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: Bar
order: 3
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
8 changes: 8 additions & 0 deletions docs/manual/plots/bar.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: 条形图
order: 3
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
8 changes: 8 additions & 0 deletions docs/manual/plots/column.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: Column
order: 1
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
8 changes: 8 additions & 0 deletions docs/manual/plots/column.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: 柱状图
order: 1
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
8 changes: 8 additions & 0 deletions docs/manual/plots/gauge.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: Gauge
order: 6
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
8 changes: 8 additions & 0 deletions docs/manual/plots/gauge.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: 仪表盘
order: 6
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
8 changes: 8 additions & 0 deletions docs/manual/plots/line.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: Line
order: 0
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
8 changes: 8 additions & 0 deletions docs/manual/plots/line.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: 折线图
order: 0
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
15 changes: 14 additions & 1 deletion docs/manual/plots/liquid.en.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
---
title: Liquid
order: 10
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">

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

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

</div>
</div>

## Blog posts

- [如何绘制一个星星形状的水波图 🌟](https://www.yuque.com/antv/g2plot/vww7eq#zK8bt)
12 changes: 12 additions & 0 deletions docs/manual/plots/liquid.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: 水波图
order: 10
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

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

</div>

## 博客文章

- [如何绘制一个星星形状的水波图 🌟](https://www.yuque.com/antv/g2plot/vww7eq#zK8bt)
8 changes: 8 additions & 0 deletions docs/manual/plots/scatter.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: Scatter
order: 20
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
8 changes: 8 additions & 0 deletions docs/manual/plots/scatter.zh.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: 散点图
order: 20
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">
Expand Down
9 changes: 9 additions & 0 deletions docs/manual/plots/waterfall.en.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
---
title: Waterfall
order: 9
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">

<div data-card-type="block" data-lake-card="table" id="pLwYV" class="">
Expand Down
9 changes: 9 additions & 0 deletions docs/manual/plots/waterfall.zh.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
---
title: 瀑布图
order: 9
contributors:
[
{
author: '新茗',
github: 'visiky',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg',
},
]
---

<div class="manual-docs">

<div data-card-type="block" data-lake-card="table" id="pLwYV" class="">
Expand Down
44 changes: 44 additions & 0 deletions examples/component/annotation/demo/area-with-line-annotation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Area } from '@antv/g2plot';

fetch('https://gw.alipayobjects.com/os/bmw-prod/1d565782-dde4-4bb6-8946-ea6a38ccf184.json')
.then((res) => res.json())
.then((data) => {
const plot = new Area('container', {
data,
padding: 'auto',
xField: 'Date',
yField: 'scales',
meta: {
Date: {
range: [0.02, 0.98],
},
},
yAxis: {
grid: null,
},
smooth: true,
annotations: [
{
type: 'line',
/** 起始位置 */
start: ['min', 'median'],
/** 结束位置 */
end: ['max', 'median'],
text: {
content: '中位线',
position: 'right',
offsetY: 18,
style: {
textAlign: 'right',
},
},
style: {
lineWidth: 0.5,
lineDash: [4, 4],
},
},
],
});

plot.render();
});
18 changes: 0 additions & 18 deletions examples/component/annotation/demo/line-annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,6 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/1d565782-dde4-4bb6-8946-ea6a38cc
},
smooth: true,
annotations: [
{
type: 'line',
/** 起始位置 */
start: ['min', 'median'],
/** 结束位置 */
end: ['max', 'median'],
text: {
content: '中位线',
position: 'right',
offsetY: 18,
style: {
textAlign: 'right',
},
},
style: {
lineDash: [4, 4],
},
},
{
type: 'line',
/** 起始位置 */
Expand Down
8 changes: 8 additions & 0 deletions examples/component/annotation/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*d8s-RrJb-xcAAAAAAAAAAAAAARQnAQ"
},
{
"filename": "area-with-line-annotation.ts",
"title": {
"zh": "带中位线标注的面积图",
"en": "Area with line annotation"
},
"screenshot": "https://gw.alipayobjects.com/zos/antfincdn/xSfk26S6da/2415772d-efc8-462a-846c-155dc15eb8cb.png"
},
{
"filename": "line-annotation1.ts",
"title": {
Expand Down
Loading