VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/libs/absol-full/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/libs/absol-full/dist/js/mdls__absol-vchart__src__Axis.js
/*** module: node_modules/absol-vchart/src/Axis.js ***/
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _VCore = _interopRequireDefault(require("./VCore"));

var _GContainer = _interopRequireDefault(require("absol-svg/js/svg/GContainer"));


var _ = _VCore.default._;
var $ = _VCore.default.$;
/***
 * @extends GContainer
 * @constructor
 */

function Axis() {
  this.$oxy = $('#oxy', this);
  this.$oxArrow = $('#ox-arrow', this);
  this.$oyArrow = $('#oy-arrow', this);
  this.$oyDivision = $('.cv-oy-division', this);
  this.oxLength = 1;
  this.oyLength = 1;
  this.oyPadding = 0;
  this.oyDivision = NaN;
}

Axis.tag = 'Axis'.toLowerCase();

Axis.render = function () {
  return _({
    tag: 'gcontainer',
    class: "vchart-axis",
    child: [{
      tag: 'path',
      id: "oy-arrow",
      attr: {
        d: "m-5 0h10l-5-6.8z"
      }
    }, {
      tag: 'path',
      id: "ox-arrow",
      attr: {
        d: 'm0 -5v10l6.8 -5z'
      }
    }, {
      tag: 'path',
      id: 'oxy',
      attr: {
        d: 'm0 -1v1 h1',
        fill: 'none'
      }
    }, {
      tag: 'path',
      class: 'cv-oy-division',
      style: {
        display: 'none'
      }
    }]
  });
};

Axis.prototype.updateOyDivision = function () {
  if (this.oyDivision) {
    this.$oyDivision.removeStyle('display');
    var y = this.oyDivision + this.oyPadding;
    if (this.oyPadding) y -= this.oyDivision;
    var d = '';

    while (y <= this.oyLength) {
      d += 'M-2 ' + -y + 'H 2 ';
      y += this.oyDivision;
    }

    this.$oyDivision.attr('d', d);
  } else {
    this.$oyDivision.addStyle('display', 'none');
  }
};

Axis.prototype.updateSize = function () {
  this.$oxy.attr('d', 'm0 ' + -this.oyLength + 'v' + this.oyLength + ' h' + this.oxLength);
  this.$oxArrow.attr('transform', 'translate(' + this.oxLength + ', 0)');
  this.$oyArrow.attr('transform', 'translate(0, ' + -this.oyLength + ')');
  this.updateOyDivision();
};

Axis.prototype.resize = function (oxLength, oyLength) {
  this.oxLength = oxLength;
  this.oyLength = oyLength;
  this.updateSize();
};

Axis.prototype.moveTo = function (x, y) {
  this.attr('transform', 'translate(' + x + ',' + y + ')');
};

Axis.prototype.init = function (props) {
  if (props) {
    if (props.oxLength && props.oyLength) this.resize(props.oxLength, props.oyLength);
    if (props.x && props.y) this.moveTo(props.x, props.y);
  }
};

_VCore.default.install(Axis);

var _default = Axis;
exports.default = _default;

VaKeR 2022