igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
214 lines (213 loc) • 7.17 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 { RectData } from "igniteui-react-core";
import { StringBuilder } from "igniteui-react-core";
/**
* @hidden
*/
export let PieSliceVisualData = /*@__PURE__*/ (() => {
class PieSliceVisualData extends Base {
constructor() {
super();
this._startAngle = 0;
this._endAngle = 0;
this._origin = null;
this._explodedOrigin = null;
this._radius = 0;
this._explodedRadius = 0;
this._innerExtentStart = 0;
this._innerExtentEnd = 0;
this._isSelected = false;
this._isExploded = false;
this._isOthersSlice = false;
this._index = 0;
this._label = null;
this._labelAngle = 0;
this._labelBounds = null;
this._appearance = null;
this._labelAppearance = null;
this._leaderLineAppearance = null;
this._slicePath = null;
this._leaderLinePath = null;
this.labelBounds = RectData.empty;
}
get startAngle() {
return this._startAngle;
}
set startAngle(a) {
this._startAngle = a;
}
get endAngle() {
return this._endAngle;
}
set endAngle(a) {
this._endAngle = a;
}
get origin() {
return this._origin;
}
set origin(a) {
this._origin = a;
}
get explodedOrigin() {
return this._explodedOrigin;
}
set explodedOrigin(a) {
this._explodedOrigin = a;
}
get radius() {
return this._radius;
}
set radius(a) {
this._radius = a;
}
get explodedRadius() {
return this._explodedRadius;
}
set explodedRadius(a) {
this._explodedRadius = a;
}
get innerExtentStart() {
return this._innerExtentStart;
}
set innerExtentStart(a) {
this._innerExtentStart = a;
}
get innerExtentEnd() {
return this._innerExtentEnd;
}
set innerExtentEnd(a) {
this._innerExtentEnd = a;
}
get isSelected() {
return this._isSelected;
}
set isSelected(a) {
this._isSelected = a;
}
get isExploded() {
return this._isExploded;
}
set isExploded(a) {
this._isExploded = a;
}
get isOthersSlice() {
return this._isOthersSlice;
}
set isOthersSlice(a) {
this._isOthersSlice = a;
}
get index() {
return this._index;
}
set index(a) {
this._index = a;
}
get label() {
return this._label;
}
set label(a) {
this._label = a;
}
get labelAngle() {
return this._labelAngle;
}
set labelAngle(a) {
this._labelAngle = a;
}
get labelBounds() {
return this._labelBounds;
}
set labelBounds(a) {
this._labelBounds = a;
}
get appearance() {
return this._appearance;
}
set appearance(a) {
this._appearance = a;
}
get labelAppearance() {
return this._labelAppearance;
}
set labelAppearance(a) {
this._labelAppearance = a;
}
get leaderLineAppearance() {
return this._leaderLineAppearance;
}
set leaderLineAppearance(a) {
this._leaderLineAppearance = a;
}
get slicePath() {
return this._slicePath;
}
set slicePath(a) {
this._slicePath = a;
}
get leaderLinePath() {
return this._leaderLinePath;
}
set leaderLinePath(a) {
this._leaderLinePath = a;
}
scaleByViewport(a) {
if (this.slicePath != null) {
this.slicePath.scaleByViewport(a);
}
if (this.leaderLinePath != null) {
this.leaderLinePath.scaleByViewport(a);
}
if (!this.labelBounds.isEmpty) {
let b = (this.labelBounds.left - a.left) / a.width;
let c = (this.labelBounds.top - a.top) / a.height;
let d = ((this.labelBounds.left + this.labelBounds.width) - a.left) / a.width;
let e = ((this.labelBounds.top + this.labelBounds.height) - a.top) / a.height;
this.labelBounds = new RectData(b, c, d - b, e - c);
}
if (this.origin != null) {
this.origin = new PointData((this.origin.x - a.left) / a.width, (this.origin.y - a.top) / a.height);
}
if (this.explodedOrigin != null) {
this.explodedOrigin = new PointData((this.explodedOrigin.x - a.left) / a.width, (this.explodedOrigin.y - a.top) / a.height);
}
}
serialize() {
let a = new StringBuilder(0);
a.u("{");
if (this.label != null) {
a.u("label: \"" + this.label + "\", ");
}
if (this.appearance != null) {
a.u("appearance: " + this.appearance.serialize() + ", ");
}
if (this.labelAppearance != null) {
a.u("labelAppearance: " + this.labelAppearance.serialize() + ", ");
}
if (this.leaderLineAppearance != null) {
a.u("leaderLineAppearance: " + this.leaderLineAppearance.serialize() + ", ");
}
if (this.slicePath != null) {
a.u("slicePath: " + this.slicePath.serialize() + ", ");
}
if (this.leaderLinePath != null) {
let b = this.leaderLinePath.serialize();
if (b != null) {
a.u("leaderLinePath: " + b + ", ");
}
}
a.u("labelAngle: " + this.labelAngle + ", ");
a.u("labelBounds: { left: " + this.labelBounds.left + ", top: " + this.labelBounds.top + ", width: " + this.labelBounds.width + ", height: " + this.labelBounds.height + "}");
a.u("}");
return a.toString();
}
}
PieSliceVisualData.$t = /*@__PURE__*/ markType(PieSliceVisualData, 'PieSliceVisualData');
return PieSliceVisualData;
})();