-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: add demos * docs: review modify * fix: 修复默认配置引起的单测问题 * fix: review modify * fix: 删除多余目录 * fix: 删除多余空格 Co-authored-by: liufu.lf <liufu.lf@antfin.com>
- Loading branch information
Showing
11 changed files
with
195 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ describe('line', () => { | |
}, | ||
}, | ||
yAxis: { | ||
nice: false, | ||
tickCount: 3, | ||
min: 500, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Scatter } from '../../../../src'; | ||
import { data } from '../../../data/gender'; | ||
import { createDiv } from '../../../utils/dom'; | ||
|
||
describe('scatter', () => { | ||
it('default config', () => { | ||
const scatter = new Scatter(createDiv(), { | ||
width: 400, | ||
height: 300, | ||
data, | ||
xField: 'weight', | ||
yField: 'height', | ||
size: 10, | ||
xAxis: { | ||
nice: true, | ||
}, | ||
}); | ||
|
||
scatter.render(); | ||
const { options } = scatter; | ||
// @ts-ignore | ||
expect(options.tooltip.offset).toBe(20); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Scatter } from '@antv/g2plot'; | ||
|
||
fetch('https://gw.alipayobjects.com/os/bmw-prod/3e4db10a-9da1-4b44-80d8-c128f42764a8.json') | ||
.then((res) => res.json()) | ||
.then((data) => { | ||
const scatterPlot = new Scatter('container', { | ||
appendPadding: 30, | ||
data, | ||
xField: 'xG conceded', | ||
yField: 'Shot conceded', | ||
colorField: 'Result', | ||
color: ['#c71e1d', '#ffca76', '#09bb9f'], | ||
size: 5, | ||
shape: 'circle', | ||
pointStyle: { | ||
fillOpacity: 1, | ||
}, | ||
xAxis: { | ||
grid: { | ||
line: { | ||
style: { | ||
stroke: '#eee', | ||
}, | ||
}, | ||
}, | ||
}, | ||
label: {}, | ||
}); | ||
scatterPlot.render(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Scatter } from '@antv/g2plot'; | ||
|
||
fetch('https://gw.alipayobjects.com/os/bmw-prod/0b37279d-1674-42b4-b285-29683747ad9a.json') | ||
.then((res) => res.json()) | ||
.then((data) => { | ||
const scatterPlot = new Scatter('container', { | ||
appendPadding: 30, | ||
data, | ||
xField: 'change in female rate', | ||
yField: 'change in male rate', | ||
sizeField: 'pop', | ||
colorField: 'continent', | ||
color: ['#ffd500', '#82cab2', '#193442', '#d18768', '#7e827a'], | ||
size: [4, 30], | ||
shape: 'circle', | ||
pointStyle: { | ||
fillOpacity: 0.8, | ||
}, | ||
xAxis: { | ||
min: -25, | ||
max: 5, | ||
grid: { | ||
line: { | ||
style: { | ||
stroke: '#eee', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
scatterPlot.render(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters