UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

1,187 lines (1,181 loc) 39.1 kB
/* 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 { __extends, __values } from "tslib"; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { ReactRenderer, ReactWrapper } from "igniteui-react-core"; import { Visibility_$type } from "igniteui-react-core"; import { TypeRegistrar } from "igniteui-react-core"; import { XamSparkline } from './XamSparkline'; import { brushToString, stringToBrush, ensureBool, ensureEnum, initializePropertiesFromCss, NamePatcher, isValidProp, getModifiedProps, toSpinal, arrayFindByName } from "igniteui-react-core"; import { IgrDataContext } from "igniteui-react-core"; import { SparklineStylingDefaults } from './SparklineStylingDefaults'; import { TrendLineType_$type } from "igniteui-react-core"; import { SparklineDisplayType_$type } from './SparklineDisplayType'; import { UnknownValuePlotting_$type } from "igniteui-react-core"; var IgrSparkline = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrSparkline, _super); function IgrSparkline(props) { var _this = _super.call(this, props) || this; _this._dataSource = null; _this._initialized = false; _this._tooltipTemplate = null; _this._tooltipContent = null; _this._defaultTooltips = null; _this._uniqueTooltipId = 0; _this.mounted = false; _this.__p = null; _this._hasUserValues = new Set(); _this._stylingContainer = null; _this._stylingParent = null; _this._inStyling = false; if (_this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this)); } _this._getMainRef = _this._getMainRef.bind(_this); _this._tooltipRef = _this._tooltipRef.bind(_this); _this._activeTooltipElements = new Map(); _this._activeTooltips = new Map(); _this._currentTooltips = []; var container = null; if (document) { container = document.createElement("div"); container.style.display = "block"; container.style.width = "100%"; container.style.height = "100%"; } var root; root = container; _this._renderer = new ReactRenderer(root, document, true, SparklineStylingDefaults); _this._implementation = _this.createImplementation(); _this._container = _this._renderer.getWrapper(container); //this._renderer.rootWrapper.append(this._container); //this._container.setStyleProperty("display", "block"); //this._container.setStyleProperty("width", "100%"); //this._container.setStyleProperty("height", "100%"); _this._wrapper = _this._renderer; //var root: any; //root = this._container; //if (this._container.nativeElement != null) { // root = this._container.nativeElement; //} var sparkline = _this.i; _this._sparkline = sparkline; sparkline.provideContainer(_this._renderer); _this._renderer.addSizeWatcher(function () { _this._sparkline.notifyResized(); }); _this._initialized = true; return _this; } Object.defineProperty(IgrSparkline.prototype, "height", { get: function () { return this._height; }, set: function (value) { this._height = value; if (this._elRef) { this._elRef.style.height = value; this.notifyResized(); } }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "width", { get: function () { return this._width; }, set: function (value) { this._width = value; if (this._elRef) { this._elRef.style.width = value; this.notifyResized(); } }, enumerable: false, configurable: true }); IgrSparkline.prototype.render = function () { // if (!this._childrenDiffer(this.props.children)) { // let div = React.createElement("div", { // ref: (ref) => { // this._elRef = ref; // }, // children: this.props.children // }); // return div; // } else { var children = []; React.Children.forEach(this.props.children, function (ch) { children.push(ch); }); if (this._currentTooltips && this._currentTooltips.length > 0) { for (var i = 0; i < this._currentTooltips.length; i++) { var t = this._currentTooltips[i]; if (this._activeTooltipElements.has(t)) { children.push(this._activeTooltipElements.get(t)); } else { if (!TypeRegistrar.isRegistered("IgrTooltipContainer")) { continue; } var Tooltip = TypeRegistrar.get("IgrTooltipContainer"); var tEle = React.createElement(Tooltip, { ref: this._tooltipRef, key: this._currentTooltips[i].key, owner: this._currentTooltips[i] }); var portal = ReactDOM.createPortal(tEle, t, this._currentTooltips[i].key); this._activeTooltipElements.set(t, portal); children.push(portal); } } } var div = React.createElement("div", { className: "ig-sparkline igr-sparkline", ref: this._getMainRef, children: children }); return div; //} }; IgrSparkline.prototype._tooltipRef = function (t) { //console.log(t); if (t === null) { return; } if (t.currentOwner && t.currentOwner.tooltipTemplate) { t.template = t.currentOwner.tooltipTemplate; } this._activeTooltips.set(t.currentOwner, t); }; IgrSparkline.prototype.componentDidMount = function () { var e_1, _a; try { for (var _b = __values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) { var p = _c.value; if (isValidProp(this, p)) { { this[p] = this.props[p]; } } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } this._elRef.style.width = this._width ? this._width : ""; this._elRef.style.height = this._height ? this._height : ""; this._elRef.appendChild(this._container.getNativeElement()); this.notifyResized(); this.initializeContent(); }; IgrSparkline.prototype.shouldComponentUpdate = function (nextProps, nextState) { var e_2, _a; var mod = getModifiedProps(this.props, nextProps); try { for (var _b = __values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) { var p = _c.value; if (isValidProp(this, p)) { this[p] = mod[p]; } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } return true; }; Object.defineProperty(IgrSparkline.prototype, "dataSource", { get: function () { if (this._dataSource != null) { return this._dataSource; } return this.i.itemsSource; }, set: function (value) { this._dataSource = value; this.i.itemsSource = this._dataSource; //console.log("setting axis data source: " + value) }, enumerable: false, configurable: true }); IgrSparkline.prototype._getMainRef = function (div) { this._elRef = div; }; IgrSparkline.prototype.destroy = function () { this._sparkline.destroy(); this._wrapper.destroy(); }; IgrSparkline.prototype.createImplementation = function () { return new XamSparkline(); }; IgrSparkline.prototype.initializeContent = function () { this._styling(this._container.getNativeElement(), this); this.i.notifyResized(); }; IgrSparkline.prototype.componentWillUnmount = function () { //this._grid.destroy(); }; IgrSparkline.prototype.initializeProperties = function () { var e_3, _a; try { for (var _b = __values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) { var p = _c.value; if (isValidProp(this, p)) { this[p] = this.props[p]; } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_3) throw e_3.error; } } }; Object.defineProperty(IgrSparkline.prototype, "tooltipTemplate", { get: function () { return this._tooltipTemplate; }, set: function (value) { this._tooltipTemplate = value; if (value == null) { if (this._tooltipContent !== null) { this._tooltipContent.destroy(); this._tooltipContent = null; } } if (this._tooltipContent != null) { this._tooltipContent.instance.template = this._tooltipTemplate; } else { this._ensureTooltipCreated(); } }, enumerable: false, configurable: true }); IgrSparkline.prototype.createWrapper = function (ele) { var wrapper = new ReactWrapper(ele, this._renderer); wrapper.updateToolTip = ele.updateToolTip; wrapper.hideToolTip = ele.hideToolTip; return wrapper; }; IgrSparkline.prototype._ensureDefaultTooltip = function () { if (this._defaultTooltips == null) { return; } this._defaultTooltips["ensureDefaultTooltip"](this); }; IgrSparkline.prototype._onDefaultTooltipsReady = function (cr) { this._ensureDefaultTooltip(); }; IgrSparkline.prototype._updateTooltipState = function () { if (this._initialized) { this.setState({ tooltips: this._currentTooltips }); } }; IgrSparkline.prototype.createTooltip = function () { // if (!TypeRegistrar.isRegistered("IgrTooltipContainer")) { // return null; // } // let Tooltip = TypeRegistrar.get("IgrTooltipContainer"); var wrapper = this._wrapper.createElement("div"); var ele = wrapper.getNativeElement(); ele.key = "__tooltip_" + this._uniqueTooltipId; this._uniqueTooltipId++; this._currentTooltips = this._currentTooltips.slice(0); this._currentTooltips.push(ele); //let element = React.createElement(Tooltip, ); //let portal = ReactDOM.createPortal(element, ele); var self = this; ele.updateToolTip = function (c, isSubContent) { if (c.externalObject) { c = c.externalObject; } else { var ext = new IgrDataContext(); ext._implementation = c; c = ext; } if (!isSubContent) { if (ele.parentElement != self._container.getNativeElement()) { if (ele.parentElement != null) { ele.parentElement.removeChild(ele); } self._container.getNativeElement().appendChild(ele); } } else { c.isSubContent = true; } if (self._activeTooltips.has(ele)) { var t = self._activeTooltips.get(ele); if (t.template === null && self.tooltipTemplate !== null) { t.template = self.tooltipTemplate; } t.dataContext = c; } ele.style.display = "block"; return true; }; ele.hideToolTip = function () { ele.style.display = "none"; }; ele.style.display = "none"; this._updateTooltipState(); return ele; }; IgrSparkline.prototype._ensureTooltipCreated = function () { if (this.i.toolTip == null) { var tooltip = this.createTooltip(); var ele = tooltip; if (tooltip == null) { return; } this._tooltipContent = tooltip; //(<any>tooltip.instance).template = this._tooltipTemplate; this.i.toolTip = this.createWrapper(tooltip); if (this._activeTooltips.has(ele)) { var tCont = this._activeTooltips.get(ele); tCont.template = ele.tooltipTemplate; } } }; Object.defineProperty(IgrSparkline.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; } /** * @hidden */, enumerable: false, configurable: true }); IgrSparkline._createFromInternal = function (internal) { if (!internal) { return null; } if (!internal.$type) { return null; } var name = internal.$type.name; var externalName = "Igr" + name; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); }; Object.defineProperty(IgrSparkline.prototype, "brush", { /** * Gets or sets the sparkline brush. */ get: function () { return brushToString(this.i.e8); }, set: function (v) { this.i.e8 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "negativeBrush", { /** * Gets or sets the negative brush of the sparkline. */ get: function () { return brushToString(this.i.ff); }, set: function (v) { this.i.ff = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "markerBrush", { /** * Gets or sets the marker brush of the sparkline. */ get: function () { return brushToString(this.i.fe); }, set: function (v) { this.i.fe = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "negativeMarkerBrush", { /** * Gets or sets the negative marker brush of the sparkline. */ get: function () { return brushToString(this.i.fg); }, set: function (v) { this.i.fg = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "firstMarkerBrush", { /** * Gets or sets the first marker brush of the sparkline. */ get: function () { return brushToString(this.i.e9); }, set: function (v) { this.i.e9 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "lastMarkerBrush", { /** * Gets or sets the last marker brush of the sparkline. */ get: function () { return brushToString(this.i.fc); }, set: function (v) { this.i.fc = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "highMarkerBrush", { /** * Gets or sets the high marker brush of the sparkline. */ get: function () { return brushToString(this.i.fa); }, set: function (v) { this.i.fa = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "lowMarkerBrush", { /** * Gets or sets the low marker brush of the sparkline. */ get: function () { return brushToString(this.i.fd); }, set: function (v) { this.i.fd = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "trendLineBrush", { /** * Gets or sets the trendline brush of the sparkline. */ get: function () { return brushToString(this.i.fi); }, set: function (v) { this.i.fi = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "horizontalAxisBrush", { /** * Gets or sets the horizontal axis line brush of the sparkline. */ get: function () { return brushToString(this.i.fb); }, set: function (v) { this.i.fb = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "verticalAxisBrush", { /** * Gets or sets the vertical axis line brush of the sparkline. */ get: function () { return brushToString(this.i.fj); }, set: function (v) { this.i.fj = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "normalRangeFill", { /** * Gets or sets the normal range brush of the sparkline. */ get: function () { return brushToString(this.i.fh); }, set: function (v) { this.i.fh = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "horizontalAxisVisibility", { /** * Gets or sets the display state of the horizontal axis. */ get: function () { return this.i.fm; }, set: function (v) { this.i.fm = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "verticalAxisVisibility", { /** * Gets or sets the display state of the vertical axis. */ get: function () { return this.i.ft; }, set: function (v) { this.i.ft = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "markerVisibility", { /** * Gets or sets the marker visibility of the sparkline. */ get: function () { return this.i.fp; }, set: function (v) { this.i.fp = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "negativeMarkerVisibility", { /** * Gets or sets the negative marker visibility of the sparkline. */ get: function () { return this.i.fq; }, set: function (v) { this.i.fq = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "firstMarkerVisibility", { /** * Gets or sets the first marker visibility of the sparkline. */ get: function () { return this.i.fk; }, set: function (v) { this.i.fk = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "lastMarkerVisibility", { /** * Gets or sets the last marker visibility of the sparkline. */ get: function () { return this.i.fn; }, set: function (v) { this.i.fn = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "lowMarkerVisibility", { /** * Gets or sets the low marker visibility of the sparkline. */ get: function () { return this.i.fo; }, set: function (v) { this.i.fo = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "highMarkerVisibility", { /** * Gets or sets the high marker visibility of the sparkline. */ get: function () { return this.i.fl; }, set: function (v) { this.i.fl = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "normalRangeVisibility", { /** * Gets or sets the normal range visibility of the sparkline. */ get: function () { return this.i.fr; }, set: function (v) { this.i.fr = ensureEnum(Visibility_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "displayNormalRangeInFront", { /** * Gets or sets the position of the normal range on the sparkline. */ get: function () { return this.i.aw; }, set: function (v) { this.i.aw = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "markerSize", { /** * Gets or sets the marker size of the sparkline. */ get: function () { return this.i.bd; }, set: function (v) { this.i.bd = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "firstMarkerSize", { /** * Gets or sets the first marker size of the sparkline. */ get: function () { return this.i.a6; }, set: function (v) { this.i.a6 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "lastMarkerSize", { /** * Gets or sets the last marker size of the sparkline. */ get: function () { return this.i.a8; }, set: function (v) { this.i.a8 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "highMarkerSize", { /** * Gets or sets the high marker size of the sparkline. */ get: function () { return this.i.a7; }, set: function (v) { this.i.a7 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "lowMarkerSize", { /** * Gets or sets the low marker size of the sparkline. */ get: function () { return this.i.bc; }, set: function (v) { this.i.bc = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "negativeMarkerSize", { /** * Gets or sets the negative marker size of the sparkline. */ get: function () { return this.i.bi; }, set: function (v) { this.i.bi = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "lineThickness", { /** * Gets or sets the line thickness of the sparkline. */ get: function () { return this.i.a9; }, set: function (v) { this.i.a9 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "minimum", { /** * Gets or sets the minimum value of the y axis. */ get: function () { return this.i.bh; }, set: function (v) { this.i.bh = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "maximum", { /** * Gets or sets the maximum value of the y axis. */ get: function () { return this.i.bg; }, set: function (v) { this.i.bg = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "valueMemberPath", { /** * Gets or sets the string path to the value column. */ get: function () { return this.i.c9; }, set: function (v) { this.i.c9 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "labelMemberPath", { /** * String identifier of a column or property name to get labels from on each item in the data source. These labels will be retrieved from the first and last item, and displayed by the horizontal axis. */ get: function () { return this.i.ce; }, set: function (v) { this.i.ce = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "trendLineType", { /** * Gets or sets the type of trendline used by the sparkline. */ get: function () { return this.i.ar; }, set: function (v) { this.i.ar = ensureEnum(TrendLineType_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "trendLinePeriod", { /** * Gets or sets the trendline period used by the sparkline. */ get: function () { return this.i.bq; }, set: function (v) { this.i.bq = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "trendLineThickness", { /** * Gets or sets the thickness of the sparkline's trendline. */ get: function () { return this.i.bm; }, set: function (v) { this.i.bm = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "normalRangeMinimum", { /** * Gets or sets the minimum value of the normal range. */ get: function () { return this.i.bk; }, set: function (v) { this.i.bk = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "normalRangeMaximum", { /** * Gets or sets the maximum value of the normal range. */ get: function () { return this.i.bj; }, set: function (v) { this.i.bj = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "displayType", { /** * Gets or sets the display type of the sparkline. */ get: function () { return this.i.aq; }, set: function (v) { this.i.aq = ensureEnum(SparklineDisplayType_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "unknownValuePlotting", { /** * Gets or sets the way null values are interpreted. */ get: function () { return this.i.as; }, set: function (v) { this.i.as = ensureEnum(UnknownValuePlotting_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "verticalAxisLabel", { /** * The value or content to display on the vertical axis. * This can be set to a formatted string, such as "{0:n}", or it can be set to a DataTemplate. */ get: function () { return this.i.bt; }, set: function (v) { this.i.bt = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "horizontalAxisLabel", { /** * The value or content to display on the horizontal axis. * This can be set to a formatted string, such as "{0}", or it can be set to a DataTemplate. */ get: function () { return this.i.br; }, set: function (v) { this.i.br = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "formatLabel", { /** * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart. */ get: function () { return this.i.bp; }, set: function (v) { this.i.bp = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "horizontalLabelFormat", { /** * Gets or sets the label composite format used when creating label values. */ get: function () { return this.i.ca; }, set: function (v) { this.i.ca = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "horizontalLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the HorizontalLabelFormat string. */ get: function () { return this.i.ag; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.ag = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "verticalLabelFormat", { /** * Gets or sets the label composite format used when creating label values. */ get: function () { return this.i.df; }, set: function (v) { this.i.df = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "verticalLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the VerticalLabelFormat string. */ get: function () { return this.i.ah; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.ah = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.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.bl; }, set: function (v) { this.i.bl = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrSparkline.prototype, "actualPixelScalingRatio", { /** * Gets the actual scaling value used by the component 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.a5; }, set: function (v) { this.i.a5 = +v; }, enumerable: false, configurable: true }); IgrSparkline.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.horizontalLabelFormatSpecifiers != null && arrayFindByName(this.horizontalLabelFormatSpecifiers, name)) { return arrayFindByName(this.horizontalLabelFormatSpecifiers, name); } if (this.verticalLabelFormatSpecifiers != null && arrayFindByName(this.verticalLabelFormatSpecifiers, name)) { return arrayFindByName(this.verticalLabelFormatSpecifiers, name); } return null; }; Object.defineProperty(IgrSparkline.prototype, "hasUserValues", { get: function () { return this._hasUserValues; }, enumerable: false, configurable: true }); IgrSparkline.prototype.__m = function (propertyName) { if (!this._inStyling) { this._hasUserValues.add(propertyName); } }; IgrSparkline.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("Sparkline"); 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; }; /** * Provides a container to the sparkline control. * @param container * The container. */ IgrSparkline.prototype.provideContainer = function (container) { this.i.provideContainer(container); }; /** * Notify that the control has resized. */ IgrSparkline.prototype.notifyResized = function () { this.i.notifyResized(); }; IgrSparkline.prototype.notifySetItem = function (source_, index, oldItem, newItem) { this.i.dn(source_, index, oldItem, newItem); }; /** * Used to manually notify the IgxSparklineComponent that the data source has reset or cleared its items. Invoking this method is only necessary if that datasource is not observable. * @param source_ * The data source which was cleared or reset. */ IgrSparkline.prototype.notifyClearItems = function (source_) { this.i.dj(source_); }; IgrSparkline.prototype.notifyInsertItem = function (source_, index, newItem) { this.i.dk(source_, index, newItem); }; IgrSparkline.prototype.notifyRemoveItem = function (source_, index, oldItem) { this.i.dl(source_, index, oldItem); }; /** * Returns the sparkline visuals expressed as a SparklineVisualData object. */ IgrSparkline.prototype.exportVisualData = function () { var iv = this.i.au(); return (iv); }; /** * Returns visuals as a serialized string. */ IgrSparkline.prototype.exportSerializedVisualData = function () { var iv = this.i.by(); return (iv); }; return IgrSparkline; }(React.Component)); export { IgrSparkline };