Skip to content

Commit

Permalink
docs(demo): 更新 radar demo,移除数据处理
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Jan 7, 2021
1 parent 1eec5e6 commit b20031b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 73 deletions.
14 changes: 2 additions & 12 deletions examples/more-plots/radar/demo/area-alternate-grid.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import { Radar } from '@antv/g2plot';
import { DataSet } from '@antv/data-set';

fetch('https://gw.alipayobjects.com/os/bmw-prod/bda695a8-cd9f-4b78-a423-3d6d547c10c3.json')
fetch('https://gw.alipayobjects.com/os/antfincdn/svFjSfJkYy/radar.json')
.then((data) => data.json())
.then((data) => {
const { DataView } = DataSet;
const dv = new DataView().source(data);
dv.transform({
type: 'fold',
fields: ['a', 'b'], // 展开字段集
key: 'user', // key字段
value: 'score', // value字段
});

const radarPlot = new Radar('container', {
data: dv.rows,
data,
xField: 'item',
yField: 'score',
seriesField: 'user',
Expand Down
14 changes: 2 additions & 12 deletions examples/more-plots/radar/demo/area-grid.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import { Radar } from '@antv/g2plot';
import { DataSet } from '@antv/data-set';

fetch('https://gw.alipayobjects.com/os/bmw-prod/bda695a8-cd9f-4b78-a423-3d6d547c10c3.json')
fetch('https://gw.alipayobjects.com/os/antfincdn/svFjSfJkYy/radar.json')
.then((data) => data.json())
.then((data) => {
const { DataView } = DataSet;
const dv = new DataView().source(data);
dv.transform({
type: 'fold',
fields: ['a', 'b'], // 展开字段集
key: 'user', // key字段
value: 'score', // value字段
});

const radarPlot = new Radar('container', {
data: dv.rows,
data,
xField: 'item',
yField: 'score',
seriesField: 'user',
Expand Down
14 changes: 2 additions & 12 deletions examples/more-plots/radar/demo/area.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import { Radar } from '@antv/g2plot';
import { DataSet } from '@antv/data-set';

fetch('https://gw.alipayobjects.com/os/bmw-prod/bda695a8-cd9f-4b78-a423-3d6d547c10c3.json')
fetch('https://gw.alipayobjects.com/os/antfincdn/svFjSfJkYy/radar.json')
.then((data) => data.json())
.then((data) => {
const { DataView } = DataSet;
const dv = new DataView().source(data);
dv.transform({
type: 'fold',
fields: ['a', 'b'], // 展开字段集
key: 'user', // key字段
value: 'score', // value字段
});

const radarPlot = new Radar('container', {
data: dv.rows,
data,
xField: 'item',
yField: 'score',
seriesField: 'user',
Expand Down
14 changes: 2 additions & 12 deletions examples/more-plots/radar/demo/line-alternate-grid.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import { Radar } from '@antv/g2plot';
import { DataSet } from '@antv/data-set';

fetch('https://gw.alipayobjects.com/os/bmw-prod/bda695a8-cd9f-4b78-a423-3d6d547c10c3.json')
fetch('https://gw.alipayobjects.com/os/antfincdn/svFjSfJkYy/radar.json')
.then((data) => data.json())
.then((data) => {
const { DataView } = DataSet;
const dv = new DataView().source(data);
dv.transform({
type: 'fold',
fields: ['a', 'b'], // 展开字段集
key: 'user', // key字段
value: 'score', // value字段
});

const radarPlot = new Radar('container', {
data: dv.rows,
data,
xField: 'item',
yField: 'score',
seriesField: 'user',
Expand Down
14 changes: 2 additions & 12 deletions examples/more-plots/radar/demo/line-grid.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import { Radar } from '@antv/g2plot';
import { DataSet } from '@antv/data-set';

fetch('https://gw.alipayobjects.com/os/bmw-prod/bda695a8-cd9f-4b78-a423-3d6d547c10c3.json')
fetch('https://gw.alipayobjects.com/os/antfincdn/svFjSfJkYy/radar.json')
.then((data) => data.json())
.then((data) => {
const { DataView } = DataSet;
const dv = new DataView().source(data);
dv.transform({
type: 'fold',
fields: ['a', 'b'], // 展开字段集
key: 'user', // key字段
value: 'score', // value字段
});

const radarPlot = new Radar('container', {
data: dv.rows,
data,
xField: 'item',
yField: 'score',
seriesField: 'user',
Expand Down
16 changes: 3 additions & 13 deletions examples/more-plots/radar/demo/line.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import { DataSet } from '@antv/data-set';
import { Radar } from '../../../relation/sankey/demo/node_modules/@antv/g2plot';
import { Radar } from '@antv/g2plot';

fetch('https://gw.alipayobjects.com/os/bmw-prod/bda695a8-cd9f-4b78-a423-3d6d547c10c3.json')
fetch('https://gw.alipayobjects.com/os/antfincdn/svFjSfJkYy/radar.json')
.then((data) => data.json())
.then((data) => {
const { DataView } = DataSet;
const dv = new DataView().source(data);
dv.transform({
type: 'fold',
fields: ['a', 'b'], // 展开字段集
key: 'user', // key字段
value: 'score', // value字段
});

const radarPlot = new Radar('container', {
data: dv.rows,
data,
xField: 'item',
yField: 'score',
seriesField: 'user',
Expand Down

0 comments on commit b20031b

Please sign in to comment.