igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,437 lines (1,436 loc) • 229 kB
JavaScript
/*
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 { EventArgs, Base, markType, Point_$type, runOn, typeCast, IList$1_$type, Number_$type, markDep, IEnumerable_$type, Array_$type, delegateCombine, fromEnum, Boolean_$type, enumGetBox, fromEn, String_$type, getInstanceType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, Delegate_$type, toNullable, delegateRemove, TypeRegistrar } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { DataTemplate } from "igniteui-react-core";
import { Visibility_$type } from "igniteui-react-core";
import { DoubleCollection } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { Style } from "igniteui-react-core";
import { MarkerType_$type } from "./MarkerType";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { Series } from "./Series";
import { List$1 } from "igniteui-react-core";
import { AnchoredCategorySeries } from "./AnchoredCategorySeries";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { CategorySeries } from "./CategorySeries";
import { CategoryFramePreparer } from "./CategoryFramePreparer";
import { NumericAxisBase } from "./NumericAxisBase";
import { ISupportsMarkers_$type } from "./ISupportsMarkers";
import { CategoryFrame } from "./CategoryFrame";
import { Rect } from "igniteui-react-core";
import { CategorySeriesView } from "./CategorySeriesView";
import { Axis } from "./Axis";
import { ScalerParams } from "./ScalerParams";
import { ObservableCollection$1 } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { CategoryBucketCalculator } from "./CategoryBucketCalculator";
import { isNaN_, isInfinity, truncate } from "igniteui-react-core";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { Path } from "igniteui-react-core";
import { ISortingAxis_$type } from "./ISortingAxis";
import { FrameworkElement } from "igniteui-react-core";
import { XamDataChart } from "./XamDataChart";
import { DependencyProperty } from "igniteui-react-core";
import { DependencyObject } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { Defaults } from "./Defaults";
import { Pool$1 } from "igniteui-react-core";
import { Rectangle } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
import { IScaler_$type } from "./IScaler";
import { IIsCategoryBased_$type } from "./IIsCategoryBased";
import { CategoryMarkerManager } from "./CategoryMarkerManager";
import { PropertyMetadata } from "igniteui-react-core";
import { dateMinValue, dateMaxValue } from "igniteui-react-core";
import { NumericXAxis } from "./NumericXAxis";
import { CategoryYAxis } from "./CategoryYAxis";
import { AnchoredCategoryBucketCalculator } from "./AnchoredCategoryBucketCalculator";
import { IStacked100Series_$type } from "./IStacked100Series";
import { NotImplementedException } from "igniteui-react-core";
import { SplineSeriesBase } from "./SplineSeriesBase";
import { CollisionAvoider } from "./CollisionAvoider";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { Numeric } from "igniteui-react-core";
import { ICategoryScaler_$type } from "./ICategoryScaler";
import { ChartSelection } from "./ChartSelection";
import { CategoryXAxis } from "./CategoryXAxis";
import { IBarSeries_$type } from "./IBarSeries";
import { Color } from "igniteui-react-core";
import { LegendItemBadgeShape_$type } from "igniteui-react-core";
import { LegendItemBadgeMode_$type } from "igniteui-react-core";
import { MarkerFillMode_$type } from "./MarkerFillMode";
import { MarkerOutlineMode_$type } from "./MarkerOutlineMode";
import { SeriesOutlineMode_$type } from "./SeriesOutlineMode";
import { SeriesHighlightedValuesDisplayMode_$type } from "igniteui-react-core";
import { TransitionInSpeedType_$type } from "./TransitionInSpeedType";
import { PropertyUpdatedEventArgs } from "igniteui-react-core";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { SingleValuesHolder } from "./SingleValuesHolder";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { SplineSeriesBaseView } from "./SplineSeriesBaseView";
import { Canvas } from "igniteui-react-core";
import { Panel } from "igniteui-react-core";
import { PlatformConstants } from "igniteui-react-core";
/**
* @hidden
*/
export let StackedSeriesCreatedEventArgs = /*@__PURE__*/ (() => {
class StackedSeriesCreatedEventArgs extends EventArgs {
constructor(a) {
super();
this.c = null;
this.c = a;
}
get brush() {
return this.c.lb;
}
set brush(a) {
this.c.lb = a;
}
get legendItemTemplate() {
return this.c.h1;
}
set legendItemTemplate(a) {
this.c.h1 = a;
}
get legendItemBadgeTemplate() {
return this.c.h0;
}
set legendItemBadgeTemplate(a) {
this.c.h0 = a;
}
get legendItemVisibility() {
return this.c.l6;
}
set legendItemVisibility(a) {
this.c.l6 = a;
}
get outline() {
return this.c.lf;
}
set outline(a) {
this.c.lf = a;
}
get dashArray() {
return this.c.lk;
}
set dashArray(a) {
this.c.lk = a;
}
get dashCap() {
return this.c.ln;
}
set dashCap(a) {
this.c.ln = a;
}
get index() {
return this.c.ch;
}
get thickness() {
return this.c.b9;
}
set thickness(a) {
this.c.b9 = a;
}
get title() {
return this.c.co;
}
set title(a) {
this.c.co = a;
}
get transitionDuration() {
return this.c.ci;
}
set transitionDuration(a) {
this.c.ci = a;
}
get transitionEasingFunction() {
return this.c.al;
}
set transitionEasingFunction(a) {
this.c.al = a;
}
get markerBrush() {
return this.c.lc;
}
set markerBrush(a) {
this.c.lc = a;
}
get markerOutline() {
return this.c.ld;
}
set markerOutline(a) {
this.c.ld = a;
}
get markerStyle() {
return this.c.l3;
}
set markerStyle(a) {
this.c.l3 = a;
}
get markerTemplate() {
return this.c.h2;
}
set markerTemplate(a) {
this.c.h2 = a;
}
get markerType() {
return this.c.aa;
}
set markerType(a) {
this.c.aa = a;
}
get markerThickness() {
return this.c.b2;
}
set markerThickness(a) {
this.c.b2 = a;
}
get lineCap() {
return this.c.lm;
}
set lineCap(a) {
this.c.lo = a;
}
}
StackedSeriesCreatedEventArgs.$t = /*@__PURE__*/ markType(StackedSeriesCreatedEventArgs, 'StackedSeriesCreatedEventArgs', EventArgs.$);
return StackedSeriesCreatedEventArgs;
})();
/**
* @hidden
*/
export let FragmentBase = /*@__PURE__*/ (() => {
class FragmentBase extends HorizontalAnchoredCategorySeries {
constructor() {
super();
this.___neverPassByValue = true;
this.adk = null;
this._logicalSeriesLink = null;
this.adm = null;
this.adk = new CategoryLineRasterizer();
}
get logicalSeriesLink() {
return this._logicalSeriesLink;
}
set logicalSeriesLink(a) {
this._logicalSeriesLink = a;
}
get parentSeries() {
return this.adm;
}
set parentSeries(a) {
this.adm = a;
}
get_e9() {
return false;
}
get_isFragment() {
return true;
}
nn() {
if (this.logicalSeriesLink != null) {
return this.logicalSeriesLink.e7;
}
return null;
}
kb() {
let a = this.parentSeries;
if (a.index == -1 || a.abo == null || a.abo.f.indexOf(this) == -1) {
return -1;
}
return a.abo.f.indexOf(this);
}
qo(a) {
super.qo(a);
a.parentSeries = this.parentSeries;
a.logicalSeriesLink = this.logicalSeriesLink;
}
kg() {
let a = this.parentSeries;
if (a.index == -1 || a.series.count == 0 || a.series.indexOf(this.logicalSeriesLink) == -1) {
return -1;
}
return a.series.indexOf(this.logicalSeriesLink);
}
resolveLegendIndex() {
let a = this.parentSeries;
if (a.abs) {
return -1 + a.index + a.abj.count - a.abo.f.indexOf(this);
}
return super.resolveLegendIndex();
}
bq() {
return this.parentSeries;
}
zd() {
if (this.parentSeries == null) {
return null;
}
return this.parentSeries.fetchXAxis();
}
adj() {
if (this.parentSeries == null) {
return this.zk;
}
return this.parentSeries.zk;
}
zu() {
if (this.parentSeries == null) {
return null;
}
return this.parentSeries.fetchYAxis();
}
adp(a, b, c, d, e, f, g, h) {
let i = c[0];
let j = c[1];
let k = new Rect(0, i - 5, j - 5, 11, 11);
if (!isNaN_(i) && !isNaN_(j) && !isInfinity(i) && !isInfinity(j) && d.tryAdd(k)) {
b.s.add({ $type: Point_$type, x: i, y: j });
a.updateMarkerTemplate(g, f, h);
return true;
}
return false;
}
aa5(a, b) {
a.aa();
if (this.valueColumn == null || this.parentSeries == null || this.logicalSeriesLink == null) {
return;
}
if (this.logicalSeriesLink.bd.count == 0 || this.logicalSeriesLink.bc.count == 0) {
return;
}
this.zl(b).d(a, b);
}
ww(a, b, c) {
return this.wy(a, b, c, this.adj().r(this.zd(), this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.zu(), this.zd(), runOn(this, this.adq), (d, e) => this.kk(d, e, this.zd(), runOn(this, this.aae), this.valueColumn != null ? new FragmentBaseValueList(this) : null), (d, e) => this.ki(d, e, this.zd(), runOn(this, this.aae), this.valueColumn != null ? new FragmentBaseValueList(this) : null));
}
ai() {
return [this.zd(), this.zu()];
}
adq(a, b, c) {
if (this.dc == null) {
return NaN;
}
let d = this.getEffectiveViewport1(this.cw);
let e = new ScalerParams(0, this.dc.yr, this.cw.b9, this.zd().dn, d);
let f = this.zk.r(this.zd(), this.dc.yr, this.cw.b9, d);
return this.jf(this.valueColumn != null ? new FragmentBaseValueList(this) : null, a, this.zd(), e, f, runOn(this, this.aae), b, c);
}
ads(a, b, c) {
let d = this.abw(c);
let e = d;
let f = this.logicalSeriesLink.a4;
let g = f ? this.parentSeries.abo.e : this.parentSeries.abo.d;
let h = this;
if (this.bo != null) {
h = this.bo;
}
let i = g.indexOf(h);
if (a.count == 0) {
return;
}
if (i == -1) {
return;
}
let j = false;
for (let k = i; k >= 0; k--) {
if (j) {
break;
}
if (k == 0) {
a.add({ $type: Point_$type, x: a._inner[a.count - 1].x, y: e });
a.add({ $type: Point_$type, x: a._inner[0].x, y: e });
break;
}
let l = typeCast(FragmentBase.$, g._inner[k - 1]);
if (l != null && l.adk != null && l.adk.o.count > 0 && this.cw != null && l.hk(this.cw.b9, this.cw.ca, this.cw)) {
j = true;
for (let m = l.adk.o.count - 1; m >= 0; m--) {
a.add(l.adk.o._inner[m]);
}
}
}
}
hk(a, b, c) {
let d = super.hk(a, b, c);
let e = typeCast(CategoryAxisBase.$, this.parentSeries.fetchXAxis());
let f = this.parentSeries.fetchYAxis();
if (this.parentSeries == null || e == null || e.itemsSource == null || f == null || this.parentSeries.dp == null || e.b7 == null || f.b7 == null) {
d = false;
}
if (this.valueColumn == null) {
return false;
}
if (isInfinity(this.valueColumn.minimum) && isInfinity(this.valueColumn.maximum)) {
d = false;
}
if (isNaN_(this.valueColumn.minimum) && isNaN_(this.valueColumn.maximum)) {
d = false;
}
return d;
}
abw(a) {
let b = 0;
let c = a.ca;
let d = a.b9;
let e = this.getEffectiveViewport1(a);
let f = new ScalerParams(0, c, d, this.zu().dn, e);
f.b = this.i5();
if (!c.isEmpty && !d.isEmpty && this.zu() != null) {
b = this.zu().f6(0, f);
}
return b;
}
ay(a) {
return null;
}
adr() {
if (this.parentSeries == null) {
return -1;
}
let a = this.parentSeries.index;
let b = 0;
let c = 1;
if (this.parentSeries.abs) {
b = this.parentSeries.abj.count - 1;
c = -1;
}
for (let d = b; this.parentSeries.abs ? d >= 0 : d < this.parentSeries.abj.count; d += c) {
let e = this.parentSeries.abj._inner[d];
if (e.visualSeriesLink == this) {
return a;
}
if (this.parentSeries.a5 == null || e.l5 != 0 || e.l4 != 0) {
continue;
}
a++;
}
return -1;
}
adt(a) {
if (a == null) {
}
}
rq(a, b, c, d) {
super.rq(a, b, c, d);
if (this.parentSeries == null) {
return;
}
let e = typeCast(NumericAxisBase.$, this.parentSeries.fetchYAxis());
if (e == null) {
return;
}
switch (b) {
case "ValueColumn":
if (this.abi.dl) {
this.abi.dk.g$m();
}
if (e != null && !e.ed()) {
this.parentSeries.abi().c9.g(this.ik);
this.r8(this.gm && this.d9);
}
break;
case "ActualBrush":
if (this.logicalSeriesLink != null) {
this.logicalSeriesLink.k6 = this.vt;
}
break;
}
}
sa(a, b) {
super.sa(a, b);
}
get useHighMarkerFidelity() {
return this.aab;
}
}
FragmentBase.$t = /*@__PURE__*/ markType(FragmentBase, 'FragmentBase', HorizontalAnchoredCategorySeries.$);
return FragmentBase;
})();
/**
* @hidden
*/
export let AreaFragment = /*@__PURE__*/ (() => {
class AreaFragment extends FragmentBase {
bk() {
return new AreaFragment();
}
constructor() {
super();
this.ab = AreaFragment.$;
}
ct() {
return new AreaFragmentView(this);
}
rh(a) {
super.rh(a);
this.adu = a;
}
get_ey() {
return true;
}
get_ex() {
return true;
}
zp() {
return 1;
}
adw(a, b) {
let c = this.adu.dz.an;
if (this.g4(a, c)) {
return true;
}
let d = this.adu.d0.an;
if (this.g4(a, d)) {
return true;
}
return false;
}
g2(a, b) {
if (this.adv(a, b)) {
return true;
}
if (this.adw(a, b)) {
return true;
}
if (this.x2(a, b)) {
return true;
}
return false;
}
adv(a, b) {
let c = this.adu.d1.an;
if (this.g3(a, b, c)) {
return true;
}
let d = this.adu.d2.an;
if (this.g3(a, b, d)) {
return true;
}
return false;
}
preferredCategoryMode(a) {
return 0;
}
pi(a, b) {
super.pi(a, b);
let c = b;
c.du();
}
aa8(a, b) {
super.aa8(a, b);
this.adk.a = typeCast(ISortingAxis_$type, this.xAxis) !== null ? true : false;
let c = typeCast(AreaFragmentView.$, b);
let d = a.k;
let e = this.getEffectiveViewport1(c);
this.zn.a2(this, this.z7(), runOn(this, this.y7), this.aag(b), this.aah(b));
let f = false;
let g = this.zn.b;
if (g != null) {
f = true;
}
if (f) {
let h = new ScalerParams(0, b.ca, b.b9, this.ac0.dn, e);
this.aa4(d, -1, this.valueColumn.count, this.ac0, h, b.t, -1);
}
this.zn.ad(c.d1, true, false, true, true);
this.zn.ad(c.d2, true, false, true, true);
this.zn.ad(c.dz, false, true, false, false);
this.zn.ad(c.d0, false, true, false, false);
let i = c.c9.d;
this.adk.i(c.dz, c.d1, c.d0, c.d2, a.k.count, a.k, true, i, this.ik, (j, k, l, m, n) => this.ads(j, a.k, b), 0);
c.dz._opacity = this.zn.j * this.ig;
c.d0._opacity = 0.5 * this.zn.j * this.ig;
}
sv() {
let a = (typeCast(XamDataChart.$, this.dc));
if (a != null) {
this.ig = isNaN_(this.ir) ? this.parentSeries.ig : this.ir;
}
}
get useHighMarkerFidelity() {
return this.aab;
}
}
AreaFragment.$t = /*@__PURE__*/ markType(AreaFragment, 'AreaFragment', FragmentBase.$);
return AreaFragment;
})();
/**
* @hidden
*/
export let ColumnFragment = /*@__PURE__*/ (() => {
class ColumnFragment extends FragmentBase {
bk() {
return new ColumnFragment();
}
get_e2() {
return true;
}
get_fo() {
return true;
}
js() {
if (!isNaN_(this.jr)) {
return super.js();
}
return Defaults.h;
}
zp() {
return 1;
}
constructor() {
super();
this.ab = ColumnFragment.$;
}
ct() {
return new ColumnFragmentView(this);
}
rh(a) {
super.rh(a);
this.adv = a;
}
get fragmentXAxis() {
return this.parentSeries != null ? typeCast(CategoryAxisBase.$, this.parentSeries.fetchXAxis()) : null;
}
get fragmentYAxis() {
return this.parentSeries != null ? typeCast(NumericYAxis.$, this.parentSeries.fetchYAxis()) : null;
}
preferredCategoryMode(a) {
return 2;
}
zd() {
return this.fragmentXAxis;
}
zu() {
return this.fragmentYAxis;
}
get_ef() {
return true;
}
fetchXAxis() {
return null;
}
fetchYAxis() {
return null;
}
pi(a, b) {
super.pi(a, b);
let c = b;
if (a && c.du != null) {
this.zf.s.clear();
c.du.count = 0;
}
}
ay(a) {
if (this.valueColumn == null || this.valueColumn.count == 0) {
return null;
}
return new AxisRange(this.valueColumn.minimum, this.valueColumn.maximum);
}
hk(a, b, c) {
if (this.parentSeries == null) {
return false;
}
return this.parentSeries.abt(this, a, b, this.adx(c));
}
hh() {
return true;
}
aag(a) {
if (this.parentSeries != null) {
return this.parentSeries.aag(this.parentSeries.cw);
}
return super.aag(a);
}
aah(a) {
if (this.parentSeries != null) {
return this.parentSeries.aah(this.parentSeries.cw);
}
return super.aag(a);
}
aai(a) {
if (this.parentSeries != null) {
return this.parentSeries.aai(this.parentSeries.cw);
}
return super.aai(a);
}
w8(a) {
if (this.zd() == null || this.fragmentYAxis == null) {
return Rect.empty;
}
let b = this.wr(a);
let c = this.cw.ca;
let d = this.cw.b9;
let e = this.getEffectiveViewport1(this.cw);
let f = new ScalerParams(0, c, d, this.fragmentYAxis.dn, e);
let g = this.an(this.zd(), this.zf.k, this.aag(this.cw), this.aah(this.cw), a, true);
if (g == null) {
return Rect.empty;
}
let h = g[0];
let i = g[1];
let j = Math.abs(b.x - h[0]);
let k = Math.abs(b.x - i[0]);
let l = this.zd().pz(c, d, e);
if (j < k) {
let m = h[0] - 0.5 * l;
let n = h[1];
let o = h[2];
return new Rect(0, m, Math.min(n, o), l, Math.max(n, o) - Math.min(n, o));
}
else {
let p = i[0] - 0.5 * l;
let q = i[1];
let r = i[2];
return new Rect(0, p, Math.min(q, r), l, Math.max(q, r) - Math.min(q, r));
}
}
g2(a, b) {
if (this.g5(a, b)) {
return true;
}
if (this.x2(a, b)) {
return true;
}
return false;
}
g5(a, b) {
let c = this.w9(a);
if (c.isEmpty) {
return false;
}
let d = this.ad4(c, this.i1(b));
return d.containsPoint(a);
}
ad4(a, b) {
let c = a.left + a.width / 2;
let d = a.top + a.height / 2;
let e = c - ((a.width / 2) + b);
let f = d - (a.height / 2);
let g = a.height;
let h = a.width + b * 2;
return new Rect(0, e, f, h, g);
}
k6(a, b) {
let c = typeCast(FrameworkElement.$, a);
let d = c != null ? typeCast(DataContext.$, c.dataContext) : null;
let e = d != null ? d.item : null;
if (e == null) {
let f = this.cw.b9;
let g = this.dc != null ? this.dc.yr : Rect.empty;
let h = { $type: Point_$type, x: g.left + g.width * (b.x - f.left) / f.width, y: g.top + g.height * (b.y - f.top) / f.height };
e = this.kw(h);
}
return e;
}
kw(a) {
let b = 0;
if (typeCast(ISortingAxis_$type, this.zd()) !== null) {
b = this.ke(a);
if (b == -1) {
return null;
}
}
else {
b = this.kc(a);
}
return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
}
ke(a) {
let b = this.cw.ca;
let c = this.cw.b9;
let d = this.getEffectiveViewport1(this.cw);
if (b.isEmpty || c.isEmpty) {
return -1;
}
let e = this.zd();
let f = new ScalerParams(0, b, c, e.dn, d);
let g = typeCast(ISortingAxis_$type, this.fragmentXAxis);
let h = this.w4(this.cw);
let i = e.f9(h.left, f);
let j = e.f9(h.right, f);
let k = (a.x - b.left) / b.width;
let l = i + ((j - i) * k);
if (truncate(l) <= dateMinValue().getTime() || truncate(l) >= dateMaxValue().getTime()) {
return -1;
}
let m = g.i$f(l);
return m;
}
kc(a) {
if (this.parentSeries == null) {
return -1;
}
return this.parentSeries.ab0(a);
}
adp(a, b, c, d, e, f, g, h) {
if (!a.shouldDisplayMarkers) {
return false;
}
let i = 0;
let j = c[0];
let k = e < i ? c[2] : c[1];
let l = new Rect(0, j - 5, k - 5, 11, 11);
if (!isNaN_(j) && !isNaN_(k) && !isInfinity(j) && !isInfinity(k) && d.tryAdd(l)) {
b.s.add({ $type: Point_$type, x: j, y: k });
a.updateMarkerTemplate(g, f, h);
return true;
}
return false;
}
adx(a) {
if (a.s) {
return this.parentSeries.ba.a$k.item(a.al);
}
else if (a == this.cv) {
return this.parentSeries.cv;
}
else {
return this.parentSeries.zo;
}
}
r7(a, b, c, d, e) {
this.ba.a$aa(this, a, b, d, e);
let f = this.ba.a$k.item(d);
let g = f;
f.bd(c);
let h = this.adx(f);
h.c9.g(this.ik);
if (this.d7(g)) {
return;
}
if (this.abj == null) {
this.abj = new CategoryFrame(3);
}
this.abj.aa();
this.aa5(this.abj, g);
this.aa8(this.abj, g);
}
aa5(a, b) {
a.aa();
if (this.valueColumn == null || this.parentSeries == null || this.logicalSeriesLink == null || this.logicalSeriesLink.bc.count == 0 || this.logicalSeriesLink.bd.count == 0) {
return;
}
let c;
if (b.s) {
c = this.parentSeries.abh;
}
else if (b == this.cv) {
c = this.parentSeries.zi;
}
else {
c = this.parentSeries.zf;
}
let d = typeCast(CategorySeriesView.$, this.adx(b));
a.k.clear();
if (a.r != null) {
a.r.clear();
}
a.s.clear();
let e = d.c9.e;
let f = d.c9.f;
let g = this.parentSeries.zk.h.yScaler;
let h = typeCast(ISortingAxis_$type, this.parentSeries.zk.h.scaler);
let i = typeCast(NumericAxisBase.$, g) !== null && g.qh;
let j = typeCast(StackedBucketCalculator.$, d.c9);
let k = d.c9.d;
let l = 0;
if (e <= f) {
for (let m = e; m <= f; m++) {
let n = m * k;
if (this._visibility != 0) {
break;
}
if (m >= this.valueColumn.count || m >= c.k.count + e) {
continue;
}
let o = this.valueColumn.item(m);
let p = !i || (i && o > 0);
let q;
if (h == null) {
q = j.getBucket1(this, m, m, b.ca, b.b9, c);
}
else {
q = j.getBucket1(this, m, h.i$b._inner[m], b.ca, b.b9, c);
}
a.k.add(q);
if (h != null) {
if (a.r == null) {
a.r = new List$1(Number_$type, 0);
}
a.r.add(n);
}
if (p) {
if (this.adp(b, a, q, this.zk.h.provideCollisionDetector(), o, n, l, a.k.count - 1)) {
l++;
}
}
}
}
b.dc.count = l;
}
aa8(a, b) {
super.aa8(a, b);
if (this.parentSeries == null) {
return;
}
this.parentSeries.ab9(this, a, b, runOn(this, this.y7));
CategoryMarkerManager.e(this, a.s, b.dc, this.x3);
}
rq(a, b, c, d) {
super.rq(a, b, c, d);
}
get useHighMarkerFidelity() {
return this.aab;
}
}
ColumnFragment.$t = /*@__PURE__*/ markType(ColumnFragment, 'ColumnFragment', FragmentBase.$);
ColumnFragment.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, ColumnFragment, 'raisePropertyChanged', ['RadiusX:ady:ad2', [1, 0], 'RadiusY:adz:ad3', [1, 0]]);
return ColumnFragment;
})();
/**
* @hidden
*/
export let BarFragment = /*@__PURE__*/ (() => {
class BarFragment extends ColumnFragment {
constructor() {
super();
this.ab = BarFragment.$;
}
get_e0() {
return true;
}
get_fo() {
return true;
}
get_e2() {
return false;
}
zp() {
return 1;
}
get barFragmentXAxis() {
return this.parentSeries != null ? this.parentSeries.xAxis : null;
}
get barFragmentYAxis() {
return this.parentSeries != null ? this.parentSeries.yAxis : null;
}
zd() {
if (this.parentSeries == null) {
return null;
}
return this.parentSeries.fetchYAxis();
}
get_isVertical() {
return true;
}
iy(a) {
let b = this.dc != null ? this.dc.yr : Rect.empty;
let c = this.cw.b9;
let d = this.w4(this.cw);
let e = this.getEffectiveViewport1(this.cw);
let f = this.zd();
let g = -1;
if (f != null && !b.isEmpty && !c.isEmpty) {
let h = new ScalerParams(0, b, c, f.dn, e);
let i = f.f9(d.top, h);
let j = f.f9(d.bottom, h);
let k = (a.y - b.top) / b.height;
let l = i + (k * (j - i));
if (f.categoryMode != 0) {
l -= 0.5;
}
g = l;
}
return g;
}
zu() {
if (this.parentSeries == null) {
return null;
}
return this.parentSeries.zu();
}
ad4(a, b) {
let c = a.left + a.width / 2;
let d = a.top + a.height / 2;
let e = c - (a.width / 2);
let f = d - ((a.height / 2) + b);
let g = a.height + b * 2;
let h = a.width;
return new Rect(0, e, f, h, g);
}
w8(a) {
if (this.zd() == null) {
return Rect.empty;
}
let b = this.wr(a);
let c = this.cw.ca;
let d = this.cw.b9;
let e = this.getEffectiveViewport1(this.cw);
let f = this.zd();
let g = new ScalerParams(0, c, d, f.dn, e);
let h = this.an(this.zd(), this.zf.k, this.aag(this.cw), this.aah(this.cw), a, true);
if (h == null) {
return Rect.empty;
}
let i = h[0];
let j = h[1];
let k = Math.abs(b.y - i[0]);
let l = Math.abs(b.y - j[0]);
let m = f.pz(c, d, e);
if (k < l) {
let n = i[0] - 0.5 * m;
let o = i[2];
let p = i[1];
return new Rect(0, o, n, Math.max(p, o) - Math.min(p, o), m);
}
else {
let q = j[0] - 0.5 * m;
let r = j[2];
let s = j[1];
return new Rect(0, r, q, Math.max(s, r) - Math.min(s, r), m);
}
}
g2(a, b) {
if (this.g5(a, b)) {
return true;
}
if (this.x2(a, b)) {
return true;
}
return false;
}
adp(a, b, c, d, e, f, g, h) {
let i = c[0];
let j = e < 0 ? c[2] : c[1];
let k = new Rect(0, j - 5, i - 5, 11, 11);
if (!isNaN_(j) && !isNaN_(i) && !isInfinity(j) && !isInfinity(i) && d.tryAdd(k)) {
b.s.add({ $type: Point_$type, x: j, y: i });
a.updateMarkerTemplate(g, f, h);
return true;
}
return false;
}
kw(a) {
let b = 0;
if (typeCast(ISortingAxis_$type, this.barFragmentYAxis) !== null) {
b = this.ke(a);
if (b == -1) {
return null;
}
}
else {
b = this.kc(a);
}
return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
}
ke(a) {
let b = this.cw.ca;
let c = this.cw.b9;
if (b.isEmpty || c.isEmpty) {
return -1;
}
let d = this.getEffectiveViewport1(this.cw);
let e = new ScalerParams(0, b, c, this.barFragmentYAxis.dn, d);
let f = typeCast(ISortingAxis_$type, this.barFragmentYAxis);
let g = this.w4(this.cw);
let h = this.barFragmentYAxis.f9(g.top, e);
let i = this.barFragmentYAxis.f9(g.bottom, e);
let j = (a.y - b.top) / b.height;
let k = h + ((i - h) * j);
if (truncate(k) <= dateMinValue().getTime() || truncate(k) >= dateMaxValue().getTime()) {
return -1;
}
let l = f.i$f(k);
return l;
}
abw(a) {
let b = 0;
let c = a.ca;
let d = a.b9;
let e = this.getEffectiveViewport1(a);
let f = new ScalerParams(0, c, d, this.barFragmentXAxis.dn, e);
if (!c.isEmpty && !d.isEmpty && this.barFragmentXAxis != null) {
b = this.barFragmentXAxis.f6(0, f);
}
return b;
}
rq(a, b, c, d) {
super.rq(a, b, c, d);
if (this.parentSeries == null || this.barFragmentXAxis == null) {
return;
}
let e = this.barFragmentXAxis;
switch (b) {
case "ValueColumn":
if (this.abi.dl) {
this.abi.dk.g$m();
}
if (e != null && !e.ed()) {
this.parentSeries.abi().c9.g(this.ik);
this.r8(this.gm && this.d9);
}
break;
}
}
get useHighMarkerFidelity() {
return this.aab;
}
}
BarFragment.$t = /*@__PURE__*/ markType(BarFragment, 'BarFragment', ColumnFragment.$);
return BarFragment;
})();
/**
* @hidden
*/
export let AreaFragmentBucketCalculator = /*@__PURE__*/ (() => {
class AreaFragmentBucketCalculator extends AnchoredCategoryBucketCalculator {
constructor(a) {
super(a);
}
getBucketWithoutUnknowns(a) {
return this.getBucket(a);
}
getBucket(a) {
let b = Math.min(a * this.d, this.i.di.valueColumn.count - 1);
let c = Math.min(b + this.d - 1, this.i.di.valueColumn.count - 1);
let d = NaN;
let e = NaN;
let f = this.i.di;
let g = f.parentSeries;
let h = typeCast(IStacked100Series_$type, g) !== null;
let i = this.i.di.valueColumn;
let j = g.abf;
let k = g.abg;
let l = f.logicalSeriesLink.bd;
let m = f.logicalSeriesLink.bc;
for (let n = b; n <= c; ++n) {
let o = i.item(n);
if (isNaN_(o) || isInfinity(o)) {
o = 0;
}
let p = Math.abs(k[n]) + j[n];
if (h) {
if (p == 0) {
o = 0;
}
else if (o < 0) {
o = (l._inner[n] + o) / p * 100;
}
else {
o = (m._inner[n] + o) / p * 100;
}
}
else {
o = o < 0 ? l._inner[n] + o : m._inner[n] + o;
}
if (!isNaN_(d)) {
if (!isNaN_(o)) {
d = Math.min(d, o);
e = Math.max(e, o);
}
}
else {
d = o;
e = o;
}
}
if (!isNaN_(d)) {
return [0.5 * (b + c), d, e];
}
return [0.5 * (b + c), NaN, NaN];
}
}
AreaFragmentBucketCalculator.$t = /*@__PURE__*/ markType(AreaFragmentBucketCalculator, 'AreaFragmentBucketCalculator', AnchoredCategoryBucketCalculator.$);
return AreaFragmentBucketCalculator;
})();
/**
* @hidden
*/
export let LineFragmentBucketCalculator = /*@__PURE__*/ (() => {
class LineFragmentBucketCalculator extends AnchoredCategoryBucketCalculator {
constructor(a) {
super(a);
}
getBucketWithoutUnknowns(a) {
return this.getBucket(a);
}
getBucket(a) {
let b = Math.min(a * this.d, this.i.di.valueColumn.count - 1);
let c = Math.min(b + this.d - 1, this.i.di.valueColumn.count - 1);
let d = NaN;
let e = NaN;
let f = typeCast(FragmentBase.$, this.i.di);
let g = f.parentSeries;
for (let h = b; h <= c; ++h) {
let i = this.i.di.valueColumn.item(h);
let j = Math.abs(g.abg[h]) + g.abf[h];
if (isNaN_(i) || isInfinity(i)) {
i = 0;
}
if (typeCast(IStacked100Series_$type, g) !== null) {
if (j == 0) {
i = 0;
}
else if (i < 0) {
i = (f.logicalSeriesLink.bd._inner[h] + i) / j * 100;
}
else {
i = (f.logicalSeriesLink.bc._inner[h] + i) / j * 100;
}
}
else {
i = i < 0 ? f.logicalSeriesLink.bd._inner[h] + i : f.logicalSeriesLink.bc._inner[h] + i;
}
if (!isNaN_(d)) {
if (!isNaN_(i)) {
d = Math.min(d, i);
e = Math.max(e, i);
}
}
else {
d = i;
e = i;
}
}
if (!isNaN_(d)) {
return [0.5 * (b + c), d, e];
}
return [0.5 * (b + c), NaN, NaN];
}
}
LineFragmentBucketCalculator.$t = /*@__PURE__*/ markType(LineFragmentBucketCalculator, 'LineFragmentBucketCalculator', AnchoredCategoryBucketCalculator.$);
return LineFragmentBucketCalculator;
})();
/**
* @hidden
*/
export let SplineFragmentBucketCalculator = /*@__PURE__*/ (() => {
class SplineFragmentBucketCalculator extends AnchoredCategoryBucketCalculator {
constructor(a) {
super(a);
}
getBucket(a) {
let b = Math.min(a * this.d, this.i.di.valueColumn.count - 1);
let c = Math.min(b + this.d - 1, this.i.di.valueColumn.count - 1);
let d = NaN;
let e = NaN;
let f = typeCast(SplineFragmentBase.$, this.i.di);
let g = f.parentSeries;
for (let h = b; h <= c; ++h) {
let i = this.i.di.valueColumn.item(h);
let j = Math.abs(g.abg[h]) + g.abf[h];
if (isNaN_(i) || isInfinity(i)) {
i = 0;
}
if (typeCast(IStacked100Series_$type, g) !== null) {
if (j == 0) {
i = 0;
}
else if (i < 0) {
i = (f.logicalSeriesLink.bd._inner[h] + i) / j * 100;
}
else {
i = (f.logicalSeriesLink.bc._inner[h] + i) / j * 100;
}
}
else {
i = i < 0 ? f.logicalSeriesLink.bd._inner[h] + i : f.logicalSeriesLink.bc._inner[h] + i;
}
if (!isNaN_(d)) {
if (!isNaN_(i)) {
d = Math.min(d, i);
e = Math.max(e, i);
}
}
else {
d = i;
e = i;
}
}
if (!isNaN_(d)) {
return [0.5 * (b + c), d, e];
}
return [0.5 * (b + c), NaN, NaN];
}
}
SplineFragmentBucketCalculator.$t = /*@__PURE__*/ markType(SplineFragmentBucketCalculator, 'SplineFragmentBucketCalculator', AnchoredCategoryBucketCalculator.$);
return SplineFragmentBucketCalculator;
})();
/**
* @hidden
*/
export let StackedBucketCalculator = /*@__PURE__*/ (() => {
class StackedBucketCalculator extends CategoryBucketCalculator {
constructor(a) {
super(a);
}
getBucket(a) {
let b = typeCast(StackedSeriesBase.$, this.c.db);
let c = Math.min(b.abg != null ? b.abg.length : 0, b.abf != null ? b.abf.length : 0);
let d = Math.min(a * this.d, c - 1);
let e = Math.min(d + this.d - 1, c - 1);
let f = NaN;
let g = NaN;
for (let h = d; h <= e; ++h) {
let i = Math.min(b.abg[h], b.abf[h]);
let j = Math.max(b.abg[h], b.abf[h]);
if (!isNaN_(f)) {
if (!isNaN_(i)) {
f = Math.min(f, i);
g = Math.max(g, i);
}
if (!isNaN_(j)) {
f = Math.min(f, j);
g = Math.max(g, j);
}
}
else {
f = i;
g = j;
}
}
if (!isNaN_(f) && !isNaN_(g)) {
return [0.5 * (d + e), f, g];
}
return [NaN, NaN, NaN];
}
getBucket1(a, b, c, d, e, f) {
return null;
}
}
StackedBucketCalculator.$t = /*@__PURE__*/ markType(StackedBucketCalculator, 'StackedBucketCalculator', CategoryBucketCalculator.$);
return StackedBucketCalculator;
})();
/**
* @hidden
*/
export let StackedBarBucketCalculator = /*@__PURE__*/ (() => {
class StackedBarBucketCalculator extends StackedBucketCalculator {
constructor(a) {
super(a);
}
g(a) {
let b = this.c.ca;
let c = this.c.b9;
let d = typeCast(StackedBarSeries.$, this.c.db);
let e = this.c.db.dp;
if (b.isEmpty || c.isEmpty || d.yAxis == null || e == null || e.count == 0) {
this.d = 0;
return;
}
let f = d.getEffectiveViewport1(this.c);
let g = new ScalerParams(0, b, c, d.yAxis.dn, f);
let h = d.w4(this.c);
let i = Math.floor(d.yAxis.ga(h.top, g, 0));
let j = Math.ceil(d.yAxis.ga(h.bottom, g, 0));
if (!d.yAxis.dn) {
j = Math.ceil(d.yAxis.ga(h.top, g, 0));
i = Math.floor(d.yAxis.ga(h.bottom, g, 0));
}
let k = Math.floor((j - i + 1) * a / h.height);
this.d = truncate(Math.max(1, k));
this.e = truncate(Math.max(0, Math.floor(i / this.d) - 1));
this.f = truncate(Math.ceil(j / this.d));
}
getBucket(a) {
return super.getBucket(a);
}
getBucket1(a, b, c, d, e, f) {
let g = [NaN, NaN, NaN];
let h = typeCast(BarFragment.$, a);
if (h == null || h.logicalSeriesLink == null) {
return g;
}
let i = typeCast(StackedBarSeries.$, this.c.db);
let j = a.valueColumn.item(c);
let k = 0;
let l = NaN;
let m = NaN;
let n = Number.NEGATIVE_INFINITY;
let o = Number.POSITIVE_INFINITY;
let p = i.getEffectiveViewport1(this.c);
let q = Math.min(i.abg != null ? i.abg.length : 0, i.abf != null ? i.abf.length : 0);
let r = c * this.d;
let s = Math.min(r + this.d - 1, q - 1);
if (r <= s) {
for (let t = r; t <= s; ++t) {
j = a.valueColumn.item(t);
if (j < k) {
o = Math.min(o, h.logicalSeriesLink.bd._inner[t] + j);
n = Math.max(n, h.logicalSeriesLink.bd._inner[t]);
}
else {
o = Math.min(o, h.logicalSeriesLink.bc._inner[t]);
n = Math.max(n, h.logicalSeriesLink.bc._inner[t] + j);
}
if (!isNaN_(l)) {
if (!isNaN_(o)) {
l = Math.min(l, o);
m = Math.max(m, o);
}
if (!isNaN_(n)) {
l = Math.min(l, n);
m = Math.max(m, n);
}
}
else {
l = o;
m = n;
}
}
}
let u = new ScalerParams(0, d, e, i.xAxis.dn, p);
g = [f.k._inner[b - this.e][0], i.xAxis.f6(m, u), i.xAxis.f6(l, u)];
return g;
}
}
StackedBarBucketCalculator.$t = /*@__PURE__*/ markType(StackedBarBucketCalculator, 'StackedBarBucketCalculator', StackedBucketCalculator.$);
return StackedBarBucketCalculator;
})();
/**
* @hidden
*/
export let StackedColumnBucketCalculator = /*@__PURE__*/ (() => {
class StackedColumnBucketCalculator extends StackedBucketCalculator {
constructor(a) {
super(a);
}
getBucket(a) {
return super.getBucket(a);
}
getBucket1(a, b, c, d, e, f) {
let g = [NaN, NaN, NaN];
let h = typeCast(ColumnFragment.$, a);
if (h == null || h.logicalSeriesLink == null) {
return g;
}
let i = typeCast(StackedColumnSeries.$, this.c.db);
let j = a.valueColumn.item(c);
let k = 0;
let l = NaN;
let m = NaN;
let n = Number.NEGATIVE_INFINITY;
let o = Number.POSITIVE_INFINITY;
let p = i.getEffectiveViewport1(this.c);
let q = Math.min(i.abg != null ? i.abg.length : 0, i.abf != null ? i.abf.length : 0);
let r = c * this.d;
let s = Math.min(r + this.d - 1, q - 1);
if (r <= s) {
for (let t = r; t <= s; ++t) {
j = a.valueColumn.item(t);
if (j < k) {
o = Math.min(o, h.logicalSeriesLink.bd._inner[t] + j);
n = Math.max(n, h.logicalSeriesLink.bd._inner[t]);
}
else {
o = Math.min(o, h.logicalSeriesLink.bc._inner[t]);