Ai
1 Star 0 Fork 35

匡胜昆/G2Plot

forked from antv/G2Plot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
issue-2021-spec.ts 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
hustcc 提交于 2022-11-11 19:01 +08:00 . feat: migrate to dumi-theme-antv from gatsby (#3388)
import { TinyArea, TinyColumn, TinyLine } from '../../src';
import { createDiv } from '../utils/dom';
const DATA = [
264, 417, 438, 887, 309, 397, 550, 575, 563, 430, 525, 592, 492, 467, 513, 546, 983, 340, 539, 243, 226, 192,
];
describe('#2021', () => {
it('TinyLine', () => {
const line = new TinyLine(createDiv(), {
width: 400,
height: 300,
data: DATA,
});
line.render();
expect(line.chart.getYScales()[0].min).toBe(0);
line.update({
yAxis: {
max: 6000,
min: 20,
},
});
expect(line.chart.getYScales()[0].min).toBe(20);
expect(line.chart.getYScales()[0].max).toBe(6000);
line.destroy();
});
it('TinyArea', () => {
const area = new TinyArea(createDiv(), {
width: 400,
height: 300,
data: DATA,
});
area.render();
expect(area.chart.getYScales()[0].min).toBe(0);
area.update({
yAxis: {
max: 6000,
min: 20,
},
});
expect(area.chart.getYScales()[0].min).toBe(20);
expect(area.chart.getYScales()[0].max).toBe(6000);
area.destroy();
});
it('TinyColumn', () => {
const column = new TinyColumn(createDiv(), {
width: 400,
height: 300,
data: DATA,
});
column.render();
expect(column.chart.getYScales()[0].min).toBe(0);
column.update({
yAxis: {
max: 6000,
min: 20,
},
});
expect(column.chart.getYScales()[0].min).toBe(20);
expect(column.chart.getYScales()[0].max).toBe(6000);
column.destroy();
});
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/17311824/g2plot.git
git@gitee.com:17311824/g2plot.git
17311824
g2plot
G2Plot
master

搜索帮助