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.8 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.aki = 1000; this.akj = 1000; this.ail = null; this.aim = null; this.ah5 = 9; this.ah7 = 1; this.air = false; this.ais = true; this.ah9 = 0; this.aij = 0; this.ajf = 0; this.aji = 0; this.aje = 0; this.ajh = 0; this.ajg = 1; this.ajj = 0; this.ajp = NaN; this.ah1 = 1; this.ait = true; this.aiu = true; this.ajc = DeviceUtils.g(2); this.ajd = DeviceUtils.g(60); this.aiy = true; this.aiv = true; this.aix = false; this.ah3 = 0; this.aiz = false; this.akk = 10; this.ajr = NaN; this.ajq = NaN; this.ajs = 0; this.ahx = null; this.ahy = null; this.aiw = true; this.ajk = 3; this.ajl = NaN; this.ajm = NaN; this.ajn = NaN; this.ajo = NaN; this.aip = false; this.aiq = false; this.ajb = null; DVContainer.instance.registerIfLoaded("CategoryChartToolbarFactoryManager"); this.u2(); } vm() { super.vm(); if (this.dataChart == null) { return; } let a = this.dataChart.c9.j.e(); this.ahz = a.d; this.ah0 = a.e; if (this.ag9 == null) { this.ag9 = a.k; } if (this.ahg == null) { this.ahg = a.k; } this.ac4 = 0; this.ahh = AxisDefaults.axis_MajorBrush; this.ahk = null; this.ahd = AxisDefaults.axis_LineBrush; this.aha = null; this.acl = AxisDefaults.categoryAxis_TickLength; this.ahe = AxisDefaults.axis_TickBrush; this.acm = AxisDefaults.axis_TickStroke; this.crosshairsAnnotationEnabled = true; this.gq = true; this.crosshairsDisplayMode = 0; this.jq = Defaults.crosshairLineThickness; this.yy = Defaults.crosshairLineBrush; this.yt = Defaults.crosshairXAxisAnnotationBackground; this.yu = Defaults.crosshairXAxisAnnotationTextColor; this.ai3 = true; } vo(a, b) { super.vo(a, b); a.kf = this.akl; a.kg = this.akm; a.df = this.ain; a.dg = this.aio; } wh(a, b, c) { super.wh(a, b, c); switch (a) { case "TransitionInDuration": this.vb((d) => d.kf = this.akl); break; case "TransitionOutDuration": this.vb((d) => d.kg = this.akm); break; case "TransitionInEasingFunction": this.vb((d) => d.df = this.ain); break; case "TransitionOutEasingFunction": this.vb((d) => d.dg = this.aio); break; } } get akl() { return this.aki; } set akl(a) { let b = this.akl; if (a != b) { this.aki = a; this.wd("TransitionInDuration", b, this.akl); } } get akm() { return this.akj; } set akm(a) { let b = this.akm; if (a != b) { this.akj = a; this.wd("TransitionOutDuration", b, this.akm); } } get ain() { return this.ail; } set ain(a) { let b = this.ain; if (a != b) { this.ail = a; this.wd("TransitionInEasingFunction", b, this.ain); } } get aio() { return this.aim; } set aio(a) { let b = this.aio; if (a != b) { this.aim = a; this.wd("TransitionOutEasingFunction", b, this.aio); } } aks() { let cvd_ = this.l5(); cvd_.scaleByViewport(); return (cvd_.serialize()); } vh(a, b) { super.vh(a, b); a.ej = this.gj; a.x1 = this.ai4; a.x4 = this.ai5; a.yr = this.ajt; a.ys = this.aju; a.w6 = this.ah2; } vn(a, b) { super.vn(a, b); let c = typeCast(HorizontalAnchoredCategorySeries.$, a); if (c == null) { return; } c.aa1 = this.ah8; c.zq = this.ai3; c.za = this.aia; c.c6 = this.aik; c.trendLineBrush = ArrayExtension.getModulus$1(Brush.$, this.af, b); c.trendLineType = this.ec; c.trendLineThickness = this.km; c.xf = this.c2(a, b); if (a.fn) { a.r7(ArrayExtension.getModulus$1(Brush.$, this.ahz, b), ArrayExtension.getModulus$1(Brush.$, this.ah0, b)); } } aib() { return new CategoryXAxis(); } aif() { return new NumericYAxis(); } ux() { this.xAxis = this.aib(); this.xAxis.name = "xAxis"; let a = this.xAxis; a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.alw)); this.yAxis = this.aif(); this.yAxis.name = "yAxis"; let b = this.yAxis; b.propertyChanged = delegateCombine(b.propertyChanged, runOn(this, this.alx)); if (this.xAxis.az == null) { this.xAxis.az = new AxisLabelSettings(); } if (this.yAxis.az == null) { this.yAxis.az = new AxisLabelSettings(); } } af9(a) { super.af9(a); a.lf = this.ai7; a.lj = this.ai9; a.b1 = this.ai8; } af7(a) { super.af7(a); a.b1 = this.ai6; a.zoomMaximumCategoryRange = this.aj7; a.zoomToCategoryRange = this.aj9; a.zoomToCategoryStart = this.aka; a.zoomMaximumItemSpan = this.aj8; a.zoomToItemSpan = this.akb; } get_cb() { return 0; } get cb() { return this.get_cb(); } get ah6() { return this.ah5; } set ah6(a) { if (a != this.ah5) { let b = this.ah6; this.ah5 = a; this.wd("ChartType", enumGetBox(CategoryChartType_$type, b), enumGetBox(CategoryChartType_$type, this.ah6)); } } get ah8() { return this.ah7; } set ah8(a) { let b = this.ah8; if (a != b) { this.ah7 = a; this.wd("MarkerCollisionAvoidance", enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, b), enumGetBox(CategorySeriesMarkerCollisionAvoidance_$type, this.ah8)); } } get ai2() { return this.air; } set ai2(a) { let b = this.ai2; if (a != b) { this.air = a; this.wd("IsSplineShapePartOfRange", b, this.ai2); } } get ai3() { return this.ais; } set ai3(a) { let b = this.ai3; if (a != b) { this.ais = a; this.wd("IsTransitionInEnabled", b, this.ai3); } } get aia() { return this.ah9; } set aia(a) { let b = this.aia; if (a != b) { this.ah9 = a; this.wd("TransitionInMode", enumGetBox(CategoryTransitionInMode_$type, b), enumGetBox(CategoryTransitionInMode_$type, this.aia)); } } get aik() { return this.aij; } set aik(a) { let b = this.aik; if (a != b) { this.aij = a; this.wd("TransitionInSpeedType", enumGetBox(TransitionInSpeedType_$type, b), enumGetBox(TransitionInSpeedType_$type, this.aik)); } } get aj2() { return this.ajf; } set aj2(a) { let b = this.aj2; if (a != b) { this.ajf = a; this.wd("XAxisInterval", b, this.aj2); } } get aj5() { return this.aji; } set aj5(a) { let b = this.aj5; if (a != b) { this.aji = a; this.wd("XAxisMinorInterval", b, this.aj5); } } get aj1() { return this.aje; } set aj1(a) { let b = this.aj1; if (a != b) { this.aje = a; this.wd("XAxisGap", b, this.aj1); } } get aj4() { return this.ajh; } set aj4(a) { let b = this.aj4; if (a != b) { this.ajh = a; this.wd("XAxisMinimumGapSize", b, this.aj4); } } get aj3() { return this.ajg; } set aj3(a) { let b = this.aj3; if (a != b) { this.ajg = a; this.wd("XAxisMaximumGap", b, this.aj3); } } get aj6() { return this.ajj; } set aj6(a) { let b = this.aj6; if (a != b) { this.ajj = a; this.wd("XAxisOverlap", b, this.aj6); } } get ake() { return this.ajp; } set ake(a) { let b = this.ake; if (a != b) { this.ajp = a; this.wd("YAxisInterval", b, this.ake); } } get ah2() { return this.ah1; } set ah2(a) { let b = this.ah2; if (a != b) { this.ah1 = a; this.wd("AutoMarginAndAngleUpdateMode", enumGetBox(AutoMarginsAndAngleUpdateMode_$type, b), enumGetBox(AutoMarginsAndAngleUpdateMode_$type, this.ah2)); } } aly() { if (this.dataChart != null) { this.dataChart.aac(); } } get ai4() { return this.ait; } set ai4(a) { let b = this.ai4; if (a != b) { this.ait = a; this.wd("ShouldAutoExpandMarginForInitialLabels", b, this.ai4); } } get ai5() { return this.aiu; } set ai5(a) { let b = this.ai5; if (a != b) { this.aiu = a; this.wd(CategoryChart.ak1, b, this.ai5); } } get ajt() { return this.ajc; } set ajt(a) { let b = this.ajt; if (a != b) { this.ajc = a; this.wd("AutoExpandMarginExtraPadding", b, this.ajt); } } get aju() { return this.ajd; } set aju(a) { let b = this.aju; if (a != b) { this.ajd = a; this.wd("AutoExpandMarginMaximumValue", b, this.aju); } } get ai9() { return this.aiy; } set ai9(a) { let b = this.ai9; if (a != b) { this.aiy = a; this.wd("YAxisFavorLabellingScaleEnd", b, this.ai9); } } get ai6() { return this.aiv; } set ai6(a) { let b = this.ai6; if (a != b) { this.aiv = a; this.wd(CategoryChart.ak8, b, this.ai6); } } get ai8() { return this.aix; } set ai8(a) { let b = this.ai8; if (a != b) { this.aix = a; this.wd(CategoryChart.alm, b, this.ai8); } } get ah4() { return this.ah3; } set ah4(a) { let b = this.ah4; if (a != b) { this.ah3 = a; this.wd("YAxisAutoRangeBufferMode", enumGetBox(AxisRangeBufferMode_$type, b), enumGetBox(AxisRangeBufferMode_$type, this.ah4)); } } get aja() { return this.aiz; } set aja(a) { let b = this.aja; if (a != b) { this.aiz = a; this.wd("YAxisIsLogarithmic", b, this.aja); } } get akn() { return this.akk; } set akn(a) { let b = this.akn; if (a != b) { this.akk = a; this.wd("YAxisLogarithmBase", b, this.akn); } } get akg() { return this.ajr; } set akg(a) { let b = this.akg; if (a != b) { this.ajr = a; this.wd("YAxisMinimumValue", b, this.akg); } } get akf() { return this.ajq; } set akf(a) { let b = this.akf; if (a != b) { this.ajq = a; this.wd("YAxisMaximumValue", b, this.akf); } } get akh() { return this.ajs; } set akh(a) { let b = this.akh; if (a != b) { this.ajs = a; this.wd("YAxisMinorInterval", b, this.akh); } } get aj0() { return this.xAxis.m1; } get ajz() { return this.xAxis.m0; } ajw() { return this.aj0; } ajy() { return this.akd; } ajv() { return this.ajz; } ajx() { return this.akc; } get akd() { return this.yAxis.l4; } get akc() { return this.yAxis.l3; } get ahz() { return this.ahx; } set ahz(a) { let b = this.ahz; if (a != b) { this.ahx = a; this.wd("NegativeBrushes", b, this.ahz); } } get ah0() { return this.ahy; } set ah0(a) { let b = this.ah0; if (a != b) { this.ahy = a; this.wd("NegativeOutlines", b, this.ah0); } } get ai7() { return this.aiw; } set ai7(a) { let b = this.ai7; if (a != b) { this.aiw = a; this.wd("YAxisAbbreviateLargeNumbers", b, this.ai7); } } get aj7() { return this.ajk; } set aj7(a) { let b = this.aj7; if (a != b) { this.ajk = a; this.wd("XAxisZoomMaximumCategoryRange", b, this.aj7); } } get aj8() { return this.ajl; } set aj8(a) { let b = this.aj8; if (a != b) { this.ajl = a; this.wd("XAxisZoomMaximumItemSpan", b, this.aj8); } } get aj9() { return this.ajm; } set aj9(a) { let b = this.aj9; if (a != b) { this.ajm = a; this.wd("XAxisZoomToCategoryRange", b, this.aj9); } } get aka() { return this.ajn; } set aka(a) { let b = this.aka; if (a != b) { this.ajn = a; this.wd("XAxisZoomToCategoryStart", b, this.aka); } } get akb() { return this.ajo; } set akb(a) { let b = this.akb; if (a != b) { this.ajo = a; this.wd("XAxisZoomToItemSpan", b, this.akb); } } get ai0() { return this.aip; } set ai0(a) { let b = this.ai0; if (a != b) { this.aip = a; this.wd("IsCategoryHighlightingEnabled", b, this.ai0); } } get ai1() { return this.aiq; } set ai1(a) { let b = this.ai1; if (a != b) { this.aiq = a; this.wd("IsItemHighlightingEnabled", b, this.ai1); } } get_h2() { 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 h2() { return this.get_h2(); } h8() { if (this.ajb == null) { this.ajb = CategoryChartMockDataGenerator.a(); } return this.ajb; } c1(a) { if (a != null) { let b = super.c1(a); if (b == 2) { if (a.fm && this.g1) { return 13; } } } return super.c1(a); } c3(a) { if (a != null) { let b = super.c1(a); if (b == 2) { if (a.fm && this.g1) { return 13; } } } return super.c3(a); } get_hk() { return true; } alw(a, b) { switch (b.propertyName) { case "ActualMinimum": this.wv("XAxisActualMinimum"); break; case "ActualMaximum": this.wv("XAxisActualMaximum"); break; } } alx(a, b) { switch (b.propertyName) { case "ActualMinimumValue": this.wv("YAxisActualMinimum"); break; case "ActualMaximumValue": this.wv("YAxisActualMaximum"); break; } } xa() { super.xa(); this.xAxis.f2 = this.ade == null ? XYChart.adq(this.xAxis, this.bf.dataSeries) : this.ade; this.xAxis.itemsSource = this.dataChart != null && this.dataChart.series.count > 0 ? this.dataChart.series._inner[0].itemsSource : null; if (this.ai4) { this.v1((a) => a.aac()); } } get xAxis() { return this._xAxis; } set xAxis(a) { this._xAxis = a; } get yAxis() { return this._yAxis; } set yAxis(a) { this._yAxis = a; } aie(a, b) { switch (a) { case 2: return this.df(1); case 3: return this.df(10); case 0: return this.df(0); case 1: return this.df(2); case 6: return this.df(6); case 7: return this.df(7); case 4: return this.df(4); case 5: return this.df(5); case 8: return this.df(8); case 9: return this.aid(b); default: return this.df(1); } } aid(a) { return this.df(a); } be(a) { switch (this.ah6) { 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.aie(this.ah6, a.suggestedSeries); c.abr = a.findMatchingHint(0).path; c.xAxis = this.xAxis; c.yAxis = this.yAxis; return c; } w8(a) { if (a.suggestedSecondaryAxis == 2) { this.yAxis.lo = true; this.yAxis.mm = 10; } } xb() { this.yAxis.lo = this.aja; this.yAxis.mm = this.akn; } get_h1() { return ((() => { let $ret = new List$1(IDataSeriesAdapterRule_$type, 0); $ret.add(new SimpleCategorySeriesRule()); $ret.add(new SubCollectionsRule()); return $ret; })()); } get h1() { return this.get_h1(); } ur(a, b) { let c = typeCast(HorizontalAnchoredCategorySeries.$, a); if (c != null) { c.aa1 = this.ah8; c.xf = this.c2(a, b); } } alu(a) { this.alv((b, c) => a(b)); } alv(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); } } aao() { return this.xAxis; } aap() { return this.yAxis; } aih() { return this.df(30); } aii() { return this.df(31); } hy(a, b) { let c = super.hy(a, b); if (c != null) { let d = new List$1(Series.$, 0); if (this.aip) { d.add(this.aih()); } if (this.aiq) { d.add(this.aii()); } 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; } } xf(a, b, c) { super.xf(a, b, c); if (this.bf.dataSeries.count > 0) { if (stringIsNullOrEmpty(this.nz)) { this.ce.setXMemberPath(a, c.getMemberPathFor(16)); } if (stringIsNullOrEmpty(this.n1)) { this.ce.setYMemberPath(a, c.getMemberPathFor(0)); } if (stringIsNullOrEmpty(this.nm)) { this.ce.setLabelMemberPath(a, c.getMemberPathFor(0)); } if (stringIsNullOrEmpty(this.ni)) { this.ce.setContentMemberPath(a, c.getMemberPathFor(0)); } } } g4() { if (this.crosshairsDisplayMode == 4 || this.crosshairsDisplayMode == 3) { return true; } else if (this.crosshairsDisplayMode == 0) { if (this.ah6 == 2 || this.ah6 == 8) { return false; } else if (this.ah6 == 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_hb() { return DVContainer.instance.checkLoaded("CategoryChartToolbarFactoryManager"); } wd(a, b, c) { super.wd(a, b, c); switch (a) { case "ChartType": this.u8(); break; case "MarkerCollisionAvoidance": this.alu((d) => d.aa1 = this.ah8); break; case "IsTransitionInEnabled": this.alu((d) => d.zq = this.ai3); break; case "IsSplineShapePartOfRange": this.alu((d) => { if (d.f1) { d.r8(this.ai2); } }); break; case "TransitionInMode": this.alu((d) => d.za = this.aia); break; case "TransitionInSpeedType": this.alu((d) => d.c6 = this.aik); break; case "XAxisInterval": this.xAxis.mw = this.aj2; break; case "XAxisMinorInterval": this.xAxis.mx = this.aj5; break; case "XAxisGap": this.xAxis.k5 = this.aj1; break; case "XAxisOverlap": this.xAxis.le = this.aj6; break; case "XAxisMinimumGapSize": this.xAxis.ld = this.aj4; break; case "XAxisMaximumGap": this.xAxis.lc = this.aj3; break; case "XAxisZoomMaximumCategoryRange": this.xAxis.zoomMaximumCategoryRange = this.aj7; break; case "XAxisZoomMaximumItemSpan": this.xAxis.zoomMaximumItemSpan = this.aj8; break; case "XAxisZoomToCategoryRange": this.xAxis.zoomToCategoryRange = this.aj9; break; case "XAxisZoomToCategoryStart": this.xAxis.zoomToCategoryStart = this.aka; break; case "XAxisZoomToItemSpan": this.xAxis.zoomToItemSpan = this.akb; break; case "YAxisInterval": this.yAxis.l8 = this.ake; break; case "YAxisFavorLabellingScaleEnd": this.yAxis.lj = this.ai9; break; case "YAxisAutoRangeBufferMode": this.yAxis.ky = this.ah4; break; case "YAxisIsLogarithmic": this.yAxis.lo = this.aja; break; case "YAxisLogarithmBase": this.yAxis.mm = this.akn; break; case "YAxisMinimumValue": this.yAxis.mc = this.akg; break; case "YAxisMaximumValue": this.yAxis.mb = this.akf; break; case "YAxisMinorInterval": this.yAxis.md = this.akh; break; case "NegativeBrushes": case "NegativeOutlines": this.alv((d, e) => { if (d.fn) { d.r7(ArrayExtension.getModulus$1(Brush.$, this.ahz, e), ArrayExtension.getModulus$1(Brush.$, this.ah0, e)); } }); break; case "YAxisAbbreviateLargeNumbers": this.agg((d) => d.lf = this.ai7); break; case "IsCategoryHighlightingEnabled": case "IsItemHighlightingEnabled": this.u8(); break; case "AutoMarginAndAngleUpdateMode": this.v1((d) => d.w6 = this.ah2); break; case "ShouldAutoExpandMarginForInitialLabels": this.v1((d) => d.x1 = this.ai4); break; case CategoryChart.ak1: this.v1((d) => d.x4 = this.ai5); break; case "AutoExpandMarginExtraPadding": this.v1((d) => d.yr = this.ajt); break; case "AutoExpandMarginMaximumValue": this.v1((d) => d.ys = this.aju); break; case CategoryChart.ak8: this.agc((d) => d.b1 = this.ai6, a); break; case CategoryChart.alm: this.agg((d) => d.b1 = this.ai8); break; } } } CategoryChart.$t = markType(CategoryChart, 'CategoryChart', XYChart.$); CategoryChart.ak1 = "ShouldConsiderAutoRotationForInitialLabels"; CategoryChart.ak8 = "XAxisEnhancedIntervalPreferMoreCategoryLabels"; CategoryChart.alm = "YAxisEnhancedIntervalPreferMoreCategoryLabels"; return CategoryChart; })();