UNPKG

igniteui-webcomponents-charts

Version:

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

244 lines (241 loc) 9.33 kB
import { __extends } from "tslib"; import { IgcHorizontalAnchoredCategorySeriesComponent } from "./igc-horizontal-anchored-category-series-component"; import { WaterfallSeries } from "./WaterfallSeries"; import { getAllPropertyNames, toSpinal, brushToString, stringToBrush, toPoint, fromRect } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; /** * Represents a IgxDataChartComponent waterfall column series. * * `WaterfallSeries` belongs to a group of `CategorySeries` and it is rendered using a collection of vertical columns that show the difference between consecutive data points. */ var IgcWaterfallSeriesComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcWaterfallSeriesComponent, _super); function IgcWaterfallSeriesComponent() { return _super.call(this) || this; } IgcWaterfallSeriesComponent.prototype.createImplementation = function () { return new WaterfallSeries(); }; Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcWaterfallSeriesComponent.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(); } }; IgcWaterfallSeriesComponent.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(IgcWaterfallSeriesComponent, "observedAttributes", { get: function () { if (IgcWaterfallSeriesComponent._observedAttributesIgcWaterfallSeriesComponent == null) { var names = getAllPropertyNames(IgcWaterfallSeriesComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcWaterfallSeriesComponent._observedAttributesIgcWaterfallSeriesComponent = names; } return IgcWaterfallSeriesComponent._observedAttributesIgcWaterfallSeriesComponent; }, enumerable: false, configurable: true }); IgcWaterfallSeriesComponent.register = function () { if (!IgcWaterfallSeriesComponent._isElementRegistered) { IgcWaterfallSeriesComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcWaterfallSeriesComponent.htmlTagName, IgcWaterfallSeriesComponent); } }; Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "isWaterfall", { /** * Gets whether the current series shows a waterfall column shape. */ get: function () { return this.i.f7; }, enumerable: false, configurable: true }); Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "isMarkerlessDisplayPreferred", { /** * Overridden by derived series classes to indicate when marker-less display is preferred or not. */ get: function () { return this.i.fm; }, enumerable: false, configurable: true }); Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "isFinancialWaterfall", { /** * Gets whether the series is financial waterfall */ get: function () { return this.i.fc; }, enumerable: false, configurable: true }); Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "isNegativeColorSupported", { /** * Overridden by derived series classes to indicate when negative colors are supported or not. */ get: function () { return this.i.fn; }, enumerable: false, configurable: true }); Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "negativeBrush", { /** * Gets or sets the brush to use for negative portions of the series. * * Gets or sets the color used to draw negative declines in values for this `WaterfallSeries`. * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.negativeBrush = "#ff0000"; * this.chart.series.add(series); * ``` */ get: function () { return brushToString(this.i.ade); }, set: function (v) { this.i.ade = stringToBrush(v); this._a("negativeBrush", brushToString(this.i.ade)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "radiusX", { /** * Gets or sets the x-radius of the ellipse that is used to round the corners of the column. * * Gets or sets the amount to round corners in the direction of the X axis in this series. * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.radiusX = 15; * series.radiusY = 15; * this.chart.series.add(series); * ``` */ get: function () { return this.i.ac4; }, set: function (v) { this.i.ac4 = +v; this._a("radiusX", this.i.ac4); }, enumerable: false, configurable: true }); Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "radiusY", { /** * Gets or sets the y-radius of the ellipse that is used to round the corners of the column. * * Gets or sets the amount to round corners in the direction of the Y axis in this series. * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.radiusX = 15; * series.radiusY = 15; * this.chart.series.add(series); * ``` */ get: function () { return this.i.ac5; }, set: function (v) { this.i.ac5 = +v; this._a("radiusY", this.i.ac5); }, enumerable: false, configurable: true }); Object.defineProperty(IgcWaterfallSeriesComponent.prototype, "negativeOutline", { /** * Brush to use for outlining negative elements in the waterfall series. * * Gets or sets the color used to draw borders of negative declines in values for this `WaterfallSeries`. * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.negativeOutline = "#ff0000"; * this.chart.series.add(series); * ``` */ get: function () { return brushToString(this.i.adf); }, set: function (v) { this.i.adf = stringToBrush(v); this._a("negativeOutline", brushToString(this.i.adf)); }, enumerable: false, configurable: true }); IgcWaterfallSeriesComponent.prototype.setNegativeColors = function (negativeBrush, negativeOutline) { this.i.r7(stringToBrush(negativeBrush), stringToBrush(negativeOutline)); }; /** * If possible, will return the best available value bounding box within the series that has the best value match for the world position provided. * @param world * The world coordinate for which to get a value bounding box for * * Returns a bounding box `Rect` for a data value given a `Point`. */ IgcWaterfallSeriesComponent.prototype.getSeriesValueBoundingBox = function (world) { var iv = this.i.ws(toPoint(world)); return fromRect(iv); }; /** * For a category plotted series, returns the current width of the items within the categories. This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned. * * Returns the width of items in the `WaterfallSeries`. * * ```ts * let itemSpan: number = series.GetItemSpan(); * ``` */ IgcWaterfallSeriesComponent.prototype.getItemSpan = function () { var iv = this.i.ix(); return (iv); }; IgcWaterfallSeriesComponent._observedAttributesIgcWaterfallSeriesComponent = null; IgcWaterfallSeriesComponent.htmlTagName = "igc-waterfall-series"; IgcWaterfallSeriesComponent._isElementRegistered = false; return IgcWaterfallSeriesComponent; }(IgcHorizontalAnchoredCategorySeriesComponent)); export { IgcWaterfallSeriesComponent };