Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('area shapes Polar', () => {
const Polar = getCoordinate('polar');
const polarCoord = new Polar({
start: {
x: 0,
y: 500,
},
end: {
x: 500,
y: 0,
},
});
it('getShapePoints && drawShape', () => {
AreaShapeFactory.setCoord(polarCoord);
const type = 'area';
const points1 = AreaShapeFactory.getShapePoints(type, {
x: 0.1,
y: 0.2,
import { getCoordinate } from '@antv/coord';
import { getScale } from '@antv/scale';
import Schema from '../../../src/geometry/schema';
import Theme from '../../../src/theme/antv';
import { createCanvas, createDiv, removeDom } from '../../util/dom';
import 'jest-extended';
import { createScale } from '../../util/scale';
const CartesianCoordinate = getCoordinate('rect');
const LinearScale = getScale('linear');
describe('Schema', () => {
const div = createDiv();
const canvas = createCanvas({
container: div,
width: 300,
height: 300,
});
const rectCoord = new CartesianCoordinate({
start: { x: 0, y: 300 },
end: { x: 300, y: 0 },
});
it('draw box', () => {
const data = [
import { getCoordinate } from '@antv/coord';
import { getScale } from '@antv/scale';
import Interval from '../../../../src/geometry/interval';
import { getDefaultSize } from '../../../../src/geometry/util/shape-size';
import Theme from '../../../../src/theme/antv';
import { createCanvas, createDiv, removeDom } from '../../../util/dom';
import 'jest-extended';
import { createScale } from '../../../util/scale';
const CartesianCoordinate = getCoordinate('rect');
const PolarCoordinate = getCoordinate('polar');
const CatScale = getScale('cat');
const IdentityScale = getScale('identity');
describe('Calculate shape size', () => {
const div = createDiv();
const canvas = createCanvas({
container: div,
});
const rectCoord = new CartesianCoordinate({
start: { x: 0, y: 180 },
end: { x: 180, y: 0 },
});
const polarCoord = new PolarCoordinate({
start: { x: 0, y: 180 },
end: { x: 180, y: 0 },
import { getCoordinate } from '@antv/coord';
import Polygon from '../../../src/geometry/polygon';
import Theme from '../../../src/theme/antv';
import { createCanvas, createDiv, removeDom } from '../../util/dom';
import 'jest-extended';
import { createScale } from '../../util/scale';
const CartesianCoordinate = getCoordinate('rect');
describe('Polygon', () => {
const div = createDiv();
const canvas = createCanvas({
container: div,
width: 300,
height: 300,
});
const rectCoord = new CartesianCoordinate({
start: { x: 0, y: 300 },
end: { x: 300, y: 0 },
});
const data = [
{ city: '杭州', sale: 100, category: '电脑' },
{ city: '广州', sale: 30, category: '电脑' },
{ city: '上海', sale: 200, category: '鼠标' },
import { expect } from 'chai';
import { getCoordinate } from '@antv/coord';
import { Canvas } from '@antv/g';
import { getScale } from '@antv/scale';
import Point from '../../../src/element/point';
import ScatterData from '../../data/bubble';
import View from '../../utils/view';
const Rect = getCoordinate('rect');
const LinearScale = getScale('linear');
const IdentityScale = getScale('identity');
describe('Point Element', () => {
const div = document.createElement('div');
document.body.appendChild(div);
let pointElement;
const coord = new Rect({
start: {
x: 0,
y: 200,
},
end: {
import { expect } from 'chai';
import { Canvas } from '@antv/g';
import EdgeShapeFactory from '../../../../src/element/shape/edge';
import * as Shape from '../../../../src/element/shape/base';
import { getCoordinate } from '@antv/coord';
import Global from '../../../../src/global';
const Rect = getCoordinate('rect');
describe('Edge shape factory', () => {
let div;
let canvas;
before(() => {
div = document.createElement('div');
div.id = 'edge-shape';
document.body.appendChild(div);
const coord = new Rect({
start: {
x: 0,
y: 500,
},
end: {
import { expect } from 'chai';
import { Canvas } from '@antv/g';
import { getCoordinate } from '@antv/coord';
import HelixAxis from '../../../src/axis/helix';
const Helix = getCoordinate('helix');
describe('Helix Axis for Helix Coord', function() {
const div = document.createElement('div');
document.body.appendChild(div);
const coord = new Helix({
start: {
x: 60,
y: 460,
},
end: {
x: 460,
y: 60,
},
});
const canvas = new Canvas({
containerDOM: div,
const expect = require('chai').expect;
const { Canvas } = require('@antv/g');
const { getCoordinate } = require('@antv/coord');
const { getScale } = require('@antv/scale');
const { Text } = require('../../../src/annotation');
const Rect = getCoordinate('rect');
const Cat = getScale('cat');
const Linear = getScale('linear');
describe('Annotation Text', () => {
const xScale = new Cat({
values: ['一月', '二月', '三月', '四月', '五月'],
});
const yScale = new Linear({
min: 0,
max: 1200,
});
const coord = new Rect({
start: { x: 60, y: 460 },
end: { x: 460, y: 60 },
});
let canvas, group, div;
import { getCoordinate } from '@antv/coord';
import { isNumberEqual } from '@antv/util';
import { doAnimate, doGroupAppearAnimate, getDefaultAnimateCfg } from '../../../src/animate/index';
import { createCanvas, createDiv, removeDom } from '../../util/dom';
const CartesianCoordinate = getCoordinate('rect');
const PolarCoordinate = getCoordinate('polar');
const HelixCoordinate = getCoordinate('helix');
describe('Animate', () => {
const rectCoord = new CartesianCoordinate({
start: { x: 0, y: 300 },
end: { x: 300, y: 0 },
});
const polarCoord = new PolarCoordinate({
start: { x: 0, y: 300 },
end: { x: 300, y: 0 },
});
const helixCoord = new HelixCoordinate({
start: { x: 0, y: 180 },
end: { x: 180, y: 0 },
});
const thetaCoord = new PolarCoordinate({
import { expect } from 'chai';
import Area from '../../../src/element/area';
import { Canvas } from '@antv/g';
import { getScale } from '@antv/scale';
import { getCoordinate } from '@antv/coord';
import View from '../../utils/view';
const Rect = getCoordinate('rect');
const LinearScale = getScale('linear');
const CatScale = getScale('cat');
describe('Area', () => {
describe('Default', () => {
const areaDiv = document.createElement('div');
areaDiv.id = 'area1';
document.body.appendChild(areaDiv);
let areaElement;
const yearScale = new CatScale({
field: 'year',
values: ['1994', '1995', '1996'],
range: [0, 1],
});