igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
401 lines (397 loc) • 15.1 kB
JavaScript
import { __extends } from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcNumericXAxisComponent } from "./igc-numeric-x-axis-component";
import { IgcNumericYAxisComponent } from "./igc-numeric-y-axis-component";
import { IgcTriangulationStatusEventArgs } from "igniteui-webcomponents-core";
import { IgcSeriesComponent } from "./igc-series-component";
import { getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core";
/**
* Base class for series which triangulate XY data prior to rendering.
*/
export var IgcScatterTriangulationSeriesComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcScatterTriangulationSeriesComponent, _super);
function IgcScatterTriangulationSeriesComponent() {
var _this = _super.call(this) || this;
_this._xAxisName = null;
_this._yAxisName = null;
_this._triangulationStatusChanged = null;
_this._triangulationStatusChanged_wrapped = null;
return _this;
}
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcScatterTriangulationSeriesComponent.prototype.connectedCallback = function () {
if (_super.prototype["connectedCallback"]) {
_super.prototype["connectedCallback"].call(this);
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
};
IgcScatterTriangulationSeriesComponent.prototype.disconnectedCallback = function () {
if (_super.prototype["disconnectedCallback"]) {
_super.prototype["disconnectedCallback"].call(this);
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
};
Object.defineProperty(IgcScatterTriangulationSeriesComponent, "observedAttributes", {
get: function () {
if (IgcScatterTriangulationSeriesComponent._observedAttributesIgcScatterTriangulationSeriesComponent == null) {
var names = getAllPropertyNames(IgcScatterTriangulationSeriesComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcScatterTriangulationSeriesComponent._observedAttributesIgcScatterTriangulationSeriesComponent = names;
}
return IgcScatterTriangulationSeriesComponent._observedAttributesIgcScatterTriangulationSeriesComponent;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "xMemberPath", {
/**
* The name of the property from which to extract the X-coordinate for each item in the ItemsSource.
*/
get: function () {
return this.i.yl;
},
set: function (v) {
this.i.yl = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "yMemberPath", {
/**
* The name of the property from which to extract the Y-coordinate for each item in the ItemsSource.
*/
get: function () {
return this.i.yt;
},
set: function (v) {
this.i.yt = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "xAxis", {
/**
* The X-Axis for this series.
*/
get: function () {
var r = this.i.xj;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgcNumericXAxisComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.xj = null : this.i.xj = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "xAxisName", {
/**
* Gets or sets the name to use to resolve xAxis from markup.
*/
get: function () {
return this._xAxisName;
},
set: function (v) {
this._xAxisName = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "yAxis", {
/**
* The Y-Axis for this series.
*/
get: function () {
var r = this.i.xk;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgcNumericYAxisComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.xk = null : this.i.xk = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "yAxisName", {
/**
* Gets or sets the name to use to resolve yAxis from markup.
*/
get: function () {
return this._yAxisName;
},
set: function (v) {
this._yAxisName = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "trianglesSource", {
/**
* The source of triangulation data.
* This property is optional. If it is left as null, the triangulation will be created based on the items in the ItemsSource. Triangulation is a demanding operation, so the runtime performance will be better when specifying a TriangulationSource, especially when a large number of data items are present.
*/
get: function () {
return this.i.trianglesSource;
},
set: function (v) {
this.i.trianglesSource = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "triangleVertexMemberPath1", {
/**
* The name of the property of the TrianglesSource items which, for each triangle, contains the index of the first vertex point in the ItemsSource.
*/
get: function () {
return this.i.x9;
},
set: function (v) {
this.i.x9 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "triangleVertexMemberPath2", {
/**
* The name of the property of the TrianglesSource items which, for each triangle, contains the index of the second vertex point in the ItemsSource.
*/
get: function () {
return this.i.yb;
},
set: function (v) {
this.i.yb = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "triangleVertexMemberPath3", {
/**
* The name of the property of the TrianglesSource items which, for each triangle, contains the index of the third vertex point in the ItemsSource.
*/
get: function () {
return this.i.yd;
},
set: function (v) {
this.i.yd = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "isShape", {
/**
* Gets whether or not this series is a shape series
*/
get: function () {
return this.i.f0;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "isMarkerlessDisplayPreferred", {
/**
* Overridden by derived series classes to indicate when marker-less display is preferred or not.
*/
get: function () {
return this.i.fo;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "xMemberAsLegendLabel", {
/**
* Gets or sets the label displayed before series X value in the Data Legend.
*/
get: function () {
return this.i.yh;
},
set: function (v) {
this.i.yh = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "yMemberAsLegendLabel", {
/**
* Gets or sets the label displayed before series Y value in the Data Legend.
*/
get: function () {
return this.i.yp;
},
set: function (v) {
this.i.yp = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "xMemberAsLegendUnit", {
/**
* Gets or sets the unit after displayed after series X value in the Data Legend.
*/
get: function () {
return this.i.yj;
},
set: function (v) {
this.i.yj = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "yMemberAsLegendUnit", {
/**
* Gets or sets the unit after displayed after series Y value in the Data Legend.
*/
get: function () {
return this.i.yr;
},
set: function (v) {
this.i.yr = v;
},
enumerable: false,
configurable: true
});
IgcScatterTriangulationSeriesComponent.prototype.bindAxes = function (axes) {
_super.prototype.bindAxes.call(this, axes);
for (var i = 0; i < axes.length; i++) {
if (this.xAxisName && this.xAxisName.length > 0 &&
axes[i].name == this.xAxisName) {
this.xAxis = axes[i];
}
}
for (var i = 0; i < axes.length; i++) {
if (this.yAxisName && this.yAxisName.length > 0 &&
axes[i].name == this.yAxisName) {
this.yAxis = axes[i];
}
}
};
IgcScatterTriangulationSeriesComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.xAxis && this.xAxis.name && this.xAxis.name == name) {
return this.xAxis;
}
if (this.yAxis && this.yAxis.name && this.yAxis.name == name) {
return this.yAxis;
}
return null;
};
IgcScatterTriangulationSeriesComponent.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.xAxis && this.xAxis._styling) {
this.xAxis._styling(container, component, this);
}
if (this.yAxis && this.yAxis._styling) {
this.yAxis._styling(container, component, this);
}
this._inStyling = false;
};
IgcScatterTriangulationSeriesComponent.prototype.getItemValue = function (item, memberPathName) {
var iv = this.i.kz(item, memberPathName);
return (iv);
};
/**
* Gets the value of a requested member path from the series.
* @param memberPathName * The property name of a valid member path for the series
*/
IgcScatterTriangulationSeriesComponent.prototype.getMemberPathValue = function (memberPathName) {
var iv = this.i.mo(memberPathName);
return (iv);
};
/**
* Determine if object can be used as YAxis
* @param axis * The object to check
*/
IgcScatterTriangulationSeriesComponent.prototype.canUseAsYAxis = function (axis) {
var iv = this.i.x1(axis);
return (iv);
};
/**
* Determine if object can be used as XAxis
* @param axis * The object to check
*/
IgcScatterTriangulationSeriesComponent.prototype.canUseAsXAxis = function (axis) {
var iv = this.i.x0(axis);
return (iv);
};
Object.defineProperty(IgcScatterTriangulationSeriesComponent.prototype, "triangulationStatusChanged", {
/**
* Raised when the status of an ongoing Triangulation has changed.
*/
get: function () {
return this._triangulationStatusChanged;
},
set: function (ev) {
var _this = this;
if (this._triangulationStatusChanged_wrapped !== null) {
this.i.triangulationStatusChanged = delegateRemove(this.i.triangulationStatusChanged, this._triangulationStatusChanged_wrapped);
this._triangulationStatusChanged_wrapped = null;
this._triangulationStatusChanged = null;
}
this._triangulationStatusChanged = ev;
this._triangulationStatusChanged_wrapped = function (o, e) {
var outerArgs = new IgcTriangulationStatusEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeTriangulationStatusChanged) {
_this.beforeTriangulationStatusChanged(_this, outerArgs);
}
if (_this._triangulationStatusChanged) {
_this._triangulationStatusChanged(_this, outerArgs);
}
};
this.i.triangulationStatusChanged = delegateCombine(this.i.triangulationStatusChanged, this._triangulationStatusChanged_wrapped);
;
},
enumerable: false,
configurable: true
});
IgcScatterTriangulationSeriesComponent._observedAttributesIgcScatterTriangulationSeriesComponent = null;
return IgcScatterTriangulationSeriesComponent;
}(IgcSeriesComponent));