@graphysdk/react 2.0.0-beta.1788419223711 → 2.0.0-beta.1788422115078

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18865,68 +18865,71 @@ var fg = Object.freeze({
18865
18865
  grandTotal: n,
18866
18866
  absoluteGrandTotal: r
18867
18867
  };
18868
- }, Zfe = ({ layer: e }) => {
18868
+ }, Zfe = ({ layer: e, mainAxis: t }) => {
18869
18869
  if (e.position !== "stack") return;
18870
- const t = we(e.mapping.x);
18871
- if (t === null || !e.data.hasVariable(fe.yMin) || !e.data.hasVariable(fe.yMax)) return;
18872
- const n = /* @__PURE__ */ new Map();
18873
- for (const o of e.data) {
18874
- const i = o[t], a = yr(o), s = Vn(o), l = Xr(o), c = Or(o), u = kN(o);
18875
- if (!he(i) || !he(a) || !he(s) || !he(l) || !he(c) || !he(u)) continue;
18876
- const d = u >= 0;
18877
- if (Math.abs(u) === 0) continue;
18878
- const f = WT(o, t), h = {
18879
- yMin: a,
18880
- yMax: s
18881
- }, p = n.get(f);
18882
- if (p === void 0) {
18883
- n.set(f, {
18884
- total: u,
18885
- topPositive: d ? h : null,
18886
- bottomNegative: d ? null : h,
18887
- anchorXMin: l,
18888
- anchorXMax: c
18870
+ const n = we(e.mapping.x);
18871
+ if (n === null || !e.data.hasVariable(fe.yMin) || !e.data.hasVariable(fe.yMax)) return;
18872
+ const r = (s) => t === "y" ? s.xMax : s.yMax, o = (s) => t === "y" ? s.xMin : s.yMin, i = /* @__PURE__ */ new Map();
18873
+ for (const s of e.data) {
18874
+ const l = s[n], c = yr(s), u = Vn(s), d = Xr(s), f = Or(s), h = kN(s);
18875
+ if (!he(l) || !he(c) || !he(u) || !he(d) || !he(f) || !he(h)) continue;
18876
+ const p = h >= 0;
18877
+ if (Math.abs(h) === 0) continue;
18878
+ const g = WT(s, n), v = {
18879
+ xMin: d,
18880
+ xMax: f,
18881
+ yMin: c,
18882
+ yMax: u
18883
+ }, y = i.get(g);
18884
+ if (y === void 0) {
18885
+ i.set(g, {
18886
+ total: h,
18887
+ topPositive: p ? v : null,
18888
+ bottomNegative: p ? null : v
18889
18889
  });
18890
18890
  continue;
18891
18891
  }
18892
- p.total += u, d ? (p.topPositive === null || s > p.topPositive.yMax) && (p.topPositive = h) : (p.bottomNegative === null || a < p.bottomNegative.yMin) && (p.bottomNegative = h);
18892
+ y.total += h, p ? (y.topPositive === null || r(v) > r(y.topPositive)) && (y.topPositive = v) : (y.bottomNegative === null || o(v) < o(y.bottomNegative)) && (y.bottomNegative = v);
18893
18893
  }
18894
- const r = [];
18895
- for (const [o, i] of n) {
18896
- const a = i.topPositive ?? i.bottomNegative;
18897
- a !== null && r.push({
18898
- xKey: o,
18899
- total: i.total,
18894
+ const a = [];
18895
+ for (const [s, l] of i) {
18896
+ const c = l.topPositive ?? l.bottomNegative;
18897
+ c !== null && a.push({
18898
+ xKey: s,
18899
+ total: l.total,
18900
18900
  anchor: {
18901
- xMin: i.anchorXMin,
18902
- xMax: i.anchorXMax,
18903
- yMin: a.yMin,
18904
- yMax: a.yMax,
18905
- direction: i.topPositive !== null ? "positive" : "negative"
18901
+ xMin: c.xMin,
18902
+ xMax: c.xMax,
18903
+ yMin: c.yMin,
18904
+ yMax: c.yMax,
18905
+ direction: l.topPositive !== null ? "positive" : "negative"
18906
18906
  }
18907
18907
  });
18908
18908
  }
18909
- return r;
18909
+ return a;
18910
18910
  }, ehe = class extends Ml {
18911
18911
  constructor(e) {
18912
18912
  super(), this.container = e;
18913
18913
  }
18914
- dependencies() {
18915
- return [];
18914
+ dependencies(e) {
18915
+ return [e.coordSystem];
18916
18916
  }
18917
- compileLayer(e) {
18918
- const t = this.container.geomRegistry.get(e.geom), n = {};
18919
- if (t.summaries.stackTotals) {
18920
- const r = Zfe({ layer: e });
18921
- r !== void 0 && (n.stackTotals = r);
18917
+ compileLayer(e, t) {
18918
+ const n = this.container.geomRegistry.get(e.geom), r = {}, o = t.coordSystem.type === "cartesian" ? t.coordSystem.mainAxis : "x";
18919
+ if (n.summaries.stackTotals) {
18920
+ const i = Zfe({
18921
+ layer: e,
18922
+ mainAxis: o
18923
+ });
18924
+ i !== void 0 && (r.stackTotals = i);
18922
18925
  }
18923
- if (t.summaries.grandTotal) {
18924
- const r = Jfe({ layer: e });
18925
- r !== void 0 && (n.grandTotal = r.grandTotal, n.absoluteGrandTotal = r.absoluteGrandTotal);
18926
+ if (n.summaries.grandTotal) {
18927
+ const i = Jfe({ layer: e });
18928
+ i !== void 0 && (r.grandTotal = i.grandTotal, r.absoluteGrandTotal = i.absoluteGrandTotal);
18926
18929
  }
18927
18930
  return {
18928
18931
  ...e,
18929
- summary: n
18932
+ summary: r
18930
18933
  };
18931
18934
  }
18932
18935
  }, b4 = class extends qa {
@@ -19138,7 +19141,10 @@ var ohe = class {
19138
19141
  coordSpec: t.coords,
19139
19142
  coordSystem: r,
19140
19143
  layers: n
19141
- }) })).pipe(({ layers: t }) => ({ layers: this.summariseCompiler.compile({ layers: t }) })).pipe(({ spec: t, scales: n, layers: r, coordSystem: o }) => ({ guides: this.guideCompiler.compile({
19144
+ }) })).pipe(({ layers: t, coordSystem: n }) => ({ layers: this.summariseCompiler.compile({
19145
+ layers: t,
19146
+ coordSystem: n
19147
+ }) })).pipe(({ spec: t, scales: n, layers: r, coordSystem: o }) => ({ guides: this.guideCompiler.compile({
19142
19148
  scales: n,
19143
19149
  config: t.config,
19144
19150
  layers: r,