igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,596 lines (1,595 loc) • 94.7 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 { Base, Point_$type, typeCast, runOn, delegateCombine, fromEnum, markType, EnumUtil, String_$type, delegateRemove, IEnumerable_$type, enumGetBox, Number_$type, markDep } from "igniteui-react-core";
import { IOuterLabelWidthDecider_$type } from "./IOuterLabelWidthDecider";
import { IFunnelLabelSizeDecider_$type } from "./IFunnelLabelSizeDecider";
import { ServiceProvider } from "./ServiceProvider";
import { MessageChannel } from "./MessageChannel";
import { MouseLeaveMessage } from "./MouseLeaveMessage";
import { MouseMoveMessage } from "./MouseMoveMessage";
import { MouseButtonMessage } from "./MouseButtonMessage";
import { Rect } from "igniteui-react-core";
import { RenderingContext } from "igniteui-react-core";
import { SetAreaSizeMessage } from "./SetAreaSizeMessage";
import { RenderingMessage } from "./RenderingMessage";
import { Polygon } from "igniteui-react-core";
import { PointCollection } from "igniteui-react-core";
import { TextBlock } from "igniteui-react-core";
import { RenderSliceMessage } from "./RenderSliceMessage";
import { List$1 } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { RenderOuterLabelMessage } from "./RenderOuterLabelMessage";
import { SliceInfo } from "./SliceInfo";
import { TooltipValueChangedMessage } from "./TooltipValueChangedMessage";
import { TooltipUpdateMessage } from "./TooltipUpdateMessage";
import { FunnelDataContext } from "./FunnelDataContext";
import { PropertyChangedMessage } from "./PropertyChangedMessage";
import { FontUtil } from "igniteui-react-core";
import { CanvasViewRenderer } from "igniteui-react-core";
import { DOMEventProxy } from "igniteui-react-core";
import { BrushCollection } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { MessageHandler } from "./MessageHandler";
import { ClearMessage } from "./ClearMessage";
import { ClearTooltipMessage } from "./ClearTooltipMessage";
import { ContainerSizeChangedMessage } from "./ContainerSizeChangedMessage";
import { ViewportChangedMessage } from "./ViewportChangedMessage";
import { ViewPropertyChangedMessage } from "./ViewPropertyChangedMessage";
import { ObjectColumn } from "./ObjectColumn";
import { Size } from "igniteui-react-core";
import { Visibility_$type } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
import { stringReplace } from "igniteui-react-core";
import { SliceInfoList } from "./SliceInfoList";
import { DoubleAnimator } from "igniteui-react-core";
import { Bezier } from "./Bezier";
import { DoubleColumn } from "./DoubleColumn";
import { OuterLabelAlignment_$type } from "./OuterLabelAlignment";
import { FunnelSliceDisplay_$type } from "./FunnelSliceDisplay";
import { IItemProvider_$type } from "./IItemProvider";
import { SliceSelectionManager } from "./SliceSelectionManager";
import { FunnelFrame } from "./FunnelFrame";
import { Style } from "igniteui-react-core";
import { IChartLegend_$type } from "igniteui-react-core";
import { DataTemplate } from "igniteui-react-core";
import { DataUpdatedMessage } from "./DataUpdatedMessage";
import { UserSelectedItemsChangedMessage } from "./UserSelectedItemsChangedMessage";
import { LabelSizeChangedMessage } from "./LabelSizeChangedMessage";
import { NotifyCollectionChangedEventArgs } from "igniteui-react-core";
import { FrameRenderCompleteMessage } from "./FrameRenderCompleteMessage";
import { IntColumn } from "./IntColumn";
import { PointList } from "./PointList";
import { Convert } from "igniteui-react-core";
import { HighlightedValueDisplayMode_$type } from "igniteui-react-core";
import { ILegendSeries_$type } from "igniteui-react-core";
import { UIElement } from "igniteui-react-core";
import { ContentControl } from "igniteui-react-core";
import { FunnelSliceDataContext } from "./FunnelSliceDataContext";
import { Control } from "igniteui-react-core";
import { SliceClickedMessage } from "./SliceClickedMessage";
import { SelectedItemsChangedMessage } from "./SelectedItemsChangedMessage";
import { SliceMouseMessage } from "./SliceMouseMessage";
import { ILegendOwner_$type } from "igniteui-react-core";
import { ILegendTemplateProvider_$type } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { FastItemsSource } from "igniteui-react-core";
import { FunnelChartSelectedItemsCollection } from "./FunnelChartSelectedItemsCollection";
import { Dictionary$2 } from "igniteui-react-core";
import { FunnelLegendTemplates } from "./FunnelLegendTemplates";
import { FunnelChartSelectedItemsChangedEventArgs } from "./FunnelChartSelectedItemsChangedEventArgs";
import { DeviceUtils } from "igniteui-react-core";
import { FunnelSliceClickedEventArgs } from "./FunnelSliceClickedEventArgs";
import { FunnelSliceEventArgs } from "./FunnelSliceEventArgs";
import { FunnelChartVisualData } from "./FunnelChartVisualData";
import { RectData } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
/**
* @hidden
*/
export let XamFunnelView = /*@__PURE__*/ (() => {
class XamFunnelView extends Base {
get i() {
return this.h;
}
set i(a) {
let b = this.h;
this.h = a;
this.a1(b, this.h);
}
am(a) {
this.f.i(new MouseLeaveMessage());
}
an(a, b, c) {
let d = new MouseMoveMessage();
d.c = a;
this.f.i(d);
}
al(a) {
let b = new MouseButtonMessage();
b.h = a;
b.c = 1;
b.e = this.j.al ? 1 : 0;
b.f = this.j.bi;
this.f.i(b);
}
ao(a) {
let b = new MouseButtonMessage();
b.h = a;
b.c = 0;
b.e = this.j.al ? 1 : 0;
b.f = this.j.bi;
this.f.i(b);
}
ap(a) {
let b = this.bg;
if (Rect.l_op_Equality(b, null)) {
return;
}
let c = b.left, d = b.top, e = b.width, f = b.height;
this.aq(this.q, c, d, e, f);
this.aq(this.o, c, d, e, f);
this.aq(this.p, c, d, e, f);
this.aq(this.r, c, d, e, f);
}
aq(a, b, c, d, e) {
if (a != null) {
if (a.d && this.t != 1) {
a.aa();
a.ab(this.t, this.t);
}
a.l(b, c, d, e);
if (a.d && this.t != 1) {
a.z();
}
}
}
ba(a) {
let b = a.m;
let c = a.e;
if (c == "LeftPanel") {
this.u = b;
}
if (c == "RightPanel") {
this.v = b;
}
}
a6(a) {
let b = a.g;
let c = this.q;
if (c.d && this.t != 1) {
c.aa();
c.ab(this.t, this.t);
}
let d = new Polygon();
let e = new PointCollection(0);
for (let f = 0; f < b.bd.count; f++) {
let g = b.bd._inner[f];
e.add({ $type: Point_$type, x: g.x + this.u + b.a7.x, y: g.y + b.a7.y });
}
d.an = e;
d.ad = a.h;
d._opacity = b.t;
d._fill = b.ao;
d._stroke = a.h < 1 ? b.ao : b.at;
if (b.bj != null) {
c.j(d, b.bj);
b.ao = d._fill;
b.at = d._stroke;
b.u = d.ad;
b.t = d._opacity;
}
c.u(d);
if (b.bm == 0) {
let h = new Polygon();
let i = new PointCollection(0);
for (let j = 0; j < b.bc.count; j++) {
let k = b.bc._inner[j];
i.add({ $type: Point_$type, x: k.x + this.u + b.a7.x, y: k.y + b.a7.y });
}
h.an = i;
h.ad = a.h;
h._opacity = b.t;
h._fill = b.ap;
h._stroke = a.h < 1 ? b.ap : b.aq;
if (b.bj != null) {
c.j(h, b.bj);
b.ao = h._fill;
b.at = h._stroke;
b.u = h.ad;
b.t = h._opacity;
}
c.u(h);
}
b.u = d.ad;
if (b.i) {
let l = new TextBlock();
if (this.bf == null) {
this.bf = new Brush();
this.bf._fill = this.ak("ui-funnel-slice", "color", -1);
}
l.ao = this.bf;
c.ae(this.m());
let m = b.ab.toString();
let n = c.g(m);
let o = this.ab();
l.al = m;
l.o = b.a4.y + b.a7.y - (o / 2);
l.n = b.a4.x + this.u + b.a7.x - (n / 2);
b.bg = new Rect(0, l.n, l.o, n, o);
b.bn = l._visibility;
c.x(l);
}
if (c.d && this.t != 1) {
c.z();
}
}
a5(a) {
let b = 0;
if (this.v > 0) {
b = this.bg.width - this.v;
}
let c = a;
let d = this.p;
if (d.d && this.t != 1) {
d.aa();
d.ab(this.t, this.t);
}
let e = new TextBlock();
e.al = c.j.toString();
d.ae(this.n());
if (this.be == null) {
this.be = new Brush();
this.be._fill = this.ad.rootWrapper.getStyleProperty("color");
}
e.ao = this.be;
let f = this.ac();
let g = c.l.y - f / 2;
let h = d.g(e.al);
e.n = b;
e.o = g;
c.f.b.bh = new Rect(0, b, g, h, f);
d.x(e);
if (d.d && this.t != 1) {
d.z();
}
}
az() {
if (this.j != null) {
this.j.bh(this.ai, "");
}
}
ax(a) {
this.av(a);
if (this.j != null) {
this.j.at(this.ai, "");
}
}
bc(a) {
this.aj = a.g;
}
bb(a) {
this.at(a);
}
ar(a) {
this.at(null);
}
at(a) {
let x_ = 0, y_ = 0;
let t_ = null, v_ = null, i_ = this.ad;
{
if (a != null) {
t_ = this.aj;
x_ = a.i.x + 6;
y_ = a.i.y + 6;
v_ = a.g.item;
}
let ren_ = this.ad;
let dc_ = null;
if (a != null) {
dc_ = a.g;
}
if (dc_ == null) {
dc_ = new FunnelDataContext();
}
dc_.item = v_;
let tt_ = this.aj;
if (tt_ != null) {
if (v_ != null) {
tt_.updateToolTip(dc_);
tt_.setRawPosition(x_, y_);
}
else {
tt_.hideToolTip();
}
}
}
}
a3(a) {
let b = a;
let c = b.g;
switch (c) {
case "Container":
this.ay(b.d);
break;
case "TextStyle":
this.l = FontUtil.toFontInfo(this.ad, b.d.toString());
break;
case "OuterLabelTextStyle":
this.k = FontUtil.toFontInfo(this.ad, b.d.toString());
break;
case "ActualPixelScalingRatio":
if (isNaN_(this.w) || this.w == 0) {
this.t = b.d;
}
break;
case "OuterLabelTextColor":
this.be = typeCast(Brush.$, b.d);
break;
case "LabelTextColor":
this.bf = typeCast(Brush.$, b.d);
break;
}
}
a4(a) {
if (this.ad != null) {
this.ad.setTimeout(a, 0);
}
else {
window.setTimeout(a, 0);
}
}
ay(a) {
if (a == null) {
if (this.j != null) {
this.j.av();
}
this.ad = null;
this.ae = this.ah = this.ag = this.ai = null;
this.o = this.q = this.p = this.r = null;
this.j = null;
return;
}
let b = a;
let c = this.ad = b;
c.rootWrapper.setStyleProperty("position", "relative");
for (let d = 0; d < 4; d++) {
let e = this.ad.createElement("canvas");
e.setStyleProperty("position", "absolute");
c.append(e);
let f = new RenderingContext(new CanvasViewRenderer(), this.ad.get2DCanvasContext(e));
if (d == 0) {
this.ae = e;
this.o = f;
}
if (d == 1) {
this.ah = e;
this.q = f;
}
if (d == 2) {
this.ag = e;
this.p = f;
}
if (d == 3) {
this.ai = e;
this.r = f;
}
}
this.af = this.ad.createElement("span");
this.af.setStyleProperty("position", "absolute");
this.af.setStyleProperty("display", "none");
c.append(this.af);
this.j = new DOMEventProxy(this.ai, this.ad, false);
let g = this.j;
g.onMouseOver = delegateCombine(g.onMouseOver, runOn(this, this.an));
let h = this.j;
h.onMouseLeave = delegateCombine(h.onMouseLeave, runOn(this, this.am));
let i = this.j;
i.onMouseDown = delegateCombine(i.onMouseDown, runOn(this, this.al));
let j = this.j;
j.onMouseUp = delegateCombine(j.onMouseUp, runOn(this, this.ao));
this.as();
}
aa() {
let a = this.ak("ui-funnel-slice", "border-top-width", -1);
return (a == null) ? -1 : parseInt(a);
}
m() {
let a = this.l;
if (a == null) {
this.l = FontUtil.getFontForClass(this.ad, "ui-funnel-slice");
a = this.l;
}
return a;
}
n() {
let a = this.k;
if (a == null) {
this.k = a = FontUtil.getFont(this.ad);
}
return a;
}
ab() {
let a = this.z;
if (a < 0) {
let b = this.l;
a = FontUtil.getCurrentFontHeight(this.ad, b);
this.z = a;
}
return a;
}
ac() {
let a = this.y;
if (a < 0) {
let b = this.k;
a = FontUtil.getCurrentFontHeight(this.ad, b);
this.y = a;
}
return a;
}
d(a) {
if (this.c != null) {
return a ? this.c : this.e;
}
let b = BrushUtil.h("chart", this.ad, this.c, this.e);
this.c = b.p2;
this.e = b.p3;
return a ? this.c : this.e;
}
ak(a, b, c) {
let d = this.af;
if (d == null) {
return null;
}
d.addClass(a);
let e = d.getStyleProperty(b);
if (e == null || e.length == 0 || e == "null" || e == "transparent") {
e = null;
}
if (c >= 0) {
let f = new Brush();
if (e != null && e.length != stringReplace(e, "(0, 0, 0, 0", "").length) {
e = null;
}
f._fill = e == null ? XamFunnelView.a[c % XamFunnelView.a.length] : e;
this.c.item(c, f);
let g = null;
if (e != null) {
g = d.getStyleProperty("border-top-color");
if (g == null || g.length == 0 || g == "null" || g == "transparent") {
g = e;
}
}
f = new Brush();
f._fill = (g == null) ? XamFunnelView.b[c % XamFunnelView.b.length] : g;
this.e.item(c, f);
}
d.removeClass(a);
return e;
}
a7(a, b, c) {
let d = new PropertyChangedMessage();
d.g = a;
d.e = b;
d.d = c;
this.f.i(d);
}
constructor() {
super();
this.g = null;
this.h = null;
this.f = null;
this.bg = null;
this.ad = null;
this.ae = null;
this.ah = null;
this.ai = null;
this.ag = null;
this.af = null;
this.o = null;
this.q = null;
this.r = null;
this.p = null;
this.j = null;
this.be = null;
this.bf = null;
this.k = null;
this.l = null;
this.x = -1;
this.y = -1;
this.z = -1;
this.u = 0;
this.v = 0;
this.aj = null;
this.c = null;
this.e = null;
this.t = 1;
this.w = NaN;
this.t = 1;
this.w = NaN;
this.f = new MessageChannel();
this.a9();
this.a8();
let a = this.g = new MessageHandler();
a.b(ClearMessage.$, runOn(this, this.ap));
a.b(RenderSliceMessage.$, runOn(this, this.a6));
a.b(RenderOuterLabelMessage.$, runOn(this, this.a5));
a.b(SetAreaSizeMessage.$, runOn(this, this.ba));
a.b(TooltipValueChangedMessage.$, runOn(this, this.bc));
a.b(TooltipUpdateMessage.$, runOn(this, this.bb));
a.b(ClearTooltipMessage.$, runOn(this, this.ar));
a.b(PropertyChangedMessage.$, runOn(this, this.a3));
a.b(ContainerSizeChangedMessage.$, (b) => this.as());
this.as();
}
av(a) {
let b = a.b4;
let c = a.by;
if (!isNaN_(b) && b != 0) {
return;
}
if (window.devicePixelRatio != undefined && window.devicePixelRatio != c) {
a.by = window.devicePixelRatio;
}
}
aw(a) {
this.g.c(a);
}
a1(a, b) {
if (a != null) {
let c = typeCast(MessageChannel.$, a.b("RenderingMessages"));
if (c != null) {
c.h(runOn(this, this.aw));
}
this.f.g();
}
if (b != null) {
let d = typeCast(MessageChannel.$, b.b("RenderingMessages"));
if (d != null) {
d.e(runOn(this, this.aw));
}
let e = typeCast(MessageChannel.$, b.b("InteractionMessages"));
this.f.f(e);
}
}
bd(a, b, c, d, e) {
a.setAttribute("width", b.toString());
a.setAttribute("height", c.toString());
a.setStyleProperty("width", d.toString() + "px");
a.setStyleProperty("height", e.toString() + "px");
}
as() {
if (this.ad == null) {
return;
}
let a = this.ad.rootWrapper.width();
let b = this.ad.rootWrapper.height();
this.bg = new Rect(0, 0, 0, a, b);
if (this.j != null) {
this.j.bl = this.bg;
}
this.bd(this.ae, a * this.t, b * this.t, a, b);
this.bd(this.ah, a * this.t, b * this.t, a, b);
this.bd(this.ag, a * this.t, b * this.t, a, b);
this.bd(this.ai, a * this.t, b * this.t, a, b);
let c = new ViewportChangedMessage();
c.e = a;
c.d = b;
this.f.i(c);
}
a0() {
this.as();
}
a9() {
let a = new ViewPropertyChangedMessage();
a.g = "OuterLabelWidthDecider";
a.e = null;
a.d = typeCast(IOuterLabelWidthDecider_$type, this);
this.f.i(a);
}
a8() {
let a = new ViewPropertyChangedMessage();
a.g = "FunnelLabelSizeDecider";
a.e = null;
a.d = typeCast(IFunnelLabelSizeDecider_$type, this);
this.f.i(a);
}
decideWidth(a) {
let b = a == null ? null : a.a;
if (b == null) {
return 0;
}
let c = 0;
this.p.ae(this.n());
for (let d of fromEnum(b)) {
if (d != null) {
c = Math.max(this.p.g(d.toString()), c);
}
}
return c;
}
decideLabelSize(a, b) {
let c = 0;
if (a.b.i) {
this.p.ae(this.m());
c = this.p.g(a.b.ab.toString());
}
return new Size(1, c, b ? this.ab() : this.ac());
}
s(a, f_) {
if (f_ == null) {
return true;
}
let b = a.a;
let c_ = this.ad;
c_ = c_ ? c_.data('igFunnelChart') : null;
if (b == null || c_ == null) {
return false;
}
let i_ = b.count;
let c = new Array(i_);
while (i_-- > 0) {
let v_ = b.item(i_);
c[i_] = f_(v_, i_, c_);
}
a.b(c);
return true;
}
au() {
}
a2() {
}
}
XamFunnelView.$t = /*@__PURE__*/ markType(XamFunnelView, 'XamFunnelView', Base.$, [IOuterLabelWidthDecider_$type, IFunnelLabelSizeDecider_$type]);
XamFunnelView.a = ["#7000ff", "#70ff00", "#00f0f0", "#ff0070", "#ff00ff"];
XamFunnelView.b = ["#7000dd", "#70dd00", "#00d0d0", "#dd0070", "#dd00dd"];
return XamFunnelView;
})();
/**
* @hidden
*/
export let XamFunnelController = /*@__PURE__*/ (() => {
class XamFunnelController extends Base {
constructor() {
super();
this.bs = null;
this.ag = null;
this.av = null;
this.ck = null;
this.cl = null;
this.cg = null;
this.ch = null;
this.bd = false;
this.bj = false;
this.aw = null;
this.aj = null;
this.z = null;
this.am = null;
this.al = null;
this.aq = null;
this.ar = null;
this.cq = null;
this.cn = null;
this.cm = null;
this.a6 = false;
this.bz = 0;
this.by = 0;
this.w = null;
this.v = null;
this.t = null;
this.p = null;
this.a2 = false;
this.a5 = false;
this.bx = 0;
this.a4 = false;
this.bt = 0;
this.a = null;
this.b = null;
this.ad = 0;
this.m = 0;
this.az = false;
this.bw = 0;
this.a7 = false;
this.d0 = null;
this.dz = null;
this.ay = false;
this.ca = 0;
this.cb = 0;
this.r = null;
this.ab = null;
this.ah = null;
this.g = null;
this.e = null;
this.f = null;
this.d5 = null;
this.d6 = null;
this.a9 = false;
this.a3 = false;
this.a8 = false;
this.a1 = false;
this.ea = 1;
this.bu = 0.5;
this.cp = null;
this.co = null;
this.bv = -1;
this.a0 = false;
this.l = null;
this.o = null;
this.du = null;
this.dt = null;
this.d4 = null;
this.ax = new DoubleAnimator(0, 1, 2000);
let a = this.ax;
a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.c4));
this.k = new FunnelFrame();
this.j = new FunnelFrame();
this.h = new FunnelFrame();
this.ai = new SliceSelectionManager();
this.ao = new DoubleColumn();
this.an = new DoubleColumn();
this.at = new ObjectColumn();
this.au = new ObjectColumn();
this.y = new MessageChannel();
this.x = new MessageChannel();
this.aa = new MessageHandler();
this.aa.b(PropertyChangedMessage.$, runOn(this, this.dj));
this.aa.b(DataUpdatedMessage.$, runOn(this, this.c0));
this.aa.b(ViewportChangedMessage.$, runOn(this, this.dr));
this.aa.b(ViewPropertyChangedMessage.$, runOn(this, this.ds));
this.aa.b(MouseMoveMessage.$, runOn(this, this.da));
this.aa.b(MouseButtonMessage.$, runOn(this, this.c8));
this.aa.b(MouseLeaveMessage.$, runOn(this, this.c9));
this.aa.b(UserSelectedItemsChangedMessage.$, runOn(this, this.dq));
this.aa.b(LabelSizeChangedMessage.$, runOn(this, this.c6));
this.aa.b(ContainerSizeChangedMessage.$, (b) => this.y.i(b));
this.bs = (b, c) => {
this.bm = true;
this.dk();
};
}
c4(a, b) {
this.b7 = this.ax.o;
if (this.b7 == 1) {
this.bb = false;
this.c1(this.h);
}
if (this.bb) {
let c = 1 - this.b7;
FunnelFrame.k(this.j, this.k, this.h, this.b7);
this.c1(this.j);
}
}
get ax() {
return this.aw;
}
set ax(a) {
this.aw = a;
}
get ak() {
return this.aj;
}
set ak(a) {
this.aj = a;
}
get aa() {
return this.z;
}
set aa(a) {
this.z = a;
}
get ao() {
return this.am;
}
set ao(a) {
this.am = a;
}
get an() {
return this.al;
}
set an(a) {
this.al = a;
}
get at() {
if (!this.bd && this.av != null) {
this.bd = this.av.s(this.aq, this.cg);
}
return this.aq;
}
set at(a) {
this.aq = a;
}
get au() {
if (!this.bj && this.av != null) {
this.bj = this.av.s(this.ar, this.ch);
}
return this.ar;
}
set au(a) {
this.ar = a;
}
get cv() {
return this.cq;
}
set cv(a) {
this.cq = a;
}
get cs() {
return this.cn;
}
set cs(a) {
this.cn = a;
}
get cr() {
return this.cm;
}
set cr(a) {
this.cm = a;
}
get bm() {
return this.a6;
}
set bm(a) {
this.a6 = a;
}
get b9() {
return this.bz;
}
set b9(a) {
this.bz = a;
}
get b8() {
return this.by;
}
set b8(a) {
this.by = a;
}
get y() {
return this.w;
}
set y(a) {
this.w = a;
}
get x() {
return this.v;
}
set x(a) {
this.v = a;
}
get u() {
return this.t;
}
set u(a) {
this.t = a;
}
get q() {
return this.p;
}
set q(a) {
this.p = a;
}
get be() {
return this.a2;
}
set be(a) {
this.a2 = a;
}
get bk() {
return this.a5;
}
set bk(a) {
this.a5 = a;
}
get b7() {
return this.bx;
}
set b7(a) {
this.bx = a;
}
get bg() {
return this.a4;
}
set bg(a) {
this.a4 = a;
}
get b0() {
return this.bt;
}
set b0(a) {
this.bt = a;
}
get c() {
if ((this.a == null || this.a.count < 1) && this.av != null) {
this.a = this.av.d(true);
}
return this.a;
}
set c(a) {
this.a = a;
}
get d() {
if ((this.b == null || this.b.count < 1) && this.av != null) {
this.b = this.av.d(false);
}
return this.b;
}
set d(a) {
this.b = a;
}
get ae() {
return this.ad;
}
set ae(a) {
this.ad = a;
}
get n() {
return this.m;
}
set n(a) {
this.m = a;
}
get bb() {
return this.az;
}
set bb(a) {
this.az = a;
}
get b6() {
return this.bw;
}
set b6(a) {
this.bw = a;
}
get bp() {
return this.a7;
}
set bp(a) {
this.a7 = a;
}
get d3() {
return this.d0;
}
set d3(a) {
this.d0 = a;
}
get d2() {
return this.dz;
}
set d2(a) {
this.dz = a;
}
get ba() {
return this.ay;
}
set ba(a) {
this.ay = a;
}
get ce() {
return this.ca;
}
set ce(a) {
this.ca = a;
}
get cf() {
return this.cb;
}
set cf(a) {
this.cb = a;
}
get s() {
return this.r;
}
set s(a) {
this.r = a;
}
get ac() {
return this.ab;
}
set ac(a) {
let b = this.ab;
this.ab = a;
this.dc(b, this.ab);
}
get ai() {
return this.ah;
}
set ai(a) {
this.ah = a;
}
get k() {
return this.g;
}
set k(a) {
this.g = a;
}
get h() {
return this.e;
}
set h(a) {
this.e = a;
}
get j() {
return this.f;
}
set j(a) {
this.f = a;
}
get d8() {
return this.d5;
}
set d8(a) {
this.d5 = a;
}
get d9() {
return this.d6;
}
set d9(a) {
this.d6 = a;
}
get br() {
return this.a9;
}
set br(a) {
this.a9 = a;
}
get bf() {
return this.a3;
}
set bf(a) {
this.a3 = a;
}
get bq() {
return this.a8;
}
set bq(a) {
this.a8 = a;
}
get bc() {
return this.a1;
}
set bc(a) {
this.a1 = a;
}
get eb() {
return this.ea;
}
set eb(a) {
this.ea = a;
}
get b3() {
return this.bu;
}
set b3(a) {
this.bu = a;
}
get cu() {
return this.cp;
}
set cu(a) {
this.cp = a;
}
get ct() {
return this.co;
}
set ct(a) {
this.co = a;
}
get b4() {
let a = this.bv;
if (a < 0 && this.av != null) {
this.bv = this.av.aa();
a = this.bv;
}
return a < 0 ? 1 : a;
}
dc(a, b) {
if (a != null) {
let c = typeCast(MessageChannel.$, a.b("ConfigurationMessages"));
if (c != null) {
c.h(runOn(this, this.c7));
}
c = typeCast(MessageChannel.$, a.b("InteractionMessages"));
if (c != null) {
c.h(runOn(this, this.c7));
}
this.y.g();
this.x.g();
}
if (b != null) {
let d = typeCast(MessageChannel.$, b.b("ConfigurationMessages"));
if (d != null) {
d.e(runOn(this, this.c7));
}
d = typeCast(MessageChannel.$, b.b("InteractionMessages"));
if (d != null) {
d.e(runOn(this, this.c7));
}
let e = typeCast(MessageChannel.$, b.b("RenderingMessages"));
this.y.f(e);
let f = typeCast(MessageChannel.$, b.b("ModelUpdateMessages"));
this.x.f(f);
}
this.bm = true;
}
c7(a) {
this.aa.c(a);
let b = typeCast(RenderingMessage.$, a);
if (b != null) {
this.bm = b.c;
}
this.dk();
}
bo() {
return this.b8 >= 0 && this.b9 >= 0;
}
bh() {
return this.ao != null && this.ao.a != null && this.ao.a.count > 0 && (this.an == null || this.an.a == null || (this.an.a.count == 0 || this.an.a.count == this.ao.a.count)) && this.u != null && this.q != null && this.c != null && this.c.count > 0 && this.d != null && this.d.count > 0 && this.bo();
}
dk() {
if (!this.bm) {
return;
}
this.cz();
if (!this.bh()) {
return;
}
this.bm = false;
let a = this.u.decideWidth(this.as());
if (a > this.b9) {
a = 0;
}
if (!this.bk) {
a = 0;
}
let b = this.b9 - a;
let c = a > 0;
let d = this.be;
let e = b >= 0;
if (e || c) {
this.dh(e, c, d, b, a);
}
}
cz() {
if (this.bn() && this.b7 > 0) {
this.ax.w();
}
this.dm("LeftLabels");
this.dm("RightLabels");
this.dm("SliceArea");
this.cy();
this.h.b.clear();
this.j.b.clear();
this.k.b.clear();
}
cy() {
let a = new FrameRenderCompleteMessage();
this.y.i(a);
}
dh(a, b, c, d, e) {
if (this.bb) {
let f = this.k;
this.k = this.j;
this.j = f;
}
else {
let g = this.k;
this.k = this.h;
this.h = g;
}
this.di(this.h, a, b, c, d, e);
this.ax.w();
this.b7 = 0;
if (this.bn()) {
FunnelFrame.k(this.j, this.k, this.h, this.b7);
this.c1(this.j);
this.bb = true;
this.ax.v();
}
else {
this.c1(this.h);
}
}
b5(a) {
if (isNaN_(a)) {
return 0;
}
return Math.abs(a);
}
di(a, b, c, d, e, f) {
let g = e / 2;
this.a0 = this.bp;
if (this.a0) {
this.c5(e, g);
}
else {
this.ak = null;
}
let h = this.n == 1;
let i = this.ap();
let j = 0;
for (let k of fromEnum(i.a)) {
j += this.b5(this.ao.a.item(k));
}
if (j == 0) {
h = false;
}
let l = this.b8 / i.a.count;
let m = 0;
let n = 0;
n = this.b4 / 2;
a.j = f;
a.f = d;
a.h = c;
a.g = this.ae == 0;
a.b = new SliceInfoList();
let o = 0;
for (let p of fromEnum(i.a)) {
let q;
if (h) {
q = (this.b5(this.ao.a.item(p)) / j) * this.b8;
}
else {
q = l;
}
let r = this.b2(e, m + n);
let s = m + q;
let t = this.b2(e, s - n);
let u = r / 2;
let v = t / 2;
let w = new SliceInfo();
let x = w.b;
x.q = m;
x.p = s;
let y = new Rect(4);
let z = new Rect(4);
let aa = 0;
if (v > u) {
aa = g - v;
}
else {
aa = g - u;
}
let ab = m;
x.bm = this.eb;
x.r = this.b3;
x.ae(this.dx(p), this.dy(p), x.r, this.eb == 0);
x.bj = this.d7(p);
x.j = this.ai.c(p);
if (b) {
w.h = true;
x.a8 = { $type: Point_$type, x: g - u - aa + n, y: m - ab + n };
x.a9 = { $type: Point_$type, x: g + u - aa - n, y: m - ab + n };
x.a5 = { $type: Point_$type, x: g - v - aa + n, y: s - ab - n };
x.a6 = { $type: Point_$type, x: g + v - aa - n, y: s - ab - n };
x.a3 = x.a9;
x.a2 = x.a8;
if (this.a0) {
this.cw(x, m + n, s - n, g, aa - n, ab);
}
}
if (d) {
x.i = true;
x.a4 = { $type: Point_$type, x: g - aa, y: (m + s) / 2 - ab };
x.ab = this.ci(p);
let ac = this.q.decideLabelSize(w, true);
if (ac.width > e) {
x.i = false;
}
if (ac.height > q) {
x.i = false;
}
y.height = ac.height;
y.width = ac.width;
y.x = x.a4.x;
y.y = x.a4.y;
x.bg = y;
}
else {
x.i = false;
x.ab = this.ci(p);
}
if (d || b) {
x.a7 = { $type: Point_$type, x: aa, y: ab };
x.item = this.ao.a.item(p);
x.w = p;
}
if (b) {
if (this.an != null && this.an.a != null && !isNaN_(this.an.a.item(p))) {
x.aa = this.an.a.item(p);
x.af();
let ad = x.s;
let ae = x.a8;
let af = x.a5;
let ag = x.a6;
let ah = (af.x - ae.x) * ad;
let ai = af.y - (af.y - ae.y) * ad;
x.a2 = { $type: Point_$type, x: af.x - ah, y: ai };
x.a3 = { $type: Point_$type, x: ag.x + ah, y: ai };
x.ah();
}
x.ad();
}
if (c) {
w.g = true;
w.n = { $type: Point_$type, x: 0, y: (m + s) / 2 };
w.l = this.cj(p);
let aj = this.q.decideLabelSize(w, false);
if (aj.height > q) {
w.g = false;
}
z.height = aj.height;
z.width = aj.width;
y.x = w.n.x;
y.y = w.n.y;
x.bh = z;
}
else {
w.g = false;
w.l = this.cj(p);
}
w.j = p;
a.b.add(w);
m += q;
o++;
}
if ((this.at != null && this.at.a != null && this.at.a.count > 0) || (this.au != null && this.au.a != null && this.au.a.count > 0)) {
this.dl(a);
}
a.b.ae();
}
cw(a, b, c, d, e, f) {
let g = this.ak.b(b);
let h = this.ak.b(c);
let i = new PointList();
let j = new PointList();
let k = g.b;
let l = h.b;
for (let m = k; m <= l; m++) {
i.add({ $type: Point_$type, x: this.ak.e._inner[m].c.x - e, y: this.ak.e._inner[m].c.y - f });
}
e += this.b4;
for (let n = l; n >= k; n--) {
let o = this.ak.e._inner[n].c;
j.add({ $type: Point_$type, x: d + d - o.x - e, y: o.y - f });
}
a.c = i;
a.e = j;
}
bl(a, b) {
if (a.x != b.x || a.y != b.y) {
return true;
}
return false;
}
c5(a, b) {
let c;
let d;
let e = 0, f = this.b8;
e = this.b4 / 2;
f -= e;
if (this.bf) {
c = { $type: Point_$type, x: b - (a * this.b0 / 2), y: e };
d = { $type: Point_$type, x: b - (a / 2), y: f };
}
else {
c = { $type: Point_$type, x: b - (a / 2), y: e };
d = { $type: Point_$type, x: b - (a * this.b0 / 2), y: f };
}
let g = this.d3.y < this.d2.y ? this.d3 : this.d2;
let h = this.d2.y > this.d3.y ? this.d2 : this.d3;
if (g.y < 0) {
g.y = 0;
}
if (h.y > 1) {
h.y = 1;
}
if (this.bf) {
let i = h.x;
h.x = g.x;
g.x = i;
i = g.y;
g.y = 1 - h.y;
h.y = 1 - i;
}
let j = { $type: Point_$type, x: a * g.x, y: this.b8 * g.y };
let k = { $type: Point_$type, x: a * h.x, y: this.b8 * h.y };
if (this.ak == null || this.bl(c, this.ak.q) || this.bl(j, this.ak.r) || this.bl(k, this.ak.s) || this.bl(d, this.ak.t)) {
this.ak = new Bezier(c, j, k, d, 2, b);
}
if (this.ak == null) {
this.a0 = false;
}
else {
this.a0 = this.ak.d;
}
}
cj(a) {
let b = this.au;
let c = b == null ? null : b.a;
return c == null || a >= c.count ? null : c.item(a);
}
ci(a) {
let b = this.at;
let c = b == null ? null : b.a;
return c == null || a >= c.count ? null : c.item(a);
}
d7(a) {
if (this.ai.c(a)) {
return this.d8;
}
if (this.ai.d(a) && this.br) {
return this.d9;
}
return null;
}
dy(a) {
return this.d.item(a % this.d.count);
}
dx(a) {
return this.c.item(a % this.c.count);
}
b2(a, b) {
let c = a * this.b0;
if (this.a0) {
let d = this.ak.b(b).c.x;
return ((a / 2) - d) * 2;
}
else {
if (this.bf) {
return a - ((a - c) * ((this.b8 - b) / this.b8));
}
else {
return a - ((a - c) * (b / this.b8));
}
}
}
ap() {
let a = new IntColumn();
a.b(this.ao.a.count);
a.c((b, c) => {
if (this.ao.a.item(b) < this.ao.a.item(c)) {
return this.bf ? -1 : 1;
}
if (this.ao.a.item(b) > this.ao.a.item(c)) {
return this.bf ? 1 : -1;
}
return 0;
});
return a;
}
c1(a) {
this.c2(a);
}
c3() {
if (this.l != null) {
this.c2(this.l);
}
}
c2(a) {
this.dm("LeftLabels");
this.dm("RightLabels");
this.dm("SliceArea");
if (a.g) {
this.dn("LeftPanel", a.j);
this.dn("RightPanel", 0);
}
else {
this.dn("LeftPanel", 0);
this.dn("RightPanel", a.j);
}
this.ag = a.b;
for (let b of fromEnum(a.b)) {
if (b.h) {
let c = new RenderSliceMessage();
c.e = "SliceArea";
c.g = b.b;
c.h = this.b4;
this.y.i(c);
}
}
for (let d of fromEnum(a.b)) {
if (d.g) {
let e = new RenderOuterLabelMessage();
if (a.g) {
e.e = "LeftLabels";
}
else {
e.e = "RightLabels";
}
e.j = d.l;
e.l = d.n;
e.h = a.j;
e.f = d;
this.y.i(e);
}
}
let f = new FrameRenderCompleteMessage();
this.y.i(f);
}
dn(a, b) {
let c = new SetAreaSizeMessage();
c.e = a;
c.i = true;
c.m = b;
this.y.i(c);
}
bn() {
return this.b6 > 0;
}
dm(a) {
let b = new ClearMessage();
b.e = a;
this.y.i(b);
}
as() {
return this.au;
}
c0(a) {
this.bm = true;
}
cc(a) {
return Convert.toInt32(a);
}
dj(a) {
let b = a;
let c = b.d;
switch (b.g) {
case "TextStyle":
this.cu = c != null ? c.toString() : "";
let d = new PropertyChangedMessage();
d.g = b.g;
d.e = b.e;
d.d = c;
this.y.i(d);
this.bm = true;
break;
case "OuterLabelTextStyle":
this.ct = c != null ? c.toString() : "";
let e = new PropertyChangedMessage();
e.g = b.g;
e.e = b.e;
e.d = c;
this.y.i(e);
this.bm = true;
break;
case "ValueColumn":
this.ao.b(c);
this.bm = true;
break;
case "HighlightValueColumn":
this.an.b(c);
this.bm = true;
break;
case "ActualHighlightValueDisplayMode":
this.eb = EnumUtil.getEnumValue(HighlightedValueDisplayMode_$type, c) == 2 ? 0 : 1;
this.bm = true;
break;
case "ActualHighlightValueOpacity":
this.b3 = c;
this.bm = true;
break;
case "InnerLabelColumn":
this.bd = false;
this.ck = c;
this.at.b(c);
this.bm = true;
break;
case "InnerLabelVisibility":
this.be = c;
this.bm = true;
break;
case "OuterLabelVisibility":
this.bk = c;
this.bm = true;
break;
case "OuterLabelColumn":
this.bj = false;
this.cl = c;
this.au.b(c);
this.bm = true;
break;
case "ValueMemberPath":
this.cv = typeCast(String_$type, c);
break;