igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
1,120 lines (1,113 loc) • 40.9 kB
JavaScript
import { __extends } from "tslib";
import { WebComponentRenderer } from "igniteui-webcomponents-core";
import { TypeRegistrar, delegateRemove, delegateCombine } from "igniteui-webcomponents-core";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { XamFunnelChart } from './XamFunnelChart';
import { RegisterElementHelper } from "igniteui-webcomponents-core";
import { IgcHTMLElement } from "igniteui-webcomponents-core";
import { getAllPropertyNames, toSpinal, fromSpinal, enumToString, brushCollectionToString, initializePropertiesFromCss, NamePatcher, fromBrushCollection, toBrushCollection, ensureBool, stringToBrush, brushToString, ensureEnum } from "igniteui-webcomponents-core";
import { Visibility_$type } from "igniteui-webcomponents-core";
import { OuterLabelAlignment_$type } from './OuterLabelAlignment';
import { FunnelSliceDisplay_$type } from './FunnelSliceDisplay';
import { IgcFunnelSliceClickedEventArgs } from './igc-funnel-slice-clicked-event-args';
import { IgcFunnelSliceEventArgs } from './igc-funnel-slice-event-args';
import { Style } from "igniteui-webcomponents-core";
import { HighlightedValueDisplayMode_$type } from "igniteui-webcomponents-core";
import { Base } from "igniteui-webcomponents-core";
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
import { IgcFunnelChartSelectedItemsCollection } from './igc-funnel-chart-selected-items-collection';
import { FunnelChartSelectedItemsCollection as FunnelChartSelectedItemsCollection_internal } from './FunnelChartSelectedItemsCollection';
import { IgcFunnelChartSelectedItemsChangedEventArgs } from './igc-funnel-chart-selected-items-changed-event-args';
var IgcFunnelChartComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcFunnelChartComponent, _super);
function IgcFunnelChartComponent() {
var _this = _super.call(this) || this;
_this._disconnected = false;
_this._dataSource = null;
_this._settingAttributes = false;
_this._attached = false;
_this._queuedSetAttributes = [];
_this._updatingFromAttribute = false;
_this._selectedItems = null;
_this.__p = null;
_this._hasUserValues = new Set();
_this._stylingContainer = null;
_this._stylingParent = null;
_this._inStyling = false;
_this._selectedItemsChanged = null;
_this._selectedItemsChanged_wrapped = null;
_this._sliceClicked = null;
_this._sliceClicked_wrapped = null;
_this._sliceEnter = null;
_this._sliceEnter_wrapped = null;
_this._sliceLeave = null;
_this._sliceLeave_wrapped = null;
_this._sliceHover = null;
_this._sliceHover_wrapped = null;
if (_this._styling) {
NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this));
}
_this._renderer = new WebComponentRenderer(_this, document, true, DataChartStylingDefaults);
_this._implementation = _this.createImplementation();
_this.container = _this._renderer.createElement("div");
_this._renderer.updateRoot(_this.container);
//this._renderer.rootWrapper.append(this._container);
_this.container.setStyleProperty("display", "block");
_this.container.setStyleProperty("width", "100%");
_this.container.setStyleProperty("height", "100%");
var root;
root = _this.container;
if (_this.container.getNativeElement() != null) {
root = _this.container.getNativeElement();
}
_this._wrapper = _this._renderer;
var chart = _this.i;
_this._chart = chart;
chart.provideContainer(_this._renderer);
_this.bindData();
chart.notifyResized();
_this._renderer.addSizeWatcher(function () {
_this._chart.notifyResized();
});
return _this;
}
Object.defineProperty(IgcFunnelChartComponent.prototype, "height", {
get: function () {
return this._height;
},
set: function (value) {
this._height = value;
this.style.height = value;
this.notifyResized();
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "width", {
get: function () {
return this._width;
},
set: function (value) {
this._width = value;
this.style.width = value;
this.notifyResized();
},
enumerable: false,
configurable: true
});
IgcFunnelChartComponent.prototype.notifyContainerResized = function () {
this._chart.notifyResized();
};
IgcFunnelChartComponent.prototype.disconnectedCallback = function () {
this._disconnected = true;
if (this.i) {
this.i.onDetachedFromUI();
}
};
IgcFunnelChartComponent.prototype.connectedCallback = function () {
if (this._disconnected) {
this._disconnected = false;
if (this.i) {
this.i.onAttachedToUI();
}
return;
}
this.classList.add("ig-funnel-chart");
this.classList.add("igc-funnel-chart");
this.appendChild(this.container.getNativeElement());
this._attached = true;
this.style.display = "block";
this.style.height = this._height;
this.style.width = this._width;
this._flushQueuedAttributes();
// supports themes or custom properties set in CSS
this._styling(this, this);
};
IgcFunnelChartComponent.prototype.destroy = function () {
this._chart.destroy();
this._wrapper.destroy();
};
IgcFunnelChartComponent.prototype.createImplementation = function () {
return new XamFunnelChart();
};
IgcFunnelChartComponent.prototype.createSeriesComponent = function (type) {
if (TypeRegistrar.isRegistered(type)) {
var s = TypeRegistrar.create(type);
s.owner = this;
s._provideRenderer(this._renderer);
return s;
}
else {
//we shouldn't get here, hopefully.
throw Error("series type not loaded: " + type);
}
};
Object.defineProperty(IgcFunnelChartComponent.prototype, "dataSource", {
get: function () {
return this._dataSource;
},
set: function (value) {
this._dataSource = value;
this.bindData();
},
enumerable: false,
configurable: true
});
IgcFunnelChartComponent.prototype.bindData = function () {
if (this._chart != null && this._chart !== undefined) {
this._chart.itemsSource = this._dataSource;
}
};
Object.defineProperty(IgcFunnelChartComponent.prototype, "legend", {
/**
* Gets or sets the legend used for the current chart.
*/
get: function () {
if (this.i.legend != null)
return this.i.legend.externalObject;
},
set: function (v) {
if (v != undefined && v != null)
this.i.legend = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
} /**
* @hidden
*/,
enumerable: false,
configurable: true
});
IgcFunnelChartComponent._createFromInternal = function (internal) {
if (!internal) {
return null;
}
if (!internal.$type) {
return null;
}
var name = internal.$type.name;
var externalName = "Igc" + name + "Component";
if (!TypeRegistrar.isRegistered(externalName)) {
return null;
}
return TypeRegistrar.create(externalName);
};
IgcFunnelChartComponent.prototype._enqueueSetAttribute = function (attrName, attrValue) {
this._queuedSetAttributes.push({ attrName: attrName, attrValue: attrValue });
};
IgcFunnelChartComponent.prototype._flushQueuedAttributes = function () {
this._settingAttributes = true;
for (var i = 0; i < this._queuedSetAttributes.length; i++) {
this.setAttribute(this._queuedSetAttributes[i].attrName, this._queuedSetAttributes[i].attrValue);
}
this._settingAttributes = false;
this._queuedSetAttributes.length = 0;
};
IgcFunnelChartComponent.prototype._a = function (attrName, attrValue) {
if (this._updatingFromAttribute) {
return;
}
if (attrValue) {
attrValue = attrValue.toString();
}
this._settingAttributes = true;
attrName = toSpinal(attrName);
if (this._attached) {
this.setAttribute(attrName, attrValue);
}
else {
this._enqueueSetAttribute(attrName, attrValue);
}
this._settingAttributes = false;
};
Object.defineProperty(IgcFunnelChartComponent, "observedAttributes", {
get: function () {
if (IgcFunnelChartComponent._observedAttributesIgcFunnelChartComponent == null) {
var names = getAllPropertyNames(IgcFunnelChartComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcFunnelChartComponent._observedAttributesIgcFunnelChartComponent = names;
}
return IgcFunnelChartComponent._observedAttributesIgcFunnelChartComponent;
},
enumerable: false,
configurable: true
});
IgcFunnelChartComponent.prototype.attributeChangedCallback = function (name, oldValue, newValue) {
if (this._settingAttributes) {
return;
}
var setName = fromSpinal(name);
this._updatingFromAttribute = true;
this[setName] = newValue;
this._updatingFromAttribute = false;
};
IgcFunnelChartComponent.register = function () {
if (!IgcFunnelChartComponent._isElementRegistered) {
IgcFunnelChartComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcFunnelChartComponent.htmlTagName, IgcFunnelChartComponent);
}
};
Object.defineProperty(IgcFunnelChartComponent.prototype, "valueMemberPath", {
/**
* Gets or sets the value member path for the funnel chart.
*/
get: function () {
return this.i.dw;
},
set: function (v) {
this.i.dw = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "highlightedValueMemberPath", {
/**
* Gets or sets the highlighted value member path for the funnel chart.
*/
get: function () {
return this.i.cs;
},
set: function (v) {
this.i.cs = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "actualHighlightValueOpacity", {
/**
* Gets the actual opacity of the primary needle while highlighting
*/
get: function () {
return this.i.bx;
},
set: function (v) {
this.i.bx = +v;
this._a("actualHighlightValueOpacity", this.i.bx);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "highlightValueOpacity", {
/**
* Gets or sets the opacity while highlighting
*/
get: function () {
return this.i.b1;
},
set: function (v) {
this.i.b1 = +v;
this._a("highlightValueOpacity", this.i.b1);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "actualHighlightValueDisplayMode", {
/**
* Gets whether and how to display the highlighted value.
*/
get: function () {
return this.i.a5;
},
set: function (v) {
this.i.a5 = ensureEnum(HighlightedValueDisplayMode_$type, v);
this._a("actualHighlightValueDisplayMode", enumToString(HighlightedValueDisplayMode_$type, this.i.a5));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "highlightValueDisplayMode", {
/**
* Gets or sets whether and how to display the highlighted value.
*/
get: function () {
return this.i.a6;
},
set: function (v) {
this.i.a6 = ensureEnum(HighlightedValueDisplayMode_$type, v);
this._a("highlightValueDisplayMode", enumToString(HighlightedValueDisplayMode_$type, this.i.a6));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "brushes", {
/**
* Gets or sets the palette of brushes to use for coloring the slices.
*/
get: function () {
return fromBrushCollection(this.i.ah);
},
set: function (v) {
this.i.ah = toBrushCollection(v);
this._a("brushes", brushCollectionToString(this.i.ah));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "outlines", {
/**
* Gets or sets the palette of brushes to use for outlines on the slices.
*/
get: function () {
return fromBrushCollection(this.i.ai);
},
set: function (v) {
this.i.ai = toBrushCollection(v);
this._a("outlines", brushCollectionToString(this.i.ai));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "bottomEdgeWidth", {
/**
* Gets or sets the percentage (from near 0 to 1) of space the bottom edge of the funnel should take.
*/
get: function () {
return this.i.bz;
},
set: function (v) {
this.i.bz = +v;
this._a("bottomEdgeWidth", this.i.bz);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "innerLabelMemberPath", {
/**
* Gets or sets the InnerLabel mapping property for the current series object.
*/
get: function () {
return this.i.cz;
},
set: function (v) {
this.i.cz = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "outerLabelMemberPath", {
/**
* Gets or sets the OuterLabel mapping property for the current series object.
*/
get: function () {
return this.i.da;
},
set: function (v) {
this.i.da = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "innerLabelVisibility", {
/**
* Gets or sets whether the inner labels are visible.
*/
get: function () {
return this.i.fv;
},
set: function (v) {
this.i.fv = ensureEnum(Visibility_$type, v);
this._a("innerLabelVisibility", enumToString(Visibility_$type, this.i.fv));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "outerLabelVisibility", {
/**
* Gets or sets whether the outer labels are visible.
*/
get: function () {
return this.i.fw;
},
set: function (v) {
this.i.fw = ensureEnum(Visibility_$type, v);
this._a("outerLabelVisibility", enumToString(Visibility_$type, this.i.fw));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "outerLabelAlignment", {
/**
* Gets or sets which side of the chart the outer labels should appear.
*/
get: function () {
return this.i.ax;
},
set: function (v) {
this.i.ax = ensureEnum(OuterLabelAlignment_$type, v);
this._a("outerLabelAlignment", enumToString(OuterLabelAlignment_$type, this.i.ax));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "funnelSliceDisplay", {
/**
* Gets or sets how the heights of the funnel slices should be configured.
*/
get: function () {
return this.i.an;
},
set: function (v) {
this.i.an = ensureEnum(FunnelSliceDisplay_$type, v);
this._a("funnelSliceDisplay", enumToString(FunnelSliceDisplay_$type, this.i.an));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "formatInnerLabel", {
/**
* Gets or sets the formatter function for inner labels. Function should return string and it takes 3 parameters: 1st-value of item to format, 2nd-index of item within data, 3rd-reference to the funnel chart.
*/
get: function () {
return this.i.b9;
},
set: function (v) {
this.i.b9 = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "formatOuterLabel", {
/**
* Gets or sets the formatter function for outer labels. Function should return string and it takes 3 parameters: 1st-value of item to format, 2nd-index of item within data, 3rd-reference to the funnel chart.
*/
get: function () {
return this.i.ca;
},
set: function (v) {
this.i.ca = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "transitionDuration", {
/**
* Gets or sets how long the animations should take to run.
*/
get: function () {
return this.i.cb;
},
set: function (v) {
this.i.cb = +v;
this._a("transitionDuration", this.i.cb);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "isInverted", {
/**
* Gets or sets if the funnel should be rendered inverted.
*/
get: function () {
return this.i.bn;
},
set: function (v) {
this.i.bn = ensureBool(v);
this._a("isInverted", this.i.bn);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "useBezierCurve", {
/**
* Gets or sets whether to use a Bezier curve to define the funnel.
*/
get: function () {
return this.i.bo;
},
set: function (v) {
this.i.bo = ensureBool(v);
this._a("useBezierCurve", this.i.bo);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "allowSliceSelection", {
/**
* Gets or sets whether to allow slices to be selected.
*/
get: function () {
return this.i.bh;
},
set: function (v) {
this.i.bh = ensureBool(v);
this._a("allowSliceSelection", this.i.bh);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "useUnselectedStyle", {
/**
* Gets or sets whether to use the unselected style on unselected slices.
*/
get: function () {
return this.i.bq;
},
set: function (v) {
this.i.bq = ensureBool(v);
this._a("useUnselectedStyle", this.i.bq);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "selectedSliceFill", {
/**
* Gets or sets the fill brush.
*/
get: function () {
return this.i.ft ? this.i.ft.fill : null;
},
set: function (v) {
this.ensureSelectedSliceStyle();
this.i.ft.fill = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "selectedSliceStroke", {
/**
* Gets or sets the stroke brush.
*/
get: function () {
return this.i.ft ? this.i.ft.stroke : null;
},
set: function (v) {
this.ensureSelectedSliceStyle();
this.i.ft.stroke = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "selectedSliceStrokeThickness", {
/**
* Gets or sets the stroke thickness.
*/
get: function () {
return this.i.ft ? this.i.ft.strokeThickness : NaN;
},
set: function (v) {
this.ensureSelectedSliceStyle();
this.i.ft.strokeThickness = +v;
this._a("selectedSliceStrokeThickness", this.i.ft.strokeThickness);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "selectedSliceOpacity", {
/**
* Gets or sets the opacity.
*/
get: function () {
return this.i.ft ? this.i.ft.opacity : NaN;
},
set: function (v) {
this.ensureSelectedSliceStyle();
this.i.ft.opacity = +v;
this._a("selectedSliceOpacity", this.i.ft.opacity);
},
enumerable: false,
configurable: true
});
IgcFunnelChartComponent.prototype.ensureSelectedSliceStyle = function () {
if (this.i.ft) {
return;
}
this.i.ft = new Style();
};
Object.defineProperty(IgcFunnelChartComponent.prototype, "unselectedSliceFill", {
/**
* Gets or sets the fill brush.
*/
get: function () {
return this.i.fu ? this.i.fu.fill : null;
},
set: function (v) {
this.ensureUnselectedSliceStyle();
this.i.fu.fill = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "unselectedSliceStroke", {
/**
* Gets or sets the stroke brush.
*/
get: function () {
return this.i.fu ? this.i.fu.stroke : null;
},
set: function (v) {
this.ensureUnselectedSliceStyle();
this.i.fu.stroke = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "unselectedSliceStrokeThickness", {
/**
* Gets or sets the stroke thickness.
*/
get: function () {
return this.i.fu ? this.i.fu.strokeThickness : NaN;
},
set: function (v) {
this.ensureUnselectedSliceStyle();
this.i.fu.strokeThickness = +v;
this._a("unselectedSliceStrokeThickness", this.i.fu.strokeThickness);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "unselectedSliceOpacity", {
/**
* Gets or sets the opacity.
*/
get: function () {
return this.i.fu ? this.i.fu.opacity : NaN;
},
set: function (v) {
this.ensureUnselectedSliceStyle();
this.i.fu.opacity = +v;
this._a("unselectedSliceOpacity", this.i.fu.opacity);
},
enumerable: false,
configurable: true
});
IgcFunnelChartComponent.prototype.ensureUnselectedSliceStyle = function () {
if (this.i.fu) {
return;
}
this.i.fu = new Style();
};
Object.defineProperty(IgcFunnelChartComponent.prototype, "selectedItems", {
/**
* Represents the current selected items.
*/
get: function () {
if (this._selectedItems === null) {
var coll = new IgcFunnelChartSelectedItemsCollection();
var innerColl = this.i.selectedItems;
if (!innerColl) {
innerColl = new FunnelChartSelectedItemsCollection_internal();
}
this._selectedItems = coll._fromInner(innerColl);
}
return this._selectedItems;
},
set: function (v) {
if (this._selectedItems !== null) {
this._selectedItems._setSyncTarget(null);
this._selectedItems = null;
}
var coll = new IgcFunnelChartSelectedItemsCollection();
this._selectedItems = coll._fromOuter(v);
var syncColl = new SyncableObservableCollection$1(Base.$type);
var innerColl = this.i.selectedItems;
if (!innerColl) {
innerColl = new FunnelChartSelectedItemsCollection_internal();
}
syncColl._inner = innerColl;
syncColl.clear();
this._selectedItems._setSyncTarget(syncColl);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "legendItemBadgeTemplate", {
/**
* Gets or sets the LegendItemBadgeTemplate to use for the legend items.
*/
get: function () {
return this.i.legendItemBadgeTemplate;
},
set: function (v) {
this.i.legendItemBadgeTemplate = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "useOuterLabelsForLegend", {
/**
* Gets or sets whether to use the outer labels to identify the legend items.
*/
get: function () {
return this.i.bp;
},
set: function (v) {
this.i.bp = ensureBool(v);
this._a("useOuterLabelsForLegend", this.i.bp);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "textStyle", {
/**
* Gets or sets the text style for inner labels
*/
get: function () {
return this.i.dl;
},
set: function (v) {
this.i.dl = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "outerLabelTextStyle", {
/**
* Gets or sets the text style for outer labels
*/
get: function () {
return this.i.dd;
},
set: function (v) {
this.i.dd = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "outlineThickness", {
/**
* Gets or sets the thickness of outline around slices.
*/
get: function () {
return this.i.b2;
},
set: function (v) {
this.i.b2 = +v;
this._a("outlineThickness", this.i.b2);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "pixelScalingRatio", {
/**
* Gets or sets the scaling value used to affect the pixel density of the control.
* A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control
* to appear blurry.
*/
get: function () {
return this.i.b4;
},
set: function (v) {
this.i.b4 = +v;
this._a("pixelScalingRatio", this.i.b4);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "outerLabelTextColor", {
/**
* Gets or sets the brush used for the outer labels.
*/
get: function () {
return brushToString(this.i.fp);
},
set: function (v) {
this.i.fp = stringToBrush(v);
this._a("outerLabelTextColor", brushToString(this.i.fp));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "textColor", {
/**
* Gets or sets the brush used for the inner labels.
*/
get: function () {
return brushToString(this.i.fq);
},
set: function (v) {
this.i.fq = stringToBrush(v);
this._a("textColor", brushToString(this.i.fq));
},
enumerable: false,
configurable: true
});
IgcFunnelChartComponent.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
};
Object.defineProperty(IgcFunnelChartComponent.prototype, "hasUserValues", {
get: function () {
return this._hasUserValues;
},
enumerable: false,
configurable: true
});
IgcFunnelChartComponent.prototype.__m = function (propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
};
IgcFunnelChartComponent.prototype._styling = function (container, component, parent) {
if (this._inStyling) {
return;
}
this._inStyling = true;
this._stylingContainer = container;
this._stylingParent = component;
var genericPrefix = "";
var typeName = this.i.$type.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
genericPrefix = toSpinal("FunnelChartComponent");
var additionalPrefixes = [];
var prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
var b = this.i.$type.baseType;
while (b && b.name != "Object" &&
b.name != "Base" &&
b.name != "Control" &&
b.Name != "DependencyObject" &&
b.Name != "FrameworkElement") {
typeName = b.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
var basePrefix = toSpinal(typeName);
additionalPrefixes.push(basePrefix + "-");
b = b.baseType;
}
if (parent) {
var parentTypeName = parent.i.$type.name;
if (parentTypeName.indexOf("Xam") === 0) {
parentTypeName = parentTypeName.substring(3);
}
var parentPrefix = toSpinal(parentTypeName);
additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
}
initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
if (this._otherStyling) {
this._otherStyling(container, component, parent);
}
this._inStyling = false;
};
/**
* Use to force the funnel chart to finish any deferred work before printing or evaluating its visual.
* This should only be called if the visual of the funnel chart needs to be synchronously saved or evaluated.
* Calling this method too often will hinder the performance of the funnel chart.
*/
IgcFunnelChartComponent.prototype.flush = function () {
this.i.d0();
};
/**
* Provides container for funnel chart
*/
IgcFunnelChartComponent.prototype.provideContainer = function (container) {
this.i.provideContainer(container);
};
/**
* Notifies the controller and view about a size change.
*/
IgcFunnelChartComponent.prototype.notifyResized = function () {
this.i.notifyResized();
};
IgcFunnelChartComponent.prototype.notifySetItem = function (source_, index, oldItem, newItem) {
this.i.eb(source_, index, oldItem, newItem);
};
/**
* Manually notifies the chart's data source that the data it has bound to has been cleared and needs to be re-examined.
* This should not be called if the data that the chart is bound to is already observable.
*/
IgcFunnelChartComponent.prototype.notifyClearItems = function (source_) {
this.i.d6(source_);
};
IgcFunnelChartComponent.prototype.notifyInsertItem = function (source_, index, newItem) {
this.i.d8(source_, index, newItem);
};
IgcFunnelChartComponent.prototype.notifyRemoveItem = function (source_, index, oldItem) {
this.i.d9(source_, index, oldItem);
};
/**
* Toggle selection of item at index.
*/
IgcFunnelChartComponent.prototype.toggleSelection = function (index) {
this.i.eo(index);
};
/**
* Exports and serializes the chart visuals.
*/
IgcFunnelChartComponent.prototype.exportSerializedVisualData = function () {
var iv = this.i.cm();
return (iv);
};
Object.defineProperty(IgcFunnelChartComponent.prototype, "selectedItemsChanged", {
/**
* Raised when the SelectedItems collection has changed.
*/
get: function () {
return this._selectedItemsChanged;
},
set: function (ev) {
var _this = this;
if (this._selectedItemsChanged_wrapped !== null) {
this.i.selectedItemsChanged = delegateRemove(this.i.selectedItemsChanged, this._selectedItemsChanged_wrapped);
this._selectedItemsChanged_wrapped = null;
this._selectedItemsChanged = null;
}
this._selectedItemsChanged = ev;
this._selectedItemsChanged_wrapped = function (o, e) {
var outerArgs = new IgcFunnelChartSelectedItemsChangedEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeSelectedItemsChanged) {
_this.beforeSelectedItemsChanged(_this, outerArgs);
}
if (_this._selectedItemsChanged) {
_this._selectedItemsChanged(_this, outerArgs);
}
};
this.i.selectedItemsChanged = delegateCombine(this.i.selectedItemsChanged, this._selectedItemsChanged_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "sliceClicked", {
/**
* Event which is raised when a slice is clicked.
* Function takes first argument null and second argument ui.
* Use ui.owner to obtain reference to igFunnelChart.
* Use ui.index to obtain index of clicked slice.
* Use ui.item to obtain reference to clicked slice item.
* Use ui.selected to check if slice became selected.
*/
get: function () {
return this._sliceClicked;
},
set: function (ev) {
var _this = this;
if (this._sliceClicked_wrapped !== null) {
this.i.sliceClicked = delegateRemove(this.i.sliceClicked, this._sliceClicked_wrapped);
this._sliceClicked_wrapped = null;
this._sliceClicked = null;
}
this._sliceClicked = ev;
this._sliceClicked_wrapped = function (o, e) {
var outerArgs = new IgcFunnelSliceClickedEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeSliceClicked) {
_this.beforeSliceClicked(_this, outerArgs);
}
if (_this._sliceClicked) {
_this._sliceClicked(_this, outerArgs);
}
};
this.i.sliceClicked = delegateCombine(this.i.sliceClicked, this._sliceClicked_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "sliceEnter", {
/**
* Raised when a funnel slice is entered.
*/
get: function () {
return this._sliceEnter;
},
set: function (ev) {
var _this = this;
if (this._sliceEnter_wrapped !== null) {
this.i.sliceEnter = delegateRemove(this.i.sliceEnter, this._sliceEnter_wrapped);
this._sliceEnter_wrapped = null;
this._sliceEnter = null;
}
this._sliceEnter = ev;
this._sliceEnter_wrapped = function (o, e) {
var outerArgs = new IgcFunnelSliceEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeSliceEnter) {
_this.beforeSliceEnter(_this, outerArgs);
}
if (_this._sliceEnter) {
_this._sliceEnter(_this, outerArgs);
}
};
this.i.sliceEnter = delegateCombine(this.i.sliceEnter, this._sliceEnter_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "sliceLeave", {
/**
* Raised when a funnel slice is left.
*/
get: function () {
return this._sliceLeave;
},
set: function (ev) {
var _this = this;
if (this._sliceLeave_wrapped !== null) {
this.i.sliceLeave = delegateRemove(this.i.sliceLeave, this._sliceLeave_wrapped);
this._sliceLeave_wrapped = null;
this._sliceLeave = null;
}
this._sliceLeave = ev;
this._sliceLeave_wrapped = function (o, e) {
var outerArgs = new IgcFunnelSliceEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeSliceLeave) {
_this.beforeSliceLeave(_this, outerArgs);
}
if (_this._sliceLeave) {
_this._sliceLeave(_this, outerArgs);
}
};
this.i.sliceLeave = delegateCombine(this.i.sliceLeave, this._sliceLeave_wrapped);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcFunnelChartComponent.prototype, "sliceHover", {
/**
* Raised when a funnel slice is hovered.
*/
get: function () {
return this._sliceHover;
},
set: function (ev) {
var _this = this;
if (this._sliceHover_wrapped !== null) {
this.i.sliceHover = delegateRemove(this.i.sliceHover, this._sliceHover_wrapped);
this._sliceHover_wrapped = null;
this._sliceHover = null;
}
this._sliceHover = ev;
this._sliceHover_wrapped = function (o, e) {
var outerArgs = new IgcFunnelSliceEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeSliceHover) {
_this.beforeSliceHover(_this, outerArgs);
}
if (_this._sliceHover) {
_this._sliceHover(_this, outerArgs);
}
};
this.i.sliceHover = delegateCombine(this.i.sliceHover, this._sliceHover_wrapped);
;
},
enumerable: false,
configurable: true
});
IgcFunnelChartComponent._observedAttributesIgcFunnelChartComponent = null;
IgcFunnelChartComponent.htmlTagName = "igc-funnel-chart";
IgcFunnelChartComponent._isElementRegistered = false;
return IgcFunnelChartComponent;
}(IgcHTMLElement));
export { IgcFunnelChartComponent };