igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
281 lines (280 loc) • 9.45 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-react-core";
import { AxisLabelVisualDataList } from "./AxisLabelVisualDataList";
import { ChartTitleVisualData } from "./ChartTitleVisualData";
import { StringBuilder } from "igniteui-react-core";
/**
* @hidden
*/
var AxisVisualData = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(AxisVisualData, _super);
function AxisVisualData() {
var _this = _super.call(this) || this;
_this._name = null;
_this._type = null;
_this._viewport = null;
_this._tickMarksLength = 0;
_this._tickMarks = null;
_this._labels = null;
_this._axisLine = null;
_this._majorLines = null;
_this._minorLines = null;
_this._strips = null;
_this._labelsPlotArea = null;
_this._labelsViewport = null;
_this._title = null;
_this._annotationBackings = null;
_this.tickMarksLength = 0;
_this.labels = new AxisLabelVisualDataList();
_this.title = new ChartTitleVisualData();
return _this;
}
Object.defineProperty(AxisVisualData.prototype, "name", {
get: function () {
return this._name;
},
set: function (a) {
this._name = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "type", {
get: function () {
return this._type;
},
set: function (a) {
this._type = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "viewport", {
get: function () {
return this._viewport;
},
set: function (a) {
this._viewport = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "tickMarksLength", {
get: function () {
return this._tickMarksLength;
},
set: function (a) {
this._tickMarksLength = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "tickMarks", {
get: function () {
return this._tickMarks;
},
set: function (a) {
this._tickMarks = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "labels", {
get: function () {
return this._labels;
},
set: function (a) {
this._labels = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "axisLine", {
get: function () {
return this._axisLine;
},
set: function (a) {
this._axisLine = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "majorLines", {
get: function () {
return this._majorLines;
},
set: function (a) {
this._majorLines = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "minorLines", {
get: function () {
return this._minorLines;
},
set: function (a) {
this._minorLines = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "strips", {
get: function () {
return this._strips;
},
set: function (a) {
this._strips = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "labelsPlotArea", {
get: function () {
return this._labelsPlotArea;
},
set: function (a) {
this._labelsPlotArea = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "labelsViewport", {
get: function () {
return this._labelsViewport;
},
set: function (a) {
this._labelsViewport = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "title", {
get: function () {
return this._title;
},
set: function (a) {
this._title = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AxisVisualData.prototype, "annotationBackings", {
get: function () {
return this._annotationBackings;
},
set: function (a) {
this._annotationBackings = a;
},
enumerable: false,
configurable: true
});
AxisVisualData.prototype.p = function () {
var e_1, _a, e_2, _b;
var a = true;
if (Base.equalsStatic(this.type, "NumericYAxis") || Base.equalsStatic(this.type, "CategoryYAxis") || Base.equalsStatic(this.type, "PercentChangeYAxis")) {
a = false;
}
try {
for (var _c = __values(fromEnum(this.labels)), _d = _c.next(); !_d.done; _d = _c.next()) {
var b = _d.value;
b.h(this.labelsViewport, a);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_d && !_d.done && (_a = _c.return))
_a.call(_c);
}
finally {
if (e_1)
throw e_1.error;
}
}
this.tickMarks.scaleByViewport(this.labelsViewport);
this.axisLine.scaleByViewport(this.labelsViewport);
if (this.title != null) {
this.title.h(this.labelsViewport);
}
this.majorLines.scaleByViewport(this.viewport);
this.minorLines.scaleByViewport(this.viewport);
this.strips.scaleByViewport(this.viewport);
if (this.annotationBackings != null) {
try {
for (var _e = __values(fromEnum(this.annotationBackings)), _f = _e.next(); !_f.done; _f = _e.next()) {
var c = _f.value;
c.scaleByViewport(this.labelsViewport);
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_f && !_f.done && (_b = _e.return))
_b.call(_e);
}
finally {
if (e_2)
throw e_2.error;
}
}
}
};
AxisVisualData.prototype.serialize = function () {
var a = new StringBuilder(0);
a.u("{");
if (this.name != null) {
a.u("name: \"" + this.name + "\",");
}
a.u("type: \"" + this.type + "\", ");
a.u("tickMarksLength: \"" + this.tickMarksLength.toString() + "\", ");
a.u("viewport: " + this.viewport.serialize() + ", ");
a.u("labelsViewport: " + this.labelsViewport.serialize() + ", ");
if (this.labelsPlotArea != null) {
a.u("labelsPlotArea: " + this.labelsPlotArea.serialize() + ", ");
}
a.u("labels: [");
for (var b = 0; b < this.labels.count; b++) {
if (b != 0) {
a.l(", ");
}
a.l(this.labels._inner[b].serialize());
}
a.u("],");
if (this.title != null) {
a.u("title: " + ((this.title != null) ? this.title.serialize() : "null") + ", ");
}
a.u("axisLine: " + ((this.axisLine != null) ? this.axisLine.serialize() : "null") + ", ");
a.u("tickMarks: " + ((this.tickMarks != null) ? this.tickMarks.serialize() : "null") + ", ");
if (this.annotationBackings != null) {
a.u("annotationBackings: [");
for (var c = 0; c < this.annotationBackings.count; c++) {
if (c != 0) {
a.l(", ");
}
a.l(this.annotationBackings._inner[c].serialize());
}
a.u("],");
}
if (this.axisLine != null) {
a.u("majorLines: " + ((this.majorLines != null) ? this.majorLines.serialize() : "null") + ", ");
a.u("minorLines: " + ((this.minorLines != null) ? this.minorLines.serialize() : "null") + ", ");
a.u("strips: " + ((this.strips != null) ? this.strips.serialize() : "null"));
}
a.u("}");
return a.toString();
};
AxisVisualData.$t = markType(AxisVisualData, 'AxisVisualData');
return AxisVisualData;
}(Base));
export { AxisVisualData };