igniteui-angular-gauges
Version:
Ignite UI Angular gauge components.
685 lines (684 loc) • 21.2 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 { Base, fromEnum, markType } from "igniteui-angular-core";
import { StringBuilder } from "igniteui-angular-core";
/**
* @hidden
*/
var GaugeVisualData = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(GaugeVisualData, _super);
function GaugeVisualData() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._scalePath = null;
_this._needlePath = null;
_this._highlightNeedlePath = null;
_this._backingPath = null;
_this._underlayPath = null;
_this._overlayPath = null;
_this._scale = null;
_this._scaleLabels = null;
_this._titleLabels = null;
_this._subtitleLabels = null;
_this._highlightLabels = null;
_this._scaleTickmarks = null;
_this._needle = null;
_this._highlightNeedle = null;
_this._ranges = null;
_this._name = null;
_this._viewport = null;
return _this;
}
Object.defineProperty(GaugeVisualData.prototype, "scalePath", {
get: function () {
return this._scalePath;
},
set: function (a) {
this._scalePath = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "needlePath", {
get: function () {
return this._needlePath;
},
set: function (a) {
this._needlePath = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "highlightNeedlePath", {
get: function () {
return this._highlightNeedlePath;
},
set: function (a) {
this._highlightNeedlePath = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "backingPath", {
get: function () {
return this._backingPath;
},
set: function (a) {
this._backingPath = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "underlayPath", {
get: function () {
return this._underlayPath;
},
set: function (a) {
this._underlayPath = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "overlayPath", {
get: function () {
return this._overlayPath;
},
set: function (a) {
this._overlayPath = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "scale", {
get: function () {
return this._scale;
},
set: function (a) {
this._scale = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "scaleLabels", {
get: function () {
return this._scaleLabels;
},
set: function (a) {
this._scaleLabels = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "titleLabels", {
get: function () {
return this._titleLabels;
},
set: function (a) {
this._titleLabels = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "subtitleLabels", {
get: function () {
return this._subtitleLabels;
},
set: function (a) {
this._subtitleLabels = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "highlightLabels", {
get: function () {
return this._highlightLabels;
},
set: function (a) {
this._highlightLabels = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "scaleTickmarks", {
get: function () {
return this._scaleTickmarks;
},
set: function (a) {
this._scaleTickmarks = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "needle", {
get: function () {
return this._needle;
},
set: function (a) {
this._needle = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "highlightNeedle", {
get: function () {
return this._highlightNeedle;
},
set: function (a) {
this._highlightNeedle = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "ranges", {
get: function () {
return this._ranges;
},
set: function (a) {
this._ranges = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GaugeVisualData.prototype, "name", {
get: function () {
return this._name;
},
set: function (a) {
this._name = a;
},
enumerable: false,
configurable: true
});
GaugeVisualData.prototype.scaleByViewport = function () {
var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f;
if (this.scalePath != null) {
this.scalePath.scaleByViewport(this.viewport);
}
if (this.needlePath != null) {
this.needlePath.scaleByViewport(this.viewport);
}
if (this.highlightNeedlePath != null) {
this.highlightNeedlePath.scaleByViewport(this.viewport);
}
if (this.backingPath != null) {
this.backingPath.scaleByViewport(this.viewport);
}
if (this.underlayPath != null) {
this.underlayPath.scaleByViewport(this.viewport);
}
if (this.overlayPath != null) {
this.overlayPath.scaleByViewport(this.viewport);
}
if (this.scaleLabels != null) {
try {
for (var _g = __values(fromEnum(this.scaleLabels)), _h = _g.next(); !_h.done; _h = _g.next()) {
var a = _h.value;
a.scaleByViewport(this.viewport);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_h && !_h.done && (_a = _g.return))
_a.call(_g);
}
finally {
if (e_1)
throw e_1.error;
}
}
}
if (this.titleLabels != null) {
try {
for (var _j = __values(fromEnum(this.titleLabels)), _k = _j.next(); !_k.done; _k = _j.next()) {
var b = _k.value;
b.scaleByViewport(this.viewport);
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_k && !_k.done && (_b = _j.return))
_b.call(_j);
}
finally {
if (e_2)
throw e_2.error;
}
}
}
if (this.subtitleLabels != null) {
try {
for (var _l = __values(fromEnum(this.subtitleLabels)), _m = _l.next(); !_m.done; _m = _l.next()) {
var c = _m.value;
c.scaleByViewport(this.viewport);
}
}
catch (e_3_1) {
e_3 = { error: e_3_1 };
}
finally {
try {
if (_m && !_m.done && (_c = _l.return))
_c.call(_l);
}
finally {
if (e_3)
throw e_3.error;
}
}
}
if (this.highlightLabels != null) {
try {
for (var _o = __values(fromEnum(this.highlightLabels)), _p = _o.next(); !_p.done; _p = _o.next()) {
var d = _p.value;
d.scaleByViewport(this.viewport);
}
}
catch (e_4_1) {
e_4 = { error: e_4_1 };
}
finally {
try {
if (_p && !_p.done && (_d = _o.return))
_d.call(_o);
}
finally {
if (e_4)
throw e_4.error;
}
}
}
if (this.scaleTickmarks != null) {
try {
for (var _q = __values(fromEnum(this.scaleTickmarks)), _r = _q.next(); !_r.done; _r = _q.next()) {
var e = _r.value;
if (e.tickPath != null) {
e.tickPath.scaleByViewport(this.viewport);
}
}
}
catch (e_5_1) {
e_5 = { error: e_5_1 };
}
finally {
try {
if (_r && !_r.done && (_e = _q.return))
_e.call(_q);
}
finally {
if (e_5)
throw e_5.error;
}
}
}
if (this.ranges != null) {
try {
for (var _s = __values(fromEnum(this.ranges)), _t = _s.next(); !_t.done; _t = _s.next()) {
var f = _t.value;
if (f.rangePath != null) {
f.rangePath.scaleByViewport(this.viewport);
}
}
}
catch (e_6_1) {
e_6 = { error: e_6_1 };
}
finally {
try {
if (_t && !_t.done && (_f = _s.return))
_f.call(_s);
}
finally {
if (e_6)
throw e_6.error;
}
}
}
};
GaugeVisualData.prototype.serialize = function () {
var e_7, _a, e_8, _b, e_9, _c, e_10, _d, e_11, _e, e_12, _f;
var a = new StringBuilder(0);
var b = true;
a.u("{");
if (this.scalePath != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("scalePath: ");
a.u(this.scalePath.serialize());
}
if (this.needlePath != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("needlePath: ");
a.u(this.needlePath.serialize());
}
if (this.highlightNeedlePath != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("highlightNeedlePath: ");
a.u(this.highlightNeedlePath.serialize());
}
if (this.backingPath != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("backingPath: ");
a.u(this.backingPath.serialize());
}
if (this.underlayPath != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("underlayPath: ");
a.u(this.underlayPath.serialize());
}
if (this.overlayPath != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("overlayPath: ");
a.u(this.overlayPath.serialize());
}
if (this.scaleLabels != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
var c = true;
a.l("scaleLabels: [");
try {
for (var _g = __values(fromEnum(this.scaleLabels)), _h = _g.next(); !_h.done; _h = _g.next()) {
var d = _h.value;
if (c) {
c = false;
}
else {
a.l(", ");
}
a.u(d.serialize());
}
}
catch (e_7_1) {
e_7 = { error: e_7_1 };
}
finally {
try {
if (_h && !_h.done && (_a = _g.return))
_a.call(_g);
}
finally {
if (e_7)
throw e_7.error;
}
}
a.u("]");
}
if (this.titleLabels != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
var e = true;
a.l("titleLabels: [");
try {
for (var _j = __values(fromEnum(this.titleLabels)), _k = _j.next(); !_k.done; _k = _j.next()) {
var f = _k.value;
if (e) {
e = false;
}
else {
a.l(", ");
}
a.u(f.serialize());
}
}
catch (e_8_1) {
e_8 = { error: e_8_1 };
}
finally {
try {
if (_k && !_k.done && (_b = _j.return))
_b.call(_j);
}
finally {
if (e_8)
throw e_8.error;
}
}
a.u("]");
}
if (this.subtitleLabels != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
var g = true;
a.l("subtitleLabels: [");
try {
for (var _l = __values(fromEnum(this.subtitleLabels)), _m = _l.next(); !_m.done; _m = _l.next()) {
var h = _m.value;
if (g) {
g = false;
}
else {
a.l(", ");
}
a.u(h.serialize());
}
}
catch (e_9_1) {
e_9 = { error: e_9_1 };
}
finally {
try {
if (_m && !_m.done && (_c = _l.return))
_c.call(_l);
}
finally {
if (e_9)
throw e_9.error;
}
}
a.u("]");
}
if (this.highlightLabels != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
var i = true;
a.l("highlightLabels: [");
try {
for (var _o = __values(fromEnum(this.highlightLabels)), _p = _o.next(); !_p.done; _p = _o.next()) {
var j = _p.value;
if (i) {
i = false;
}
else {
a.l(", ");
}
a.u(j.serialize());
}
}
catch (e_10_1) {
e_10 = { error: e_10_1 };
}
finally {
try {
if (_p && !_p.done && (_d = _o.return))
_d.call(_o);
}
finally {
if (e_10)
throw e_10.error;
}
}
a.u("]");
}
if (this.scaleTickmarks != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
var k = true;
a.l("scaleTickmarks: [");
try {
for (var _q = __values(fromEnum(this.scaleTickmarks)), _r = _q.next(); !_r.done; _r = _q.next()) {
var l = _r.value;
if (k) {
k = false;
}
else {
a.l(", ");
}
a.u(l.serialize());
}
}
catch (e_11_1) {
e_11 = { error: e_11_1 };
}
finally {
try {
if (_r && !_r.done && (_e = _q.return))
_e.call(_q);
}
finally {
if (e_11)
throw e_11.error;
}
}
a.u("]");
}
if (this.needle != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("needle: ");
a.u(this.needle.serialize());
}
if (this.highlightNeedle != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("highlightNeedle: ");
a.u(this.highlightNeedle.serialize());
}
if (this.ranges != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
var m = true;
a.l("ranges: [");
try {
for (var _s = __values(fromEnum(this.ranges)), _t = _s.next(); !_t.done; _t = _s.next()) {
var n = _t.value;
if (m) {
m = false;
}
else {
a.l(", ");
}
a.u(n.serialize());
}
}
catch (e_12_1) {
e_12 = { error: e_12_1 };
}
finally {
try {
if (_t && !_t.done && (_f = _s.return))
_f.call(_s);
}
finally {
if (e_12)
throw e_12.error;
}
}
a.u("]");
}
if (this.name != null) {
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("name: '");
a.l(this.name);
a.u("'");
}
if (b) {
b = false;
}
else {
a.l(", ");
}
a.l("viewport: {");
a.l("left: " + this.viewport.left + ", top: " + this.viewport.top + ", width: " + this.viewport.width + ", height: " + this.viewport.height);
a.u("}");
a.u("}");
return a.toString();
};
Object.defineProperty(GaugeVisualData.prototype, "viewport", {
get: function () {
return this._viewport;
},
set: function (a) {
this._viewport = a;
},
enumerable: false,
configurable: true
});
GaugeVisualData.$t = markType(GaugeVisualData, 'GaugeVisualData');
return GaugeVisualData;
}(Base));
export { GaugeVisualData };