How to use the @antv/g.MatrixUtil.vec2 function in @antv/g

To help you get started, we’ve selected a few @antv/g 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 / src / component / axis / line.js View on Github external
/**
 * @fileOverview the radius axis of polar coordinate and axis of cartesian coordinate
 * @author sima.zhang
 */
const Base = require('./base');
const Util = require('../../util');
const { MatrixUtil } = require('@antv/g');
const vec2 = MatrixUtil.vec2;

class Line extends Base {
  getDefaultCfg() {
    const cfg = super.getDefaultCfg();
    return Util.mix({}, cfg, {
      x: null, // @type {Number} 距离初始位置的x轴偏移量,仅对于左侧、右侧的纵向坐标有效
      y: null, // @type {Number} 距离初始位置的y轴偏移量,仅对顶部、底部的横向坐标轴有效
      line: { // @type {Attrs} 坐标轴线的图形属性,如果设置成null,则不显示轴线
        lineWidth: 1,
        stroke: '#C0D0E0'
      },
      tickLine: { // @type {Attrs} 标注坐标线的图形属性
        lineWidth: 1,
        stroke: '#C0D0E0',
        length: 5
      },
github antvis / G2 / src / component / axis / helix.js View on Github external
/**
 * @fileOverview the helix axis of helix coordinate
 * @author sima.zhang
 */
const Util = require('../../util');
const Base = require('./base');
const { MatrixUtil, PathUtil } = require('@antv/g');
const vec2 = MatrixUtil.vec2;

class Helix extends Base {
  getDefaultCfg() {
    const cfg = super.getDefaultCfg();

    return Util.mix({}, cfg, {
      type: 'helix',
      line: { // @type {Attrs} 坐标轴线的图形属性,如果设置成null,则不显示轴线
        lineWidth: 1,
        stroke: '#C0D0E0'
      },
      tickLine: { // @type {Attrs} 标注坐标线的图形属性
        lineWidth: 1,
        stroke: '#C0D0E0',
        length: 5
      },
github antvis / G2 / src / component / axis / polyline.js View on Github external
/**
 * @fileOverview the axis of map coodinate
 * @author sima.zhang
 */
const Util = require('../../util');
const Base = require('./base');
const { MatrixUtil, PathUtil } = require('@antv/g');
const vec2 = MatrixUtil.vec2;

class Polyline extends Base {
  getDefaultCfg() {
    const cfg = super.getDefaultCfg();

    return Util.mix({}, cfg, {
      type: 'polyline'
    });
  }

  getLinePath() {
    const self = this;
    const tickPoints = self.get('tickPoints');
    const start = self.get('start');
    const end = self.get('end');
    const points = [];
github antvis / G2 / src / coord / helix.js View on Github external
/**
 * @fileOverview the class of Helix Coordinate
 * @author sima.zhang
 */
const Util = require('../util');
const Base = require('./base');
const MatrixUtil = require('@antv/g').MatrixUtil;
const vec2 = MatrixUtil.vec2;

class Helix extends Base {

  getDefaultCfg() {
    const cfg = super.getDefaultCfg();
    return Util.mix({}, cfg, {
      startAngle: 1.25 * Math.PI,
      endAngle: 7.25 * Math.PI,
      innerRadius: 0,
      type: 'helix',
      isHelix: true
    });
  }

  constructor(cfg) {
    super(cfg);