igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
291 lines (290 loc) • 9.59 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 { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { typeCast, Array_$type, runOn, markType } from "igniteui-react-core";
import { ISortingAxis_$type } from "./ISortingAxis";
import { List$1 } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ChartSelection } from "./ChartSelection";
import { intDivide, isNaN_ } from "igniteui-react-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { Defaults } from "./Defaults";
import { Color } from "igniteui-react-core";
/**
* @hidden
*/
export let StepLineSeries = /*@__PURE__*/ (() => {
class StepLineSeries extends HorizontalAnchoredCategorySeries {
bk() {
return new StepLineSeries();
}
get_fl() {
return true;
}
get_f2() {
return true;
}
get_fm() {
return true;
}
ct() {
return new StepLineSeriesView(this);
}
zt() {
return true;
}
q3(a) {
super.q3(a);
this.ac4 = a;
}
constructor() {
super();
this.ac3 = null;
this.ac3 = new CategoryLineRasterizer();
this.ab = StepLineSeries.$;
}
ac() {
super.ac();
}
preferredCategoryMode(a) {
return typeCast(ISortingAxis_$type, a) !== null ? 0 : 1;
}
get_ex() {
return true;
}
o7(a, b) {
super.o7(a, b);
let c = b;
c.du();
}
b3() {
if (this.b4 == 0) {
return 2;
}
else {
return super.b3();
}
}
iw(a, b, c, d, e, f, g, h) {
let i = NaN;
if (c >= 0 && c < b.count) {
i = b.item(c);
}
let j = NaN;
if (d >= 0 && d < b.count) {
j = b.item(d);
}
if (f == 0) {
return j;
}
if (e == b.count - 1) {
return i;
}
if (isNaN_(j) && g != 0 && a <= 0.5 && !h) {
return i;
}
if (isNaN_(i) && g != 0 && a >= 0.5 && !h) {
return j;
}
if (a > 0.5) {
return j;
}
return i;
}
ac5(a, b, c, d, e, f) {
let g;
if (b) {
if (f) {
g = (a & 1) == 0;
if (g || (intDivide(a, 2)) + 1 < 0) {
return c.h._inner[(intDivide(a, 2))][0];
}
if (c.h.count == (intDivide(a, 2)) + 1) {
return c.h._inner[(intDivide(a, 2))][0];
}
return c.h._inner[(intDivide(a, 2)) + 1][0];
}
g = (a & 1) == 0;
return c.h._inner[(intDivide(a, 2))][0] + (g ? d : -d);
}
if (f) {
g = (a & 1) == 0;
if (g || ((intDivide(a, 2)) + 1) >= c.h.count) {
return c.h._inner[(intDivide(a, 2))][0];
}
if (c.h.count == (intDivide(a, 2)) + 1) {
return c.h._inner[(intDivide(a, 2))][0];
}
return c.h._inner[(intDivide(a, 2)) + 1][0];
}
g = (a & 1) == 0;
return c.h._inner[(intDivide(a, 2))][0] + (g ? -d : d);
}
aas(a, b) {
super.aas(a, b);
let c = b.ca;
let d = b.b9;
let e = this.getEffectiveViewport1(b);
let f = typeCast(ISortingAxis_$type, this.ack) != null;
let g = this.ack.ch;
let h = 0;
if (this.ack != null) {
h = 0.5 * this.ack.getCategorySize(c, d, e);
}
let i = a.h;
let j = 2 * i.count;
let k = new List$1(Array_$type, 2, j);
if (!this.ack.ch) {
for (let l = 0; l < j; l++) {
let m = new Array(4);
m[0] = this.ac5(l, false, a, h, g, f);
m[1] = a.h._inner[(intDivide(l, 2))][1];
m[2] = this.ac5(l, true, a, h, g, f);
m[3] = a.h._inner[(intDivide(l, 2))][2];
k.add(m);
}
}
else {
for (let n = 0; n < j; n++) {
let o = new Array(4);
o[0] = this.ac5(n, true, a, h, g, f);
o[1] = a.h._inner[(intDivide(n, 2))][1];
o[2] = this.ac5(n, true, a, h, g, f);
o[3] = a.h._inner[(intDivide(n, 2))][2];
k.add(o);
}
}
let p = typeCast(StepLineSeriesView.$, b);
let q = p.c9.d;
this.y7.a2(this, this.zr(), runOn(this, this.yr), this.z0(b), this.z1(b));
let r = false;
let s = this.y7.b;
if (s != null) {
r = true;
}
if (r) {
let t = new ScalerParams(0, b.ca, b.b9, this.ack.ch, e);
this.aao(i, -1, this.valueColumn.count, this.ack, t, b.t, -1);
}
let u = p.d0;
let v = p.d1;
let w = p.dz;
this.y7.ad(u, true, false, true, false);
this.y7.ad(v, true, false, true, false);
this.y7.ad(w, false, true, false, false);
w._opacity = 0.75 * this.y7.j;
if (b.dd(a)) {
p.dv(j, k, false, 1, this.aa0(k, j - 1, b.b9, b.ca), q, this.ie);
b.dg(a);
}
}
p6(a, b, c) {
this.aak(a, b, c, this.yy, 0);
}
ak(a, b) {
let c = new List$1(ChartSelection.$, 0);
this.p6(a, c, b);
return c.toArray();
}
get useHighMarkerFidelity() {
return this.zv;
}
}
StepLineSeries.$t = /*@__PURE__*/ markType(StepLineSeries, 'StepLineSeries', HorizontalAnchoredCategorySeries.$);
return StepLineSeries;
})();
/**
* @hidden
*/
export let StepLineSeriesView = /*@__PURE__*/ (() => {
class StepLineSeriesView extends AnchoredCategorySeriesView {
constructor(a) {
super(a);
this.dt = null;
this.d3 = new Path();
this.d2 = new Path();
this.d4 = new Path();
this.dy = new Path();
this.dx = new Path();
this.dw = new Path();
this.dt = a;
}
a4() {
super.a4();
if (!this.t) {
this.dt.xf = Defaults.c;
}
}
get d0() {
return this.d3;
}
get d1() {
return this.d4;
}
get dz() {
return this.d2;
}
du() {
this.d2.an = null;
this.d3.an = null;
this.d4.an = null;
this.a2();
}
dv(a, b, c, d, e, f, g) {
this.dt.ac3.a = typeCast(ISortingAxis_$type, this.db.fetchXAxis()) !== null ? true : false;
this.dt.ac3.m(this.d3, this.d2, this.d4, a, b, c, d, e, f, g);
this.a2();
}
bq() {
super.bq();
this.dx.an = this.d3.an;
this.dy.an = this.d4.an;
this.dw.an = this.d2.an;
let a = this.b3();
this.dx._stroke = a;
this.dx.ad = this.f.ig + 3;
this.dy._stroke = a;
this.dy.ad = this.f.ig + 3;
this.dw._fill = a;
this.dw._opacity = 1;
}
bj(a, b) {
super.bj(a, b);
if (a.d) {
if (b) {
a.t(this.dw);
a.t(this.dx);
a.t(this.dy);
}
else {
a.t(this.d2);
a.t(this.d3);
a.t(this.d4);
}
}
}
ax(a) {
super.ax(a);
this.f.bc.exportPathData(a, this.d3, "lowerShape", ["Lower", "Main"]);
this.f.bc.exportPathData(a, this.d4, "upperShape", ["Upper"]);
this.f.bc.exportPathData(a, this.d2, "translucentShape", ["Translucent"]);
}
an() {
let a = new Color();
a.colorString = "rgba(95,95,95,0.5)";
this.f.v6 = a;
this.f.jn = 3;
this.f.jo = 1;
this.f.jp = 4;
this.f.hd = false;
}
}
StepLineSeriesView.$t = /*@__PURE__*/ markType(StepLineSeriesView, 'StepLineSeriesView', AnchoredCategorySeriesView.$);
return StepLineSeriesView;
})();