igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
190 lines (189 loc) • 6.74 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 { Base, fromEnum, markType } from "igniteui-react-core";
import { AxisLabelVisualDataList } from "./AxisLabelVisualDataList";
import { ChartTitleVisualData } from "./ChartTitleVisualData";
import { StringBuilder } from "igniteui-react-core";
/**
* @hidden
*/
export let AxisVisualData = /*@__PURE__*/ (() => {
class AxisVisualData extends Base {
constructor() {
super();
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();
}
get name() {
return this._name;
}
set name(a) {
this._name = a;
}
get type() {
return this._type;
}
set type(a) {
this._type = a;
}
get viewport() {
return this._viewport;
}
set viewport(a) {
this._viewport = a;
}
get tickMarksLength() {
return this._tickMarksLength;
}
set tickMarksLength(a) {
this._tickMarksLength = a;
}
get tickMarks() {
return this._tickMarks;
}
set tickMarks(a) {
this._tickMarks = a;
}
get labels() {
return this._labels;
}
set labels(a) {
this._labels = a;
}
get axisLine() {
return this._axisLine;
}
set axisLine(a) {
this._axisLine = a;
}
get majorLines() {
return this._majorLines;
}
set majorLines(a) {
this._majorLines = a;
}
get minorLines() {
return this._minorLines;
}
set minorLines(a) {
this._minorLines = a;
}
get strips() {
return this._strips;
}
set strips(a) {
this._strips = a;
}
get labelsPlotArea() {
return this._labelsPlotArea;
}
set labelsPlotArea(a) {
this._labelsPlotArea = a;
}
get labelsViewport() {
return this._labelsViewport;
}
set labelsViewport(a) {
this._labelsViewport = a;
}
get title() {
return this._title;
}
set title(a) {
this._title = a;
}
get annotationBackings() {
return this._annotationBackings;
}
set annotationBackings(a) {
this._annotationBackings = a;
}
p() {
let a = true;
if (Base.equalsStatic(this.type, "NumericYAxis") || Base.equalsStatic(this.type, "CategoryYAxis") || Base.equalsStatic(this.type, "PercentChangeYAxis")) {
a = false;
}
for (let b of fromEnum(this.labels)) {
b.h(this.labelsViewport, a);
}
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) {
for (let c of fromEnum(this.annotationBackings)) {
c.scaleByViewport(this.labelsViewport);
}
}
}
serialize() {
let 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 (let 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 (let 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 = /*@__PURE__*/ markType(AxisVisualData, 'AxisVisualData');
return AxisVisualData;
})();