igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
639 lines (638 loc) • 22.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, markType, IList_$type, Number_$type, typeCast, Array_$type, fromEn } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { StringBuilder } from "igniteui-angular-core";
import { boxArray$1 } from "igniteui-angular-core";
import { stringFormat } from "igniteui-angular-core";
import { stringStartsWith } from "igniteui-angular-core";
/**
* @hidden
*/
var FinancialChartRangeSelectorVisualData = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(FinancialChartRangeSelectorVisualData, _super);
function FinancialChartRangeSelectorVisualData() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._visibility = null;
_this._buttonVisibilities = null;
_this._buttonLabels = null;
_this._buttonsChecked = null;
_this._buttonLefts = null;
_this._buttonTops = null;
_this._buttonWidths = null;
_this._buttonHeights = null;
_this._left = 0;
_this._top = 0;
_this._width = 0;
_this._height = 0;
return _this;
}
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "visibility", {
get: function () {
return this._visibility;
},
set: function (a) {
this._visibility = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "buttonVisibilities", {
get: function () {
return this._buttonVisibilities;
},
set: function (a) {
this._buttonVisibilities = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "buttonLabels", {
get: function () {
return this._buttonLabels;
},
set: function (a) {
this._buttonLabels = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "buttonsChecked", {
get: function () {
return this._buttonsChecked;
},
set: function (a) {
this._buttonsChecked = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "buttonLefts", {
get: function () {
return this._buttonLefts;
},
set: function (a) {
this._buttonLefts = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "buttonTops", {
get: function () {
return this._buttonTops;
},
set: function (a) {
this._buttonTops = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "buttonWidths", {
get: function () {
return this._buttonWidths;
},
set: function (a) {
this._buttonWidths = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "buttonHeights", {
get: function () {
return this._buttonHeights;
},
set: function (a) {
this._buttonHeights = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "left", {
get: function () {
return this._left;
},
set: function (a) {
this._left = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "top", {
get: function () {
return this._top;
},
set: function (a) {
this._top = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "width", {
get: function () {
return this._width;
},
set: function (a) {
this._width = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartRangeSelectorVisualData.prototype, "height", {
get: function () {
return this._height;
},
set: function (a) {
this._height = a;
},
enumerable: false,
configurable: true
});
FinancialChartRangeSelectorVisualData.prototype.serialize = function () {
return FinancialChartVisualData.y(["buttonLabels", "buttonsChecked", "buttonLefts", "buttonTops", "buttonWidths", "buttonHeights", "left", "top", "width", "height"], [this.buttonLabels, this.buttonsChecked, this.buttonLefts, this.buttonTops, this.buttonWidths, this.buttonHeights, this.left, this.top, this.width, this.height]);
};
FinancialChartRangeSelectorVisualData.$t = markType(FinancialChartRangeSelectorVisualData, 'FinancialChartRangeSelectorVisualData');
return FinancialChartRangeSelectorVisualData;
}(Base));
export { FinancialChartRangeSelectorVisualData };
/**
* @hidden
*/
var FinancialChartEnumPickerVisualData = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(FinancialChartEnumPickerVisualData, _super);
function FinancialChartEnumPickerVisualData() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.a = null;
_this.g = null;
_this.d = 0;
_this.e = 0;
_this.f = 0;
_this.c = 0;
_this.b = false;
return _this;
}
FinancialChartEnumPickerVisualData.prototype.h = function () {
return FinancialChartVisualData.y(["items", "selectedItem", "left", "top", "width", "height", "isVisible"], [this.a, this.g, this.d, this.e, this.f, this.c, this.b]);
};
FinancialChartEnumPickerVisualData.$t = markType(FinancialChartEnumPickerVisualData, 'FinancialChartEnumPickerVisualData');
return FinancialChartEnumPickerVisualData;
}(Base));
export { FinancialChartEnumPickerVisualData };
/**
* @hidden
*/
var FinancialChartToolbarVisualData = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(FinancialChartToolbarVisualData, _super);
function FinancialChartToolbarVisualData() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._chartTypePicker = null;
_this._rangeSelector = null;
return _this;
}
Object.defineProperty(FinancialChartToolbarVisualData.prototype, "chartTypePicker", {
get: function () {
return this._chartTypePicker;
},
set: function (a) {
this._chartTypePicker = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartToolbarVisualData.prototype, "rangeSelector", {
get: function () {
return this._rangeSelector;
},
set: function (a) {
this._rangeSelector = a;
},
enumerable: false,
configurable: true
});
FinancialChartToolbarVisualData.prototype.serialize = function () {
return FinancialChartVisualData.y(["chartTypePicker", "rangeSelector"], [this.chartTypePicker == null ? null : this.chartTypePicker.h(), this.rangeSelector == null ? null : this.rangeSelector.serialize()]);
};
FinancialChartToolbarVisualData.$t = markType(FinancialChartToolbarVisualData, 'FinancialChartToolbarVisualData');
return FinancialChartToolbarVisualData;
}(Base));
export { FinancialChartToolbarVisualData };
/**
* @hidden
*/
var FinancialChartVisualData = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(FinancialChartVisualData, _super);
function FinancialChartVisualData() {
var _this = _super.call(this) || this;
_this._mainChart = null;
_this._volumeChart = null;
_this._indicatorCharts = null;
_this._toolbar = null;
_this._zoomChart = null;
_this._mainChartLeft = 0;
_this._mainChartTop = 0;
_this._volumeChartLeft = 0;
_this._volumeChartTop = 0;
_this._indicatorChartLefts = null;
_this._indicatorChartTops = null;
_this._zoomChartLeft = 0;
_this._zoomChartTop = 0;
_this._toolbarLeft = 0;
_this._toolbarTop = 0;
_this._toolbarWidth = 0;
_this._toolbarHeight = 0;
_this._legendLeft = 0;
_this._legendTop = 0;
_this._legendWidth = 0;
_this._legendHeight = 0;
_this._legend = null;
_this.mainChartLeft = NaN;
_this.mainChartTop = NaN;
_this.volumeChartLeft = NaN;
_this.volumeChartTop = NaN;
_this.zoomChartLeft = NaN;
_this.zoomChartTop = NaN;
_this.indicatorChartLefts = new List$1(Number_$type, 0);
_this.indicatorChartTops = new List$1(Number_$type, 0);
return _this;
}
Object.defineProperty(FinancialChartVisualData.prototype, "mainChart", {
get: function () {
return this._mainChart;
},
set: function (a) {
this._mainChart = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "volumeChart", {
get: function () {
return this._volumeChart;
},
set: function (a) {
this._volumeChart = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "indicatorCharts", {
get: function () {
return this._indicatorCharts;
},
set: function (a) {
this._indicatorCharts = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "toolbar", {
get: function () {
return this._toolbar;
},
set: function (a) {
this._toolbar = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "zoomChart", {
get: function () {
return this._zoomChart;
},
set: function (a) {
this._zoomChart = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "mainChartLeft", {
get: function () {
return this._mainChartLeft;
},
set: function (a) {
this._mainChartLeft = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "mainChartTop", {
get: function () {
return this._mainChartTop;
},
set: function (a) {
this._mainChartTop = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "volumeChartLeft", {
get: function () {
return this._volumeChartLeft;
},
set: function (a) {
this._volumeChartLeft = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "volumeChartTop", {
get: function () {
return this._volumeChartTop;
},
set: function (a) {
this._volumeChartTop = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "indicatorChartLefts", {
get: function () {
return this._indicatorChartLefts;
},
set: function (a) {
this._indicatorChartLefts = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "indicatorChartTops", {
get: function () {
return this._indicatorChartTops;
},
set: function (a) {
this._indicatorChartTops = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "zoomChartLeft", {
get: function () {
return this._zoomChartLeft;
},
set: function (a) {
this._zoomChartLeft = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "zoomChartTop", {
get: function () {
return this._zoomChartTop;
},
set: function (a) {
this._zoomChartTop = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "toolbarLeft", {
get: function () {
return this._toolbarLeft;
},
set: function (a) {
this._toolbarLeft = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "toolbarTop", {
get: function () {
return this._toolbarTop;
},
set: function (a) {
this._toolbarTop = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "toolbarWidth", {
get: function () {
return this._toolbarWidth;
},
set: function (a) {
this._toolbarWidth = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "toolbarHeight", {
get: function () {
return this._toolbarHeight;
},
set: function (a) {
this._toolbarHeight = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "legendLeft", {
get: function () {
return this._legendLeft;
},
set: function (a) {
this._legendLeft = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "legendTop", {
get: function () {
return this._legendTop;
},
set: function (a) {
this._legendTop = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "legendWidth", {
get: function () {
return this._legendWidth;
},
set: function (a) {
this._legendWidth = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "legendHeight", {
get: function () {
return this._legendHeight;
},
set: function (a) {
this._legendHeight = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChartVisualData.prototype, "legend", {
get: function () {
return this._legend;
},
set: function (a) {
this._legend = a;
},
enumerable: false,
configurable: true
});
FinancialChartVisualData.prototype.ab = function (a) {
if (a != null) {
var chart_ = a;
chart_.scaleByViewport();
}
};
FinancialChartVisualData.prototype.scaleByViewport = function () {
this.ab(this.mainChart);
this.ab(this.volumeChart);
if (this.indicatorCharts != null) {
for (var a = 0; a < this.indicatorCharts.count; a++) {
this.ab(this.indicatorCharts._inner[a]);
}
}
this.ab(this.zoomChart);
};
FinancialChartVisualData.prototype.w = function (a) {
if (a != null) {
var chart_ = a;
return (chart_.serialize());
}
return null;
};
FinancialChartVisualData.prototype.serialize = function () {
var a = new StringBuilder(0);
a.u("{");
if (this.volumeChart != null) {
a.u("volumeChart: " + this.w(this.volumeChart) + ",");
}
if (this.zoomChart != null) {
a.u("zoomChart: " + this.w(this.zoomChart) + ",");
}
if (this.indicatorCharts != null) {
a.u("indicatorCharts: [");
for (var b = 0; b < this.indicatorCharts.count; b++) {
if (b > 0) {
a.u(",");
}
a.l(this.w(this.indicatorCharts._inner[b]));
}
a.t();
a.u("],");
}
if (this.toolbar != null) {
a.u("toolbar: " + this.toolbar.serialize() + ",");
}
if (this.mainChart != null) {
a.u("mainChart: " + this.w(this.mainChart) + ",");
}
a.u("mainChartLeft: " + this.mainChartLeft.toString() + ",");
a.u("mainChartTop: " + this.mainChartTop.toString() + ",");
a.u("volumeChartLeft: " + this.volumeChartLeft.toString() + ",");
a.u("volumeChartTop: " + this.volumeChartTop.toString() + ",");
a.u("zoomChartLeft: " + this.zoomChartLeft.toString() + ",");
a.u("zoomChartTop: " + this.zoomChartTop.toString() + ",");
a.u("toolbarLeft: " + this.toolbarLeft.toString() + ",");
a.u("toolbarTop: " + this.toolbarTop.toString() + ",");
a.u("toolbarWidth: " + this.toolbarWidth.toString() + ",");
a.u("toolbarHeight: " + this.toolbarHeight.toString() + ",");
a.u("indicatorChartLefts: [");
for (var c = 0; c < this.indicatorChartLefts.count; c++) {
if (c > 0) {
a.u(",");
}
a.k(this.indicatorChartLefts._inner[c]);
}
a.t();
a.u("],");
a.u("indicatorChartTops: [");
for (var d = 0; d < this.indicatorChartTops.count; d++) {
if (d > 0) {
a.u(",");
}
a.k(this.indicatorChartTops._inner[d]);
}
a.t();
a.u("],");
a.u(stringFormat("legendLeft: {0},", this.legendLeft));
a.u(stringFormat("legendTop: {0},", this.legendTop));
a.u(stringFormat("legendWidth: {0},", this.legendWidth));
a.u(stringFormat("legendHeight: {0},", this.legendHeight));
var e;
if (this.legend != null) {
e = (this.legend.serialize());
}
else {
e = "null";
}
a.u(stringFormat("legend: {0}", e));
a.u("}");
return a.toString();
};
FinancialChartVisualData.y = function (a, b) {
var c = new StringBuilder(0);
c.u("{");
for (var d = 0; d < a.length; d++) {
c.l(a[d] + ": " + FinancialChartVisualData.aa(b[d]));
if (d < a.length - 1) {
c.l(", ");
}
c.t();
}
c.l("}");
return c.toString();
};
FinancialChartVisualData.aa = function (a) {
if (a == null) {
return "null";
}
if (typeof a === 'string' && !stringStartsWith(a, "{")) {
return "\"" + a + "\"";
}
if (typeCast(IList_$type, a) !== null) {
return FinancialChartVisualData.z(a);
}
if (typeCast(Array_$type, a) !== null) {
return FinancialChartVisualData.z(boxArray$1(a));
}
return a.toString();
};
FinancialChartVisualData.z = function (a) {
var e_1, _a;
if (a == null) {
return "null";
}
var b = new StringBuilder(0);
b.l("[");
var c = 0;
try {
for (var _b = __values(fromEn(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
var d = _c.value;
b.l(FinancialChartVisualData.aa(d));
if (++c < a.count) {
b.l(", ");
}
}
}
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;
}
}
b.l("]");
return b.toString();
};
FinancialChartVisualData.$t = markType(FinancialChartVisualData, 'FinancialChartVisualData');
return FinancialChartVisualData;
}(Base));
export { FinancialChartVisualData };