How to use the @antv/g.MatrixUtil 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 / 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) {
github antvis / G2 / src / coord / base.js View on Github external
/**
 * @fileOverview the base class of Coordinate
 * @author sima.zhang
 */
const Util = require('../util');
const MatrixUtil = require('@antv/g').MatrixUtil;
const mat3 = MatrixUtil.mat3;
const vec3 = MatrixUtil.vec3;

class Coord {
  /**
   * 获取默认的配置属性
   * @protected
   * @return {Object} 默认属性
   */
  getDefaultCfg() {
    return {
      /**
       * Mark x y is transposed.
       * @type {Boolean}
       */
      isTransposed: false,
github antvis / G2 / src / component / axis / circle.js View on Github external
/**
 * @fileOverview the circle axis of polar coordinate
 * @author sima.zhang
 */
const Util = require('../../util');
const Base = require('./base');
const { vec2 } = require('@antv/g').MatrixUtil;

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

    return Util.mix({}, cfg, {
      /**
       * 坐标轴的类型
       * @type {String}
       */
      type: 'circle',
      /**
       * 指定刻度之间的间距
       * @type {Number}
       */
      tickInterval: null,