From 76c109d46c2e6cf1934cbd87f57be656748cded9 Mon Sep 17 00:00:00 2001 From: visiky <736929286@qq.com> Date: Wed, 21 Apr 2021 10:34:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20=E6=96=87=E6=A1=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=B4=A1=E7=8C=AE=E8=80=85=20&=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B0=B4=E6=B3=A2=E5=9B=BE=E7=9A=84=E5=8D=9A=E5=AE=A2=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E8=BD=AF=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/manual/plots/area.en.md | 8 ++++++++ docs/manual/plots/area.zh.md | 8 ++++++++ docs/manual/plots/bar.en.md | 8 ++++++++ docs/manual/plots/bar.zh.md | 8 ++++++++ docs/manual/plots/column.en.md | 8 ++++++++ docs/manual/plots/column.zh.md | 8 ++++++++ docs/manual/plots/gauge.en.md | 8 ++++++++ docs/manual/plots/gauge.zh.md | 8 ++++++++ docs/manual/plots/line.en.md | 8 ++++++++ docs/manual/plots/line.zh.md | 8 ++++++++ docs/manual/plots/liquid.en.md | 15 ++++++++++++++- docs/manual/plots/liquid.zh.md | 12 ++++++++++++ docs/manual/plots/scatter.en.md | 8 ++++++++ docs/manual/plots/scatter.zh.md | 8 ++++++++ docs/manual/plots/waterfall.en.md | 9 +++++++++ docs/manual/plots/waterfall.zh.md | 9 +++++++++ 16 files changed, 140 insertions(+), 1 deletion(-) diff --git a/docs/manual/plots/area.en.md b/docs/manual/plots/area.en.md index e97d3c4748..cf1bb228ca 100644 --- a/docs/manual/plots/area.en.md +++ b/docs/manual/plots/area.en.md @@ -1,6 +1,14 @@ --- title: Area order: 5 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/area.zh.md b/docs/manual/plots/area.zh.md index 5266b0f6d5..df768bb50f 100644 --- a/docs/manual/plots/area.zh.md +++ b/docs/manual/plots/area.zh.md @@ -1,6 +1,14 @@ --- title: 面积图 order: 5 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/bar.en.md b/docs/manual/plots/bar.en.md index 0806524e1a..299e44fad2 100644 --- a/docs/manual/plots/bar.en.md +++ b/docs/manual/plots/bar.en.md @@ -1,6 +1,14 @@ --- title: Bar order: 3 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/bar.zh.md b/docs/manual/plots/bar.zh.md index a2c89b1014..fe602b6b34 100644 --- a/docs/manual/plots/bar.zh.md +++ b/docs/manual/plots/bar.zh.md @@ -1,6 +1,14 @@ --- title: 条形图 order: 3 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/column.en.md b/docs/manual/plots/column.en.md index 054d48968b..3fd4770ecc 100644 --- a/docs/manual/plots/column.en.md +++ b/docs/manual/plots/column.en.md @@ -1,6 +1,14 @@ --- title: Column order: 1 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/column.zh.md b/docs/manual/plots/column.zh.md index 42535c298f..3214b41198 100644 --- a/docs/manual/plots/column.zh.md +++ b/docs/manual/plots/column.zh.md @@ -1,6 +1,14 @@ --- title: 柱状图 order: 1 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/gauge.en.md b/docs/manual/plots/gauge.en.md index 1449d872ca..5445d07954 100644 --- a/docs/manual/plots/gauge.en.md +++ b/docs/manual/plots/gauge.en.md @@ -1,6 +1,14 @@ --- title: Gauge order: 6 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/gauge.zh.md b/docs/manual/plots/gauge.zh.md index 69e4fbcc51..c83826dd28 100644 --- a/docs/manual/plots/gauge.zh.md +++ b/docs/manual/plots/gauge.zh.md @@ -1,6 +1,14 @@ --- title: 仪表盘 order: 6 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/line.en.md b/docs/manual/plots/line.en.md index 2f3952024a..aad3f4d677 100644 --- a/docs/manual/plots/line.en.md +++ b/docs/manual/plots/line.en.md @@ -1,6 +1,14 @@ --- title: Line order: 0 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/line.zh.md b/docs/manual/plots/line.zh.md index 72dd491060..138d3ded21 100644 --- a/docs/manual/plots/line.zh.md +++ b/docs/manual/plots/line.zh.md @@ -1,6 +1,14 @@ --- title: 折线图 order: 0 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/liquid.en.md b/docs/manual/plots/liquid.en.md index 467c38e442..94bc279b04 100644 --- a/docs/manual/plots/liquid.en.md +++ b/docs/manual/plots/liquid.en.md @@ -1,7 +1,16 @@ --- title: Liquid order: 10 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] --- +
@@ -76,4 +85,8 @@ In addition to the built-in shapes, the liquid plot also supports custom graphic -
\ No newline at end of file +
+ +## Blog posts + +- [如何绘制一个星星形状的水波图 🌟](https://www.yuque.com/antv/g2plot/vww7eq#zK8bt) \ No newline at end of file diff --git a/docs/manual/plots/liquid.zh.md b/docs/manual/plots/liquid.zh.md index dac731cddf..d5e169c460 100644 --- a/docs/manual/plots/liquid.zh.md +++ b/docs/manual/plots/liquid.zh.md @@ -1,6 +1,14 @@ --- title: 水波图 order: 10 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
@@ -78,3 +86,7 @@ liquidPlot.render();
+ +## 博客文章 + +- [如何绘制一个星星形状的水波图 🌟](https://www.yuque.com/antv/g2plot/vww7eq#zK8bt) \ No newline at end of file diff --git a/docs/manual/plots/scatter.en.md b/docs/manual/plots/scatter.en.md index cf6059743a..013b8dcf0f 100644 --- a/docs/manual/plots/scatter.en.md +++ b/docs/manual/plots/scatter.en.md @@ -1,6 +1,14 @@ --- title: Scatter order: 20 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/scatter.zh.md b/docs/manual/plots/scatter.zh.md index bc84c5fa8c..ca10751796 100644 --- a/docs/manual/plots/scatter.zh.md +++ b/docs/manual/plots/scatter.zh.md @@ -1,6 +1,14 @@ --- title: 散点图 order: 20 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] ---
diff --git a/docs/manual/plots/waterfall.en.md b/docs/manual/plots/waterfall.en.md index f004987082..a7cbb2ef36 100644 --- a/docs/manual/plots/waterfall.en.md +++ b/docs/manual/plots/waterfall.en.md @@ -1,7 +1,16 @@ --- title: Waterfall order: 9 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] --- +
diff --git a/docs/manual/plots/waterfall.zh.md b/docs/manual/plots/waterfall.zh.md index 1f7883ff55..a79c874105 100644 --- a/docs/manual/plots/waterfall.zh.md +++ b/docs/manual/plots/waterfall.zh.md @@ -1,7 +1,16 @@ --- title: 瀑布图 order: 9 +contributors: + [ + { + author: '新茗', + github: 'visiky', + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', + }, + ] --- +
From 14679d5591e0b96fc7499f5e15fae90064b1e86a Mon Sep 17 00:00:00 2001 From: visiky <736929286@qq.com> Date: Wed, 21 Apr 2021 11:10:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=E7=BD=91=E7=AB=99=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E5=A2=9E=E5=8A=A0=E5=91=A8=E8=BE=B9=E7=94=9F=E6=80=81?= =?UTF-8?q?=20&=20=E8=A1=A5=E5=85=85=E9=9D=A2=E7=A7=AF=E5=9B=BE=E7=89=B9?= =?UTF-8?q?=E6=80=A7demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/manual/plots/area.en.md | 8 ++++ docs/manual/plots/area.zh.md | 24 +++++----- .../demo/area-with-line-annotation.ts | 44 +++++++++++++++++++ .../annotation/demo/line-annotation.ts | 18 -------- examples/component/annotation/demo/meta.json | 8 ++++ gatsby-config.js | 17 +++++-- 6 files changed, 87 insertions(+), 32 deletions(-) create mode 100644 examples/component/annotation/demo/area-with-line-annotation.ts diff --git a/docs/manual/plots/area.en.md b/docs/manual/plots/area.en.md index cf1bb228ca..f42bff6bce 100644 --- a/docs/manual/plots/area.en.md +++ b/docs/manual/plots/area.en.md @@ -118,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`. + + +
diff --git a/docs/manual/plots/area.zh.md b/docs/manual/plots/area.zh.md index df768bb50f..fecd0739c7 100644 --- a/docs/manual/plots/area.zh.md +++ b/docs/manual/plots/area.zh.md @@ -2,13 +2,7 @@ title: 面积图 order: 5 contributors: - [ - { - author: '新茗', - github: 'visiky', - avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg', - }, - ] + [{ author: '新茗', github: 'visiky', avatar: 'https://gw.alipayobjects.com/zos/antfincdn/KAeYPA3TV0/avatar.jpeg' }] ---
@@ -104,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(); @@ -118,4 +114,12 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/360c3eae-0c73-46f0-a982-4746a609 🎨 面积图详细的配置参考 [API 文档](/zh/docs/api/plots/area)。 -
\ No newline at end of file +## 面积图特性 + +### 添加中位线标注 + +- 通过 `annotations` 可以给面积图增加图表标注 + + + +
diff --git a/examples/component/annotation/demo/area-with-line-annotation.ts b/examples/component/annotation/demo/area-with-line-annotation.ts new file mode 100644 index 0000000000..c419a06d27 --- /dev/null +++ b/examples/component/annotation/demo/area-with-line-annotation.ts @@ -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(); + }); diff --git a/examples/component/annotation/demo/line-annotation.ts b/examples/component/annotation/demo/line-annotation.ts index 626880201e..e1f3a99eff 100644 --- a/examples/component/annotation/demo/line-annotation.ts +++ b/examples/component/annotation/demo/line-annotation.ts @@ -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', /** 起始位置 */ diff --git a/examples/component/annotation/demo/meta.json b/examples/component/annotation/demo/meta.json index f51ed8830e..bc425daecb 100644 --- a/examples/component/annotation/demo/meta.json +++ b/examples/component/annotation/demo/meta.json @@ -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": { diff --git a/gatsby-config.js b/gatsby-config.js index 8759aa2673..92e974b8bc 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -55,12 +55,21 @@ module.exports = { }, order: 0, }, + ], + ecosystems: [ { - slug: 'https://charts.ant.design/', - title: { - zh: 'React 版本', - en: 'React Version', + name: { + zh: 'Ant Design Charts(React)', + en: 'Ant Design Charts (React)', + }, + url: 'https://charts.ant.design/', + }, + { + name: { + zh: 'G2Plot 可视化圈子(博客文章)', + en: 'Blog posts of G2Plot', }, + url: 'https://www.yuque.com/antv/g2plot', }, ], docs: [