UNPKG

igniteui-webcomponents-charts

Version:

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

136 lines (135 loc) 5.88 kB
import { __extends } from "tslib"; import { ColorScaleInterpolationMode_$type } from "./ColorScaleInterpolationMode"; import { IgcColorScaleComponent } from "./igc-color-scale-component"; import { CustomPaletteColorScale } from "./CustomPaletteColorScale"; import { getAllPropertyNames, toSpinal, toColorCollection, fromColorCollection, colorCollectionToString, ensureEnum, enumToString } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; /** * ColorScale class for selecting a color from a given palette, or interpolating between adjacent colors in that palette. */ var IgcCustomPaletteColorScaleComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcCustomPaletteColorScaleComponent, _super); function IgcCustomPaletteColorScaleComponent() { return _super.call(this) || this; } IgcCustomPaletteColorScaleComponent.prototype.createImplementation = function () { return new CustomPaletteColorScale(); }; Object.defineProperty(IgcCustomPaletteColorScaleComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcCustomPaletteColorScaleComponent.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(); } }; IgcCustomPaletteColorScaleComponent.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(IgcCustomPaletteColorScaleComponent, "observedAttributes", { get: function () { if (IgcCustomPaletteColorScaleComponent._observedAttributesIgcCustomPaletteColorScaleComponent == null) { var names = getAllPropertyNames(IgcCustomPaletteColorScaleComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcCustomPaletteColorScaleComponent._observedAttributesIgcCustomPaletteColorScaleComponent = names; } return IgcCustomPaletteColorScaleComponent._observedAttributesIgcCustomPaletteColorScaleComponent; }, enumerable: false, configurable: true }); IgcCustomPaletteColorScaleComponent.register = function () { if (!IgcCustomPaletteColorScaleComponent._isElementRegistered) { IgcCustomPaletteColorScaleComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcCustomPaletteColorScaleComponent.htmlTagName, IgcCustomPaletteColorScaleComponent); } }; Object.defineProperty(IgcCustomPaletteColorScaleComponent.prototype, "minimumValue", { /** * The lowest value to assign a color. Any given value less than this value will be made Transparent. */ get: function () { return this.i.minimumValue; }, set: function (v) { this.i.minimumValue = +v; this._a("minimumValue", this.i.minimumValue); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCustomPaletteColorScaleComponent.prototype, "maximumValue", { /** * The highest value to assign a color. Any given value greater than this value will be made Transparent. */ get: function () { return this.i.maximumValue; }, set: function (v) { this.i.maximumValue = +v; this._a("maximumValue", this.i.maximumValue); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCustomPaletteColorScaleComponent.prototype, "palette", { /** * A list of colors to select from or interpolate between. */ get: function () { return fromColorCollection(this.i.palette); }, set: function (v) { this.i.palette = toColorCollection(v); this._a("palette", colorCollectionToString(this.i.palette)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCustomPaletteColorScaleComponent.prototype, "interpolationMode", { /** * The approach to use when getting a color from the palette. */ get: function () { return this.i.interpolationMode; }, set: function (v) { this.i.interpolationMode = ensureEnum(ColorScaleInterpolationMode_$type, v); this._a("interpolationMode", enumToString(ColorScaleInterpolationMode_$type, this.i.interpolationMode)); }, enumerable: false, configurable: true }); IgcCustomPaletteColorScaleComponent.prototype.providePalette = function (colors) { this.i.providePalette(colors); }; IgcCustomPaletteColorScaleComponent._observedAttributesIgcCustomPaletteColorScaleComponent = null; IgcCustomPaletteColorScaleComponent.htmlTagName = "igc-custom-palette-color-scale"; IgcCustomPaletteColorScaleComponent._isElementRegistered = false; return IgcCustomPaletteColorScaleComponent; }(IgcColorScaleComponent)); export { IgcCustomPaletteColorScaleComponent };