123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var Base = require('./base');
- var isNumber = require('@antv/util/lib/type/is-number');
- var Identity =
- /*#__PURE__*/
- function (_Base) {
- _inheritsLoose(Identity, _Base);
- function Identity() {
- return _Base.apply(this, arguments) || this;
- }
- var _proto = Identity.prototype;
- _proto._initDefaultCfg = function _initDefaultCfg() {
- _Base.prototype._initDefaultCfg.call(this);
- this.isIdentity = true;
- this.type = 'identity';
- /**
- * 常量值
- * @type {*}
- */
- this.value = null;
- }
- /**
- * @override
- */
- ;
- _proto.getText = function getText() {
- return this.value.toString();
- }
- /**
- * @override
- */
- ;
- _proto.scale = function scale(value) {
- if (this.value !== value && isNumber(value)) {
- return value;
- }
- return this.range[0];
- }
- /**
- * @override
- */
- ;
- _proto.invert = function invert() {
- return this.value;
- };
- return Identity;
- }(Base);
- Base.Identity = Identity;
- module.exports = Identity;
|