igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
205 lines (204 loc) • 7.29 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-angular-core";
import { AxisVisualDataList } from "./AxisVisualDataList";
import { SeriesVisualDataList } from "./SeriesVisualDataList";
import { RectData } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { StringBuilder } from "igniteui-angular-core";
import { PointData } from "igniteui-angular-core";
/**
* @hidden
*/
export let ChartVisualData = /*@__PURE__*/ (() => {
class ChartVisualData extends Base {
constructor() {
super();
this._axes = null;
this._series = null;
this._title = null;
this._subtitle = null;
this._width = 0;
this._height = 0;
this._contentArea = null;
this._centralArea = null;
this._plotArea = null;
this._name = null;
this._isViewportScaled = false;
this._defaultTooltipData = null;
this._dipScalingRatio = 0;
this.dipScalingRatio = 1;
this.axes = new AxisVisualDataList();
this.series = new SeriesVisualDataList();
}
get axes() {
return this._axes;
}
set axes(a) {
this._axes = a;
}
get series() {
return this._series;
}
set series(a) {
this._series = a;
}
get title() {
return this._title;
}
set title(a) {
this._title = a;
}
get subtitle() {
return this._subtitle;
}
set subtitle(a) {
this._subtitle = a;
}
get width() {
return this._width;
}
set width(a) {
this._width = a;
}
get height() {
return this._height;
}
set height(a) {
this._height = a;
}
get contentArea() {
return this._contentArea;
}
set contentArea(a) {
this._contentArea = a;
}
get centralArea() {
return this._centralArea;
}
set centralArea(a) {
this._centralArea = a;
}
get plotArea() {
return this._plotArea;
}
set plotArea(a) {
this._plotArea = a;
}
get name() {
return this._name;
}
set name(a) {
this._name = a;
}
get isViewportScaled() {
return this._isViewportScaled;
}
set isViewportScaled(a) {
this._isViewportScaled = a;
}
scaleByViewport() {
for (let a of fromEnum(this.axes)) {
a.q();
}
for (let b of fromEnum(this.series)) {
b.n();
}
if (this.title != null) {
this.title.g();
}
if (this.subtitle != null) {
this.subtitle.g();
}
}
getBounds() {
return new RectData(0, 0, this.width, this.height);
}
serialize() {
let a = new StringBuilder(0);
a.u("{");
if (this.name != null) {
a.u("name: '" + this.name + "',");
}
a.u("width: " + this.width + ",");
a.u("height: " + this.height + ",");
a.u("plotArea: { left: " + this.plotArea.left + ", top: " + this.plotArea.top + ", width: " + this.plotArea.width + ", height: " + this.plotArea.height + "}, ");
a.u("contentArea: { left: " + this.contentArea.left + ", top: " + this.contentArea.top + ", width: " + this.contentArea.width + ", height: " + this.contentArea.height + "}, ");
a.u("centralArea: { left: " + this.centralArea.left + ", top: " + this.centralArea.top + ", width: " + this.centralArea.width + ", height: " + this.centralArea.height + "}, ");
a.u("isViewportScaled: " + (this.isViewportScaled ? "true" : "false") + ", ");
a.u("axes: [");
for (let b = 0; b < this.axes.count; b++) {
if (b != 0) {
a.l(", ");
}
a.l(this.axes._inner[b].serialize());
}
a.u("],");
a.u("series: [");
for (let c = 0; c < this.series.count; c++) {
if (c != 0) {
a.l(", ");
}
a.l(this.series._inner[c].serialize());
}
a.u("]");
if (this.title != null) {
a.u(", title: " + this.title.serialize());
}
if (this.defaultTooltipData != null) {
a.u(", defaultTooltipData: " + this.defaultTooltipData.serialize());
}
if (this.subtitle != null) {
a.u(", subtitle: " + this.subtitle.serialize());
}
a.l(", dipScalingRatio: " + this.dipScalingRatio.toString());
a.u("}");
return a.toString();
}
getSerializedSeriesPoints(a, b, c) {
let d = new List$1(List$1.$.specialize(PointData.$), 0);
for (let e = 0; e < this.series.count; e++) {
if (this.series._inner[e].name == a) {
let f = this.series._inner[e].shapes.containingTag(b);
for (let g = 0; g < f.count; g++) {
let h = f._inner[e];
h.getPointsOverride(d, c);
}
}
}
let i = new StringBuilder(0);
i.u("[");
for (let j = 0; j < d.count; j++) {
let k = d._inner[j];
i.u("[");
for (let l = 0; l < k.count; l++) {
if (l != 0) {
i.l(", ");
}
i.l("{ x: " + k._inner[l].x + ", y: " + k._inner[l].y + "}");
}
i.u("]");
}
i.u("]");
return i.toString();
}
get defaultTooltipData() {
return this._defaultTooltipData;
}
set defaultTooltipData(a) {
this._defaultTooltipData = a;
}
get dipScalingRatio() {
return this._dipScalingRatio;
}
set dipScalingRatio(a) {
this._dipScalingRatio = a;
}
}
ChartVisualData.$t = markType(ChartVisualData, 'ChartVisualData');
return ChartVisualData;
})();