How to use the @antv/coord/lib/.Cartesian function in @antv/coord

To help you get started, we’ve selected a few @antv/coord examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / G2 / test / unit / geom / label / geom-labels-spec.js View on Github external
it('test pie', function() {
      expect(Labels.getLabelsClass('theta')).to.equal(PieLabels);
    });
  });

  const div = document.createElement('div');
  div.id = 'gl1';
  document.body.appendChild(div);

  const canvas = new Canvas({
    containerId: 'gl1',
    width: 500,
    height: 500
  });

  const coord = new Coord.Cartesian({
    start: {
      x: 0,
      y: 100
    },
    end: {
      x: 100,
      y: 0
    }
  });

  const labelScale = Scale.cat({
    field: 'z',
    values: [ '1', '2' ]
  });
  const points = [
    { x: 100, y: 10, z: 0, _origin: { x: 100, y: 10, z: '1' } },
github antvis / G2 / test / unit / geom / label / geom-labels-spec.js View on Github external
describe('transposed label', function() {
    const coord = new Coord.Cartesian({
      start: {
        x: 0,
        y: 100
      },
      end: {
        x: 100,
        y: 0
      }
    });
    coord.transpose();


    it('offset > 0', function() {
      const gLabels = canvas.addGroup(GeomLabels, {
        coord,
        labelCfg: {
github antvis / G2 / test / unit / geom / shape / point-spec.js View on Github external
const expect = require('chai').expect;
const { Canvas } = require('../../../../src/renderer');
const Shape = require('../../../../src/geom/shape/shape');
const Coord = require('@antv/coord/lib/');
const Global = require('../../../../src/global');
require('../../../../src/geom/shape/point');

const div = document.createElement('div');
div.id = 'csp';
document.body.appendChild(div);

const coord = new Coord.Cartesian({
  start: {
    x: 0,
    y: 500
  },
  end: {
    x: 500,
    y: 0
  }
});

const canvas = new Canvas({
  containerId: 'csp',
  width: 500,
  height: 500
});
github antvis / G2 / test / unit / geom / shape / line-spec.js View on Github external
const expect = require('chai').expect;
const { Canvas } = require('../../../../src/renderer');
const Line = require('../../../../src/geom/shape/line');
const Coord = require('@antv/coord/lib/');
const Global = require('../../../../src/global');

const div = document.createElement('div');
div.id = 'csl';
document.body.appendChild(div);

const coord = new Coord.Cartesian({
  start: {
    x: 0,
    y: 500
  },
  end: {
    x: 500,
    y: 0
  }
});
const canvas = new Canvas({
  containerId: 'csl',
  width: 500,
  height: 500
});

describe('line shapes', function() {
github antvis / G2 / test / unit / geom / shape / polygon-spec.js View on Github external
const expect = require('chai').expect;
const { Canvas } = require('../../../../src/renderer');
const Polygon = require('../../../../src/geom/shape/polygon');
const Coord = require('@antv/coord/lib/');

const div = document.createElement('div');
div.id = 'cspolygon';
document.body.appendChild(div);

const coord = new Coord.Cartesian({
  start: {
    x: 0,
    y: 500
  },
  end: {
    x: 500,
    y: 0
  }
});

const canvas = new Canvas({
  containerId: 'cspolygon',
  width: 500,
  height: 500
});