@milaboratories/miplots4 1.0.169 → 1.0.170

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,6 +1,6 @@
1
1
  var ot = Object.defineProperty;
2
- var it = (d, e, t) => e in d ? ot(d, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[e] = t;
3
- var C = (d, e, t) => it(d, typeof e != "symbol" ? e + "" : e, t);
2
+ var it = (p, e, t) => e in p ? ot(p, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[e] = t;
3
+ var C = (p, e, t) => it(p, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { j as O } from "../_virtual/jsx-runtime.js";
5
5
  import nt from "../_virtual/lodash.js";
6
6
  import { c as at } from "../_virtual/client.js";
@@ -12,59 +12,59 @@ import { getChartEdgeSides as mt } from "../utils/getChartEdgeSides.js";
12
12
  import { getContinuousLegendTicks as Q } from "../utils/getContinuousLegendTicks.js";
13
13
  import { TextMeasurer as gt } from "../utils/TextMeasurer/TextMeasurer.js";
14
14
  import { ChartsGroup as xt } from "./components/ChartsGroup.js";
15
- import { MIN_MARGIN as F, TITLE_LINE as V, LEGEND_OFFSET as ft, DEFAULT_AES as Z, CHART_SIDE_ELEMENTS as St } from "./constants.js";
15
+ import { MIN_MARGIN as F, TITLE_LINE as V, DEFAULT_AES as Z, LEGEND_OFFSET as ft, CHART_SIDE_ELEMENTS as St } from "./constants.js";
16
16
  import { calculateChartSideElementSizes as yt } from "./utils/calculateChartSideElementSizes.js";
17
17
  import { calculateSideElementsBBoxes as Ct } from "./utils/calculateSideElementsBBoxes.js";
18
- import { createDiscreteColorScale as Lt, createDiscreteRoundColorScale as Gt, createContinuousColorScale as Et } from "./utils/createColorScales.js";
18
+ import { createDiscreteColorScale as Lt, createDiscreteRoundColorScale as Et, createContinuousColorScale as Gt } from "./utils/createColorScales.js";
19
19
  import { calculateAnnotationTitleSizes as bt } from "./utils/calculateAnnotationTitleSizes.js";
20
20
  import { calculateCaptionTails as zt } from "./utils/calculateCaptionTails.js";
21
21
  import _ from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js";
22
- import I from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js";
22
+ import R from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js";
23
23
  import At from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/extent.js";
24
24
  import $ from "../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/cluster.js";
25
25
  const Tt = Math.cos(Math.PI / 4), Ht = 5;
26
- function tt(d, e, t) {
26
+ function tt(p, e, t) {
27
27
  function s(r) {
28
28
  r[t] = e(r.data.height), r.children && r.children.forEach(s);
29
29
  }
30
- s(d);
30
+ s(p);
31
31
  }
32
- function st(d, e, t, s = t) {
33
- function r(i) {
34
- i[s] = i[t] + e, i.children && i.children.forEach(r);
32
+ function st(p, e, t, s = t) {
33
+ function r(n) {
34
+ n[s] = n[t] + e, n.children && n.children.forEach(r);
35
35
  }
36
- r(d);
36
+ r(p);
37
37
  }
38
- const Mt = (d, e) => {
38
+ const Mt = (p, e) => {
39
39
  const t = Math.min(...e), s = Math.max(...e);
40
40
  if (t === s) {
41
- const a = d % 2 === 0 ? [] : [t];
42
- for (let l = 1; l < d / 2 + 1; l++)
41
+ const a = p % 2 === 0 ? [] : [t];
42
+ for (let l = 1; l < p / 2 + 1; l++)
43
43
  a.push(t + l), a.unshift(t - l);
44
44
  return a;
45
45
  }
46
- if (d < 2)
46
+ if (p < 2)
47
47
  return [t, s];
48
- const r = (s - t) / (d - 1), i = [];
49
- for (let a = 0; a < d - 1; a++)
50
- i.push(t + r * a);
51
- return i.push(s), i;
48
+ const r = (s - t) / (p - 1), n = [];
49
+ for (let a = 0; a < p - 1; a++)
50
+ n.push(t + r * a);
51
+ return n.push(s), n;
52
52
  };
53
- function et(d, e, t) {
53
+ function et(p, e, t) {
54
54
  let s = t;
55
- return d && (d.colorRange && (s = d.colorRange), d.method === "standardScaling" && (s = [-2, 2]), d.method === "meanNormalization" && (s = [-0.75, 0.75])), Mt(e, s);
55
+ return p && (p.colorRange && (s = p.colorRange), p.method === "standardScaling" && (s = [-2, 2]), p.method === "meanNormalization" && (s = [-0.75, 0.75])), Mt(e, s);
56
56
  }
57
- function P(d, e, t) {
57
+ function P(p, e, t) {
58
58
  let s = 0;
59
- for (const r of d) {
59
+ for (const r of p) {
60
60
  if (e[r] === void 0) continue;
61
- const i = t.getTextWidth(e[r]);
62
- i > s && (s = i);
61
+ const n = t.getTextWidth(e[r]);
62
+ n > s && (s = n);
63
63
  }
64
64
  return s;
65
65
  }
66
- function K(d, e) {
67
- return e === 90 ? d : e === 45 ? d * Tt + (d > 0 ? 2 * Ht : 0) : V;
66
+ function K(p, e) {
67
+ return e === 90 ? p : e === 45 ? p * Tt + (p > 0 ? 2 * Ht : 0) : V;
68
68
  }
69
69
  class Zt {
70
70
  constructor() {
@@ -115,7 +115,7 @@ class Zt {
115
115
  y: { null: _().domain(["null"]).range([1]) }
116
116
  });
117
117
  C(this, "step", { x: {}, y: {} });
118
- C(this, "colorScale", I().domain([0, 1]).range(["white", "black"]));
118
+ C(this, "colorScale", R().domain([0, 1]).range(["white", "black"]));
119
119
  C(this, "annotationColorScales", {});
120
120
  C(this, "dendrogramAesScales", {});
121
121
  C(this, "legend", {
@@ -143,7 +143,7 @@ class Zt {
143
143
  right: this.legend.width + t.outerOffset
144
144
  }, this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartsWidth + this.margins.right, this.chartSizes.totalHeight = this.margins.top + Math.max(this.chartSizes.chartsHeight + this.margins.bottom, this.legend.height);
145
145
  }
146
- updateLegendSize(e, t, s, r, i) {
146
+ updateLegendSize(e, t, s, r, n) {
147
147
  if (!t.show) {
148
148
  this.legend = { width: 0, height: 0, items: [] };
149
149
  return;
@@ -151,95 +151,95 @@ class Zt {
151
151
  const a = Math.min(
152
152
  Math.max(this.chartSizes.chartHeight, ut),
153
153
  pt
154
- ), l = Math.max(this.chartSizes.chartHeight, a), c = [], x = { width: 0, height: 0, left: 0, top: 0 }, m = (n) => n.reduce((o, h) => (o[h] = String(h), o), {});
154
+ ), l = Math.max(this.chartSizes.chartHeight, a), c = [], x = { width: 0, height: 0, left: 0, top: 0 }, d = (i) => i.reduce((o, h) => (o[h] = String(h), o), {});
155
155
  if (e === "continuous") {
156
- const n = this.colorScale, o = Q(n, i), h = I([o[0], o[o.length - 1]], [a, 0]), u = r.label ?? r.value;
156
+ const i = this.colorScale, o = Q(i, n), h = R([o[0], o[o.length - 1]], [a, 0]), u = r.label ?? r.value;
157
157
  c.push({
158
158
  ...x,
159
159
  type: "continuous",
160
160
  id: "heatmapValue",
161
- scale: n,
161
+ scale: i,
162
162
  values: o,
163
163
  title: u,
164
164
  tickPositionScale: h
165
165
  });
166
166
  } else if (e === "discrete") {
167
- const n = this.colorScale, o = r.label ?? r.value, h = n.domain(), u = m(h);
168
- c.push({ ...x, type: "discreteColor", id: "heatmapValue", title: o, scale: n, values: h, labels: u });
167
+ const i = this.colorScale, o = r.label ?? r.value, h = i.domain(), u = d(h);
168
+ c.push({ ...x, type: "discreteColor", id: "heatmapValue", title: o, scale: i, values: h, labels: u });
169
169
  }
170
- if (s.forEach((n) => {
171
- const o = n.valueColumn.label ?? n.valueColumn.value;
172
- if (n.type === "continuous") {
173
- const h = this.annotationColorScales[n.id].scale, u = Q(h, i), G = I([u[0], u[u.length - 1]], [a, 0]);
174
- c.push({ ...x, type: "continuous", id: n.id, tickPositionScale: G, title: o, scale: h, values: u });
170
+ if (s.forEach((i) => {
171
+ const o = i.valueColumn.label ?? i.valueColumn.value;
172
+ if (i.type === "continuous") {
173
+ const h = this.annotationColorScales[i.id].scale, u = Q(h, n), L = R([u[0], u[u.length - 1]], [a, 0]);
174
+ c.push({ ...x, type: "continuous", id: i.id, tickPositionScale: L, title: o, scale: h, values: u });
175
175
  }
176
- if (n.type === "discrete") {
177
- const h = this.annotationColorScales[n.id].scale, u = h.domain(), G = m(u);
178
- c.push({ ...x, type: "discreteColor", id: n.id, title: o, scale: h, values: u, labels: G });
176
+ if (i.type === "discrete") {
177
+ const h = this.annotationColorScales[i.id].scale, u = h.domain(), L = d(u);
178
+ c.push({ ...x, type: "discreteColor", id: i.id, title: o, scale: h, values: u, labels: L });
179
179
  }
180
180
  }), !c.length) {
181
181
  this.legend = { width: 0, height: 0, items: [] };
182
182
  return;
183
183
  }
184
- const p = dt(c, this.chartSizes.chartHeight, a), L = p[p.length - 1], f = L.left + L.width + ft;
184
+ const m = dt(c, this.chartSizes.chartHeight, a), f = m.reduce((i, o) => Math.max(i, o.left + o.width), 0) + ft;
185
185
  this.legend = {
186
186
  width: f,
187
187
  height: l,
188
- items: p
188
+ items: m
189
189
  };
190
190
  }
191
191
  updateCaptionsSize(e, t, s, r) {
192
- const i = new gt("bold 16px Manrope"), { xGroupKeys: a, yGroupKeys: l, xGroupLabels: c, yGroupLabels: x, xKeysByGroups: m, yKeysByGroups: p, xLabels: L, yLabels: f } = e.meta;
192
+ const n = new gt("bold 16px Manrope"), { xGroupKeys: a, yGroupKeys: l, xGroupLabels: c, yGroupLabels: x, xKeysByGroups: d, yKeysByGroups: m, xLabels: z, yLabels: f } = e.meta;
193
193
  this.labelAngles = {
194
194
  xAxisLabels: t.axisLabelsAngle,
195
195
  yAxisLabels: s.axisLabelsAngle,
196
196
  xGroupLabels: t.groupLabelsAngle,
197
197
  yGroupLabels: s.groupLabelsAngle
198
198
  };
199
- const n = a.reduce((S, g) => Math.max(S, P(m[g], L, i)), 0), o = l.reduce((S, g) => Math.max(S, P(p[g], f, i)), 0), h = P(a, c, i), u = P(l, x, i), { xCaptionTail: G, yCaptionTail: M } = zt(
199
+ const i = a.reduce((S, g) => Math.max(S, P(d[g], z, n)), 0), o = l.reduce((S, g) => Math.max(S, P(m[g], f, n)), 0), h = P(a, c, n), u = P(l, x, n), { xCaptionTail: L, yCaptionTail: M } = zt(
200
200
  this.labelAngles,
201
201
  r,
202
202
  this.scales,
203
203
  this.step,
204
204
  e,
205
- i
205
+ n
206
206
  );
207
207
  this.captionsSizes = {
208
- xCaptionTail: G,
208
+ xCaptionTail: L,
209
209
  yCaptionTail: M,
210
210
  xGroupCaptions: K(h, this.labelAngles.xGroupLabels),
211
211
  yGroupCaptions: K(u, this.labelAngles.yGroupLabels),
212
- xAxisCaptions: K(n, this.labelAngles.xAxisLabels),
212
+ xAxisCaptions: K(i, this.labelAngles.xAxisLabels),
213
213
  yAxisCaptions: K(o, this.labelAngles.yAxisLabels)
214
214
  };
215
215
  }
216
- updateChartDimensions(e, t, s, r, i, a, l, c, x, m) {
217
- const p = t.length, L = Math.min(i.nRows ?? p, p), f = Math.min(i.nCols ?? p, p);
218
- this.columnsCount = i.nRows ? Math.ceil(p / L) : f, this.rowsCount = Math.ceil(p / this.columnsCount);
219
- const { sharedX: n, sharedY: o } = i;
216
+ updateChartDimensions(e, t, s, r, n, a, l, c, x, d) {
217
+ const m = t.length, z = Math.min(n.nRows ?? m, m), f = Math.min(n.nCols ?? m, m);
218
+ this.columnsCount = n.nRows ? Math.ceil(m / z) : f, this.rowsCount = Math.ceil(m / this.columnsCount);
219
+ const { sharedX: i, sharedY: o } = n;
220
220
  this.chartsDimensions = {};
221
221
  let h = 0, u = 0;
222
222
  t.forEach((S, g) => {
223
- const E = g % this.columnsCount + 1, y = mt(g, t.length, this.columnsCount, this.rowsCount), b = this.step.x[S], w = this.step.y[S], D = yt(
223
+ const E = g % this.columnsCount + 1, y = mt(g, t.length, this.columnsCount, this.rowsCount), G = this.step.x[S], w = this.step.y[S], D = yt(
224
224
  a,
225
225
  l,
226
226
  this.captionsSizes,
227
227
  c,
228
228
  x,
229
- m,
229
+ d,
230
230
  y,
231
- n,
231
+ i,
232
232
  o,
233
233
  t,
234
234
  s,
235
235
  r,
236
- b,
236
+ G,
237
237
  w
238
- ), N = bt(c, y, n, o);
239
- function H(R) {
238
+ ), N = bt(c, y, i, o);
239
+ function H(v) {
240
240
  return Math.max(
241
- St[R].reduce((k, j) => k + D[R][j], 0),
242
- N[R],
241
+ St[v].reduce((k, j) => k + D[v][j], 0),
242
+ N[v],
243
243
  e.innerOffset
244
244
  );
245
245
  }
@@ -250,117 +250,117 @@ class Zt {
250
250
  bottom: H("bottom")
251
251
  };
252
252
  A.left < this.captionsSizes.xCaptionTail && (A.left = this.captionsSizes.xCaptionTail), A.bottom < this.captionsSizes.yCaptionTail && (A.bottom = this.captionsSizes.yCaptionTail);
253
- const v = Ct(D, this.chartSizes.chartWidth, this.chartSizes.chartHeight), B = this.chartSizes.chartWidth + A.left + A.right, W = this.chartSizes.chartHeight + A.top + A.bottom;
253
+ const I = Ct(D, this.chartSizes.chartWidth, this.chartSizes.chartHeight), B = this.chartSizes.chartWidth + A.left + A.right, W = this.chartSizes.chartHeight + A.top + A.bottom;
254
254
  this.chartsDimensions[S] = {
255
255
  left: h,
256
256
  top: u,
257
257
  inner: { width: this.chartSizes.chartWidth, height: this.chartSizes.chartHeight },
258
258
  outer: { width: B, height: W },
259
259
  padding: A,
260
- sideElementBBoxes: v,
260
+ sideElementBBoxes: I,
261
261
  chartEdgeSides: y
262
262
  }, h += B, E === this.columnsCount && (h = 0, u += W);
263
263
  });
264
- const G = t.slice(0, this.columnsCount).reduce((S, g) => S + this.chartsDimensions[g].outer.width, 0), M = t.filter((S, g) => g % this.columnsCount === 0).reduce((S, g) => S + this.chartsDimensions[g].outer.height, 0);
265
- this.chartSizes.chartsWidth = G, this.chartSizes.chartsHeight = M;
264
+ const L = t.slice(0, this.columnsCount).reduce((S, g) => S + this.chartsDimensions[g].outer.width, 0), M = t.filter((S, g) => g % this.columnsCount === 0).reduce((S, g) => S + this.chartsDimensions[g].outer.height, 0);
265
+ this.chartSizes.chartsWidth = L, this.chartSizes.chartsHeight = M;
266
266
  }
267
267
  updateChartsSizes(e, t, s) {
268
- const { width: r, height: i, cellWidth: a, cellHeight: l } = e, c = t.meta.facetKeys[0];
268
+ const { width: r, height: n, cellWidth: a, cellHeight: l } = e, c = t.meta.facetKeys[0];
269
269
  if (a && c) {
270
- const x = t.facets[c].xKeys.length, m = t.meta.xGroupKeys.length;
271
- this.chartSizes.chartWidth = x * a + s * (m - 1);
270
+ const x = t.facets[c].xKeys.length, d = t.meta.xGroupKeys.length;
271
+ this.chartSizes.chartWidth = x * a + s * (d - 1);
272
272
  } else
273
273
  this.chartSizes.chartWidth = r;
274
274
  if (l && c) {
275
- const x = t.facets[c].yKeys.length, m = t.meta.yGroupKeys.length;
276
- this.chartSizes.chartHeight = x * l + s * (m - 1);
275
+ const x = t.facets[c].yKeys.length, d = t.meta.yGroupKeys.length;
276
+ this.chartSizes.chartHeight = x * l + s * (d - 1);
277
277
  } else
278
- this.chartSizes.chartHeight = i;
278
+ this.chartSizes.chartHeight = n;
279
279
  }
280
280
  // update scales for cell positions, x and y for each facet
281
- updateScales(e, t, s, r, i, a, l, c, x, m) {
282
- const { width: p, height: L, cellWidth: f, cellHeight: n } = i, { meta: o, facets: h } = t, { sharedX: u, sharedY: G } = r, M = (g, E = {}) => g.sort(
283
- (y, b) => a.sorting === "asc" ? (E[y] ?? y).localeCompare(E[b] ?? b, "en", { numeric: !0 }) : (E[b] ?? b).localeCompare(E[y] ?? y, "en", { numeric: !0 })
281
+ updateScales(e, t, s, r, n, a, l, c, x, d) {
282
+ const { width: m, height: z, cellWidth: f, cellHeight: i } = n, { meta: o, facets: h } = t, { sharedX: u, sharedY: L } = r, M = (g, E = {}) => g.sort(
283
+ (y, G) => a.sorting === "asc" ? (E[y] ?? y).localeCompare(E[G] ?? G, "en", { numeric: !0 }) : (E[G] ?? G).localeCompare(E[y] ?? y, "en", { numeric: !0 })
284
284
  ), S = (g, E = {}) => g.sort(
285
- (y, b) => l.sorting === "asc" ? (E[y] ?? y).localeCompare(E[b] ?? b, "en", { numeric: !0 }) : (E[b] ?? b).localeCompare(E[y] ?? y, "en", { numeric: !0 })
285
+ (y, G) => l.sorting === "asc" ? (E[y] ?? y).localeCompare(E[G] ?? G, "en", { numeric: !0 }) : (E[G] ?? G).localeCompare(E[y] ?? y, "en", { numeric: !0 })
286
286
  );
287
287
  e.forEach((g) => {
288
- const E = h[g], y = m.xGroup ? o.xGroupKeys : M(o.xGroupKeys), b = m.yGroup ? o.yGroupKeys : S(o.yGroupKeys), { xKeysByGroups: w } = u ? o : E, { yKeysByGroups: D } = G ? o : E, N = y.map((z) => w[z].length), H = b.map((z) => D[z].length), A = N.reduce((z, T) => z + T, 0), v = H.reduce((z, T) => z + T, 0), B = f || (p - (N.filter((z) => z > 0).length - 1) * s) / A, W = n || (L - (H.filter((z) => z > 0).length - 1) * s) / v, R = [];
288
+ const E = h[g], y = d.xGroup ? o.xGroupKeys : M(o.xGroupKeys), G = d.yGroup ? o.yGroupKeys : S(o.yGroupKeys), { xKeysByGroups: w } = u ? o : E, { yKeysByGroups: D } = L ? o : E, N = y.map((b) => w[b].length), H = G.map((b) => D[b].length), A = N.reduce((b, T) => b + T, 0), I = H.reduce((b, T) => b + T, 0), B = f || (m - (N.filter((b) => b > 0).length - 1) * s) / A, W = i || (z - (H.filter((b) => b > 0).length - 1) * s) / I, v = [];
289
289
  let k = [], j = 0;
290
- y.forEach((z) => {
291
- const T = c || m.x ? w[z] : M(w[z], o.xLabels);
290
+ y.forEach((b) => {
291
+ const T = c || d.x ? w[b] : M(w[b], o.xLabels);
292
292
  k = k.concat(T), T.forEach(() => {
293
- R.push(j), j += B;
293
+ v.push(j), j += B;
294
294
  }), T.length > 0 && (j += s);
295
295
  });
296
296
  const J = [];
297
297
  let X = [], U = 0;
298
- b.forEach((z) => {
299
- const T = x || m.y ? D[z] : S(D[z], o.yLabels);
298
+ G.forEach((b) => {
299
+ const T = x || d.y ? D[b] : S(D[b], o.yLabels);
300
300
  X = X.concat(T), T.forEach(() => {
301
301
  J.push(U), U += W;
302
302
  }), T.length > 0 && (U += s);
303
- }), this.scales.x[g] = _().domain(k).range(R), this.scales.y[g] = _().domain(X).range(J), this.step.x[g] = B, this.step.y[g] = W;
303
+ }), this.scales.x[g] = _().domain(k).range(v), this.scales.y[g] = _().domain(X).range(J), this.step.x[g] = B, this.step.y[g] = W;
304
304
  });
305
305
  }
306
- updateAesScale(e, t, s, r, i, a, l) {
306
+ updateAesScale(e, t, s, r, n, a, l) {
307
307
  if (e === "continuous")
308
- s.valueColors ? this.colorScale = I().domain(s.valuesByColors ?? et(l, s.valueColors.length, t)).range(s.valueColors) : s.colorsList && (this.colorScale = I().domain(et(l, s.colorsList.length, t)).range(s.colorsList));
308
+ s.valueColors ? this.colorScale = R().domain(s.valuesByColors ?? et(l, s.valueColors.length, t)).range(s.valueColors) : s.colorsList && (this.colorScale = R().domain(et(l, s.colorsList.length, t)).range(s.colorsList));
309
309
  else if (s.colorsMap) {
310
- const m = Object.entries(s.colorsMap);
311
- this.colorScale = _().domain(m.map((p) => p[0])).range(m.map((p) => p[1])).unknown("#ccc");
310
+ const d = Object.entries(s.colorsMap);
311
+ this.colorScale = _().domain(d.map((m) => m[0])).range(d.map((m) => m[1])).unknown("#ccc");
312
312
  } else s.colorsList && (this.colorScale = Lt(s.colorsList, a.map(String)));
313
- const { xDataByKeys: c, yDataByKeys: x } = i.meta;
314
- r.forEach((m) => {
315
- const { colors: p, type: L, axis: f, valueColumn: n } = m, o = (f === "x" ? c : x)[n.valueLabels ?? n.value];
316
- if (L === "discrete") {
313
+ const { xDataByKeys: c, yDataByKeys: x } = n.meta;
314
+ r.forEach((d) => {
315
+ const { colors: m, type: z, axis: f, valueColumn: i } = d, o = (f === "x" ? c : x)[i.valueLabels ?? i.value];
316
+ if (z === "discrete") {
317
317
  const h = nt.uniq(Object.values(o).map(String)).sort();
318
- this.annotationColorScales[m.id] = {
318
+ this.annotationColorScales[d.id] = {
319
319
  type: "discrete",
320
- scale: Gt(p, h)
320
+ scale: Et(m, h)
321
321
  };
322
322
  } else {
323
323
  const h = Object.values(o).map(Number);
324
324
  if (!h.length)
325
325
  return;
326
- const [u = h[0], G = h[0]] = At(h);
327
- this.annotationColorScales[m.id] = {
326
+ const [u = h[0], L = h[0]] = At(h);
327
+ this.annotationColorScales[d.id] = {
328
328
  type: "continuous",
329
- scale: Et(p, u, G, 0, 0.5, 1)
329
+ scale: Gt(m, u, L, 0, 0.5, 1)
330
330
  };
331
331
  }
332
332
  });
333
333
  }
334
- updateDendrogram(e, t, s, r, i, a, l) {
334
+ updateDendrogram(e, t, s, r, n, a, l) {
335
335
  e.forEach((c) => {
336
336
  this.dendrograms[c] = { x: { treesByGroupKey: {}, data: a }, y: { treesByGroupKey: {}, data: l } };
337
- const { xKeysByGroups: x, yKeysByGroups: m } = r[c];
337
+ const { xKeysByGroups: x, yKeysByGroups: d } = r[c];
338
338
  if (a) {
339
- const { hierarchyByGroupX: p } = i[c], L = t.reduce((f, n) => {
339
+ const { hierarchyByGroupX: m } = n[c], z = t.reduce((f, i) => {
340
340
  var o;
341
- return Math.max(f, (o = p[n]) == null ? void 0 : o.data.height);
341
+ return Math.max(f, (o = m[i]) == null ? void 0 : o.data.height);
342
342
  }, 0);
343
- this.dendrograms[c].x.treesByGroupKey = t.reduce((f, n) => {
344
- const o = p[n], h = x[n];
343
+ this.dendrograms[c].x.treesByGroupKey = t.reduce((f, i) => {
344
+ const o = m[i], h = x[i];
345
345
  $().separation(() => 1).size([h.length * this.step.x[c], a.size])(
346
346
  o
347
347
  );
348
- const u = o, G = I().domain(a.position === "top" ? [0, L] : [L, 0]).range([a.size, 0]);
349
- return tt(u, G, "y"), st(u, this.scales.x[c](h[0]), "x"), f[n] = u, f;
348
+ const u = o, L = R().domain(a.position === "top" ? [0, z] : [z, 0]).range([a.size, 0]);
349
+ return tt(u, L, "y"), st(u, this.scales.x[c](h[0]), "x"), f[i] = u, f;
350
350
  }, {}), this.dendrograms[c].x.data = a;
351
351
  }
352
352
  if (l) {
353
- const { hierarchyByGroupY: p } = i[c], L = s.reduce((f, n) => {
353
+ const { hierarchyByGroupY: m } = n[c], z = s.reduce((f, i) => {
354
354
  var o;
355
- return Math.max(f, (o = p[n]) == null ? void 0 : o.data.height);
355
+ return Math.max(f, (o = m[i]) == null ? void 0 : o.data.height);
356
356
  }, 0);
357
- this.dendrograms[c].y.treesByGroupKey = s.reduce((f, n) => {
358
- const o = p[n], h = m[n];
357
+ this.dendrograms[c].y.treesByGroupKey = s.reduce((f, i) => {
358
+ const o = m[i], h = d[i];
359
359
  $().separation(() => 1).size([h.length * this.step.y[c], l.size])(
360
360
  o
361
361
  );
362
- const u = o, G = I().domain(l.position === "left" ? [0, L] : [L, 0]).range([l.size, 0]);
363
- return st(u, this.scales.y[c](h[0]), "x", "y"), tt(u, G, "x"), f[n] = u, f;
362
+ const u = o, L = R().domain(l.position === "left" ? [0, z] : [z, 0]).range([l.size, 0]);
363
+ return st(u, this.scales.y[c](h[0]), "x", "y"), tt(u, L, "x"), f[i] = u, f;
364
364
  }, {}), this.dendrograms[c].y.data = l;
365
365
  }
366
366
  });
@@ -370,38 +370,38 @@ class Zt {
370
370
  return;
371
371
  const t = Object.keys(e);
372
372
  this.dendrogramAesScales = t.reduce((s, r) => {
373
- const i = e[r], a = Object.keys(i);
373
+ const n = e[r], a = Object.keys(n);
374
374
  return s[r] = _().domain(a).range(
375
375
  a.map((l) => ({
376
376
  ...Z,
377
- ...i[l]
377
+ ...n[l]
378
378
  }))
379
379
  ).unknown(Z), s;
380
380
  }, {});
381
381
  }
382
- render(e, t, s, r, i, a, l, c, x, m, p, L, f, n, o, h, u) {
383
- var v;
384
- const { meta: G, facets: M } = a, { facetKeys: S, xGroupKeys: g, yGroupKeys: E, valueExtent: y } = G, { xAxis: b, yAxis: w, title: D, size: N, valueType: H } = s;
385
- this.updateChartsSizes(N, a, i.groupGap), this.updateAesScale(H, y.dataSource, i, l, a, f, n), this.updateScales(S, a, i.groupGap, r, N, s.xAxis, s.yAxis, x, m, h), this.updateCaptionsSize(a, b, w, r), this.updateChartDimensions(
382
+ render(e, t, s, r, n, a, l, c, x, d, m, z, f, i, o, h, u) {
383
+ var I;
384
+ const { meta: L, facets: M } = a, { facetKeys: S, xGroupKeys: g, yGroupKeys: E, valueExtent: y } = L, { xAxis: G, yAxis: w, title: D, size: N, valueType: H } = s;
385
+ this.updateChartsSizes(N, a, n.groupGap), this.updateAesScale(H, y.dataSource, n, l, a, f, i), this.updateScales(S, a, n.groupGap, r, N, s.xAxis, s.yAxis, x, d, h), this.updateCaptionsSize(a, G, w, r), this.updateChartDimensions(
386
386
  N,
387
387
  S,
388
388
  g,
389
389
  E,
390
390
  r,
391
- b,
391
+ G,
392
392
  w,
393
393
  l,
394
394
  x,
395
- m
396
- ), this.updateLegendSize(H, s.legend, l, c, y.dataSource), this.updateMargins(D, N), this.updateDendrogram(S, g, E, M, p, x, m), this.updateDendrogramAesScales(L);
395
+ d
396
+ ), this.updateLegendSize(H, s.legend, l, c, y.dataSource), this.updateMargins(D, N), this.updateDendrogram(S, g, E, M, m, x, d), this.updateDendrogramAesScales(z);
397
397
  const A = /* @__PURE__ */ O.jsx(ht, { dataFrame: e, children: /* @__PURE__ */ O.jsx(
398
398
  xt,
399
399
  {
400
- aes: i,
400
+ aes: n,
401
401
  annotations: l,
402
402
  annotationColorScales: this.annotationColorScales,
403
403
  captionsSizes: this.captionsSizes,
404
- cellsMeta: G,
404
+ cellsMeta: L,
405
405
  columnsCount: this.columnsCount,
406
406
  chartsDimensions: this.chartsDimensions,
407
407
  chartSettings: s,
@@ -424,7 +424,7 @@ class Zt {
424
424
  cellsRenderingMode: u
425
425
  }
426
426
  ) });
427
- this.component = A, (v = this.reactRoot) == null || v.render(A);
427
+ this.component = A, (I = this.reactRoot) == null || I.render(A);
428
428
  }
429
429
  renderError(e) {
430
430
  var t;