igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
200 lines (199 loc) • 6.89 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { NumericAxisBase } from "./NumericAxisBase";
import { NumericScaleMode_$type } from "./NumericScaleMode";
import { DependencyProperty } from "igniteui-react-core";
import { NumericScaler } from "./NumericScaler";
import { typeCast, enumGetBox, markType, markDep } from "igniteui-react-core";
import { ArgumentNullException } from "igniteui-react-core";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-react-core";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
* @hidden
*/
var StraightNumericAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(StraightNumericAxisBase, _super);
function StraightNumericAxisBase() {
var _this = _super.call(this) || this;
_this.td = null;
_this.th = false;
_this.tr();
return _this;
}
StraightNumericAxisBase.prototype.bo = function () {
return new StraightNumericAxisBaseView(this);
};
StraightNumericAxisBase.prototype.k8 = function (a) {
_super.prototype.k8.call(this, a);
this.tg = a;
};
StraightNumericAxisBase.prototype.ko = function (a) {
_super.prototype.ko.call(this, a);
this.kr(a, "ScaleMode");
};
StraightNumericAxisBase.prototype.kr = function (a, b) {
_super.prototype.kr.call(this, a, b);
var c = typeCast(StraightNumericAxisBase.$, a);
if (c == null) {
return;
}
var d = this;
if (b == "ScaleMode") {
c.tb = d.tb;
}
};
Object.defineProperty(StraightNumericAxisBase.prototype, "tf", {
get: function () {
return this.c(StraightNumericAxisBase.tt);
},
set: function (a) {
this.h(StraightNumericAxisBase.tt, a);
},
enumerable: false,
configurable: true
});
StraightNumericAxisBase.tp = function (a, b) {
var c = typeCast(StraightNumericAxisBase.$, a);
c.tr();
c.lu("Scaler", b.oldValue, b.newValue);
};
StraightNumericAxisBase.prototype.te = function () {
return null;
};
StraightNumericAxisBase.prototype.get_tc = function () {
if (this.td == null) {
this.tr();
}
return this.td;
};
StraightNumericAxisBase.prototype.set_tc = function (a) {
var b = this.td != a;
if (b) {
var c = this.td;
this.td = a;
this.lu("ActualScaler", c, a);
}
};
Object.defineProperty(StraightNumericAxisBase.prototype, "tc", {
get: function () {
return this.get_tc();
},
set: function (a) {
this.set_tc(a);
},
enumerable: false,
configurable: true
});
StraightNumericAxisBase.prototype.sl = function (a, b, c, d, e, f, g) {
var h = this.tc.t(a, b, c, f, g);
f = h.p3;
g = h.p4;
return {
p5: f,
p6: g
};
};
StraightNumericAxisBase.prototype.tq = function (a) {
var b = this.th;
this.th = true;
a();
this.th = b;
};
StraightNumericAxisBase.prototype.tr = function () {
var a = this.tf;
if (a == null) {
a = this.p1();
}
this.tc = a;
if (this.tc == null) {
throw new ArgumentNullException(0, "ActualScaler");
}
this.tm();
};
StraightNumericAxisBase.prototype.tm = function () {
this.tg.bw();
};
StraightNumericAxisBase.prototype.lc = function (a, b, c, d) {
if (this.th) {
return;
}
_super.prototype.lc.call(this, a, b, c, d);
switch (b) {
case NumericAxisBase.$$p[12]:
this.tr();
break;
case NumericAxisBase.$$p[11]:
this.tr();
break;
case StraightNumericAxisBase.$$p[0]:
this.tr();
break;
case "Scaler":
this.tr();
break;
case "ActualScaler":
this.qa = typeCast(LogarithmicScaler.$, this.tc) !== null;
this.tm();
this.ee();
this.l0(false);
break;
case "ActualMaximumValue":
this.tn();
break;
case "ActualMinimumValue":
this.to();
this.tr();
break;
}
};
StraightNumericAxisBase.prototype.to = function () {
this.tc.y(this.qy);
};
StraightNumericAxisBase.prototype.tn = function () {
this.tc.x(this.qx);
};
StraightNumericAxisBase.prototype.ti = function (a, b) {
if (a < this.qy) {
a = this.qy;
}
else if (a > this.qx) {
a = this.qx;
}
if (!b.dz) {
return (a - this.qy) / (this.qx - this.qy);
}
else {
return (a - this.qx) / (this.qy - this.qx);
}
};
StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
StraightNumericAxisBase.tt = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.tp));
StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'lu', ['ScaleMode:tb:ts', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
/**
* @hidden
*/
var StraightNumericAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(StraightNumericAxisBaseView, _super);
function StraightNumericAxisBaseView(a) {
var _this = _super.call(this, a) || this;
_this.bv = null;
_this.bv = a;
return _this;
}
StraightNumericAxisBaseView.prototype.bw = function () {
this.bv.tc.x(this.bv.qx);
this.bv.tc.y(this.bv.qy);
};
StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };