UNPKG

igniteui-react-charts

Version:

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

994 lines (993 loc) 32.2 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 { Base, typeCast, runOn, fromEnum, Point_$type, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, delegateCombine } from "igniteui-react-core"; import { DomWrapper_$type } from "igniteui-react-core"; import { Dictionary$2 } from "igniteui-react-core"; import { RenderingContext } from "igniteui-react-core"; import { CanvasScalingHelpers } from "igniteui-react-core"; import { LegendItemHelper } from "igniteui-react-core"; import { ContentControl } from "igniteui-react-core"; import { ILegendContext_$type } from "igniteui-react-core"; import { DataTemplatePassInfo } from "igniteui-react-core"; import { DataTemplateMeasureInfo } from "igniteui-react-core"; import { DataTemplateRenderInfo } from "igniteui-react-core"; import { CanvasViewRenderer } from "igniteui-react-core"; import { Size } from "igniteui-react-core"; import { Rect } from "igniteui-react-core"; import { FontUtil } from "igniteui-react-core"; import { IChartLegend_$type } from "igniteui-react-core"; import { ObservableCollection$1 } from "igniteui-react-core"; import { UIElement } from "igniteui-react-core"; import { LegendItemInfo } from "./LegendItemInfo"; import { ILegendSeries_$type } from "igniteui-react-core"; import { PropertyUpdatedEventArgs } from "igniteui-react-core"; import { LegendMouseButtonEventArgs } from "./LegendMouseButtonEventArgs"; import { LegendMouseEventArgs } from "./LegendMouseEventArgs"; import { LegendTextContentChangedEventArgs } from "./LegendTextContentChangedEventArgs"; import { LegendVisualData } from "./LegendVisualData"; import { MouseButtonEventArgs } from "igniteui-react-core"; import { MouseEventArgs } from "igniteui-react-core"; import { RectData } from "igniteui-react-core"; import { AppearanceHelper } from "igniteui-react-core"; import { LegendItemVisualData } from "./LegendItemVisualData"; import { stringIsNullOrEmpty } from "igniteui-react-core"; /** * @hidden */ var LegendBaseViewManager = /** @class */ /*@__PURE__*/ (function (_super) { __extends(LegendBaseViewManager, _super); function LegendBaseViewManager(a) { var _this = _super.call(this) || this; _this.a = null; _this.e = false; _this.n = null; _this.i = null; _this.d = false; _this.h = null; _this.o = null; _this.c = null; _this.f = false; _this.p = null; _this.a = a; _this.h = new Dictionary$2(Base.$, DomWrapper_$type, 0); return _this; } LegendBaseViewManager.prototype.t = function () { if (this.e) { return; } this.e = true; var a = CanvasScalingHelpers.b(this.i); var b = LegendItemHelper.b; var c = CanvasScalingHelpers.a(b, b, a); LegendItemHelper.b = c; this.a.am(); this.e = false; }; LegendBaseViewManager.prototype.y = function () { }; LegendBaseViewManager.prototype.w = function () { this.t(); }; LegendBaseViewManager.prototype.x = function (a) { if (a == null) { this.n = null; this.i = null; return; } this.i = a; this.n = this.k(); this.n.addClass(this.a.t); this.i.append(this.n); }; LegendBaseViewManager.prototype.k = function () { return this.i.createElement("table"); }; LegendBaseViewManager.prototype.j = function () { var a = this.i.createElement("tr"); a.addClass(this.a.u); var b = this.a.l; if (b) { a.setStyleProperty("display", "block"); a.setStyleProperty("float", "left"); a.setStyleProperty("margin", "0px"); a.setStyleProperty("margin-right", "8px"); } return a; }; LegendBaseViewManager.prototype.l = function (a) { return this.m(a, this.n); }; LegendBaseViewManager.prototype.m = function (a, b) { var c = typeCast(ContentControl.$, a); var d = this.j(); if (c != null) { var e = typeCast(ILegendContext_$type, c.content); if (e != null && c.ah != null) { var f = new DataTemplatePassInfo(); f.context = d; f.passID = "LegendItem"; var g = new DataTemplateMeasureInfo(); g.passInfo = f; g.width = NaN; g.height = NaN; g.data = e; g.context = d; var h = new DataTemplateRenderInfo(); h.passInfo = f; if (c.ah.measure != null) { c.ah.measure(g); } h.context = this.i.getSubRenderer(d); h.availableWidth = g.width; h.availableHeight = g.height; h.data = e; h.xPosition = 0; h.yPosition = 0; c.ah.render(h); var i = d.findByClass(".ui-legend-item-badge"); for (var j = 0; j < i.length; j++) { i[j].removeClass("ui-legend-item-badge").addClass(this.a.s); } i = d.findByClass(".ui-legend-item-text"); for (var k = 0; k < i.length; k++) { if (this.a.l) { i[k].setStyleProperty("white-space", "nowrap"); } i[k].removeClass("ui-legend-item-text").addClass(this.a.v); } } } return d; }; LegendBaseViewManager.prototype.s = function (a, b) { if (this.i == null) { return; } var c = this.m(a, this.n); c.listen("mouseup", runOn(this.a, this.a.af)); c.listen("mousedown", runOn(this.a, this.a.ac)); c.listen("mouseleave", runOn(this.a, this.a.ad)); c.listen("mousemove", runOn(this.a, this.a.ae)); this.h.addItem(a, c); if ((this.n.getChildCount() == 0) || (b >= this.n.getChildCount())) { this.n.append(c); } else { var d = this.n.getChildAt(b); d.before(c); } }; LegendBaseViewManager.prototype.aa = function (a) { }; LegendBaseViewManager.prototype.ab = function (a) { var _this = this; var b; if (((function () { var c = _this.h.tryGetValue(a, b); b = c.p1; return c.ret; })())) { b.unlistenAll(); b.remove(); this.h.removeItem(a); } }; LegendBaseViewManager.prototype.r = function (visual_) { var e_1, _a; try { for (var _b = __values(fromEnum(this.h)), _c = _b.next(); !_c.done; _c = _b.next()) { var pair_ = _c.value; if (pair_.value.getNativeElement() === visual_) { return pair_.key; } ; } } 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; } } return null; }; LegendBaseViewManager.prototype.g = function (a) { var e_2, _a; try { for (var _b = __values(fromEnum(this.h.keys)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; var c = typeCast(ContentControl.$, b); if (c != null && c.content != null) { var d = typeCast(ILegendContext_$type, c.content); if (d != null && d.itemLabel == a.itemLabel && d.legendLabel == a.legendLabel && d.series == a.series && d.itemBrush == a.itemBrush) { return true; } } } } 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 false; }; LegendBaseViewManager.prototype.b = function (a) { var b = this.i.rootWrapper.width(); var c = this.i.rootWrapper.height(); this.n.remove(); var d = this.i.createElement("div"); d.setStyleProperty("position", "relative"); this.o = this.i.createElement("<canvas style=\"position : absolute; top : 0; left : 0\" />"); this.o.setStyleProperty("position", "absolute"); this.o.setStyleProperty("top", "0px"); this.o.setStyleProperty("left", "0px"); this.i.append(d); d.append(this.o); this.c = new RenderingContext(new CanvasViewRenderer(), this.i.get2DCanvasContext(this.o)); this.o.setAttribute("width", b.toString()); this.o.setAttribute("height", c.toString()); return this.c; }; LegendBaseViewManager.prototype.aj = function () { return new Size(1, this.i.rootWrapper.width(), Math.max(10, this.i.rootWrapper.height() - 15)); }; LegendBaseViewManager.prototype.ac = function (a, b, c, d) { var e_3, _a; var e = a.h(); e.beginPath(); e.moveTo(b.an._inner[0].x, b.an._inner[0].y); for (var f = 1; f < b.an.count; f++) { e.lineTo(b.an._inner[f].x, b.an._inner[f].y); } e.lineTo(b.an._inner[0].x, b.an._inner[0].y); var g = e.createLinearGradient(d.left, d.top, d.left, d.top + d.height); try { for (var _b = __values(fromEnum(c.a)), _c = _b.next(); !_c.done; _c = _b.next()) { var h = _c.value; g.addColorStop(h.a, h.b._fill); } } 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; } } e.fillStyle = g; e.fill(); }; LegendBaseViewManager.prototype.u = function () { }; LegendBaseViewManager.prototype.v = function () { }; LegendBaseViewManager.prototype.q = function (a) { var e_4, _a; try { for (var _b = __values(fromEnum(this.h.values)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; var c = this.ai(b); if (c.containsPoint(a)) { return b; } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_4) throw e_4.error; } } return null; }; LegendBaseViewManager.prototype.ai = function (a) { var b = a.getOffset(); var c = this.i.rootWrapper.getOffset(); var d = { $type: Point_$type, x: b.left - c.left, y: b.top - c.top }; var e = a.width(); var f = a.height(); return new Rect(0, d.x, d.y, e, f); }; LegendBaseViewManager.prototype.ae = function (a) { var b = this.q(a); if (b != null) { if (!this.f) { this.a.c.a8(this.a.f(b)); } this.p = b; this.f = true; } else { if (this.f) { this.a.c.a8(this.a.f(this.p)); this.p = null; } this.f = false; } }; LegendBaseViewManager.prototype.ad = function (a) { this.ae(a); var b = this.q(a); this.a.c.ba(this.a.e(b)); }; LegendBaseViewManager.prototype.af = function () { if (this.f) { this.a.c.a8(this.a.f(this.p)); this.p = null; } this.f = false; }; LegendBaseViewManager.prototype.z = function (a) { var b = this.n == null ? 0 : this.n.getChildCount(); for (var c = 0; c < b; c++) { var d = this.n.getChildAt(c); d.setStyleProperty("display", a ? "block" : ""); d.setStyleProperty("float", a ? "left" : ""); d.setStyleProperty("margin", a ? "0px" : ""); d.setStyleProperty("margin-right", a ? "8px" : ""); d.getChildAt(1).setStyleProperty("white-space", a ? "nowrap" : ""); } }; LegendBaseViewManager.prototype.ag = function (a) { this.n.setStyleProperty("color", a); }; LegendBaseViewManager.prototype.ah = function (a) { var b = FontUtil.getFontInfoFromString(this.i, a); this.n.setStyleProperty("font-family", b.q); this.n.setStyleProperty("font-size", b.f + "px"); this.n.setStyleProperty("font-style", b.t); }; LegendBaseViewManager.$t = markType(LegendBaseViewManager, 'LegendBaseViewManager'); return LegendBaseViewManager; }(Base)); export { LegendBaseViewManager }; /** * @hidden */ var LegendBase = /** @class */ /*@__PURE__*/ (function (_super) { __extends(LegendBase, _super); function LegendBase() { var _this = _super.call(this) || this; _this.ak = null; _this.at = false; _this.aw = null; _this.ax = null; _this.av = null; _this._seriesOwner = null; _this._chartOwner = null; _this.propertyChanged = null; _this.propertyUpdated = null; _this.legendItemMouseLeftButtonDown = null; _this.legendItemMouseLeftButtonUp = null; _this.legendItemMouseEnter = null; _this.legendItemMouseLeave = null; _this.legendItemMouseMove = null; _this.legendTextContentChanged = null; var a = _this.aj(); _this.bd(a); a.al(); _this.aw = new ObservableCollection$1(UIElement.$, 0); _this.av = new ObservableCollection$1(LegendItemInfo.$, 0); _this.ax = new ObservableCollection$1(LegendItemInfo.$, 0); var b = _this.ax; b.collectionChanged = delegateCombine(b.collectionChanged, function (b, c) { return _this.at = true; }); var c = _this.aw; c.collectionChanged = delegateCombine(c.collectionChanged, function (c, d) { if (d.action == 4) { _this.ax.clear(); } if (d.action == 1) { _this.ax.removeAt(d.oldStartingIndex); } }); _this.a0 = "ig-chart-legend-items-list"; _this.a1 = "ig-chart-legend-item"; _this.az = "ig-chart-legend-item-badge"; _this.a2 = "ig-chart-legend-item-text"; return _this; } LegendBase.prototype.onDetachedFromUI = function () { this.ak.ak(); }; LegendBase.prototype.onAttachedToUI = function () { this.ak.ai(); }; LegendBase.prototype.aj = function () { return new LegendBaseView(this); }; LegendBase.prototype.bd = function (a) { this.ak = a; }; LegendBase.prototype.addChildInOrder = function (a, b) { }; LegendBase.prototype.a5 = function (a, b) { }; Object.defineProperty(LegendBase.prototype, "seriesOwner", { get: function () { return this._seriesOwner; }, set: function (a) { this._seriesOwner = a; }, enumerable: false, configurable: true }); Object.defineProperty(LegendBase.prototype, "chartOwner", { get: function () { return this._chartOwner; }, set: function (a) { this._chartOwner = a; }, enumerable: false, configurable: true }); LegendBase.prototype.get_isItemwise = function () { return false; }; Object.defineProperty(LegendBase.prototype, "isItemwise", { get: function () { return this.get_isItemwise(); }, enumerable: false, configurable: true }); LegendBase.prototype.get_isScale = function () { return false; }; Object.defineProperty(LegendBase.prototype, "isScale", { get: function () { return this.get_isScale(); }, enumerable: false, configurable: true }); LegendBase.prototype.clearLegendItemsForSeries = function (a) { var e_5, _a, e_6, _b; if (a == null || this.aw == null || this.aw.count == 0) { return; } var b = new ObservableCollection$1(UIElement.$, 0); try { for (var _c = __values(fromEnum(this.aw)), _d = _c.next(); !_d.done; _d = _c.next()) { var c = _d.value; var d = typeCast(ContentControl.$, c); if (d != null && d.content != null) { var e = typeCast(ILegendContext_$type, d.content); if (e != null && e.series == a) { b.add(c); } } } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_5) throw e_5.error; } } try { for (var _e = __values(fromEnum(b)), _f = _e.next(); !_f.done; _f = _e.next()) { var f = _f.value; this.aw.remove(f); } } catch (e_6_1) { e_6 = { error: e_6_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_6) throw e_6.error; } } }; LegendBase.prototype.containsChild = function (a) { return this.aw.contains(a); }; LegendBase.prototype.removeChild = function (a) { this.aw.remove(a); }; Object.defineProperty(LegendBase.prototype, "ai", { get: function () { if (this.seriesOwner != null) { return this.seriesOwner; } else { return this.chartOwner; } }, enumerable: false, configurable: true }); LegendBase.prototype.be = function (a, b, c) { if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } if (this.propertyUpdated != null) { this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c)); } }; LegendBase.prototype.ba = function (a) { if (this.legendItemMouseLeftButtonDown != null) { this.legendItemMouseLeftButtonDown(this, a); } if (a.d != null) { a.d.onLegendItemPointerDown(a.item); } }; LegendBase.prototype.bb = function (a) { if (this.legendItemMouseLeftButtonUp != null) { this.legendItemMouseLeftButtonUp(this, a); } if (a.d != null) { a.d.onLegendItemPointerUp(a.item); } }; LegendBase.prototype.a8 = function (a) { if (this.legendItemMouseEnter != null) { this.legendItemMouseEnter(this, a); } if (a.d != null) { a.d.onLegendItemEnter(a.item); } }; LegendBase.prototype.a9 = function (a) { if (this.legendItemMouseLeave != null) { this.legendItemMouseLeave(this, a); } if (a.d != null) { a.d.onLegendItemLeave(a.item); } }; LegendBase.prototype.bc = function (a) { if (this.legendItemMouseMove != null) { this.legendItemMouseMove(this, a); } if (a.d != null) { a.d.onLegendItemOver(a.item); } }; LegendBase.prototype.flushTextContentChangedCheck = function () { this.a4(); }; LegendBase.prototype.a4 = function () { var e_7, _a; if (!this.at) { return; } this.at = false; if (this.legendTextContentChanged == null) { return; } var a = false; if (this.av.count != this.ax.count) { a = true; } else { for (var b = 0; b < this.ax.count; b++) { var c = this.ax._inner[b]; var d = this.av._inner[b]; if (!Base.equalsStatic(c.d, d.d)) { a = true; break; } } } this.av.clear(); var _loop_1 = function (e) { this_1.av.add(((function () { var $ret = new LegendItemInfo(); $ret.b = e.b; $ret.c = e.c; $ret.a = e.a; $ret.d = e.d; return $ret; })())); }; var this_1 = this; try { for (var _b = __values(fromEnum(this.ax)), _c = _b.next(); !_c.done; _c = _b.next()) { var e = _c.value; _loop_1(e); } } catch (e_7_1) { e_7 = { error: e_7_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_7) throw e_7.error; } } if (a) { this.legendTextContentChanged(this, new LegendTextContentChangedEventArgs()); } }; LegendBase.prototype.provideContainer = function (a) { this.ak.aj(a); }; Object.defineProperty(LegendBase.prototype, "a0", { get: function () { return this.ak.t; }, set: function (a) { var b = this.ak.t; this.ak.t = a; if (b != a) { } }, enumerable: false, configurable: true }); Object.defineProperty(LegendBase.prototype, "a1", { get: function () { return this.ak.u; }, set: function (a) { var b = this.ak.u; this.ak.u = a; if (b != a) { } }, enumerable: false, configurable: true }); Object.defineProperty(LegendBase.prototype, "az", { get: function () { return this.ak.s; }, set: function (a) { var b = this.ak.s; this.ak.s = a; if (b != a) { } }, enumerable: false, configurable: true }); Object.defineProperty(LegendBase.prototype, "a2", { get: function () { return this.ak.v; }, set: function (a) { var b = this.ak.v; this.ak.v = a; if (b != a) { } }, enumerable: false, configurable: true }); LegendBase.prototype.exportVisualData = function () { return this.ak.g(); }; LegendBase.prototype.exportSerializedVisualData = function () { var a = this.exportVisualData(); return a.serialize(); }; LegendBase.prototype.get_isFinancial = function () { return false; }; Object.defineProperty(LegendBase.prototype, "isFinancial", { get: function () { return this.get_isFinancial(); }, enumerable: false, configurable: true }); LegendBase.prototype.bh = function (a) { this.ak.aq(a); }; LegendBase.prototype.bg = function (a) { this.ak.ap(a); }; LegendBase.prototype.bi = function () { this.ak.ar(); }; LegendBase.$t = markType(LegendBase, 'LegendBase', ContentControl.$, [INotifyPropertyChanged_$type, IChartLegend_$type]); return LegendBase; }(ContentControl)); export { LegendBase }; /** * @hidden */ var LegendBaseView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(LegendBaseView, _super); function LegendBaseView(a) { var _this = _super.call(this) || this; _this.d = null; _this.c = null; _this.t = null; _this.u = null; _this.s = null; _this.v = null; _this.m = false; _this.j = false; _this.q = null; _this.r = null; _this.c = a; _this.d = new LegendBaseViewManager(_this); _this.d.t(); return _this; } LegendBaseView.prototype.ak = function () { this.d.y(); }; LegendBaseView.prototype.ai = function () { this.d.w(); }; LegendBaseView.prototype.al = function () { }; LegendBaseView.prototype.get_k = function () { return false; }; Object.defineProperty(LegendBaseView.prototype, "k", { get: function () { return this.get_k(); }, enumerable: false, configurable: true }); LegendBaseView.prototype.e = function (a) { var b; var c; var d; var e = this.ab(a, b, c, d); b = e.p1; c = e.p2; d = e.p3; var f = new MouseButtonEventArgs(); var g = new LegendMouseButtonEventArgs(b, c, d, f, a); return g; }; LegendBaseView.prototype.f = function (a) { var b; var c; var d; var e = this.ab(a, b, c, d); b = e.p1; c = e.p2; d = e.p3; var f = new MouseEventArgs(); var g = new LegendMouseEventArgs(b, c, d, f, a); return g; }; LegendBaseView.prototype.ab = function (a, b, c, d) { b = this.c.ai; c = null; d = null; if (a != null) { var e = typeCast(ContentControl.$, a); if (e != null && e.content != null && typeCast(ILegendContext_$type, e.content) !== null) { var f = typeCast(ILegendContext_$type, e.content); c = typeCast(ILegendSeries_$type, f.series); if (c != null) { b = c.container; } d = f.item; } } return { p1: b, p2: c, p3: d }; }; LegendBaseView.prototype.aa = function () { }; LegendBaseView.prototype.n = function () { return true; }; LegendBaseView.prototype.z = function (a) { }; LegendBaseView.prototype.an = function (a) { }; LegendBaseView.prototype.aj = function (a) { this.d.x(a); }; LegendBaseView.prototype.ao = function (a) { this.d.ab(a); }; LegendBaseView.prototype.y = function (a) { var b = this.c.aw.indexOf(a); this.d.s(a, b); }; LegendBaseView.prototype.ag = function () { this.d.u(); }; LegendBaseView.prototype.ah = function () { this.d.v(); }; Object.defineProperty(LegendBaseView.prototype, "l", { get: function () { return this.j; }, set: function (a) { this.j = a; this.d.z(this.j); }, enumerable: false, configurable: true }); Object.defineProperty(LegendBaseView.prototype, "w", { get: function () { return this.q; }, set: function (a) { this.q = a; this.d.ag(this.q); }, enumerable: false, configurable: true }); Object.defineProperty(LegendBaseView.prototype, "x", { get: function () { return this.r; }, set: function (a) { this.r = a; this.d.ah(this.r); }, enumerable: false, configurable: true }); LegendBaseView.prototype.am = function () { this.d.t(); }; LegendBaseView.prototype.o = function (e_) { var ev_ = e_.originalEvent; return ev_.currentTarget; }; LegendBaseView.prototype.p = function (e_) { return this.d.r(this.o(e_)); }; LegendBaseView.prototype.ae = function (a) { if (!this.m) { this.c.a8(this.f(this.p(a))); } this.m = true; }; LegendBaseView.prototype.ad = function (a) { if (this.m) { this.c.a9(this.f(this.p(a))); } this.m = false; }; LegendBaseView.prototype.ac = function (a) { this.c.ba(this.e(this.p(a))); }; LegendBaseView.prototype.af = function (a) { this.c.bb(this.e(this.p(a))); }; LegendBaseView.prototype.i = function (a) { var b = a.querySelectorAll("span *"); var c = Rect.empty; for (var e = 0; e < b.length; e++) { var d = b[e]; if (stringIsNullOrEmpty(d.getText())) { continue; } var f = new Rect(0, d.getOffset().left, d.getOffset().top, d.width(), d.height()); f.union(c); c = f; } return RectData.b(c); }; LegendBaseView.prototype.h = function (a) { var b = a.querySelectorAll("canvas"); var c = b.length > 0 ? b[0] : null; return c != null ? new RectData(c.getOffset().left, c.getOffset().top, c.width(), c.height()) : null; }; LegendBaseView.prototype.a = function (a) { if (this.c == null || this.c.aw == null || this.c.aw.count <= a) { return null; } var b = this.c.aw._inner[a]; if (b == null) { return null; } var c = b.content; if (c == null) { return null; } var d = c.actualItemBrush != null ? c.actualItemBrush : c.itemBrush; return AppearanceHelper.b(d); }; LegendBaseView.prototype.b = function (a) { if (this.c == null || this.c.aw == null || this.c.aw.count <= a) { return null; } var b = this.c.aw._inner[a]; if (b == null) { return null; } var c = b.content; if (c == null) { return null; } var d = c.outline; return AppearanceHelper.b(d); }; LegendBaseView.prototype.g = function () { var a = new LegendVisualData(); var b = this.d.n; var c = b.getChildCount(); for (var d = 0; d < c; d++) { var e = new LegendItemVisualData(); var f = b.getChildAt(d); e.label = f.getText(); e.label = e.label != null ? e.label.trim() : null; e.bounds = new RectData(f.getOffset().left, f.getOffset().top, f.width(), f.height()); e.labelBounds = this.i(f); e.badgeBounds = this.h(f); e.appearance.fill = this.a(d); e.appearance.stroke = this.b(d); a.items.add(e); } for (var g = 0; g < this.c.aw.count; g++) { a.items._inner[g].appearance.fill = this.a(g); a.items._inner[g].appearance.stroke = this.b(g); } return a; }; LegendBaseView.prototype.aq = function (a) { this.d.ae(a); }; LegendBaseView.prototype.ap = function (a) { this.d.ad(a); }; LegendBaseView.prototype.ar = function () { this.d.af(); }; LegendBaseView.$t = markType(LegendBaseView, 'LegendBaseView'); return LegendBaseView; }(Base)); export { LegendBaseView };