From 404ebec365eb6bb93cdfa34eeecd1a120036f2de Mon Sep 17 00:00:00 2001 From: "liufu.lf" Date: Mon, 21 Sep 2020 16:44:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=95=A3=E7=82=B9?= =?UTF-8?q?=E5=9B=BE=20demos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/scatter/basic/demo/basic.ts | 11 ++++++- examples/scatter/basic/demo/color-mapping.ts | 14 ++++++-- examples/scatter/basic/demo/label.ts | 13 ++++++++ examples/scatter/basic/demo/meta.json | 8 ----- examples/scatter/basic/demo/quadrant.ts | 13 ++++++++ examples/scatter/basic/demo/shape-mapping.ts | 34 -------------------- examples/scatter/basic/demo/size.ts | 13 ++++++++ 7 files changed, 61 insertions(+), 45 deletions(-) delete mode 100644 examples/scatter/basic/demo/shape-mapping.ts diff --git a/examples/scatter/basic/demo/basic.ts b/examples/scatter/basic/demo/basic.ts index a7059332b6..64eb07f5ea 100644 --- a/examples/scatter/basic/demo/basic.ts +++ b/examples/scatter/basic/demo/basic.ts @@ -10,7 +10,11 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json') yField: 'Rating', shape: 'circle', yAxis: { - grid: {}, + line: { + style: { + stroke: '#aaa', + }, + }, }, xAxis: { min: -100, @@ -22,6 +26,11 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json') }, }, }, + line: { + style: { + stroke: '#aaa', + }, + }, }, pointStyle: { stroke: '#fff', diff --git a/examples/scatter/basic/demo/color-mapping.ts b/examples/scatter/basic/demo/color-mapping.ts index b133fa9002..96de9a1515 100644 --- a/examples/scatter/basic/demo/color-mapping.ts +++ b/examples/scatter/basic/demo/color-mapping.ts @@ -10,10 +10,15 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json') yField: 'Rating', shape: 'circle', colorField: 'Genre', - sizeField: 'Rating', - size: [2, 5], + color: ['#d62728', '#2ca02c', '#000000', '#9467bd', '#ffd500', '#1f77b4', '#00518a', '#ffbc69', '#9bd646'], + size: 4, yAxis: { nice: true, + line: { + style: { + stroke: '#aaa', + }, + }, }, xAxis: { min: -100, @@ -24,6 +29,11 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json') }, }, }, + line: { + style: { + stroke: '#aaa', + }, + }, }, pointStyle: { stroke: '#fff', diff --git a/examples/scatter/basic/demo/label.ts b/examples/scatter/basic/demo/label.ts index 9164d22e41..5691632eec 100644 --- a/examples/scatter/basic/demo/label.ts +++ b/examples/scatter/basic/demo/label.ts @@ -15,6 +15,14 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/3e4db10a-9da1-4b44-80d8-c128f427 pointStyle: { fillOpacity: 1, }, + yAxis: { + nice: true, + line: { + style: { + stroke: '#aaa', + }, + }, + }, xAxis: { grid: { line: { @@ -23,6 +31,11 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/3e4db10a-9da1-4b44-80d8-c128f427 }, }, }, + line: { + style: { + stroke: '#aaa', + }, + }, }, label: {}, }); diff --git a/examples/scatter/basic/demo/meta.json b/examples/scatter/basic/demo/meta.json index 909156c2d0..f64f517a76 100644 --- a/examples/scatter/basic/demo/meta.json +++ b/examples/scatter/basic/demo/meta.json @@ -18,14 +18,6 @@ "zh": "散点图颜色映射", "en": "the color mapping of Scatter chart" }, - "screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*Mds9Q7-zeHMAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "shape-mapping.ts", - "title": { - "zh": "散点形状色映射", - "en": "the shape mapping of Scatter chart" - }, "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/kRFIJ2OlFs/FE726B54-2352-47F5-AAF9-B17D281CE513.png" }, { diff --git a/examples/scatter/basic/demo/quadrant.ts b/examples/scatter/basic/demo/quadrant.ts index bc4fdc1f0d..97d917c855 100644 --- a/examples/scatter/basic/demo/quadrant.ts +++ b/examples/scatter/basic/demo/quadrant.ts @@ -15,6 +15,7 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747 shape: 'circle', pointStyle: { fillOpacity: 0.8, + stroke: '#bbb', }, xAxis: { min: -25, @@ -26,6 +27,18 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747 }, }, }, + line: { + style: { + stroke: '#aaa', + }, + }, + }, + yAxis: { + line: { + style: { + stroke: '#aaa', + }, + }, }, quadrant: { xBaseline: 0, diff --git a/examples/scatter/basic/demo/shape-mapping.ts b/examples/scatter/basic/demo/shape-mapping.ts deleted file mode 100644 index babe04a087..0000000000 --- a/examples/scatter/basic/demo/shape-mapping.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Scatter } from '@antv/g2plot'; - -fetch('https://gw.alipayobjects.com/os/antfincdn/aao6XnO5pW/IMDB.json') - .then((res) => res.json()) - .then((data) => { - const scatterPlot = new Scatter('container', { - appendPadding: 10, - data, - xField: 'Revenue (Millions)', - yField: 'Rating', - shapeField: 'Genre', - shape: ['circle', 'square', 'bowtie', 'diamond', 'hexagon', 'triangle', 'hyphen', 'line', 'cross'], - colorField: 'Genre', - size: 6, - yAxis: { - nice: true, - }, - xAxis: { - min: -100, - nice: true, - grid: { - line: { - style: { - stroke: '#eee', - }, - }, - }, - }, - pointStyle: { - stroke: '#fff', - }, - }); - scatterPlot.render(); - }); diff --git a/examples/scatter/basic/demo/size.ts b/examples/scatter/basic/demo/size.ts index 706e75d73c..55a06e00ae 100644 --- a/examples/scatter/basic/demo/size.ts +++ b/examples/scatter/basic/demo/size.ts @@ -15,6 +15,7 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747 shape: 'circle', pointStyle: { fillOpacity: 0.8, + stroke: '#bbb', }, xAxis: { min: -25, @@ -26,6 +27,18 @@ fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747 }, }, }, + line: { + style: { + stroke: '#aaa', + }, + }, + }, + yAxis: { + line: { + style: { + stroke: '#aaa', + }, + }, }, }); scatterPlot.render();