UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

1,045 lines (1,044 loc) 33.7 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 { XYChart } from "./XYChart"; import { typeCast, runOn, delegateCombine, enumGetBox, markType, TypeRegistrar, getInstanceType } from "igniteui-angular-core"; import { CategoryChartType_$type } from "./CategoryChartType"; import { CategorySeriesMarkerCollisionAvoidance_$type } from "./CategorySeriesMarkerCollisionAvoidance"; import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode"; import { TransitionInSpeedType_$type } from "./TransitionInSpeedType"; import { AutoMarginsAndAngleUpdateMode_$type } from "./AutoMarginsAndAngleUpdateMode"; import { AxisRangeBufferMode_$type } from "./AxisRangeBufferMode"; import { CategoryXAxis } from "./CategoryXAxis"; import { List$1 } from "igniteui-angular-core"; import { DataSeriesType_$type } from "igniteui-angular-core"; import { NumericYAxis } from "./NumericYAxis"; import { IDataSeriesAdapterRule_$type } from "igniteui-angular-core"; import { SimpleCategorySeriesRule } from "igniteui-angular-core"; import { SubCollectionsRule } from "igniteui-angular-core"; import { DVContainer } from "igniteui-angular-core"; import { Brush } from "igniteui-angular-core"; import { AxisDefaults } from "./AxisDefaults"; import { Defaults } from "./Defaults"; import { Series } from "./Series"; import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries"; import { ArrayExtension } from "igniteui-angular-core"; import { AxisLabelSettings } from "./AxisLabelSettings"; import { DeviceUtils } from "igniteui-angular-core"; import { CategoryChartMockDataGenerator } from "./CategoryChartMockDataGenerator"; import { stringIsNullOrEmpty } from "igniteui-angular-core"; /** * @hidden */ export let CategoryChart = /*@__PURE__*/ (() => { class CategoryChart extends XYChart { constructor() { super(); this.ajk = 1000; this.ajl = 1000; this.ahn = null; this.aho = null; this.ag7 = 9; this.ag9 = 1; this.aht = false; this.ahu = true; this.ahb = 0; this.ahl = 0; this.aih = 0; this.aik = 0; this.aig = 0; this.aij = 0; this.aii = 1; this.ail = 0; this.air = NaN; this.ag3 = 1; this.ahv = true; this.ahw = true; this.aie = DeviceUtils.g(2); this.aif = DeviceUtils.g(60); this.ah0 = true; this.ahx = true; this.ahz = false; this.ag5 = 0; this.ah1 = false; this.ajm = 10; this.ait = NaN; this.ais = NaN; this.aiu = 0; this.agz = null; this.ag0 = null; this.ahy = true; this.aim = 3; this.ain = NaN; this.aio = NaN; this.aip = NaN; this.aiq = NaN; this.ahr = false; this.ahs = false; this.aid = null; DVContainer.instance.registerIfLoaded("CategoryChartToolbarFactoryManager"); this.ul(); } u5() { super.u5(); if (this.dataChart == null) { return; } let a = this.dataChart.c9.j.e(); this.ag1 = a.d; this.ag2 = a.e; if (this.agb == null) { this.agb = a.k; } if (this.agi == null) { this.agi = a.k; } this.aca = 0; this.agj = AxisDefaults.h; this.agm = null; this.agf = AxisDefaults.g; this.agc = null; this.abt = AxisDefaults.f; this.agg = AxisDefaults.j; this.abu = AxisDefaults.e; this.crosshairsAnnotationEnabled = true; this.gn = true; this.crosshairsDisplayMode = 0; this.jl = Defaults.j; this.yc = Defaults.ae; this.x7 = Defaults.af; this.x8 = Defaults.ag; this.ah5 = true; } u7(a, b) { super.u7(a, b); a.kd = this.ajn; a.ke = this.ajo; a.de = this.ahp; a.df = this.ahq; } vx(a, b, c) { super.vx(a, b, c); switch (a) { case "TransitionInDuration": this.uu((d) => d.kd = this.ajn); break; case "TransitionOutDuration": this.uu((d) => d.ke = this.ajo); break; case "TransitionInEasingFunction": this.uu((d) => d.de = this.ahp); break; case "TransitionOutEasingFunction": this.uu((d) => d.df = this.ahq); break; } } get ajn() { return this.ajk; } set ajn(a) { let b = this.ajn; if (a != b) { this.ajk = a; this.vu("TransitionInDuration", b, this.ajn); } } get ajo() { return this.ajl; } set ajo(a) { let b = this.ajo; if (a != b) { this.ajl = a; this.vu("TransitionOutDuration", b, this.ajo); } } get ahp() { return this.ahn; } set ahp(a) { let b = this.ahp; if (a != b) { this.ahn = a; this.vu("TransitionInEasingFunction", b, this.ahp); } } get ahq() { return this.aho; } set ahq(a) { let b = this.ahq; if (a != b) { this.aho = a; this.vu("TransitionOutEasingFunction", b, this.ahq); } } aju() { let cvd_ = this.lu(); cvd_.scaleByViewport(); return (cvd_.serialize()); } u0(a, b) { super.u0(a, b); a.ek = this.gg; a.xm = this.ah6; a.xp = this.ah7; a.yc = this.aiv; a.yd = this.aiw; a.wr = this.ag4; } u6(a, b) { super.u6(a, b); let c = typeCast(HorizontalAnchoredCategorySeries.$, a); if (c == null) { return; } c.aaw = this.aha; c.zk = this.ah5; c.y4 = this.ahc; c.c5 = this.ahm; c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.af, b); c.trendLineType = this.trendLineType; c.trendLineThickness = this.kh; c.w9 = this.c2(a, b); if (a.fl) { a.r2(ArrayExtension.getModulus$1(Brush.$, this.ag1, b), ArrayExtension.getModulus$1(Brush.$, this.ag2, b)); } } ahd() { return new CategoryXAxis(); } ahh() { return new NumericYAxis(); } ug() { this.xAxis = this.ahd(); this.xAxis.name = "xAxis"; let a = this.xAxis; a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.aky)); this.yAxis = this.ahh(); this.yAxis.name = "yAxis"; let b = this.yAxis; b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.akz)); if (this.xAxis.az == null) { this.xAxis.az = new AxisLabelSettings(); } if (this.yAxis.az == null) { this.yAxis.az = new AxisLabelSettings(); } } afb(a) { super.afb(a); a.lf = this.ah9; a.lj = this.aib; a.b1 = this.aia; } ae9(a) { super.ae9(a); a.b1 = this.ah8; a.zoomMaximumCategoryRange = this.ai9; a.zoomToCategoryRange = this.ajb; a.zoomToCategoryStart = this.ajc; a.zoomMaximumItemSpan = this.aja; a.zoomToItemSpan = this.ajd; } get_cb() { return 0; } get cb() { return this.get_cb(); } get ag8() { return this.ag7; } set ag8(a) { if (a != this.ag7) { let b = this.ag8; this.ag7 = a; this.vu("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.ag8)); } } get aha() { return this.ag9; } set aha(a) { let b = this.aha; if (a != b) { this.ag9 = a; this.vu("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.aha)); } } get ah4() { return this.aht; } set ah4(a) { let b = this.ah4; if (a != b) { this.aht = a; this.vu("IsSplineShapePartOfRange", b, this.ah4); } } get ah5() { return this.ahu; } set ah5(a) { let b = this.ah5; if (a != b) { this.ahu = a; this.vu("IsTransitionInEnabled", b, this.ah5); } } get ahc() { return this.ahb; } set ahc(a) { let b = this.ahc; if (a != b) { this.ahb = a; this.vu("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.ahc)); } } get ahm() { return this.ahl; } set ahm(a) { let b = this.ahm; if (a != b) { this.ahl = a; this.vu("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.ahm)); } } get ai4() { return this.aih; } set ai4(a) { let b = this.ai4; if (a != b) { this.aih = a; this.vu("XAxisInterval", b, this.ai4); } } get ai7() { return this.aik; } set ai7(a) { let b = this.ai7; if (a != b) { this.aik = a; this.vu("XAxisMinorInterval", b, this.ai7); } } get ai3() { return this.aig; } set ai3(a) { let b = this.ai3; if (a != b) { this.aig = a; this.vu("XAxisGap", b, this.ai3); } } get ai6() { return this.aij; } set ai6(a) { let b = this.ai6; if (a != b) { this.aij = a; this.vu("XAxisMinimumGapSize", b, this.ai6); } } get ai5() { return this.aii; } set ai5(a) { let b = this.ai5; if (a != b) { this.aii = a; this.vu("XAxisMaximumGap", b, this.ai5); } } get ai8() { return this.ail; } set ai8(a) { let b = this.ai8; if (a != b) { this.ail = a; this.vu("XAxisOverlap", b, this.ai8); } } get ajg() { return this.air; } set ajg(a) { let b = this.ajg; if (a != b) { this.air = a; this.vu("YAxisInterval", b, this.ajg); } } get ag4() { return this.ag3; } set ag4(a) { let b = this.ag4; if (a != b) { this.ag3 = a; this.vu("AutoMarginAndAngleUpdateMode", enumGetBox(AutoMarginsAndAngleUpdateMode_$type, b), enumGetBox(AutoMarginsAndAngleUpdateMode_$type, this.ag4)); } } ak0() { if (this.dataChart != null) { this.dataChart.zx(); } } get ah6() { return this.ahv; } set ah6(a) { let b = this.ah6; if (a != b) { this.ahv = a; this.vu("ShouldAutoExpandMarginForInitialLabels", b, this.ah6); } } get ah7() { return this.ahw; } set ah7(a) { let b = this.ah7; if (a != b) { this.ahw = a; this.vu(CategoryChart.aj3, b, this.ah7); } } get aiv() { return this.aie; } set aiv(a) { let b = this.aiv; if (a != b) { this.aie = a; this.vu("AutoExpandMarginExtraPadding", b, this.aiv); } } get aiw() { return this.aif; } set aiw(a) { let b = this.aiw; if (a != b) { this.aif = a; this.vu("AutoExpandMarginMaximumValue", b, this.aiw); } } get aib() { return this.ah0; } set aib(a) { let b = this.aib; if (a != b) { this.ah0 = a; this.vu("YAxisFavorLabellingScaleEnd", b, this.aib); } } get ah8() { return this.ahx; } set ah8(a) { let b = this.ah8; if (a != b) { this.ahx = a; this.vu(CategoryChart.aka, b, this.ah8); } } get aia() { return this.ahz; } set aia(a) { let b = this.aia; if (a != b) { this.ahz = a; this.vu(CategoryChart.ako, b, this.aia); } } get ag6() { return this.ag5; } set ag6(a) { let b = this.ag6; if (a != b) { this.ag5 = a; this.vu("YAxisAutoRangeBufferMode", enumGetBox(AxisRangeBufferMode_$type, b), enumGetBox(AxisRangeBufferMode_$type, this.ag6)); } } get aic() { return this.ah1; } set aic(a) { let b = this.aic; if (a != b) { this.ah1 = a; this.vu("YAxisIsLogarithmic", b, this.aic); } } get ajp() { return this.ajm; } set ajp(a) { let b = this.ajp; if (a != b) { this.ajm = a; this.vu("YAxisLogarithmBase", b, this.ajp); } } get aji() { return this.ait; } set aji(a) { let b = this.aji; if (a != b) { this.ait = a; this.vu("YAxisMinimumValue", b, this.aji); } } get ajh() { return this.ais; } set ajh(a) { let b = this.ajh; if (a != b) { this.ais = a; this.vu("YAxisMaximumValue", b, this.ajh); } } get ajj() { return this.aiu; } set ajj(a) { let b = this.ajj; if (a != b) { this.aiu = a; this.vu("YAxisMinorInterval", b, this.ajj); } } get ai2() { return this.xAxis.m1; } get ai1() { return this.xAxis.m0; } aiy() { return this.ai2; } ai0() { return this.ajf; } aix() { return this.ai1; } aiz() { return this.aje; } get ajf() { return this.yAxis.l4; } get aje() { return this.yAxis.l3; } get ag1() { return this.agz; } set ag1(a) { let b = this.ag1; if (a != b) { this.agz = a; this.vu("NegativeBrushes", b, this.ag1); } } get ag2() { return this.ag0; } set ag2(a) { let b = this.ag2; if (a != b) { this.ag0 = a; this.vu("NegativeOutlines", b, this.ag2); } } get ah9() { return this.ahy; } set ah9(a) { let b = this.ah9; if (a != b) { this.ahy = a; this.vu("YAxisAbbreviateLargeNumbers", b, this.ah9); } } get ai9() { return this.aim; } set ai9(a) { let b = this.ai9; if (a != b) { this.aim = a; this.vu("XAxisZoomMaximumCategoryRange", b, this.ai9); } } get aja() { return this.ain; } set aja(a) { let b = this.aja; if (a != b) { this.ain = a; this.vu("XAxisZoomMaximumItemSpan", b, this.aja); } } get ajb() { return this.aio; } set ajb(a) { let b = this.ajb; if (a != b) { this.aio = a; this.vu("XAxisZoomToCategoryRange", b, this.ajb); } } get ajc() { return this.aip; } set ajc(a) { let b = this.ajc; if (a != b) { this.aip = a; this.vu("XAxisZoomToCategoryStart", b, this.ajc); } } get ajd() { return this.aiq; } set ajd(a) { let b = this.ajd; if (a != b) { this.aiq = a; this.vu("XAxisZoomToItemSpan", b, this.ajd); } } get ah2() { return this.ahr; } set ah2(a) { let b = this.ah2; if (a != b) { this.ahr = a; this.vu("IsCategoryHighlightingEnabled", b, this.ah2); } } get ah3() { return this.ahs; } set ah3(a) { let b = this.ah3; if (a != b) { this.ahs = a; this.vu("IsItemHighlightingEnabled", b, this.ah3); } } get_hx() { let a = new List$1(DataSeriesType_$type, 0); if (TypeRegistrar.isRegistered("AreaSeries")) { a.add(2); } if (TypeRegistrar.isRegistered("ColumnSeries")) { a.add(1); } if (TypeRegistrar.isRegistered("LineSeries")) { a.add(0); } if (TypeRegistrar.isRegistered("PointSeries")) { a.add(10); } if (TypeRegistrar.isRegistered("SplineSeries")) { a.add(6); } if (TypeRegistrar.isRegistered("SplineAreaSeries")) { a.add(7); } if (TypeRegistrar.isRegistered("StepAreaSeries")) { a.add(5); } if (TypeRegistrar.isRegistered("StepLineSeries")) { a.add(4); } if (TypeRegistrar.isRegistered("WaterfallSeries")) { a.add(8); } return a; } get hx() { return this.get_hx(); } h3() { if (this.aid == null) { this.aid = CategoryChartMockDataGenerator.a(); } return this.aid; } c1(a) { if (a != null) { let b = super.c1(a); if (b == 2) { if (a.fk && this.gy) { return 13; } } } return super.c1(a); } c3(a) { if (a != null) { let b = super.c1(a); if (b == 2) { if (a.fk && this.gy) { return 13; } } } return super.c3(a); } get_hh() { return true; } aky(a, b) { switch (b.propertyName) { case "ActualMinimum": this.wb("XAxisActualMinimum"); break; case "ActualMaximum": this.wb("XAxisActualMaximum"); break; } } akz(a, b) { switch (b.propertyName) { case "ActualMinimumValue": this.wb("YAxisActualMinimum"); break; case "ActualMaximumValue": this.wb("YAxisActualMaximum"); break; } } wp() { super.wp(); this.xAxis.f2 = this.ack == null ? XYChart.acw(this.xAxis, this.bf.dataSeries) : this.ack; this.xAxis.itemsSource = this.dataChart != null && this.dataChart.series.count > 0 ? this.dataChart.series._inner[0].itemsSource : null; if (this.ah6) { this.vk((a) => a.zx()); } } get xAxis() { return this._xAxis; } set xAxis(a) { this._xAxis = a; } get yAxis() { return this._yAxis; } set yAxis(a) { this._yAxis = a; } ahg(a, b) { switch (a) { case 2: return this.de(1); case 3: return this.de(10); case 0: return this.de(0); case 1: return this.de(2); case 6: return this.de(6); case 7: return this.de(7); case 4: return this.de(4); case 5: return this.de(5); case 8: return this.de(8); case 9: return this.ahf(b); default: return this.de(1); } } ahf(a) { return this.de(a); } be(a) { switch (this.ag8) { case 1: return 2; case 0: return 0; case 3: return 10; case 6: return 6; case 7: return 7; case 5: return 5; case 4: return 4; case 8: return 8; case 9: return a.suggestedSeries; default: case 2: return 1; } } dc(a, b) { let c = this.ahg(this.ag8, a.suggestedSeries); c.abm = a.findMatchingHint(0).path; c.xAxis = this.xAxis; c.yAxis = this.yAxis; return c; } wn(a) { if (a.suggestedSecondaryAxis == 2) { this.yAxis.lo = true; this.yAxis.mm = 10; } } wq() { this.yAxis.lo = this.aic; this.yAxis.mm = this.ajp; } get_hw() { return ((() => { let $ret = new List$1(IDataSeriesAdapterRule_$type, 0); $ret.add(new SimpleCategorySeriesRule()); $ret.add(new SubCollectionsRule()); return $ret; })()); } get hw() { return this.get_hw(); } ua(a, b) { let c = typeCast(HorizontalAnchoredCategorySeries.$, a); if (c != null) { c.aaw = this.aha; c.w9 = this.c2(a, b); } } akw(a) { this.akx((b, c) => a(b)); } akx(a) { if (this.dataChart == null) { return; } for (let b = 0; b < this.dataChart.series.count; b++) { let c = typeCast(HorizontalAnchoredCategorySeries.$, this.dataChart.series._inner[b]); if (c == null) { continue; } a(c, b); } } z2() { return this.xAxis; } z3() { return this.yAxis; } ahj() { return this.de(30); } ahk() { return this.de(31); } ht(a, b) { let c = super.ht(a, b); if (c != null) { let d = new List$1(Series.$, 0); if (this.ahr) { d.add(this.ahj()); } if (this.ahs) { d.add(this.ahk()); } for (let e = 0; e < d.count; e++) { let f = d._inner[e]; f.name = a + getInstanceType(f).typeName; c.add(f); } } return c; } ba() { if (this.a9 == 0) { return 1; } else { return this.a9; } } wu(a, b, c) { super.wu(a, b, c); if (this.bf.dataSeries.count > 0) { if (stringIsNullOrEmpty(this.no)) { this.ce.setXMemberPath(a, c.getMemberPathFor(16)); } if (stringIsNullOrEmpty(this.nq)) { this.ce.setYMemberPath(a, c.getMemberPathFor(0)); } if (stringIsNullOrEmpty(this.nb)) { this.ce.setLabelMemberPath(a, c.getMemberPathFor(0)); } if (stringIsNullOrEmpty(this.m7)) { this.ce.setContentMemberPath(a, c.getMemberPathFor(0)); } } } g1() { if (this.crosshairsDisplayMode == 4 || this.crosshairsDisplayMode == 3) { return true; } else if (this.crosshairsDisplayMode == 0) { if (this.ag8 == 2 || this.ag8 == 8) { return false; } else if (this.ag8 == 9 && this.bf != null && this.bf.dataSeries != null && this.bf.dataSeries.count > 0) { let a = this.bf.dataSeries._inner[0].suggestedSeries; if (a == 1 || a == 8) { return false; } } return true; } return false; } get_g8() { return DVContainer.instance.checkLoaded("CategoryChartToolbarFactoryManager"); } vu(a, b, c) { super.vu(a, b, c); switch (a) { case "ChartType": this.ur(); break; case "MarkerCollisionAvoidance": this.akw((d) => d.aaw = this.aha); break; case "IsTransitionInEnabled": this.akw((d) => d.zk = this.ah5); break; case "IsSplineShapePartOfRange": this.akw((d) => { if (d.fz) { d.r3(this.ah4); } }); break; case "TransitionInMode": this.akw((d) => d.y4 = this.ahc); break; case "TransitionInSpeedType": this.akw((d) => d.c5 = this.ahm); break; case "XAxisInterval": this.xAxis.mw = this.ai4; break; case "XAxisMinorInterval": this.xAxis.mx = this.ai7; break; case "XAxisGap": this.xAxis.k5 = this.ai3; break; case "XAxisOverlap": this.xAxis.le = this.ai8; break; case "XAxisMinimumGapSize": this.xAxis.ld = this.ai6; break; case "XAxisMaximumGap": this.xAxis.lc = this.ai5; break; case "XAxisZoomMaximumCategoryRange": this.xAxis.zoomMaximumCategoryRange = this.ai9; break; case "XAxisZoomMaximumItemSpan": this.xAxis.zoomMaximumItemSpan = this.aja; break; case "XAxisZoomToCategoryRange": this.xAxis.zoomToCategoryRange = this.ajb; break; case "XAxisZoomToCategoryStart": this.xAxis.zoomToCategoryStart = this.ajc; break; case "XAxisZoomToItemSpan": this.xAxis.zoomToItemSpan = this.ajd; break; case "YAxisInterval": this.yAxis.l8 = this.ajg; break; case "YAxisFavorLabellingScaleEnd": this.yAxis.lj = this.aib; break; case "YAxisAutoRangeBufferMode": this.yAxis.ky = this.ag6; break; case "YAxisIsLogarithmic": this.yAxis.lo = this.aic; break; case "YAxisLogarithmBase": this.yAxis.mm = this.ajp; break; case "YAxisMinimumValue": this.yAxis.mc = this.aji; break; case "YAxisMaximumValue": this.yAxis.mb = this.ajh; break; case "YAxisMinorInterval": this.yAxis.md = this.ajj; break; case "NegativeBrushes": case "NegativeOutlines": this.akx((d, e) => { if (d.fl) { d.r2(ArrayExtension.getModulus$1(Brush.$, this.ag1, e), ArrayExtension.getModulus$1(Brush.$, this.ag2, e)); } }); break; case "YAxisAbbreviateLargeNumbers": this.afi((d) => d.lf = this.ah9); break; case "IsCategoryHighlightingEnabled": case "IsItemHighlightingEnabled": this.ur(); break; case "AutoMarginAndAngleUpdateMode": this.vk((d) => d.wr = this.ag4); break; case "ShouldAutoExpandMarginForInitialLabels": this.vk((d) => d.xm = this.ah6); break; case CategoryChart.aj3: this.vk((d) => d.xp = this.ah7); break; case "AutoExpandMarginExtraPadding": this.vk((d) => d.yc = this.aiv); break; case "AutoExpandMarginMaximumValue": this.vk((d) => d.yd = this.aiw); break; case CategoryChart.aka: this.afe((d) => d.b1 = this.ah8, a); break; case CategoryChart.ako: this.afi((d) => d.b1 = this.aia); break; } } } CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$); CategoryChart.aj3 = "ShouldConsiderAutoRotationForInitialLabels"; CategoryChart.aka = "XAxisEnhancedIntervalPreferMoreCategoryLabels"; CategoryChart.ako = "YAxisEnhancedIntervalPreferMoreCategoryLabels"; return CategoryChart; })();