@milaboratories/miplots4 1.0.158 → 1.0.159

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.
@@ -36,7 +36,7 @@ declare class ChartRenderer {
36
36
  updateLegendSize(valueType: HeatmapSettingsImpl['chartSettings']['valueType'], legend: HeatmapSettingsImpl['chartSettings']['legend'], annotations: HeatmapSettingsImpl['annotations'], columnValue: ColumnName, valueExtent: [number, number]): void;
37
37
  updateCaptionsSize(groupedCells: GroupedCellsHeatmap, xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'], yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'], facetSettings: HeatmapSettingsImpl['facetSettings']): void;
38
38
  updateChartDimensions(size: HeatmapSettingsImpl['chartSettings']['size'], facetKeys: string[], xGroupKeys: string[], yGroupKeys: string[], facetSettings: HeatmapSettingsImpl['facetSettings'], xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'], yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'], annotations: HeatmapSettingsImpl['annotations'], dendrogramX: HeatmapSettingsImpl['dendrogramX'], dendrogramY: HeatmapSettingsImpl['dendrogramY']): void;
39
- updateChartsSizes(size: HeatmapSettingsImpl['chartSettings']['size'], facetSettings: HeatmapSettingsImpl['facetSettings'], groupedCells: GroupedCellsHeatmap, groupGap: number): void;
39
+ updateChartsSizes(size: HeatmapSettingsImpl['chartSettings']['size'], groupedCells: GroupedCellsHeatmap, groupGap: number): void;
40
40
  updateScales(facetKeys: string[], groupedCells: GroupedCellsHeatmap, groupGap: number, facetSettings: HeatmapSettingsImpl['facetSettings'], size: HeatmapSettingsImpl['chartSettings']['size'], xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'], yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'], dendrogramX: HeatmapSettingsImpl['dendrogramX'], dendrogramY: HeatmapSettingsImpl['dendrogramY'], customOrder: {
41
41
  x: boolean;
42
42
  y: boolean;
@@ -1,6 +1,6 @@
1
1
  var ot = Object.defineProperty;
2
- var it = (m, e, s) => e in m ? ot(m, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : m[e] = s;
3
- var C = (m, e, s) => it(m, typeof e != "symbol" ? e + "" : e, s);
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);
4
4
  import { j as O } from "../_virtual/jsx-runtime.js";
5
5
  import nt from "../_virtual/lodash.js";
6
6
  import { c as rt } from "../_virtual/client.js";
@@ -23,48 +23,48 @@ import D from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/li
23
23
  import Gt 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 Et = Math.cos(Math.PI / 4), At = 5;
26
- function tt(m, e, s) {
27
- function t(n) {
28
- n[s] = e(n.data.height), n.children && n.children.forEach(t);
26
+ function tt(d, e, t) {
27
+ function s(a) {
28
+ a[t] = e(a.data.height), a.children && a.children.forEach(s);
29
29
  }
30
- t(m);
30
+ s(d);
31
31
  }
32
- function st(m, e, s, t = s) {
33
- function n(i) {
34
- i[t] = i[s] + e, i.children && i.children.forEach(n);
32
+ function st(d, e, t, s = t) {
33
+ function a(i) {
34
+ i[s] = i[t] + e, i.children && i.children.forEach(a);
35
35
  }
36
- n(m);
36
+ a(d);
37
37
  }
38
- const Tt = (m, e) => {
39
- const s = Math.min(...e), t = Math.max(...e);
40
- if (s === t) {
41
- const r = m % 2 === 0 ? [] : [s];
42
- for (let a = 1; a < m / 2 + 1; a++)
43
- r.push(s + a), r.unshift(s - a);
44
- return r;
38
+ const Tt = (d, e) => {
39
+ const t = Math.min(...e), s = Math.max(...e);
40
+ if (t === s) {
41
+ const n = d % 2 === 0 ? [] : [t];
42
+ for (let r = 1; r < d / 2 + 1; r++)
43
+ n.push(t + r), n.unshift(t - r);
44
+ return n;
45
45
  }
46
- if (m < 2)
47
- return [s, t];
48
- const n = (t - s) / (m - 1), i = [];
49
- for (let r = 0; r < m - 1; r++)
50
- i.push(s + n * r);
51
- return i.push(t), i;
46
+ if (d < 2)
47
+ return [t, s];
48
+ const a = (s - t) / (d - 1), i = [];
49
+ for (let n = 0; n < d - 1; n++)
50
+ i.push(t + a * n);
51
+ return i.push(s), i;
52
52
  };
53
- function et(m, e, s) {
54
- let t = s;
55
- return m && (m.colorRange && (t = m.colorRange), m.method === "standardScaling" && (t = [-2, 2]), m.method === "meanNormalization" && (t = [-0.75, 0.75])), Tt(e, t);
53
+ function et(d, e, t) {
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])), Tt(e, s);
56
56
  }
57
- function P(m, e, s) {
58
- let t = 0;
59
- for (const n of m) {
60
- if (e[n] === void 0) continue;
61
- const i = s.getTextWidth(e[n]);
62
- i > t && (t = i);
57
+ function P(d, e, t) {
58
+ let s = 0;
59
+ for (const a of d) {
60
+ if (e[a] === void 0) continue;
61
+ const i = t.getTextWidth(e[a]);
62
+ i > s && (s = i);
63
63
  }
64
- return t;
64
+ return s;
65
65
  }
66
- function K(m, e) {
67
- return e === 90 ? m : e === 45 ? m * Et + (m > 0 ? 2 * At : 0) : V;
66
+ function K(d, e) {
67
+ return e === 90 ? d : e === 45 ? d * Et + (d > 0 ? 2 * At : 0) : V;
68
68
  }
69
69
  class Jt {
70
70
  constructor() {
@@ -128,31 +128,31 @@ class Jt {
128
128
  clear() {
129
129
  var e;
130
130
  this.parentNode && this.rootNode && ((e = this.parentNode) == null || e.removeChild(this.rootNode), this.parentNode = null, this.rootNode = null), setTimeout(() => {
131
- var s;
132
- (s = this.reactRoot) == null || s.unmount(), this.reactRoot = null;
131
+ var t;
132
+ (t = this.reactRoot) == null || t.unmount(), this.reactRoot = null;
133
133
  });
134
134
  }
135
135
  init(e) {
136
136
  this.parentNode === null && (this.parentNode = e, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = rt.createRoot(this.rootNode));
137
137
  }
138
- updateMargins(e, s) {
138
+ updateMargins(e, t) {
139
139
  this.margins = {
140
- top: e.show ? ct + lt * 2 : s.outerOffset,
141
- bottom: s.outerOffset,
142
- left: s.outerOffset,
143
- right: this.legend.width + s.outerOffset
140
+ top: e.show ? ct + lt * 2 : t.outerOffset,
141
+ bottom: t.outerOffset,
142
+ left: t.outerOffset,
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, s, t, n, i) {
147
- if (!s.show) {
146
+ updateLegendSize(e, t, s, a, i) {
147
+ if (!t.show) {
148
148
  this.legend = { width: 0, height: 0, items: [] };
149
149
  return;
150
150
  }
151
- const r = this.chartSizes.chartHeight, a = [], p = { width: 0, height: 0, left: 0, top: 0 }, f = (h) => h.reduce((c, o) => (c[o] = String(o), c), {});
151
+ const n = this.chartSizes.chartHeight, r = [], u = { width: 0, height: 0, left: 0, top: 0 }, f = (h) => h.reduce((c, o) => (c[o] = String(o), c), {});
152
152
  if (e === "continuous") {
153
- const h = this.colorScale, c = Q(h, i), o = D([c[0], c[c.length - 1]], [r, 0]), l = n.label ?? n.value;
154
- a.push({
155
- ...p,
153
+ const h = this.colorScale, c = Q(h, i), o = D([c[0], c[c.length - 1]], [n, 0]), l = a.label ?? a.value;
154
+ r.push({
155
+ ...u,
156
156
  type: "continuous",
157
157
  id: "heatmapValue",
158
158
  scale: h,
@@ -161,41 +161,41 @@ class Jt {
161
161
  tickPositionScale: o
162
162
  });
163
163
  } else if (e === "discrete") {
164
- const h = this.colorScale, c = n.label ?? n.value, o = h.domain(), l = f(o);
165
- a.push({ ...p, type: "discreteColor", id: "heatmapValue", title: c, scale: h, values: o, labels: l });
164
+ const h = this.colorScale, c = a.label ?? a.value, o = h.domain(), l = f(o);
165
+ r.push({ ...u, type: "discreteColor", id: "heatmapValue", title: c, scale: h, values: o, labels: l });
166
166
  }
167
- if (t.forEach((h) => {
167
+ if (s.forEach((h) => {
168
168
  const c = h.valueColumn.label ?? h.valueColumn.value;
169
169
  if (h.type === "continuous") {
170
- const o = this.annotationColorScales[h.id].scale, l = Q(o, i), x = D([l[0], l[l.length - 1]], [r, 0]);
171
- a.push({ ...p, type: "continuous", id: h.id, tickPositionScale: x, title: c, scale: o, values: l });
170
+ const o = this.annotationColorScales[h.id].scale, l = Q(o, i), x = D([l[0], l[l.length - 1]], [n, 0]);
171
+ r.push({ ...u, type: "continuous", id: h.id, tickPositionScale: x, title: c, scale: o, values: l });
172
172
  }
173
173
  if (h.type === "discrete") {
174
174
  const o = this.annotationColorScales[h.id].scale, l = o.domain(), x = f(l);
175
- a.push({ ...p, type: "discreteColor", id: h.id, title: c, scale: o, values: l, labels: x });
175
+ r.push({ ...u, type: "discreteColor", id: h.id, title: c, scale: o, values: l, labels: x });
176
176
  }
177
- }), !a.length) {
177
+ }), !r.length) {
178
178
  this.legend = { width: 0, height: 0, items: [] };
179
179
  return;
180
180
  }
181
- const d = ut(a, this.chartSizes.chartHeight), u = d[d.length - 1], b = u.left + u.width + gt;
181
+ const p = ut(r, this.chartSizes.chartHeight), m = p[p.length - 1], b = m.left + m.width + gt;
182
182
  this.legend = {
183
183
  width: b,
184
- height: r,
185
- items: d
184
+ height: n,
185
+ items: p
186
186
  };
187
187
  }
188
- updateCaptionsSize(e, s, t, n) {
189
- const i = new dt("bold 16px Manrope"), { xGroupKeys: r, yGroupKeys: a, xGroupLabels: p, yGroupLabels: f, xKeysByGroups: d, yKeysByGroups: u, xLabels: b, yLabels: h } = e.meta;
188
+ updateCaptionsSize(e, t, s, a) {
189
+ const i = new dt("bold 16px Manrope"), { xGroupKeys: n, yGroupKeys: r, xGroupLabels: u, yGroupLabels: f, xKeysByGroups: p, yKeysByGroups: m, xLabels: b, yLabels: h } = e.meta;
190
190
  this.labelAngles = {
191
- xAxisLabels: s.axisLabelsAngle,
192
- yAxisLabels: t.axisLabelsAngle,
193
- xGroupLabels: s.groupLabelsAngle,
194
- yGroupLabels: t.groupLabelsAngle
191
+ xAxisLabels: t.axisLabelsAngle,
192
+ yAxisLabels: s.axisLabelsAngle,
193
+ xGroupLabels: t.groupLabelsAngle,
194
+ yGroupLabels: s.groupLabelsAngle
195
195
  };
196
- const c = r.reduce((S, g) => Math.max(S, P(d[g], b, i)), 0), o = a.reduce((S, g) => Math.max(S, P(u[g], h, i)), 0), l = P(r, p, i), x = P(a, f, i), { xCaptionTail: E, yCaptionTail: M } = zt(
196
+ const c = n.reduce((S, g) => Math.max(S, P(p[g], b, i)), 0), o = r.reduce((S, g) => Math.max(S, P(m[g], h, i)), 0), l = P(n, u, i), x = P(r, f, i), { xCaptionTail: E, yCaptionTail: M } = zt(
197
197
  this.labelAngles,
198
- n,
198
+ a,
199
199
  this.scales,
200
200
  this.step,
201
201
  e,
@@ -210,29 +210,29 @@ class Jt {
210
210
  yAxisCaptions: K(o, this.labelAngles.yAxisLabels)
211
211
  };
212
212
  }
213
- updateChartDimensions(e, s, t, n, i, r, a, p, f, d) {
214
- const u = s.length, b = Math.min(i.nRows ?? u, u), h = Math.min(i.nCols ?? u, u);
215
- this.columnsCount = i.nRows ? Math.ceil(u / b) : h, this.rowsCount = Math.ceil(u / this.columnsCount);
213
+ updateChartDimensions(e, t, s, a, i, n, r, u, f, p) {
214
+ const m = t.length, b = Math.min(i.nRows ?? m, m), h = Math.min(i.nCols ?? m, m);
215
+ this.columnsCount = i.nRows ? Math.ceil(m / b) : h, this.rowsCount = Math.ceil(m / this.columnsCount);
216
216
  const { sharedX: c, sharedY: o } = i;
217
217
  this.chartsDimensions = {};
218
218
  let l = 0, x = 0;
219
- s.forEach((S, g) => {
220
- const L = g % this.columnsCount + 1, y = pt(g, s.length, this.columnsCount, this.rowsCount), z = this.step.x[S], w = this.step.y[S], v = ft(
219
+ t.forEach((S, g) => {
220
+ const L = g % this.columnsCount + 1, y = pt(g, t.length, this.columnsCount, this.rowsCount), z = this.step.x[S], w = this.step.y[S], v = ft(
221
+ n,
221
222
  r,
222
- a,
223
223
  this.captionsSizes,
224
- p,
224
+ u,
225
225
  f,
226
- d,
226
+ p,
227
227
  y,
228
228
  c,
229
229
  o,
230
- s,
231
230
  t,
232
- n,
231
+ s,
232
+ a,
233
233
  z,
234
234
  w
235
- ), N = bt(p, y, c, o);
235
+ ), N = bt(u, y, c, o);
236
236
  function H(R) {
237
237
  return Math.max(
238
238
  xt[R].reduce((k, j) => k + v[R][j], 0),
@@ -258,162 +258,162 @@ class Jt {
258
258
  chartEdgeSides: y
259
259
  }, l += W, L === this.columnsCount && (l = 0, x += _);
260
260
  });
261
- const E = s.slice(0, this.columnsCount).reduce((S, g) => S + this.chartsDimensions[g].outer.width, 0), M = s.filter((S, g) => g % this.columnsCount === 0).reduce((S, g) => S + this.chartsDimensions[g].outer.height, 0);
261
+ const E = 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);
262
262
  this.chartSizes.chartsWidth = E, this.chartSizes.chartsHeight = M;
263
263
  }
264
- updateChartsSizes(e, s, t, n) {
265
- const { width: i, height: r, cellWidth: a, cellHeight: p } = e, f = t.meta.facetKeys[0];
266
- if (a && s.sharedX && f) {
267
- const d = t.facets[f].xKeys.length, u = t.meta.xGroupKeys.length;
268
- this.chartSizes.chartWidth = d * a + n * (u - 1);
264
+ updateChartsSizes(e, t, s) {
265
+ const { width: a, height: i, cellWidth: n, cellHeight: r } = e, u = t.meta.facetKeys[0];
266
+ if (n && u) {
267
+ const f = t.facets[u].xKeys.length, p = t.meta.xGroupKeys.length;
268
+ this.chartSizes.chartWidth = f * n + s * (p - 1);
269
269
  } else
270
- this.chartSizes.chartWidth = i;
271
- if (p && s.sharedY && f) {
272
- const d = t.facets[f].yKeys.length, u = t.meta.yGroupKeys.length;
273
- this.chartSizes.chartHeight = d * p + n * (u - 1);
270
+ this.chartSizes.chartWidth = a;
271
+ if (r && u) {
272
+ const f = t.facets[u].yKeys.length, p = t.meta.yGroupKeys.length;
273
+ this.chartSizes.chartHeight = f * r + s * (p - 1);
274
274
  } else
275
- this.chartSizes.chartHeight = r;
275
+ this.chartSizes.chartHeight = i;
276
276
  }
277
277
  // update scales for cell positions, x and y for each facet
278
- updateScales(e, s, t, n, i, r, a, p, f, d) {
279
- const { width: u, height: b, cellWidth: h, cellHeight: c } = i, { meta: o, facets: l } = s, { sharedX: x, sharedY: E } = n, M = (g, L = {}) => g.sort(
280
- (y, z) => r.sorting === "asc" ? (L[y] ?? y).localeCompare(L[z] ?? z, "en", { numeric: !0 }) : (L[z] ?? z).localeCompare(L[y] ?? y, "en", { numeric: !0 })
278
+ updateScales(e, t, s, a, i, n, r, u, f, p) {
279
+ const { width: m, height: b, cellWidth: h, cellHeight: c } = i, { meta: o, facets: l } = t, { sharedX: x, sharedY: E } = a, M = (g, L = {}) => g.sort(
280
+ (y, z) => n.sorting === "asc" ? (L[y] ?? y).localeCompare(L[z] ?? z, "en", { numeric: !0 }) : (L[z] ?? z).localeCompare(L[y] ?? y, "en", { numeric: !0 })
281
281
  ), S = (g, L = {}) => g.sort(
282
- (y, z) => a.sorting === "asc" ? (L[y] ?? y).localeCompare(L[z] ?? z, "en", { numeric: !0 }) : (L[z] ?? z).localeCompare(L[y] ?? y, "en", { numeric: !0 })
282
+ (y, z) => r.sorting === "asc" ? (L[y] ?? y).localeCompare(L[z] ?? z, "en", { numeric: !0 }) : (L[z] ?? z).localeCompare(L[y] ?? y, "en", { numeric: !0 })
283
283
  );
284
284
  e.forEach((g) => {
285
- const L = l[g], y = d.xGroup ? o.xGroupKeys : M(o.xGroupKeys), z = d.yGroup ? o.yGroupKeys : S(o.yGroupKeys), { xKeysByGroups: w } = x ? o : L, { yKeysByGroups: v } = E ? o : L, N = y.map((G) => w[G].length), H = z.map((G) => v[G].length), A = N.reduce((G, T) => G + T, 0), B = H.reduce((G, T) => G + T, 0), W = x && h ? h : (u - (N.filter((G) => G > 0).length - 1) * t) / A, _ = E && c ? c : (b - (H.filter((G) => G > 0).length - 1) * t) / B, R = [];
285
+ const L = l[g], y = p.xGroup ? o.xGroupKeys : M(o.xGroupKeys), z = p.yGroup ? o.yGroupKeys : S(o.yGroupKeys), { xKeysByGroups: w } = x ? o : L, { yKeysByGroups: v } = E ? o : L, N = y.map((G) => w[G].length), H = z.map((G) => v[G].length), A = N.reduce((G, T) => G + T, 0), B = H.reduce((G, T) => G + T, 0), W = h || (m - (N.filter((G) => G > 0).length - 1) * s) / A, _ = c || (b - (H.filter((G) => G > 0).length - 1) * s) / B, R = [];
286
286
  let k = [], j = 0;
287
287
  y.forEach((G) => {
288
- const T = p || d.x ? w[G] : M(w[G], o.xLabels);
288
+ const T = u || p.x ? w[G] : M(w[G], o.xLabels);
289
289
  k = k.concat(T), T.forEach(() => {
290
290
  R.push(j), j += W;
291
- }), T.length > 0 && (j += t);
291
+ }), T.length > 0 && (j += s);
292
292
  });
293
293
  const J = [];
294
- let X = [], U = 0;
294
+ let U = [], X = 0;
295
295
  z.forEach((G) => {
296
- const T = f || d.y ? v[G] : S(v[G], o.yLabels);
297
- X = X.concat(T), T.forEach(() => {
298
- J.push(U), U += _;
299
- }), T.length > 0 && (U += t);
300
- }), this.scales.x[g] = I().domain(k).range(R), this.scales.y[g] = I().domain(X).range(J), this.step.x[g] = W, this.step.y[g] = _;
296
+ const T = f || p.y ? v[G] : S(v[G], o.yLabels);
297
+ U = U.concat(T), T.forEach(() => {
298
+ J.push(X), X += _;
299
+ }), T.length > 0 && (X += s);
300
+ }), this.scales.x[g] = I().domain(k).range(R), this.scales.y[g] = I().domain(U).range(J), this.step.x[g] = W, this.step.y[g] = _;
301
301
  });
302
302
  }
303
- updateAesScale(e, s, t, n, i, r, a) {
303
+ updateAesScale(e, t, s, a, i, n, r) {
304
304
  if (e === "continuous")
305
- t.valueColors ? this.colorScale = D().domain(t.valuesByColors ?? et(a, t.valueColors.length, s)).range(t.valueColors) : t.colorsList && (this.colorScale = D().domain(et(a, t.colorsList.length, s)).range(t.colorsList));
306
- else if (t.colorsMap) {
307
- const d = Object.entries(t.colorsMap);
308
- this.colorScale = I().domain(d.map((u) => u[0])).range(d.map((u) => u[1])).unknown("#ccc");
309
- } else t.colorsList && (this.colorScale = yt(t.colorsList, r.map(String)));
310
- const { xDataByKeys: p, yDataByKeys: f } = i.meta;
311
- n.forEach((d) => {
312
- const { colors: u, type: b, axis: h, valueColumn: c } = d, o = (h === "x" ? p : f)[c.valueLabels ?? c.value];
305
+ s.valueColors ? this.colorScale = D().domain(s.valuesByColors ?? et(r, s.valueColors.length, t)).range(s.valueColors) : s.colorsList && (this.colorScale = D().domain(et(r, s.colorsList.length, t)).range(s.colorsList));
306
+ else if (s.colorsMap) {
307
+ const p = Object.entries(s.colorsMap);
308
+ this.colorScale = I().domain(p.map((m) => m[0])).range(p.map((m) => m[1])).unknown("#ccc");
309
+ } else s.colorsList && (this.colorScale = yt(s.colorsList, n.map(String)));
310
+ const { xDataByKeys: u, yDataByKeys: f } = i.meta;
311
+ a.forEach((p) => {
312
+ const { colors: m, type: b, axis: h, valueColumn: c } = p, o = (h === "x" ? u : f)[c.valueLabels ?? c.value];
313
313
  if (b === "discrete") {
314
314
  const l = nt.uniq(Object.values(o).map(String)).sort();
315
- this.annotationColorScales[d.id] = {
315
+ this.annotationColorScales[p.id] = {
316
316
  type: "discrete",
317
- scale: Ct(u, l)
317
+ scale: Ct(m, l)
318
318
  };
319
319
  } else {
320
320
  const l = Object.values(o).map(Number);
321
321
  if (!l.length)
322
322
  return;
323
323
  const [x = l[0], E = l[0]] = Gt(l);
324
- this.annotationColorScales[d.id] = {
324
+ this.annotationColorScales[p.id] = {
325
325
  type: "continuous",
326
- scale: Lt(u, x, E, 0, 0.5, 1)
326
+ scale: Lt(m, x, E, 0, 0.5, 1)
327
327
  };
328
328
  }
329
329
  });
330
330
  }
331
- updateDendrogram(e, s, t, n, i, r, a) {
332
- e.forEach((p) => {
333
- this.dendrograms[p] = { x: { treesByGroupKey: {}, data: r }, y: { treesByGroupKey: {}, data: a } };
334
- const { xKeysByGroups: f, yKeysByGroups: d } = n[p];
335
- if (r) {
336
- const { hierarchyByGroupX: u } = i[p], b = s.reduce((h, c) => {
331
+ updateDendrogram(e, t, s, a, i, n, r) {
332
+ e.forEach((u) => {
333
+ this.dendrograms[u] = { x: { treesByGroupKey: {}, data: n }, y: { treesByGroupKey: {}, data: r } };
334
+ const { xKeysByGroups: f, yKeysByGroups: p } = a[u];
335
+ if (n) {
336
+ const { hierarchyByGroupX: m } = i[u], b = t.reduce((h, c) => {
337
337
  var o;
338
- return Math.max(h, (o = u[c]) == null ? void 0 : o.data.height);
338
+ return Math.max(h, (o = m[c]) == null ? void 0 : o.data.height);
339
339
  }, 0);
340
- this.dendrograms[p].x.treesByGroupKey = s.reduce((h, c) => {
341
- const o = u[c], l = f[c];
342
- $().separation(() => 1).size([l.length * this.step.x[p], r.size])(
340
+ this.dendrograms[u].x.treesByGroupKey = t.reduce((h, c) => {
341
+ const o = m[c], l = f[c];
342
+ $().separation(() => 1).size([l.length * this.step.x[u], n.size])(
343
343
  o
344
344
  );
345
- const x = o, E = D().domain(r.position === "top" ? [0, b] : [b, 0]).range([r.size, 0]);
346
- return tt(x, E, "y"), st(x, this.scales.x[p](l[0]), "x"), h[c] = x, h;
347
- }, {}), this.dendrograms[p].x.data = r;
345
+ const x = o, E = D().domain(n.position === "top" ? [0, b] : [b, 0]).range([n.size, 0]);
346
+ return tt(x, E, "y"), st(x, this.scales.x[u](l[0]), "x"), h[c] = x, h;
347
+ }, {}), this.dendrograms[u].x.data = n;
348
348
  }
349
- if (a) {
350
- const { hierarchyByGroupY: u } = i[p], b = t.reduce((h, c) => {
349
+ if (r) {
350
+ const { hierarchyByGroupY: m } = i[u], b = s.reduce((h, c) => {
351
351
  var o;
352
- return Math.max(h, (o = u[c]) == null ? void 0 : o.data.height);
352
+ return Math.max(h, (o = m[c]) == null ? void 0 : o.data.height);
353
353
  }, 0);
354
- this.dendrograms[p].y.treesByGroupKey = t.reduce((h, c) => {
355
- const o = u[c], l = d[c];
356
- $().separation(() => 1).size([l.length * this.step.y[p], a.size])(
354
+ this.dendrograms[u].y.treesByGroupKey = s.reduce((h, c) => {
355
+ const o = m[c], l = p[c];
356
+ $().separation(() => 1).size([l.length * this.step.y[u], r.size])(
357
357
  o
358
358
  );
359
- const x = o, E = D().domain(a.position === "left" ? [0, b] : [b, 0]).range([a.size, 0]);
360
- return st(x, this.scales.y[p](l[0]), "x", "y"), tt(x, E, "x"), h[c] = x, h;
361
- }, {}), this.dendrograms[p].y.data = a;
359
+ const x = o, E = D().domain(r.position === "left" ? [0, b] : [b, 0]).range([r.size, 0]);
360
+ return st(x, this.scales.y[u](l[0]), "x", "y"), tt(x, E, "x"), h[c] = x, h;
361
+ }, {}), this.dendrograms[u].y.data = r;
362
362
  }
363
363
  });
364
364
  }
365
365
  updateDendrogramAesScales(e) {
366
366
  if (!e)
367
367
  return;
368
- const s = Object.keys(e);
369
- this.dendrogramAesScales = s.reduce((t, n) => {
370
- const i = e[n], r = Object.keys(i);
371
- return t[n] = I().domain(r).range(
372
- r.map((a) => ({
368
+ const t = Object.keys(e);
369
+ this.dendrogramAesScales = t.reduce((s, a) => {
370
+ const i = e[a], n = Object.keys(i);
371
+ return s[a] = I().domain(n).range(
372
+ n.map((r) => ({
373
373
  ...Z,
374
- ...i[a]
374
+ ...i[r]
375
375
  }))
376
- ).unknown(Z), t;
376
+ ).unknown(Z), s;
377
377
  }, {});
378
378
  }
379
- render(e, s, t, n, i, r, a, p, f, d, u, b, h, c, o, l, x) {
379
+ render(e, t, s, a, i, n, r, u, f, p, m, b, h, c, o, l, x) {
380
380
  var B;
381
- const { meta: E, facets: M } = r, { facetKeys: S, xGroupKeys: g, yGroupKeys: L, valueExtent: y } = E, { xAxis: z, yAxis: w, title: v, size: N, valueType: H } = t;
382
- this.updateChartsSizes(N, n, r, i.groupGap), this.updateAesScale(H, y.dataSource, i, a, r, h, c), this.updateScales(S, r, i.groupGap, n, N, t.xAxis, t.yAxis, f, d, l), this.updateCaptionsSize(r, z, w, n), this.updateChartDimensions(
381
+ const { meta: E, facets: M } = n, { facetKeys: S, xGroupKeys: g, yGroupKeys: L, valueExtent: y } = E, { xAxis: z, yAxis: w, title: v, size: N, valueType: H } = s;
382
+ this.updateChartsSizes(N, n, i.groupGap), this.updateAesScale(H, y.dataSource, i, r, n, h, c), this.updateScales(S, n, i.groupGap, a, N, s.xAxis, s.yAxis, f, p, l), this.updateCaptionsSize(n, z, w, a), this.updateChartDimensions(
383
383
  N,
384
384
  S,
385
385
  g,
386
386
  L,
387
- n,
387
+ a,
388
388
  z,
389
389
  w,
390
- a,
390
+ r,
391
391
  f,
392
- d
393
- ), this.updateLegendSize(H, t.legend, a, p, y.dataSource), this.updateMargins(v, N), this.updateDendrogram(S, g, L, M, u, f, d), this.updateDendrogramAesScales(b);
392
+ p
393
+ ), this.updateLegendSize(H, s.legend, r, u, y.dataSource), this.updateMargins(v, N), this.updateDendrogram(S, g, L, M, m, f, p), this.updateDendrogramAesScales(b);
394
394
  const A = /* @__PURE__ */ O.jsx(ht, { dataFrame: e, children: /* @__PURE__ */ O.jsx(
395
395
  mt,
396
396
  {
397
397
  aes: i,
398
- annotations: a,
398
+ annotations: r,
399
399
  annotationColorScales: this.annotationColorScales,
400
400
  captionsSizes: this.captionsSizes,
401
401
  cellsMeta: E,
402
402
  columnsCount: this.columnsCount,
403
403
  chartsDimensions: this.chartsDimensions,
404
- chartSettings: t,
404
+ chartSettings: s,
405
405
  chartSizes: this.chartSizes,
406
406
  colorScale: this.colorScale,
407
407
  dendrogramAesScales: this.dendrogramAesScales,
408
408
  dendrograms: this.dendrograms,
409
409
  facetKeys: S,
410
- facetSettings: n,
410
+ facetSettings: a,
411
411
  groupedCells: M,
412
412
  labelAngles: this.labelAngles,
413
413
  legend: this.legend,
414
414
  margins: this.margins,
415
415
  scales: this.scales,
416
- settingsId: s,
416
+ settingsId: t,
417
417
  step: this.step,
418
418
  xGroupKeys: g,
419
419
  yGroupKeys: L,
@@ -424,8 +424,8 @@ class Jt {
424
424
  this.component = A, (B = this.reactRoot) == null || B.render(A);
425
425
  }
426
426
  renderError(e) {
427
- var s;
428
- (s = this.reactRoot) == null || s.render(/* @__PURE__ */ O.jsx(at, { message: e }));
427
+ var t;
428
+ (t = this.reactRoot) == null || t.render(/* @__PURE__ */ O.jsx(at, { message: e }));
429
429
  }
430
430
  }
431
431
  export {