igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
242 lines (241 loc) • 8.16 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, __values } from "tslib";
import { HorizontalAxisLabelPanelBase } from "./HorizontalAxisLabelPanelBase";
import { Number_$type, fromEnum, Boolean_$type, markType } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { HorizontalAxisLabelPanelBaseView } from "./HorizontalAxisLabelPanelBaseView";
import { TransformGroup } from "igniteui-react-core";
import { RotateTransform } from "igniteui-react-core";
import { TranslateTransform } from "igniteui-react-core";
import { ViewportUtils } from "./ViewportUtils";
/**
* @hidden
*/
var RadialAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(RadialAxisLabelPanel, _super);
function RadialAxisLabelPanel() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.d1 = null;
_this.dy = 0;
_this.dx = new List$1(Number_$type, 0);
return _this;
}
RadialAxisLabelPanel.prototype.ae = function () {
return new RadialAxisLabelPanelView(this);
};
RadialAxisLabelPanel.prototype.ck = function (a) {
_super.prototype.ck.call(this, a);
this.dv = a;
};
Object.defineProperty(RadialAxisLabelPanel.prototype, "dw", {
get: function () {
return !this.am;
},
enumerable: false,
configurable: true
});
RadialAxisLabelPanel.prototype.df = function () {
return this.ao && (!this.ay || this.bo() == -180);
};
RadialAxisLabelPanel.prototype.dg = function () {
return !this.az;
};
RadialAxisLabelPanel.prototype.b5 = function (a) {
_super.prototype.b5.call(this, a);
if (this.dy % 360 == 0 || this.am) {
this.dv.a5();
}
else {
this.dv.a4(a);
}
};
RadialAxisLabelPanel.prototype.bo = function () {
var a = _super.prototype.bo.call(this);
if (this.dw) {
a -= (this.dy * 180) / Math.PI;
}
return a;
};
RadialAxisLabelPanel.prototype.de = function () {
return this.bo() % 360 != 0;
};
RadialAxisLabelPanel.prototype.dd = function () {
if (this.ad != null && this.ad.b0 != null && this.ad.b0.ga) {
return false;
}
if (this.am) {
return true;
}
var a = this.dy * 180 / Math.PI;
if (a < 30 || a > 330 || (a > 150 && a < 210)) {
return true;
}
return false;
};
RadialAxisLabelPanel.prototype.cp = function (a, b) {
var c = b * Math.PI / 180;
var d = Math.abs(Math.sin(c));
if (this.ad.a3 != null && this.ad.a3.c == 4) {
d = d * -1;
}
this.dv.a6(a, b, d);
};
RadialAxisLabelPanel.prototype.d0 = function () {
var e_1, _a;
var a = 1.7976931348623157E+308;
try {
for (var _b = __values(fromEnum(this.bd)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
a = Math.min(b.c, a);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
return a;
};
RadialAxisLabelPanel.prototype.dz = function () {
var e_2, _a;
var a = -1.7976931348623157E+308;
try {
for (var _b = __values(fromEnum(this.bd)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
a = Math.max(b.c, a);
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_2)
throw e_2.error;
}
}
return a;
};
RadialAxisLabelPanel.prototype.dt = function (a, b) {
var c;
if (this.ad.df) {
c = this.d0();
}
else {
c = this.dz();
}
var d = new List$1(Number_$type, 0);
var e = new List$1(Boolean_$type, 0);
for (var f = 0; f < this.bd.count; f++) {
var g = this.bd._inner[f];
if (g.c == c && !g.a) {
d.add(this.bd.indexOf(g));
}
}
this.dx = d;
var h = new List$1(Rect.$, 0);
for (var i = 0; i < a.count; i++) {
var j = a._inner[i];
var k = this.bd._inner[i].a;
if (!this.dx.contains(i)) {
h.add(j);
e.add(k);
}
}
this.ao = this.an(h, e);
};
RadialAxisLabelPanel.prototype.au = function (a, b) {
if (this.dx.contains(a)) {
return false;
}
else {
return _super.prototype.au.call(this, a, b);
}
};
RadialAxisLabelPanel.prototype.du = function () {
this.dx = new List$1(Number_$type, 0);
_super.prototype.du.call(this);
};
RadialAxisLabelPanel.prototype.ai = function () {
return 5;
};
RadialAxisLabelPanel.prototype.a1 = function (a) {
return a == 5 || a == 4 || a == 1 || a == 0;
};
RadialAxisLabelPanel.prototype.cc = function () {
};
RadialAxisLabelPanel.$t = markType(RadialAxisLabelPanel, 'RadialAxisLabelPanel', HorizontalAxisLabelPanelBase.$);
return RadialAxisLabelPanel;
}(HorizontalAxisLabelPanelBase));
export { RadialAxisLabelPanel };
/**
* @hidden
*/
var RadialAxisLabelPanelView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(RadialAxisLabelPanelView, _super);
function RadialAxisLabelPanelView(a) {
var _this = _super.call(this, a) || this;
_this.a3 = null;
_this.a3 = a;
return _this;
}
RadialAxisLabelPanelView.prototype.a6 = function (a, b, c) {
var d = this.m(a);
var e = this.l(a);
var f = new TransformGroup();
f.j.add(((function () {
var $ret = new RotateTransform();
$ret.j = b;
$ret.k = d / 2;
$ret.l = e / 2;
return $ret;
})()));
f.j.add(((function () {
var $ret = new TranslateTransform();
$ret.j = d / -2;
$ret.k = d / 2 * c;
return $ret;
})()));
a.j = f;
};
RadialAxisLabelPanelView.prototype.a5 = function () {
this.a.j = null;
};
RadialAxisLabelPanelView.prototype.a4 = function (a) {
var _this = this;
var b = ViewportUtils.i(0.5, this.a.c8, this.a.c7, this.a.ad != null ? this.a.ad.nw() : Rect.empty);
this.a.j = ((function () {
var $ret = new RotateTransform();
$ret.j = (_this.a3.dy * 180) / Math.PI;
$ret.k = _this.a3.d1.x;
$ret.l = (_this.a3.d1.y * a.height) + b;
return $ret;
})());
};
RadialAxisLabelPanelView.prototype.am = function () {
_super.prototype.am.call(this);
this.a.c9(new Size(1, this.a.c4.width, this.a.c4.height));
};
RadialAxisLabelPanelView.$t = markType(RadialAxisLabelPanelView, 'RadialAxisLabelPanelView', HorizontalAxisLabelPanelBaseView.$);
return RadialAxisLabelPanelView;
}(HorizontalAxisLabelPanelBaseView));
export { RadialAxisLabelPanelView };