@milaboratories/miplots4 1.0.141 → 1.0.142

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ChartRenderer.d.ts","sourceRoot":"","sources":["../../src/dendro/ChartRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAER,cAAc,EAGd,SAAS,EACT,gBAAgB,EAGnB,MAAM,UAAU,CAAC;AAMlB,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAc,UAAU,EAAc,MAAM,oBAAoB,CAAC;AAUtG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA4DvD,cAAM,aAAa;IACf,SAAS,EAAE,YAAY,CAAW;IAClC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAQ;IACtC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAQ;IACpC,UAAU,EAAE,UAAU,CAQpB;IAEF,MAAM,EAAE,UAAU,CAAoC;IAGtD,aAAa,EAAE,WAAW,CAGxB;IACF,WAAW,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAgB;IACnD,iBA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,KAAK,IAAI;IAwD3C,WAAW,CAAC,OAAO,EAAE,MAAM;CAG9B;AAED,eAAe,aAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  var V = Object.defineProperty;
2
- var Y = (r, t, e) => t in r ? V(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var H = (r, t, e) => Y(r, typeof t != "symbol" ? t + "" : t, e);
2
+ var Y = (n, t, e) => t in n ? V(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var E = (n, t, e) => Y(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { j as F } from "../node_modules/react/jsx-runtime.js";
5
5
  import { createRoot as Z } from "../node_modules/react-dom/client.js";
6
6
  import { Error as $ } from "../common/Error.js";
@@ -15,81 +15,85 @@ import "../types/histogram.js";
15
15
  import "../types/bubble.js";
16
16
  import { getContinuousLegendTicks as it } from "../utils/getContinuousLegendTicks.js";
17
17
  import { getContinuousLegendWidth as st, getDiscreteLegendWidth as ot } from "../utils/getLegendWidth.js";
18
- import { TextMeasurer as j } from "../utils/TextMeasurer/TextMeasurer.js";
19
- import { Chart as nt } from "./components/Chart.js";
20
- import { HEIGHT as k, WIDTH as P, MARGIN as N, MAX_HEATMAP_WIDTH as rt, COLOR_NULL as O, MAX_LEGEND_HEIGHT as ht, HEATMAP_LEFT_OFFSET as U } from "./constants.js";
18
+ import { TextMeasurer as K } from "../utils/TextMeasurer/TextMeasurer.js";
19
+ import { Chart as rt } from "./components/Chart.js";
20
+ import { MARGIN as N, HEIGHT as k, WIDTH as j, MAX_HEATMAP_WIDTH as nt, COLOR_NULL as G, MAX_LEGEND_HEIGHT as ht, HEATMAP_LEFT_OFFSET as U } from "./constants.js";
21
21
  import { updateLinksHeight as at, updateNodesHorizontalPosition as lt } from "./getHierarchyData.js";
22
22
  import b from "../node_modules/d3-scale/src/ordinal.js";
23
23
  import ct from "../node_modules/d3-scale/src/linear.js";
24
24
  import { sqrt as J } from "../node_modules/d3-scale/src/pow.js";
25
- import dt from "../node_modules/d3-hierarchy/src/cluster.js";
26
- function R(r, t) {
25
+ import pt from "../node_modules/d3-hierarchy/src/cluster.js";
26
+ function O(n, t) {
27
27
  if (X(t))
28
- return (e) => t.valuesMap[String(r.getColumnValue(t.columnName.value, e))];
28
+ return (e) => t.valuesMap[String(n.getColumnValue(t.columnName.value, e))];
29
29
  if (q(t)) {
30
30
  const { domain: e, range: s } = t, c = J().domain(e).range(s);
31
31
  return (h) => {
32
- const o = c(Number(r.getColumnValue(t.columnName.value, h)));
32
+ const o = c(Number(n.getColumnValue(t.columnName.value, h)));
33
33
  return Math.max(1, o);
34
34
  };
35
35
  }
36
36
  return (e) => t;
37
37
  }
38
- function pt(r, t) {
38
+ function dt(n, t) {
39
39
  return {
40
- nodeShape: R(r, t.nodeShape),
41
- nodeColor: R(r, t.nodeColor),
42
- nodeSize: R(r, t.nodeSize),
43
- lineShape: R(r, t.lineShape),
44
- lineColor: R(r, t.lineColor)
40
+ nodeShape: O(n, t.nodeShape),
41
+ nodeColor: O(n, t.nodeColor),
42
+ nodeSize: O(n, t.nodeSize),
43
+ lineShape: O(n, t.lineShape),
44
+ lineColor: O(n, t.lineColor)
45
45
  };
46
46
  }
47
- const ut = (r, t) => {
47
+ const mt = (n, t) => {
48
48
  const e = Math.min(...t), s = Math.max(...t);
49
49
  if (e === s) {
50
- const o = r % 2 === 0 ? [] : [e];
51
- for (let d = 1; d < r / 2 + 1; d++)
52
- o.push(e + d), o.unshift(e - d);
50
+ const o = n % 2 === 0 ? [] : [e];
51
+ for (let p = 1; p < n / 2 + 1; p++)
52
+ o.push(e + p), o.unshift(e - p);
53
53
  return o;
54
54
  }
55
- if (r < 2)
55
+ if (n < 2)
56
56
  return [e, s];
57
- const c = (s - e) / (r - 1), h = [];
58
- for (let o = 0; o < r - 1; o++)
57
+ const c = (s - e) / (n - 1), h = [];
58
+ for (let o = 0; o < n - 1; o++)
59
59
  h.push(e + c * o);
60
60
  return h.push(s), h;
61
61
  };
62
- function mt(r, t = 1, e, s) {
63
- const c = (r < 16 ? 40 : r < 49 ? 32 : 24) * t;
62
+ function ut(n, t = 1, e, s) {
63
+ const c = (n < 16 ? 40 : n < 49 ? 32 : 24) * t;
64
64
  return Math.max(Math.min(c, s ?? 1 / 0), e ?? -1 / 0);
65
65
  }
66
66
  class Ft {
67
67
  constructor() {
68
- H(this, "component", /* @__PURE__ */ F.jsx(F.Fragment, {}));
69
- H(this, "reactRoot", null);
70
- H(this, "parentNode", null);
71
- H(this, "rootNode", null);
72
- H(this, "chartSizes", {
73
- treeWidth: P,
68
+ E(this, "component", /* @__PURE__ */ F.jsx(F.Fragment, {}));
69
+ E(this, "reactRoot", null);
70
+ E(this, "parentNode", null);
71
+ E(this, "rootNode", null);
72
+ E(this, "chartSizes", {
73
+ treeWidth: j,
74
74
  treeHeight: k,
75
75
  heatmapWidth: 0,
76
76
  heatmapHeight: 0,
77
- totalWidth: P + P + N.LEFT + N.RIGHT,
77
+ totalWidth: j + j + N.LEFT + N.RIGHT,
78
78
  totalHeight: k + N.TOP + N.BOTTOM,
79
- labelsOffset: 0
79
+ labelsOffset: 0,
80
+ marginLeft: N.LEFT,
81
+ marginRight: N.RIGHT,
82
+ marginTop: N.TOP,
83
+ marginBottom: N.BOTTOM
80
84
  });
81
- H(this, "legend", { width: 0, height: 0, items: [] });
85
+ E(this, "legend", { width: 0, height: 0, items: [] });
82
86
  // heatmap scales and step
83
- H(this, "heatmapScales", {
87
+ E(this, "heatmapScales", {
84
88
  x: b().domain(["null"]).range([1]),
85
89
  y: b().domain(["null"]).range([1])
86
90
  });
87
- H(this, "heatmapStep", { x: 0, y: 0 });
88
- H(this, "heatmapColorScale", {
91
+ E(this, "heatmapStep", { x: 0, y: 0 });
92
+ E(this, "heatmapColorScale", {
89
93
  scale: b([]),
90
94
  getter: () => "white"
91
95
  });
92
- H(this, "heatmapLabels", []);
96
+ E(this, "heatmapLabels", []);
93
97
  }
94
98
  clear() {
95
99
  var t;
@@ -106,46 +110,46 @@ class Ft {
106
110
  this.chartSizes.heatmapWidth = 0;
107
111
  return;
108
112
  }
109
- const { xKeysByGroups: c, xGroupKeys: h, xKeys: o, yKeys: d } = t, f = 5, S = h.map((i) => c[i].length), _ = S.reduce((i, n) => i + n, 0), M = this.chartSizes.treeHeight / d.length, v = Math.min(
113
+ const { xKeysByGroups: c, xGroupKeys: h, xKeys: o, yKeys: p } = t, S = 5, f = h.map((i) => c[i].length), A = f.reduce((i, r) => i + r, 0), M = this.chartSizes.treeHeight / p.length, v = Math.min(
110
114
  Math.max(
111
- (rt - (S.filter((i) => i > 0).length - 1) * f) / _,
115
+ (nt - (f.filter((i) => i > 0).length - 1) * S) / A,
112
116
  s.minCellWidth
113
117
  ),
114
118
  s.maxCellWidth
115
119
  ), y = [];
116
- let z = 0;
120
+ let C = 0;
117
121
  h.forEach((i) => {
118
- const n = c[i];
119
- n.forEach(() => {
120
- y.push(z), z += v;
121
- }), n.length > 0 && (z += f);
122
- }), this.heatmapScales.x = b().domain(o).range(y), this.heatmapScales.y = b().domain(d).range(d.map((i, n) => n * M)), this.heatmapStep.x = v, this.heatmapStep.y = M;
123
- const { colorsList: x, colorsMap: T } = e.aes;
124
- if (e.valueType === "continuous" && x) {
125
- const i = ct().domain(ut(x.length, t.meta.valueExtent)).range(x);
122
+ const r = c[i];
123
+ r.forEach(() => {
124
+ y.push(C), C += v;
125
+ }), r.length > 0 && (C += S);
126
+ }), this.heatmapScales.x = b().domain(o).range(y), this.heatmapScales.y = b().domain(p).range(p.map((i, r) => r * M)), this.heatmapStep.x = v, this.heatmapStep.y = M;
127
+ const { colorsList: T, colorsMap: x } = e.aes;
128
+ if (e.valueType === "continuous" && T) {
129
+ const i = ct().domain(mt(T.length, t.meta.valueExtent)).range(T);
126
130
  this.heatmapColorScale = {
127
131
  scale: i,
128
- getter: (n) => i(n)
132
+ getter: (r) => i(r)
129
133
  };
130
134
  }
131
- if (e.valueType === "discrete" && T) {
132
- const i = Object.keys(T).filter((n) => t.meta.uniqueValues.has(n));
135
+ if (e.valueType === "discrete" && x) {
136
+ const i = Object.keys(x).filter((r) => t.meta.uniqueValues.has(r));
133
137
  this.heatmapColorScale = {
134
138
  scale: b(
135
139
  i,
136
- i.map((n) => T[n])
137
- ).unknown(O),
138
- getter: (n) => n ? T[n] ?? O : O
140
+ i.map((r) => x[r])
141
+ ).unknown(G),
142
+ getter: (r) => r ? x[r] ?? G : G
139
143
  };
140
144
  }
141
- if (e.valueType === "stringSource" && x) {
142
- const i = [...t.meta.uniqueValues], n = b(
145
+ if (e.valueType === "stringSource" && T) {
146
+ const i = [...t.meta.uniqueValues], r = b(
143
147
  i,
144
- i.map((C, L) => x[L % x.length])
145
- ).unknown(O);
148
+ i.map((z, H) => T[H % T.length])
149
+ ).unknown(G);
146
150
  this.heatmapColorScale = {
147
- scale: n,
148
- getter: (C) => C ? n(C) : O
151
+ scale: r,
152
+ getter: (z) => z ? r(z) : G
149
153
  };
150
154
  }
151
155
  this.chartSizes.heatmapWidth = this.heatmapScales.x(t.xKeys[t.xKeys.length - 1]) + this.heatmapStep.x;
@@ -159,102 +163,102 @@ class Ft {
159
163
  };
160
164
  return;
161
165
  }
162
- const d = new j("600 14px Arial"), f = 16, S = 48, _ = 20, M = 24;
163
- function v(p, a) {
166
+ const p = new K("600 14px Arial"), S = 16, f = 48, A = 20, M = 24;
167
+ function v(d, a) {
164
168
  return Math.max(
165
- ...p.map((u) => d.getTextWidth(String(u)) + _),
166
- d.getTextWidth(a)
169
+ ...d.map((m) => p.getTextWidth(String(m)) + A),
170
+ p.getTextWidth(a)
167
171
  );
168
172
  }
169
173
  const y = [];
170
- [s.nodeColor, s.nodeShape, s.lineColor].filter(X).map((p) => p.columnName).forEach((p) => {
171
- const a = e[p.value];
174
+ [s.nodeColor, s.nodeShape, s.lineColor].filter(X).map((d) => d.columnName).forEach((d) => {
175
+ const a = e[d.value];
172
176
  if (a.usedAes.length === 0 || !a.aesMap)
173
177
  return;
174
- const u = p.label ?? p.value, E = a.values, m = {};
175
- E.forEach((l) => {
176
- m[l] || (m[l] = { ...tt }), a.usedAes.forEach((g) => {
177
- var w, A, W;
178
- (g === "dotFill" || g === "lineColor") && (m[l].color = ((w = a.aesMap[l]) == null ? void 0 : w[g]) ?? D), g === "dotShape" && (m[l].shape = ((A = a.aesMap[l]) == null ? void 0 : A[g]) ?? "21"), g === "dotSize" && (m[l].size = ((W = a.aesMap[l]) == null ? void 0 : W[g]) ?? 3);
178
+ const m = d.label ?? d.value, L = a.values, u = {};
179
+ L.forEach((l) => {
180
+ u[l] || (u[l] = { ...tt }), a.usedAes.forEach((g) => {
181
+ var w, R, W;
182
+ (g === "dotFill" || g === "lineColor") && (u[l].color = ((w = a.aesMap[l]) == null ? void 0 : w[g]) ?? D), g === "dotShape" && (u[l].shape = ((R = a.aesMap[l]) == null ? void 0 : R[g]) ?? "21"), g === "dotSize" && (u[l].size = ((W = a.aesMap[l]) == null ? void 0 : W[g]) ?? 3);
179
183
  });
180
184
  }), y.push({
181
- columnKey: u,
182
- data: m,
185
+ columnKey: m,
186
+ data: u,
183
187
  values: a.values,
184
188
  labels: a.labels
185
189
  });
186
190
  });
187
- const x = [];
188
- let T = 0, i = 0, n = 0, C = Math.min(this.chartSizes.treeHeight, ht);
191
+ const T = [];
192
+ let x = 0, i = 0, r = 0, z = Math.min(this.chartSizes.treeHeight, ht);
189
193
  if (c && h) {
190
- const p = o.valueType, a = c.label ?? c.value;
191
- if (p === "continuous") {
192
- const u = this.heatmapColorScale.scale, E = it(u, h.meta.valueExtent, 4), l = {
194
+ const d = o.valueType, a = c.label ?? c.value;
195
+ if (d === "continuous") {
196
+ const m = this.heatmapColorScale.scale, L = it(m, h.meta.valueExtent, 4), l = {
193
197
  id: "heatmapValue",
194
198
  type: "continuous",
195
- width: st(E, a),
196
- height: C,
199
+ width: st(L, a),
200
+ height: z,
197
201
  left: 0,
198
202
  top: 0,
199
203
  title: a,
200
- scale: u,
201
- values: E,
204
+ scale: m,
205
+ values: L,
202
206
  labels: {}
203
207
  };
204
- x.push(l), i = l.height + S, T = l.width;
208
+ T.push(l), i = l.height + f, x = l.width;
205
209
  } else {
206
- const u = this.heatmapColorScale.scale, E = ot(u, a), m = u.domain(), l = m.length * f, g = {
210
+ const m = this.heatmapColorScale.scale, L = ot(m, a), u = m.domain(), l = u.length * S, g = {
207
211
  id: "heatmapValue",
208
212
  type: "discrete",
209
- width: E,
213
+ width: L,
210
214
  height: l,
211
215
  left: 0,
212
216
  top: 0,
213
217
  title: a,
214
- scale: u,
215
- values: m,
218
+ scale: m,
219
+ values: u,
216
220
  labels: {}
217
221
  };
218
- x.push(g), i = g.height + S, T = g.width;
222
+ T.push(g), i = g.height + f, x = g.width;
219
223
  }
220
224
  }
221
- if (y.map(({ columnKey: p, labels: a, values: u, data: E }) => {
222
- i > C && (i = 0, n += T + M);
223
- const m = p, l = v(
224
- u.map((G) => a[G]),
225
- m
226
- ), g = u.length * f;
227
- g > C && (C = g);
228
- const w = b().domain(u).range(u.map((G) => E[G])), A = n, W = i;
229
- x.push({ id: p, type: "nodes", width: l, height: g, left: A, top: W, title: m, scale: w, values: u, labels: a }), T = l, i += g + S;
225
+ if (y.map(({ columnKey: d, labels: a, values: m, data: L }) => {
226
+ i > z && (i = 0, r += x + M);
227
+ const u = d, l = v(
228
+ m.map((_) => a[_]),
229
+ u
230
+ ), g = m.length * S;
231
+ g > z && (z = g);
232
+ const w = b().domain(m).range(m.map((_) => L[_])), R = r, W = i;
233
+ T.push({ id: d, type: "nodes", width: l, height: g, left: R, top: W, title: u, scale: w, values: m, labels: a }), x = l, i += g + f;
230
234
  }), q(s.nodeSize)) {
231
- i > C && (i = 0, n += T + M);
232
- const { columnName: p, domain: a, range: u } = s.nodeSize, E = p.label ?? p.value, m = J(a, u), l = m.ticks(3), g = m.tickFormat(3), w = l.reduce((I, B) => (I[String(B)] = g(B), I), {}), A = v(
235
+ i > z && (i = 0, r += x + M);
236
+ const { columnName: d, domain: a, range: m } = s.nodeSize, L = d.label ?? d.value, u = J(a, m), l = u.ticks(3), g = u.tickFormat(3), w = l.reduce((I, P) => (I[String(P)] = g(P), I), {}), R = v(
233
237
  l.map((I) => w[I]),
234
- E
235
- ), W = (m(Math.max(...l)) * 2 + 4) * l.length;
236
- W > C && (C = W);
237
- const G = n, Q = i;
238
- x.push({ id: p.value, type: "size", width: A, height: W, left: G, top: Q, title: E, scale: m, values: l, labels: w }), T = A, i += W + S;
238
+ L
239
+ ), W = (u(Math.max(...l)) * 2 + 4) * l.length;
240
+ W > z && (z = W);
241
+ const _ = r, Q = i;
242
+ T.push({ id: d.value, type: "size", width: R, height: W, left: _, top: Q, title: L, scale: u, values: l, labels: w }), x = R, i += W + f;
239
243
  }
240
- const L = n + T + 2 * et, K = C;
244
+ const H = r + x + 2 * et, B = z;
241
245
  this.legend = {
242
- width: L,
243
- height: K,
244
- items: x
246
+ width: H,
247
+ height: B,
248
+ items: T
245
249
  };
246
250
  }
247
251
  updateChartSizes(t, e, s) {
248
252
  const c = s.leaves().length;
249
253
  this.chartSizes.treeWidth = e ? t.width / 2 : t.width;
250
- const h = mt(c, t.scale, t.minCellHeight, t.maxCellHeight) * c;
251
- this.chartSizes.treeHeight = h, this.chartSizes.heatmapHeight = h;
254
+ const h = ut(c, t.scale, t.minCellHeight, t.maxCellHeight) * c;
255
+ this.chartSizes.treeHeight = h, this.chartSizes.heatmapHeight = h, this.chartSizes.marginLeft = t.marginLeft, this.chartSizes.marginRight = t.marginRight, this.chartSizes.marginBottom = t.marginBottom, this.chartSizes.marginTop = t.marginTop;
252
256
  }
253
257
  updateTotalSizes(t) {
254
- this.chartSizes.totalWidth = this.chartSizes.treeWidth + this.chartSizes.heatmapWidth + this.legend.width + N.LEFT + N.RIGHT, t && (this.chartSizes.totalWidth += U), this.legend.width > 0 && (this.chartSizes.totalWidth += U), this.chartSizes.totalHeight = Math.max(this.chartSizes.treeHeight, this.legend.height) + N.TOP + N.BOTTOM;
258
+ this.chartSizes.totalWidth = this.chartSizes.treeWidth + this.chartSizes.heatmapWidth + this.legend.width + this.chartSizes.marginLeft + this.chartSizes.marginRight, t && (this.chartSizes.totalWidth += U), this.legend.width > 0 && (this.chartSizes.totalWidth += U), this.chartSizes.totalHeight = Math.max(this.chartSizes.treeHeight, this.legend.height) + this.chartSizes.marginTop + this.chartSizes.marginBottom;
255
259
  }
256
260
  prepareTableLabels(t) {
257
- const e = new j("bold 14px Arial"), s = "…";
261
+ const e = new K("bold 14px Arial"), s = "…";
258
262
  if (this.heatmapStep.x < 12 || !t) {
259
263
  this.heatmapLabels = [];
260
264
  return;
@@ -262,64 +266,64 @@ class Ft {
262
266
  const c = this.heatmapStep.x - 4;
263
267
  this.heatmapLabels = t.xKeys.map((h) => {
264
268
  const o = t.meta.xLabels[h];
265
- let d = e.getTextWidth(o);
266
- if (d < c)
269
+ let p = e.getTextWidth(o);
270
+ if (p < c)
267
271
  return o;
268
- let f = o, S = f == null ? void 0 : f.length;
269
- for (; d > c && S > 0; )
270
- S--, f = (o == null ? void 0 : o.substring(0, S)) + s, d = e.getTextWidth(f);
271
- return S > 0 ? f : "";
272
+ let S = o, f = S == null ? void 0 : S.length;
273
+ for (; p > c && f > 0; )
274
+ f--, S = (o == null ? void 0 : o.substring(0, f)) + s, p = e.getTextWidth(S);
275
+ return f > 0 ? S : "";
272
276
  });
273
277
  }
274
278
  addLabelsWidthToTreeArea(t, e) {
275
279
  if (!e)
276
280
  return;
277
- const s = t.leaves(), c = new j("bold 14px Manrope");
281
+ const s = t.leaves(), c = new K("bold 14px Manrope");
278
282
  let h = 0;
279
283
  s.forEach((o) => {
280
284
  if (!o.data.label)
281
285
  return;
282
- const d = c.getTextWidth(o.data.label), f = o.y + d - this.chartSizes.treeWidth + 8;
283
- f > h && (h = f);
286
+ const p = c.getTextWidth(o.data.label), S = o.y + p - this.chartSizes.treeWidth + 8;
287
+ S > h && (h = S);
284
288
  }), this.chartSizes.treeWidth += h;
285
289
  }
286
- render(t, e, s, c, h, o, d, f, S, _, M, v, y, z, x, T, i, n) {
290
+ render(t, e, s, c, h, o, p, S, f, A, M, v, y, C, T, x, i, r) {
287
291
  var a;
288
- this.updateChartSizes(e.size, z, s), this.updateHeatmapScales(z, x, e.size), this.updateLegendSize(e.legend, T, M, y, z, x), this.prepareTableLabels(z);
289
- const C = h === "top" ? [this.chartSizes.treeWidth, this.chartSizes.treeHeight] : [this.chartSizes.treeHeight, this.chartSizes.treeWidth];
290
- dt().size(C).separation(() => 1)(s);
291
- const L = s;
292
+ this.updateChartSizes(e.size, C, s), this.updateHeatmapScales(C, T, e.size), this.updateLegendSize(e.legend, x, M, y, C, T), this.prepareTableLabels(C);
293
+ const z = h === "top" ? [this.chartSizes.treeWidth, this.chartSizes.treeHeight] : [this.chartSizes.treeHeight, this.chartSizes.treeWidth];
294
+ pt().size(z).separation(() => 1)(s);
295
+ const H = s;
292
296
  at(
293
- L,
297
+ H,
294
298
  h === "top" ? this.chartSizes.treeHeight : this.chartSizes.treeWidth,
295
299
  i === "alignLeavesToLine"
296
- ), lt(L), this.addLabelsWidthToTreeArea(L, S), this.updateTotalSizes(z);
297
- const K = pt(t, M), p = /* @__PURE__ */ F.jsx(
298
- nt,
300
+ ), lt(H), this.addLabelsWidthToTreeArea(H, f), this.updateTotalSizes(C);
301
+ const B = dt(t, M), d = /* @__PURE__ */ F.jsx(
302
+ rt,
299
303
  {
300
304
  chartSizes: this.chartSizes,
301
305
  chartSettings: e,
302
- nodes: L.descendants(),
303
- links: L.links(),
306
+ nodes: H.descendants(),
307
+ links: H.links(),
304
308
  connectionType: c,
305
309
  rootPosition: h,
306
310
  edgeInheritance: o,
307
- showNodes: d,
308
- showEdges: f,
309
- showLeavesLabels: S,
310
- showNodesLabels: _,
311
- aesGetters: K,
311
+ showNodes: p,
312
+ showEdges: S,
313
+ showLeavesLabels: f,
314
+ showNodesLabels: A,
315
+ aesGetters: B,
312
316
  labels: v,
313
- heatmapData: z,
317
+ heatmapData: C,
314
318
  heatmapScales: this.heatmapScales,
315
319
  heatmapStep: this.heatmapStep,
316
320
  heatmapColor: this.heatmapColorScale.getter,
317
321
  heatmapLabels: this.heatmapLabels,
318
322
  legendData: this.legend,
319
- onClick: n
323
+ onClick: r
320
324
  }
321
325
  );
322
- this.component = p, (a = this.reactRoot) == null || a.render(p);
326
+ this.component = d, (a = this.reactRoot) == null || a.render(d);
323
327
  }
324
328
  renderError(t) {
325
329
  var e;