igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
288 lines (287 loc) • 10.6 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, markType } from "igniteui-react-core";
import { PointData } from "igniteui-react-core";
import { PrimitiveAppearanceData } from "igniteui-react-core";
import { LabelAppearanceData } from "igniteui-react-core";
import { RectData } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { StringBuilder } from "igniteui-react-core";
/**
* @hidden
*/
export let FunnelSliceVisualData = /*@__PURE__*/ (() => {
class FunnelSliceVisualData extends Base {
constructor() {
super();
this._isSelected = false;
this._index = 0;
this._top = 0;
this._bottom = 0;
this._sliceCenterPoint = null;
this._upperRight = null;
this._lowerRight = null;
this._upperLeft = null;
this._lowerLeft = null;
this._height = 0;
this._upperWidth = 0;
this._lowerWidth = 0;
this._innerLabel = null;
this._outerLabel = null;
this._sliceBorderBrush = null;
this._sliceBorderThickness = 0;
this._appearance = null;
this._innerLabelAppearance = null;
this._outerLabelAppearance = null;
this._slicePoints = null;
this._innerLabelPosition = null;
this._outerLabelPosition = null;
this._outerLabelBounds = null;
this._innerLabelBounds = null;
this._isVisibile = false;
this.appearance = new PrimitiveAppearanceData();
this.slicePoints = new Array(0);
this.innerLabelAppearance = new LabelAppearanceData();
this.outerLabelBounds = RectData.b(Rect.empty);
this.innerLabelBounds = RectData.b(Rect.empty);
}
get isSelected() {
return this._isSelected;
}
set isSelected(a) {
this._isSelected = a;
}
get index() {
return this._index;
}
set index(a) {
this._index = a;
}
get top() {
return this._top;
}
set top(a) {
this._top = a;
}
get bottom() {
return this._bottom;
}
set bottom(a) {
this._bottom = a;
}
get sliceCenterPoint() {
return this._sliceCenterPoint;
}
set sliceCenterPoint(a) {
this._sliceCenterPoint = a;
}
get upperRight() {
return this._upperRight;
}
set upperRight(a) {
this._upperRight = a;
}
get lowerRight() {
return this._lowerRight;
}
set lowerRight(a) {
this._lowerRight = a;
}
get upperLeft() {
return this._upperLeft;
}
set upperLeft(a) {
this._upperLeft = a;
}
get lowerLeft() {
return this._lowerLeft;
}
set lowerLeft(a) {
this._lowerLeft = a;
}
get height() {
return this._height;
}
set height(a) {
this._height = a;
}
get upperWidth() {
return this._upperWidth;
}
set upperWidth(a) {
this._upperWidth = a;
}
get lowerWidth() {
return this._lowerWidth;
}
set lowerWidth(a) {
this._lowerWidth = a;
}
get innerLabel() {
return this._innerLabel;
}
set innerLabel(a) {
this._innerLabel = a;
}
get outerLabel() {
return this._outerLabel;
}
set outerLabel(a) {
this._outerLabel = a;
}
get sliceBorderBrush() {
return this._sliceBorderBrush;
}
set sliceBorderBrush(a) {
this._sliceBorderBrush = a;
}
get sliceBorderThickness() {
return this._sliceBorderThickness;
}
set sliceBorderThickness(a) {
this._sliceBorderThickness = a;
}
get appearance() {
return this._appearance;
}
set appearance(a) {
this._appearance = a;
}
get innerLabelAppearance() {
return this._innerLabelAppearance;
}
set innerLabelAppearance(a) {
this._innerLabelAppearance = a;
}
get outerLabelAppearance() {
return this._outerLabelAppearance;
}
set outerLabelAppearance(a) {
this._outerLabelAppearance = a;
}
get slicePoints() {
return this._slicePoints;
}
set slicePoints(a) {
this._slicePoints = a;
}
get innerLabelPosition() {
return this._innerLabelPosition;
}
set innerLabelPosition(a) {
this._innerLabelPosition = a;
}
get outerLabelPosition() {
return this._outerLabelPosition;
}
set outerLabelPosition(a) {
this._outerLabelPosition = a;
}
get outerLabelBounds() {
return this._outerLabelBounds;
}
set outerLabelBounds(a) {
this._outerLabelBounds = a;
}
get innerLabelBounds() {
return this._innerLabelBounds;
}
set innerLabelBounds(a) {
this._innerLabelBounds = a;
}
get isVisibile() {
return this._isVisibile;
}
set isVisibile(a) {
this._isVisibile = a;
}
scaleByViewport(a) {
if (this.outerLabelBounds != null) {
let b = (this.outerLabelBounds.left - a.left) / a.width;
let c = ((this.outerLabelBounds.left + this.outerLabelBounds.width) - a.left) / a.width;
let d = (this.outerLabelBounds.top - a.top) / a.height;
let e = ((this.outerLabelBounds.top + this.outerLabelBounds.height) - a.top) / a.height;
this.outerLabelBounds = new RectData(b, d, c - b, e - d);
}
if (this.outerLabelPosition != null) {
let f = (this.outerLabelPosition.x - a.left) / a.width;
let g = (this.outerLabelPosition.y - a.top) / a.height;
this.outerLabelPosition = new PointData(f, g);
}
if (this.innerLabelBounds != null) {
let h = (this.innerLabelBounds.left - a.left) / a.width;
let i = ((this.innerLabelBounds.left + this.innerLabelBounds.width) - a.left) / a.width;
let j = (this.innerLabelBounds.top - a.top) / a.height;
let k = ((this.innerLabelBounds.top + this.innerLabelBounds.height) - a.top) / a.height;
this.innerLabelBounds = new RectData(h, j, i - h, k - j);
}
if (this.innerLabelPosition != null) {
let l = (this.innerLabelPosition.x - a.left) / a.width;
let m = (this.innerLabelPosition.y - a.top) / a.height;
this.innerLabelPosition = new PointData(l, m);
}
let n = new Array(this.slicePoints.length);
let o = 0;
let r = this.slicePoints;
for (let q = 0; q < r.length; q++) {
let p = r[q];
let s = (p.x - a.left) / a.width;
let t = (p.y - a.top) / a.height;
n[o] = new PointData(s, t);
o++;
}
this.slicePoints = n;
}
serialize() {
let a = new StringBuilder(0);
a.u("{");
a.u("index: " + this.index + ", ");
if (this.innerLabel != null) {
a.u("innerLabel: \"" + this.innerLabel + "\", ");
}
if (this.outerLabel != null) {
a.u("outerLabel: \"" + this.innerLabel + "\", ");
}
if (this.appearance != null) {
a.u("appearance: " + this.appearance.serialize() + ", ");
}
if (this.innerLabelAppearance != null) {
a.u("innerLabelAppearance: " + this.innerLabelAppearance.serialize() + ", ");
}
if (this.outerLabelAppearance != null) {
a.u("outerLabelAppearance: " + this.outerLabelAppearance.serialize() + ", ");
}
if (this.slicePoints != null) {
a.u("slicePoints: [");
for (let b = 0; b < this.slicePoints.length; b++) {
a.u("{ x: " + this.slicePoints[b].x + ", y: " + this.slicePoints[b].y + " }");
if (b < this.slicePoints.length - 1) {
a.l(",");
}
}
a.u("], ");
}
if (this.innerLabelBounds != null) {
a.u("innerLabelBounds: { left: " + this.innerLabelBounds.left + ", top: " + this.innerLabelBounds.top + ", width: " + this.innerLabelBounds.width + ", height: " + this.innerLabelBounds.height + "}, ");
}
if (this.outerLabelBounds != null) {
a.u("outerLabelBounds: { left: " + this.outerLabelBounds.left + ", top: " + this.outerLabelBounds.top + ", width: " + this.outerLabelBounds.width + ", height: " + this.outerLabelBounds.height + "}, ");
}
if (this.innerLabelPosition != null) {
a.u("innerLabelPosition: { x: " + this.innerLabelPosition.x + ", y: " + this.innerLabelPosition.y + "}, ");
}
if (this.outerLabelPosition != null) {
a.u("outerLabelPosition: { x: " + this.outerLabelPosition.x + ", y: " + this.outerLabelPosition.y + "}, ");
}
a.u("isSelected: " + (this.isSelected ? "true" : "false"));
a.u("}");
return a.toString();
}
}
FunnelSliceVisualData.$t = /*@__PURE__*/ markType(FunnelSliceVisualData, 'FunnelSliceVisualData');
return FunnelSliceVisualData;
})();