UNPKG

igniteui-react-charts

Version:

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

1,378 lines (1,377 loc) 51.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 { FinancialSeries } from "./FinancialSeries"; import { ITrendLineSeries_$type } from "./ITrendLineSeries"; import { TrendLineType_$type } from "igniteui-react-core"; import { DependencyProperty } from "igniteui-react-core"; import { Brush } from "igniteui-react-core"; import { PenLineCap_$type } from "igniteui-react-core"; import { DoubleCollection } from "igniteui-react-core"; import { PriceDisplayType_$type } from "./PriceDisplayType"; import { CategoryCollisionMode_$type } from "./CategoryCollisionMode"; import { Series } from "./Series"; import { Defaults } from "./Defaults"; import { enumGetBox, EnumUtil, Number_$type, typeCast, fromEnum, Point_$type, runOn, markType, markDep } from "igniteui-react-core"; import { CategoryFrame } from "./CategoryFrame"; import { ISortingAxis_$type } from "./ISortingAxis"; import { FinancialSeriesView } from "./FinancialSeriesView"; import { Rect } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { RectUtil } from "igniteui-react-core"; import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory"; import { AxisRange } from "./AxisRange"; import { ScalerParams } from "./ScalerParams"; import { TrendResolutionParams } from "./TrendResolutionParams"; import { Pool$1 } from "igniteui-react-core"; import { Path } from "igniteui-react-core"; import { Thickness } from "igniteui-react-core"; import { PathGeometry } from "igniteui-react-core"; import { PathFigure } from "igniteui-react-core"; import { LineSegment } from "igniteui-react-core"; import { GeometryGroup } from "igniteui-react-core"; import { LineGeometry } from "igniteui-react-core"; import { RectangleGeometry } from "igniteui-react-core"; import { DataLegendSeriesValueInfo } from "igniteui-react-core"; import { DataLegendSeriesContext } from "igniteui-react-core"; import { ChartSelection } from "./ChartSelection"; import { PropertyMetadata } from "igniteui-react-core"; import { truncate, isNaN_, isInfinity } from "igniteui-react-core"; import { boxArray$1 } from "igniteui-react-core"; import { round10N } from "igniteui-react-core"; import { FinancialPriceBucketCalculator } from "./FinancialPriceBucketCalculator"; import { Extensions } from "igniteui-react-core"; /** * @hidden */ export let FinancialPriceSeries = /*@__PURE__*/ (() => { class FinancialPriceSeries extends FinancialSeries { bk() { return new FinancialPriceSeries(); } get_fa() { return true; } jk() { if (!isNaN_(this.jj)) { return super.jk(); } return Defaults.k; } ct() { return new FinancialPriceSeriesView(this); } q1(a) { super.q1(a); this.aa4 = a; } constructor() { super(); this.aa6 = true; this.aa7 = 0; this.aa8 = 0; this.ab = FinancialPriceSeries.$; this.xc = new CategoryFrame(5); this.xe = new CategoryFrame(5); this.xa = new CategoryFrame(5); } get acn() { return this.c(FinancialPriceSeries.ab4); } set acn(a) { this.h(FinancialPriceSeries.ab4, a); } pb(a, b, c, d) { super.pb(a, b, c, d); if (this.w8 != null && typeCast(ISortingAxis_$type, this.w8) !== null) { this.w8.i$i(); } this.aa4.b4.e(this.id); if (this.aa4.ce) { this.aa4.cc.g$i(a, b, c, d); } if (this.xr != null) { this.xr.c1(); } this.rs(true); if (a == 0 || a == 2 || a == 3 || a == 4) { this.aa6 = true; } else if (a == 1) { for (let e = b; e < b + c; e++) { let f = 0; f += this.x2.item(e); f += this.x3.item(e); f += this.x1.item(e); this.aa7 += f / 3; } this.aa8 = this.aa7 / this.x2.count; } } b3() { if (this.b4 == 0) { return 1; } else { return super.b3(); } } wp(a) { if (this.xa == null || this.xa.h.count == 0) { return Rect.empty; } let b = this.v9(a); let c = this.cw.b2; let d = this.cw.b1; let e = this.getEffectiveViewport1(this.cw); let f = this.an(this.w8, this.xa.h, this.y5(this.cw), this.y7(this.cw), a, true); let g = f[0]; let h = f[1]; let i = Math.abs(b.x - g[0]); let j = Math.abs(b.x - h[0]); let k = this.aa9(this.xp, e); k = Math.max(k, 3); let l = (k - 1) / 2; if (i < j) { let m = g[0] - l; let n = g[0]; let o = g[0] + l; let p = g[1]; let q = g[2]; let r = g[3]; let s = g[4]; let t = Math.min(Math.min(Math.min(p, q), r), s); let u = Math.max(Math.max(Math.max(p, q), r), s); return new Rect(0, m, t, Math.abs(o - m), u - t); } else { let v = h[0] - l; let w = h[0]; let x = h[0] + l; let y = h[1]; let z = h[2]; let aa = h[3]; let ab = h[4]; let ac = Math.min(Math.min(Math.min(y, z), aa), ab); let ad = Math.max(Math.max(Math.max(y, z), aa), ab); return new Rect(0, v, ac, Math.abs(x - v), ad - ac); } } aa2(a, b) { let c = a[0] - b; let d = a[0]; let e = a[0] + b; let f = a[1]; let g = a[2]; let h = a[3]; let i = a[4]; let j = Math.min(Math.min(Math.min(f, g), h), i); let k = Math.max(Math.max(Math.max(f, g), h), i); let l = Math.min(g, h); let m = Math.max(g, h); let n = Math.min(f, i); let o = Math.max(f, i); if (this.aa5 == 1) { let p = new Array(3); let q = new Rect(0, c, f, b, 0); let r = new Rect(0, d, i, b, 0); let s = new Rect(0, d, l, 0, m - l); p[0] = q; p[1] = r; p[2] = s; return p; } else { let t = new Array(2); let u = new Rect(0, d, l, 0, m - l); let v = new Rect(0, c, n, b * 2, o - n); t[0] = u; t[1] = v; return t; } } ao(a) { let b = new List$1(Rect.$, 0); let c = this.v9(a); let d = this.cw.b2; let e = this.cw.b1; let f = this.getEffectiveViewport1(this.cw); let g = this.an(this.w8, this.xa.h, this.y5(this.cw), this.y7(this.cw), a, true); let h = g[0]; let i = g[1]; let j = Math.abs(c.x - h[0]); let k = Math.abs(c.x - i[0]); let l = this.aa9(this.xp, f); l = Math.max(l, 3); let m = (l - 1) / 2; if (j < k) { return this.aa2(h, m); } else { return this.aa2(i, m); } } gw(a, b) { if (this.gz(a, b)) { return true; } return false; } gz(a, b) { let c = this.wq(a); if (c.isEmpty) { return false; } let d = RectUtil.r(c, (this.ie / 2) + this.iu(b)); if (d.containsPoint(a)) { let e = this.ap(a); if (e != null) { for (let f = 0; f < e.length; f++) { let g = e[f]; let h = RectUtil.r(g, (this.ie / 2) + this.iu(b)); if (h.containsPoint(a)) { return true; } } } } return false; } ra(a, b, c, d) { switch (b) { case FinancialPriceSeries.$$p[4]: case FinancialPriceSeries.$$p[5]: case FinancialPriceSeries.$$p[6]: case FinancialPriceSeries.$$p[7]: case FinancialPriceSeries.$$p[1]: case FinancialPriceSeries.$$p[2]: case FinancialPriceSeries.$$p[9]: case FinancialPriceSeries.$$p[10]: this.qf(); break; case FinancialSeries.$$p[14]: this.aa4.ck(); if (this.dc != null) { this.dc.n3(); } break; case "TrendLineType": let e = EnumUtil.getEnumValue(TrendLineType_$type, d); if (e != 0) { this.aa4.cc = CategoryTrendLineManagerFactory.a(this.aa4.cc, this.w8, this.sx, this, this.ds); } break; } super.ra(a, b, c, d); if (this.aa4.ce && this.aa4.cc != null && this.aa4.cc.g$e(a, b, c, d)) { this.rs(false); this.ql(); } switch (b) { case FinancialPriceSeries.$$p[3]: if (this.sx != null) { this.ab3(); this.sk(); this.xa.z(); this.aag(this.xa, this.aa4); } this.ql(); break; case "ActualHighlightingMode": case "ActualSelectionMode": case "ActualFocusMode": this.rs(true); break; case "TrendLineBrush": this.rg(b); break; case "TrendLineType": this.ql(); break; case FinancialSeries.$$p[10]: case FinancialPriceSeries.$$p[8]: this.q3(); break; } } ab3() { this.aa4.co(); if (this.cv != null) { this.cv.co(); } } ay(a) { if (a != null && a == this.xr && this.x3 != null && !isNaN_(this.x3.minimum) && this.x2 != null && !isNaN_(this.x2.maximum)) { return new AxisRange(this.x3.minimum, this.x2.maximum); } return null; } az(a) { if (a.isEmpty && this.dc != null) { a = this.dc.v5; } if (this.x3 == null || this.x2 == null) { return null; } let b = this.wl(this.cw); let c = new ScalerParams(0, a, this.dc.wn, this.w8.ch, this.getEffectiveViewport()); let d = (this.w8.eo(b.left, c)); let e = (this.w8.eo(b.right, c)); if (this.w8.ch) { let f = d; d = e; e = f; } let g = null; if (this.w8.cn) { g = this.w8; d = g.i$f(d); e = g.i$f(e); } else { d = Math.floor(d); e = Math.ceil(e); } d = Math.max(0, Math.min(this.x3.count - 1, d)); e = Math.max(0, Math.min(this.x3.count - 1, e)); let h = 1.7976931348623157E+308; let i = -1.7976931348623157E+308; for (let j = truncate(d); j <= truncate(e); j++) { let k = j; if (g != null) { k = g.i$b._inner[j]; } let l = this.x3.item(k); if (this.x3.mayContainUnknowns) { if (isInfinity(l) || isNaN_(l)) { continue; } } let m = this.x2.item(k); if (this.x2.mayContainUnknowns) { if (isInfinity(m) || isNaN_(m)) { continue; } } h = Math.min(h, l); i = Math.max(i, m); } let n = new AxisRange(h, i); n = this.ax(n, this.xr, a); return n; } iy() { return Series.iz(this.x4, typeCast(ISortingAxis_$type, this.w8)); } gd(a) { let b = this.dp != null ? this.dp.indexOf(a) : -1; let c = this.cw.b2; c = c.copy(); let d = this.cw.b1; let e = new Rect(0, 0, 0, 1, 1); let f = this.wn(this.cw); if (b >= 0 && Rect.l_op_Inequality(c, null) && Rect.l_op_Inequality(d, null)) { if (this.w8 != null) { let g = new ScalerParams(0, e, e, this.w8.ch, f); let h = this.w8.el(b, g); if (h < c.left + 0.1 * c.width) { h = h + 0.4 * c.width; } if (h > c.right - 0.1 * c.width) { h = h - 0.4 * c.width; } c.x = h - 0.5 * c.width; } if (this.xr != null && this.x3 != null && this.x2 != null && b < this.x3.count && b < this.x2.count) { let i = new ScalerParams(0, e, e, this.xr.ch, f); i.b = this.iy(); let j = this.xr.el(this.x3.item(b), i); let k = this.xr.el(this.x2.item(b), i); if (!isNaN_(j) && !isNaN_(k)) { let l = Math.abs(j - k); if (c.height < l) { c.height = l; c.y = Math.min(j, k); } else { if (j < c.top + 0.1 * c.height) { j = j + 0.4 * c.height; } if (j > c.bottom - 0.1 * c.height) { j = j - 0.4 * c.height; } c.y = j - 0.5 * c.height; } } } this.c4.au(this.dc, c, true); } return b >= 0; } he(a, b, c) { let d = super.he(a, b, c); if (this.x4 == null || this.x1 == null || this.x2 == null || this.x3 == null) { d = false; } return d; } aae(a, b) { super.aae(a, b); let c = b.b2; let d = b.b1; let e = this.getEffectiveViewport1(b); let f = this.w8; let g = this.xr; let h = new ScalerParams(0, c, d, f.ch, e); let i = ((() => { let $ret = new ScalerParams(0, c, d, g.ch, e); $ret.b = this.iy(); return $ret; })()); let j = this.w8.ag(); let k = j[0]; let l = j[1]; a.h.clear(); if (a.o != null) { a.o.clear(); } a.p.clear(); a.s.clear(); let m = 0; let n = typeCast(ISortingAxis_$type, this.w8); if (n != null && (n.i$b == null || n.i$b.count != this.dp.count)) { return; } m = this.yz(c, d, e); let o = typeCast(FinancialPriceSeriesView.$, b); let p = this.id; let q = b.b4.b; if (this.trendLineType != 0) { let r = new Array(this.dp.count); let s = 0; for (let t of fromEnum(this.yq)) { r[s] = t; s++; } if (this.aa4.ce) { this.aa4.cc.prepareLineCore(a.s, this.trendLineType, boxArray$1(r), this.trendLinePeriod, (u) => this.w8.el(u, h), (u) => this.xr.el(u, i), ((() => { let $ret = new TrendResolutionParams(); $ret.e = b.b4.b; $ret.f = b.b4.c; $ret.g = b.b4.d; $ret.a = m; $ret.d = p; $ret.i = d; $ret.h = e; $ret.c = k; $ret.b = l; return $ret; })())); } } if (b.w.count > 0) { let u = new Array(this.dp.count); let v = 0; for (let w of fromEnum(this.yq)) { u[v] = w; v++; } a.f.clear(); for (let x = 0; x < b.w.count; x++) { a.f.add(new List$1(Point_$type, 0)); let y = b.w._inner[x]; y.prepareLineCore(a.f._inner[x], y.g$b, boxArray$1(u), y.g$f, (z) => this.w8.el(z, h), (z) => this.xr.el(z, i), ((() => { let $ret = new TrendResolutionParams(); $ret.e = b.b4.b; $ret.f = b.b4.c; $ret.g = b.b4.d; $ret.a = m; $ret.d = p; $ret.i = d; $ret.h = e; $ret.c = k; $ret.b = l; return $ret; })())); } } let z = this.w8.eo(2, h) - this.w8.eo(1, h); for (let aa = b.b4.c; aa <= b.b4.d; ++aa) { let ab; let ac = aa * q; if (n == null) { ab = b.b4.getBucket(aa); } else { let ad = n.i$b._inner[aa]; ac = ad; let ae = n.i$d(ad); let af = this.x4.item(ad); let ag = this.x2.item(ad); let ah = this.x3.item(ad); let ai = this.x1.item(ad); let aj = af; let ak = ag; let al = ah; let am = ai; let an = ae; while (aa < b.b4.d) { ad = n.i$b._inner[aa + 1]; an = n.i$d(ad); if (an - ae > z * p) { break; } ac = ad; aa++; ak = Math.max(ak, this.x2.item(ad)); al = Math.min(al, this.x3.item(ad)); am = this.x1.item(ad); } let ao = NaN; if (!isNaN_(ae)) { ao = this.w8.el(ae, h); } ab = [ao, aj, ak, al, am]; } if (!isNaN_(ab[0])) { if (n != null) { ab[0] = ab[0] + m; } else { ab[0] = f.el(ab[0], h) + m; } ab[1] = g.el(ab[1], i); ab[2] = g.el(ab[2], i); ab[3] = g.el(ab[3], i); ab[4] = g.el(ab[4], i); if (n != null) { if (a.o == null) { a.o = new List$1(Number_$type, 0); } a.o.add(ac); } a.h.add(ab); } } return; } o5(a, b) { super.o5(a, b); let c = typeCast(FinancialPriceSeriesView.$, b); c.ci(); if (a) { c.cd.count = 0; } if (c.ce && c.cc != null) { c.cc.g$h(); } } ss(a, b) { super.ss(a, b); if (this.dc != null) { this.dc.n3(); } } wx(a, b) { if (this.w8 != null && this.w8.categoryMode == 0) { let c = this.getEffectiveViewport1(this.cw); let d = this.aa9(this.xp, c) / 2; return new Thickness(1, d, 0, d, 0); } return super.wx(a, b); } get_ee() { return true; } aag(a, b) { super.aag(a, b); if (this.w8 == null || this.xr == null) { return; } let c = false; if (b.b7(a)) { c = true; b.b9(a); } this.xh.a2(this, this.yg(), runOn(this, this.w0), this.y5(b), this.y7(b)); let d = false; let e = this.xh.b; if (e != null) { d = true; } let f = typeCast(FinancialPriceSeriesView.$, b); f.ch(); f.cf = false; if (f.ce) { f.cc.g$h(); } if (this.trendLineType != 0) { f.cc.g$k(a.s); } if (b.w.count > 0) { for (let g = 0; g < b.w.count; g++) { let h = b.w._inner[g]; h.g$k(a.f._inner[g]); } } if (d) { this.ab1(a, b, c); } else { f.cd.count = 0; this.ab0(a, b); } } iw() { let a = this.getEffectiveViewport1(this.cw); return this.aa9(this.xp, a); } ab1(a, b, c) { let d = this.aa5; let e = this.getEffectiveViewport1(b); let f = this.aa9(b, e); let g = (f - 1) / 2; let h = typeCast(ISortingAxis_$type, this.w8) !== null; let i = typeCast(FinancialPriceSeriesView.$, b); i.cf = true; let j = a.h; let k = 0; let l = this.dp.count; let m = this.w8; let n = new ScalerParams(0, b.b2, b.b1, m.ch, e); let o = this.vb; let p = this.aay; if (p == null) { p = o; } let q = this.vf; let r = this.aco; if (r == null) { r = q; } for (let s = 0; s < j.count; ++s) { let t = j._inner[s][0] - g; let u = j._inner[s][0]; let v = j._inner[s][0] + g; let w = j._inner[s][1]; let x = j._inner[s][2]; let y = j._inner[s][3]; let z = j._inner[s][4]; if (isNaN_(w) || isNaN_(x) || isNaN_(y) || isNaN_(z)) { continue; } let aa = i.cd.item(k); k++; let ab = w < z; let ac = new PathGeometry(); if (c) { switch (d) { case 0: if (ab) { let ad = w; w = z; z = ad; } let ae = new PathFigure(); ae._startPoint = { $type: Point_$type, x: u, y: y }; ae._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: u, y: w }; return $ret; })())); let af = new PathFigure(); af._startPoint = { $type: Point_$type, x: t, y: z }; af._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: v, y: z }; return $ret; })())); af._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: v, y: w }; return $ret; })())); af._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: t, y: w }; return $ret; })())); af._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: t, y: z }; return $ret; })())); let ag = new PathFigure(); ag._startPoint = { $type: Point_$type, x: u, y: z }; ag._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: u, y: x }; return $ret; })())); ac.c.add(ae); ac.c.add(af); ac.c.add(ag); break; case 1: let ah = new PathFigure(); ah._startPoint = { $type: Point_$type, x: t, y: w }; ah._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: u, y: w }; return $ret; })())); let ai = new PathFigure(); ai._startPoint = { $type: Point_$type, x: u, y: y }; ai._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: u, y: x }; return $ret; })())); let aj = new PathFigure(); aj._startPoint = { $type: Point_$type, x: u, y: z }; aj._segments.add(((() => { let $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: v, y: z }; return $ret; })())); ac.c.add(ah); ac.c.add(ai); ac.c.add(aj); break; } } if (ab) { this.xh.ak = p; this.xh.ag = p; this.xh.ah = r; this.xh.al = r; this.xh.f = true; } else { this.xh.ak = o; this.xh.ag = o; this.xh.ah = q; this.xh.al = q; this.xh.f = false; } let ak = this.xh.aw(l, s)[0]; if (h && a.o != null && s >= 0 && s < a.o.count) { ak = truncate(Math.round(a.o._inner[s])); } this.aad(j, s, l, m, n, b.r, ak); if (d == 1) { this.xh.ad(aa, true, false, false, false); } else { this.xh.ad(aa, false, false, false, false); } if (c) { aa.an = ac; } } i.cd.count = k; i.cj(); } aa9(a, b) { let c = this.w8.k8(a.b2, a.b1, b); c = Math.max(c, this.id * 0.9); c = Math.max(c, 3); return c; } ab0(a, b) { let c = this.aa5; let d = this.getEffectiveViewport1(b); let e = this.aa9(b, d); let f = (e - 1) / 2; let g = typeCast(FinancialPriceSeriesView.$, b); let h = g.cr(); let i = g.cq(); let j = a.h; for (let k = 0; k < j.count; ++k) { let l = j._inner[k][0] - f; let m = j._inner[k][0]; let n = j._inner[k][0] + f; let o = j._inner[k][1]; let p = j._inner[k][2]; let q = j._inner[k][3]; let r = j._inner[k][4]; if (isNaN_(o) || isNaN_(p) || isNaN_(q) || isNaN_(r)) { continue; } let s = o < r; let t = s ? i : h; switch (c) { case 0: if (s) { let u = o; o = r; r = u; } t.d.add(((() => { let $ret = new LineGeometry(); $ret.d = { $type: Point_$type, x: m, y: q }; $ret.c = { $type: Point_$type, x: m, y: o }; return $ret; })())); t.d.add(((() => { let $ret = new RectangleGeometry(); $ret.e = new Rect(0, l, r, n - l, o - r); return $ret; })())); t.d.add(((() => { let $ret = new LineGeometry(); $ret.d = { $type: Point_$type, x: m, y: r }; $ret.c = { $type: Point_$type, x: m, y: p }; return $ret; })())); break; case 1: t.d.add(((() => { let $ret = new LineGeometry(); $ret.d = { $type: Point_$type, x: l, y: o }; $ret.c = { $type: Point_$type, x: m, y: o }; return $ret; })())); t.d.add(((() => { let $ret = new LineGeometry(); $ret.d = { $type: Point_$type, x: m, y: q }; $ret.c = { $type: Point_$type, x: m, y: p }; return $ret; })())); t.d.add(((() => { let $ret = new LineGeometry(); $ret.d = { $type: Point_$type, x: m, y: r }; $ret.c = { $type: Point_$type, x: n, y: r }; return $ret; })())); break; } } } kx(a, b) { if (this.aa4.ce && a == this.aa4.cc.g$n) { return null; } return super.kx(a, b); } sj() { super.sj(); if (this.index < 0) { return; } this.aa4.cp(); } pz(a) { super.pz(a); if (this.aa4.ce) { this.bc.exportTrendlineData(this, a, this.aa4.cc.g$n); } } vz() { return this.aco; } r5(a, b) { super.r5(a, b); this.aco = b; } bf(a) { if (this.aa5 == 0) { return 3; } else if (this.aa5 == 1) { if (this.be == 1) { return 3; } return 2; } return a; } getDataLegendSeriesContextAt(a, b) { let c = { $type: Point_$type, x: a, y: b }; let d = this.i3(c, false, false); let e = this.i1(c, false, false); let f = new DataLegendSeriesValueInfo(); f.a = 4; f.l = this.y0(c, false, false); f.q = "Close"; f.r = this.zc != null ? this.zc : "Close"; f.s = this.abd != null ? this.abd : "C:"; f.t = this.abf != null ? this.abf : ""; let g = new DataLegendSeriesValueInfo(); g.l = this.y1(c, false, false); g.a = 3; g.q = "Open"; g.r = this.zy != null ? this.zy : "Open"; g.s = this.abr != null ? this.abr : "O:"; g.t = this.abt != null ? this.abt : ""; g.k = true; let h = new DataLegendSeriesValueInfo(); h.l = (f.l - g.l) / g.l * 100; h.l = round10N(h.l, 1); h.a = 9; h.q = "Change"; h.r = "Change"; h.s = ""; h.v = ""; h.x = "+"; h.w = "%"; h.y = "%"; h.t = null; h.c = false; h.k = true; h.e = false; h.f = true; h.h = false; h.g = false; h.d = false; h.n = 1; h.m = 1; g.z = h.l >= 0 ? this.vb : this.aay; f.z = h.l >= 0 ? this.vb : this.aay; h.z = h.l >= 0 ? this.vb : this.aay; let i = new DataLegendSeriesValueInfo(); i.l = e > d ? d : e; i.a = 1; i.q = "Low"; i.r = this.zu != null ? this.zu : "Low"; i.s = this.abm != null ? this.abm : "L:"; i.t = this.abo != null ? this.abo : ""; i.k = true; let j = new DataLegendSeriesValueInfo(); j.l = e > d ? e : d; j.a = 2; j.q = "High"; j.r = this.zp != null ? this.zp : "High"; j.s = this.abi != null ? this.abi : "H:"; j.t = this.abk != null ? this.abk : ""; j.k = true; let k = new DataLegendSeriesValueInfo(); k.l = (j.l + i.l + f.l) / 3; k.l = round10N(k.l, 2); k.a = 5; k.q = "TypicalPrice"; k.r = "TypicalPrice"; k.s = "TP:"; k.t = ""; k.k = true; let l = new DataLegendSeriesValueInfo(); l.l = this.y2(c, false, false); l.a = 8; l.q = "Volume"; l.r = this.z2 != null ? this.z2 : "Volume"; l.s = "VOL:"; l.t = ""; l.k = true; l.n = 0; l.m = 0; l.e = false; l.f = false; l.h = false; let m = new List$1(DataLegendSeriesValueInfo.$, 0); m.add(g); m.add(j); m.add(i); m.add(f); m.add(k); m.add(h); m.add(l); let n = new DataLegendSeriesContext(); n.h = this.mc(); n.e = m; return n; } ab2() { if (this.aa6) { this.aa7 = 0; for (let a = 0; a < this.x2.count; a++) { let b = 0; b += this.x2.item(a); b += this.x3.item(a); b += this.x1.item(a); this.aa7 += b / 3; } this.aa8 = this.aa7 / this.x2.count; this.aa6 = false; } } aq(a) { let b = NaN; switch (a) { case 2: b = this.x2.maximum; break; case 1: b = this.x3.minimum; break; case 3: if (this.aa6) { this.ab2(); } b = this.aa8; break; } let c = this.xr; if (c.cp) { return [NaN, b]; } else { return [b, NaN]; } } wh(a) { let b = NaN; switch (a) { case 2: b = this.x2.maximum; break; case 1: b = this.x3.minimum; break; case 3: if (this.aa6) { this.ab2(); } b = this.aa8; break; } if (isNaN_(b)) { return { $type: Point_$type, x: NaN, y: NaN }; } let c = this.xr; let d = this.getEffectiveViewport1(this.cw); let e = new ScalerParams(0, this.cw.b2, this.cw.b1, c.ch, d); if (c.cp) { e.b = this.iy(); } e.c = d; if (c.cp) { return { $type: Point_$type, x: NaN, y: c.el(b, e) }; } else { return { $type: Point_$type, x: c.el(b, e), y: NaN }; } } wi(a) { let b = this.xr; let c = this.getEffectiveViewport1(this.cw); let d = new ScalerParams(0, this.cw.b2, this.cw.b1, b.ch, c); if (b.cp) { d.b = this.iy(); } d.c = c; if (b.cp) { return { $type: Point_$type, x: NaN, y: b.el(a[1], d) }; } else { return { $type: Point_$type, x: b.el(a[0], d), y: NaN }; } } ak(a, b) { let c = new List$1(ChartSelection.$, 0); this.p4(a, c, b); return c.toArray(); } p4(a, b, c) { let d = this.dc.wk(this.dc.wa(a)); let e = this.xr; let f = this.w8; let g = this.dc.wd(this.wu, this.getEffectiveViewport(), d); let h, i; let j = this.abx(d, f, true, g, h, i); h = j.p4; i = j.p5; if (this.aa3 == 0) { this.abz(b, h, i, c); } else { let k, l; let m = this.abw(d, e, true, g, k, l); k = m.p4; l = m.p5; this.aby(1, b, h, i, k, l, c); } } abx(a, b, c, d, e, f) { let g = new ScalerParams(0, a, this.dc.wn, this.w8.ch, this.getEffectiveViewport()); let h = (this.w8.eo(d.left, g)); let i = (this.w8.eo(d.right, g)); if (this.w8.ch) { let j = h; h = i; i = j; } if (this.w8.cn) { let k = this.w8; h = k.i$f(h); i = k.i$f(i); } else { h = Math.floor(h); i = Math.ceil(i); } e = truncate(Math.max(0, Math.min(this.x3.count - 1, h))); f = truncate(Math.max(0, Math.min(this.x3.count - 1, i))); return { p4: e, p5: f }; } abw(a, b, c, d, e, f) { let g = new ScalerParams(0, a, this.dc.wn, b.ch, this.getEffectiveViewport()); let h = c ? (b.ch ? d.top : d.bottom) : (b.ch ? d.left : d.right); let i = c ? (b.ch ? d.bottom : d.top) : (b.ch ? d.right : d.left); e = b.eo(h, g); f = b.eo(i, g); return { p4: e, p5: f }; } abv(a, b, c) { if (c == 2 || c == 1) { a.add(((() => { let $ret = new ChartSelection(); $ret.item = this.dp.item(b); return $ret; })())); } else { a.add(((() => { let $ret = new ChartSelection(); $ret.item = this.dp.item(b); $ret.series = this; return $ret; })())); } } abz(a, b, c, d) { if (b == -1 || c == -1) { return; } if (d == 7 || d == 6) { a.add(((() => { let $ret = new ChartSelection(); $ret.series = this; return $ret; })())); return; } for (let e = b; e <= c; e++) { this.abv(a, e, d); } } aby(a, b, c, d, e, f, g) { if (c == -1 || d == -1) { return; } for (let h = c; h <= d; h++) { let i = Math.min(this.x4.item(h), this.x3.item(h)); let j = Math.max(this.x1.item(h), this.x2.item(h)); let k = Math.min(i, j); let l = Math.max(i, j); if (k < f && e < l) { if (g == 7 || g == 6) { b.add(((() => { let $ret = new ChartSelection(); $ret.series = this; return $ret; })())); return; } this.abv(b, h, g); } } } bd() { return CategoryTrendLineManagerFactory.a(null, this.w8, null, null, this.ds); } } FinancialPriceSeries.$t = /*@__PURE__*/ markType(FinancialPriceSeries, 'FinancialPriceSeries', FinancialSeries.$, [ITrendLineSeries_$type]); FinancialPriceSeries.ab4 = /*@__PURE__*/ DependencyProperty.i("ActualTrendLineBrush", Brush.$, FinancialPriceSeries.$, /*@__PURE__*/ new PropertyMetadata(2, null, (a, b) => a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue))); FinancialPriceSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, FinancialPriceSeries, 'raisePropertyChanged', ['CategoryCollisionMode:aa3:ab5', [CategoryCollisionMode_$type, /*@__PURE__*/ enumGetBox(CategoryCollisionMode_$type, 0)], 'CloseMemberAsLegendLabel:abd:ab6', [2, null], 'CloseMemberAsLegendUnit:abf:ab7', [2, null], 'DisplayType:aa5:ab8', [PriceDisplayType_$type, /*@__PURE__*/ enumGetBox(PriceDisplayType_$type, 0)], 'HighMemberAsLegendLabel:abi:ab9', [2, null], 'HighMemberAsLegendUnit:abk:aca', [2, null], 'LowMemberAsLegendLabel:abm:acb', [2, null], 'LowMemberAsLegendUnit:abo:acc', [2, null], 'NegativeOutline:aco:acd', [Brush.$, null], 'OpenMemberAsLegendLabel:abr:ace', [2, null], 'OpenMemberAsLegendUnit:abt:acf', [2, null], 'TrendLineType::acl', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness::ack', [1, 1.5], 'TrendLinePeriod::acj', [1, 7], 'TrendLineBrush::acg', [Brush.$, null], 'TrendLineZIndex:abb:acm', [1, 1001], 'TrendLineDashArray:acp:ach', [DoubleCollection.$], 'TrendLineDashCap:acq:aci', [PenLineCap_$type, /*@__PURE__*/ enumGetBox(PenLineCap_$type, 0)]]); return FinancialPriceSeries; })(); /** * @hidden */ export let FinancialPriceSeriesView = /*@__PURE__*/ (() => { class FinancialPriceSeriesView extends FinancialSeriesView { constructor(a) { super(a); this.ca = null; this.cd = null; this.cg = null; this.cu = ((() => { let $ret = new Path(); $ret.an = new GeometryGroup(); return $ret; })()); this.ct = ((() => { let $ret = new Path(); $ret.an = new GeometryGroup(); return $ret; })()); this.cb = null; this.cs = new Path(); this.cf = false; this.ca = a; this.cg = new List$1(Path.$, 0); this.cd = ((() => { let $ret = new Pool$1(Path.$); $ret.create = runOn(this, this.cv); $ret.activate = runOn(this, this.cl); $ret.disactivate = runOn(this, this.cn); $ret.destroy = runOn(this, this.cm); return $ret; })()); } cv() { let a = new Path(); this.cg.add(a); a._visibility = 1; return a; } cl(a) { a._visibility = 0; } cn(a) { a._visibility = 1; } cm(a) { this.cg.remove(a); } b5() { return new FinancialPriceBucketCalculator(this); } ax() { super.ax(); if (!this.r) { this.ca.aa5 = Defaults.g; this.ca.aay = Defaults.ah; this.ca.aco = Defaults.ai; this.ca.jp = Defaults.l; this.ca.vx = this.ca.vf; } } get cc() { if (this.cb == null) { this.cb = CategoryTrendLineManagerFactory.a(this.cb, this.f.a0(), this.f.sx, this.f, this.f.ds); } return this.cb; } set cc(a) { this.cb = a; } get ce() { return this.cb != null; } co() { if (this.ca.aa5 == 1) { this.cu._stroke = this.f.vb; } else { this.cu._stroke = this.f.vf; } if (this.ca.aa5 == 1) { this.ct._stroke = this.b6.aay; } else { this.ct._stroke = this.ca.aco; } } ci() { this.av(); this.cd.count = 0; this.ch(); } ch() { let a = typeCast(GeometryGroup.$, this.cu.an); let b = typeCast(GeometryGroup.$, this.ct.an); Extensions.d(a); Extensions.d(b); } cr() { this.av(); return typeCast(GeometryGroup.$, this.cu.an); } cq() { this.av(); return typeCast(GeometryGroup.$, this.ct.an); } cp() { this.ca.acn = null; if (this.ca.trendLineBrush != null) { this.ca.acn = this.ca.trendLineBrush; } else { this.ca.acn = this.ca.vb; } } bh() { super.bh(); this.cu.ad = this.f.ie; this.cu.ai = this.f.v4; this.cu.aj = this.f.v5; if (this.ca.aa5 == 1) { this.cu._stroke = this.f.vb; } else { this.cu._stroke = this.f.vf; this.cu._fill = this.f.vb; } this.ct.ad = this.f.ie; this.ct.ai = this.f.v4; this.ct.aj = this.f.v5; if (this.ca.aa5 == 1) { this.ct._stroke = this.b6.aay; } else { this.ct._stroke = this.ca.aco; this.ct._fill = this.b6.aay; } } bi() { super.bi(); let a = this.bv(); this.cu.ad = this.f.ie + 3; if (this.ca.aa5 == 1) { this.cu._stroke = a; } else { this.cu._stroke = a; this.cu._fill = a; } this.ct.ad = this.f.ie + 3; if (this.ca.aa5 == 1) { this.ct._stroke = a; } else { this.ct._stroke = a; this.ct._fill = a; } } af(a) { return this.cg._inner[a]; } ae(a) { let b = this.cg._inner[a]; this.cs._visibility = b._visibility; this.cs.an = b.an; let c = this.bw(a); this.cs._fill = c; this.cs._stroke = c; this.cs.ad = this.f.ie + 3; return this.cs; } bc(a, b) { super.bc(a, b); if (a.d) { if (this.cf) { for (let c = 0; c < this.cg.count; c++) { let d = this.ad(c, b); if (d._visibility == 0) { a.t(d); }