igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
399 lines (393 loc) • 14.2 kB
JavaScript
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcNumericXAxisComponent } from "./igc-numeric-x-axis-component";
import { IgcNumericYAxisComponent } from "./igc-numeric-y-axis-component";
import { IgcProgressiveLoadStatusEventArgs } from "./igc-progressive-load-status-event-args";
import { IgcSeriesComponent } from "./igc-series-component";
import { HighDensityScatterSeries } from "./HighDensityScatterSeries";
import { getAllPropertyNames, toSpinal, ensureBool, colorToString, stringToColor, toPoint } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents a IgxDataChartComponent series where a high volume of scatter points can be displayed.
*/
export let IgcHighDensityScatterSeriesComponent = /*@__PURE__*/ (() => {
class IgcHighDensityScatterSeriesComponent extends IgcSeriesComponent {
createImplementation() {
return new HighDensityScatterSeries();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor() {
super();
this._xAxisName = null;
this._yAxisName = null;
this._progressiveLoadStatusChanged = null;
this._progressiveLoadStatusChanged_wrapped = null;
}
connectedCallback() {
if (super["connectedCallback"]) {
super["connectedCallback"]();
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
}
disconnectedCallback() {
if (super["disconnectedCallback"]) {
super["disconnectedCallback"]();
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
}
static get observedAttributes() {
if (IgcHighDensityScatterSeriesComponent._observedAttributesIgcHighDensityScatterSeriesComponent == null) {
let names = getAllPropertyNames(IgcHighDensityScatterSeriesComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcHighDensityScatterSeriesComponent._observedAttributesIgcHighDensityScatterSeriesComponent = names;
}
return IgcHighDensityScatterSeriesComponent._observedAttributesIgcHighDensityScatterSeriesComponent;
}
static register() {
if (!IgcHighDensityScatterSeriesComponent._isElementRegistered) {
IgcHighDensityScatterSeriesComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcHighDensityScatterSeriesComponent.htmlTagName, IgcHighDensityScatterSeriesComponent);
}
}
/**
* Gets whether the current series shows pixels.
*/
get isPixel() {
return this.i.fp;
}
/**
* Checks if this series is a scatter series
*/
get isScatter() {
return this.i.fx;
}
/**
* Gets or sets the effective x-axis for the current object.
*/
get xAxis() {
const r = this.i.xa;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcNumericXAxisComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set xAxis(v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.xa = null : this.i.xa = v.i;
}
/**
* Gets or sets the name to use to resolve xAxis from markup.
*/
get xAxisName() {
return this._xAxisName;
}
set xAxisName(v) {
this._xAxisName = v;
}
/**
* Gets or sets the effective y-axis for the current object.
*/
get yAxis() {
const r = this.i.xc;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgcNumericYAxisComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set yAxis(v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.xc = null : this.i.xc = v.i;
}
/**
* Gets or sets the name to use to resolve yAxis from markup.
*/
get yAxisName() {
return this._yAxisName;
}
set yAxisName(v) {
this._yAxisName = v;
}
/**
* Gets or sets the x value mapping property for the current series object.
*/
get xMemberPath() {
return this.i.ze;
}
set xMemberPath(v) {
this.i.ze = v;
}
/**
* Gets or sets the label displayed before series X value in the Data Legend.
*/
get xMemberAsLegendLabel() {
return this.i.za;
}
set xMemberAsLegendLabel(v) {
this.i.za = v;
}
/**
* Gets or sets the label displayed before series Y value in the Data Legend.
*/
get yMemberAsLegendLabel() {
return this.i.zi;
}
set yMemberAsLegendLabel(v) {
this.i.zi = v;
}
/**
* Gets or sets the unit after displayed after series X value in the Data Legend.
*/
get xMemberAsLegendUnit() {
return this.i.zc;
}
set xMemberAsLegendUnit(v) {
this.i.zc = v;
}
/**
* Gets or sets the unit after displayed after series Y value in the Data Legend.
*/
get yMemberAsLegendUnit() {
return this.i.zk;
}
set yMemberAsLegendUnit(v) {
this.i.zk = v;
}
/**
* Gets or sets the y value mapping property for the current series object.
*/
get yMemberPath() {
return this.i.zm;
}
set yMemberPath(v) {
this.i.zm = v;
}
/**
* Gets or sets the whether to use use brute force mode.
*/
get useBruteForce() {
return this.i.xr;
}
set useBruteForce(v) {
this.i.xr = ensureBool(v);
this._a("useBruteForce", this.i.xr);
}
/**
* Gets or sets the whether to progressively load the data into the chart.
*/
get progressiveLoad() {
return this.i.xq;
}
set progressiveLoad(v) {
this.i.xq = ensureBool(v);
this._a("progressiveLoad", this.i.xq);
}
/**
* Gets or sets the density value that maps to the minimum heat color.
*/
get heatMinimum() {
return this.i.ym;
}
set heatMinimum(v) {
this.i.ym = +v;
this._a("heatMinimum", this.i.ym);
}
/**
* Gets or sets the value that maps to the maximum heat color.
*/
get heatMaximum() {
return this.i.yl;
}
set heatMaximum(v) {
this.i.yl = +v;
this._a("heatMaximum", this.i.yl);
}
/**
* Gets or sets the color to use for the minimum end of the scale.
*/
get heatMinimumColor() {
return colorToString(this.i.aak);
}
set heatMinimumColor(v) {
this.i.aak = stringToColor(v);
this._a("heatMinimumColor", colorToString(this.i.aak));
}
/**
* Gets or sets the color to use for the maximum end of the scale.
*/
get heatMaximumColor() {
return colorToString(this.i.aaj);
}
set heatMaximumColor(v) {
this.i.aaj = stringToColor(v);
this._a("heatMaximumColor", colorToString(this.i.aaj));
}
/**
* Gets or sets the the pixel extent of the square data points that are rendered.
*/
get pointExtent() {
return this.i.yy;
}
set pointExtent(v) {
this.i.yy = +v;
this._a("pointExtent", this.i.yy);
}
/**
* Represents the current status of the progressive load of the series. It will range from 0 to 100, where 100 is fully loaded.
*/
get progressiveStatus() {
return this.i.yz;
}
set progressiveStatus(v) {
this.i.yz = +v;
this._a("progressiveStatus", this.i.yz);
}
bindAxes(axes) {
super.bindAxes(axes);
for (let i = 0; i < axes.length; i++) {
if (this.xAxisName && this.xAxisName.length > 0 &&
axes[i].name == this.xAxisName) {
this.xAxis = axes[i];
}
}
for (let i = 0; i < axes.length; i++) {
if (this.yAxisName && this.yAxisName.length > 0 &&
axes[i].name == this.yAxisName) {
this.yAxis = axes[i];
}
}
}
findByName(name) {
var baseResult = super.findByName(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;
}
_styling(container, component, parent) {
super._styling(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;
}
getItemValue(item, memberPathName) {
let iv = this.i.kr(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
*/
getMemberPathValue(memberPathName) {
let iv = this.i.mf(memberPathName);
return (iv);
}
/**
* Determine if object can be used as YAxis
* @param axis * The object to check
*/
canUseAsYAxis(axis) {
let iv = this.i.xp(axis);
return (iv);
}
/**
* Determine if object can be used as XAxis
* @param axis * The object to check
*/
canUseAsXAxis(axis) {
let iv = this.i.xo(axis);
return (iv);
}
/**
* Scrolls the series to display the item for the specified data item.
* The series is scrolled by the minimum amount required to place the specified data item within
* the central 80% of the visible axis.
* @param item * The data item (item) to scroll to.
*/
scrollIntoView(item) {
let iv = this.i.ge(item);
return (iv);
}
/**
* Gets the item that is the best match for the specified world coordinates.
* @param world * The world coordinates to use.
*/
getItem(world) {
let iv = this.i.ko(toPoint(world));
return (iv);
}
/**
* Raised when the progressive loading state of the series has changed.
*/
get progressiveLoadStatusChanged() {
return this._progressiveLoadStatusChanged;
}
set progressiveLoadStatusChanged(ev) {
if (this._progressiveLoadStatusChanged_wrapped !== null) {
this.i.progressiveLoadStatusChanged = delegateRemove(this.i.progressiveLoadStatusChanged, this._progressiveLoadStatusChanged_wrapped);
this._progressiveLoadStatusChanged_wrapped = null;
this._progressiveLoadStatusChanged = null;
}
this._progressiveLoadStatusChanged = ev;
this._progressiveLoadStatusChanged_wrapped = (o, e) => {
let outerArgs = new IgcProgressiveLoadStatusEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeProgressiveLoadStatusChanged) {
this.beforeProgressiveLoadStatusChanged(this, outerArgs);
}
if (this._progressiveLoadStatusChanged) {
this._progressiveLoadStatusChanged(this, outerArgs);
}
};
this.i.progressiveLoadStatusChanged = delegateCombine(this.i.progressiveLoadStatusChanged, this._progressiveLoadStatusChanged_wrapped);
;
}
}
IgcHighDensityScatterSeriesComponent._observedAttributesIgcHighDensityScatterSeriesComponent = null;
IgcHighDensityScatterSeriesComponent.htmlTagName = "igc-high-density-scatter-series";
IgcHighDensityScatterSeriesComponent._isElementRegistered = false;
return IgcHighDensityScatterSeriesComponent;
})();