@milaboratories/miplots4 1.0.170 → 1.0.172

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.
Files changed (131) hide show
  1. package/README.md +11 -6
  2. package/dist/_virtual/client.js +1 -1
  3. package/dist/_virtual/client2.js +2 -2
  4. package/dist/_virtual/index.js +1 -1
  5. package/dist/_virtual/index2.js +1 -1
  6. package/dist/_virtual/jsx-runtime.js +1 -1
  7. package/dist/_virtual/react-dom-client.development.js +5 -0
  8. package/dist/_virtual/react-dom-client.development.js.map +1 -0
  9. package/dist/_virtual/react-dom-client.production.js +5 -0
  10. package/dist/_virtual/react-dom-client.production.js.map +1 -0
  11. package/dist/_virtual/{react-dom-server-legacy.browser.production.min.js → react-dom-server-legacy.browser.production.js} +1 -1
  12. package/dist/_virtual/react-dom-server-legacy.browser.production.js.map +1 -0
  13. package/dist/_virtual/react-dom-server.browser.production.js +5 -0
  14. package/dist/_virtual/react-dom-server.browser.production.js.map +1 -0
  15. package/dist/_virtual/react-dom.production.js +5 -0
  16. package/dist/_virtual/react-dom.production.js.map +1 -0
  17. package/dist/_virtual/react-jsx-runtime.production.js +5 -0
  18. package/dist/_virtual/react-jsx-runtime.production.js.map +1 -0
  19. package/dist/_virtual/react.production.js +5 -0
  20. package/dist/_virtual/react.production.js.map +1 -0
  21. package/dist/_virtual/scheduler.production.js +5 -0
  22. package/dist/_virtual/scheduler.production.js.map +1 -0
  23. package/dist/_virtual/server.browser.js +1 -1
  24. package/dist/bubble/ChartRenderer.js +143 -146
  25. package/dist/bubble/ChartRenderer.js.map +1 -1
  26. package/dist/bubble/index.js.map +1 -1
  27. package/dist/common/ErrorBoundary.d.ts +1 -1
  28. package/dist/dendro/ChartRenderer.js +175 -174
  29. package/dist/dendro/ChartRenderer.js.map +1 -1
  30. package/dist/dendro/index.js.map +1 -1
  31. package/dist/discrete/index.js.map +1 -1
  32. package/dist/heatmap/index.js.map +1 -1
  33. package/dist/histogram/index.js.map +1 -1
  34. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +17062 -0
  35. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js.map +1 -0
  36. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +9790 -0
  37. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js.map +1 -0
  38. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6245 -0
  39. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js.map +1 -0
  40. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4106 -0
  41. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js.map +1 -0
  42. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6763 -0
  43. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.browser.development.js.map +1 -0
  44. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4655 -0
  45. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-server.browser.production.js.map +1 -0
  46. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.development.js +228 -0
  47. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.development.js.map +1 -0
  48. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.production.js +148 -0
  49. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom.production.js.map +1 -0
  50. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +24 -0
  51. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js.map +1 -0
  52. package/dist/node_modules/.pnpm/{react-dom@18.3.1_react@18.3.1 → react-dom@19.2.4_react@19.2.4}/node_modules/react-dom/index.js +1 -1
  53. package/dist/node_modules/.pnpm/{react-dom@18.3.1_react@18.3.1 → react-dom@19.2.4_react@19.2.4}/node_modules/react-dom/index.js.map +1 -1
  54. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/server.browser.js +16 -0
  55. package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/server.browser.js.map +1 -0
  56. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js +246 -0
  57. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -0
  58. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js +36 -0
  59. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js.map +1 -0
  60. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.development.js +865 -0
  61. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.development.js.map +1 -0
  62. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js +373 -0
  63. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js.map +1 -0
  64. package/dist/node_modules/.pnpm/{react@18.3.1 → react@19.2.4}/node_modules/react/index.js +1 -1
  65. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/index.js.map +1 -0
  66. package/dist/node_modules/.pnpm/{react@18.3.1 → react@19.2.4}/node_modules/react/jsx-runtime.js +3 -3
  67. package/dist/node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js.map +1 -0
  68. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +237 -0
  69. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js.map +1 -0
  70. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +234 -0
  71. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js.map +1 -0
  72. package/dist/node_modules/.pnpm/{scheduler@0.23.2 → scheduler@0.27.0}/node_modules/scheduler/index.js +1 -1
  73. package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js.map +1 -0
  74. package/dist/scatterplot/ChartRenderer.js +149 -152
  75. package/dist/scatterplot/ChartRenderer.js.map +1 -1
  76. package/dist/scatterplot/index.js.map +1 -1
  77. package/dist/scatterplot-umap/ChartRenderer.js +152 -155
  78. package/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
  79. package/dist/utils/arrangeLegendParts.js +35 -35
  80. package/dist/utils/arrangeLegendParts.js.map +1 -1
  81. package/dist/utils/getContinuousLegendTicks.js +5 -8
  82. package/dist/utils/getContinuousLegendTicks.js.map +1 -1
  83. package/dist/utils/getSizeLegendItem.d.ts +3 -0
  84. package/dist/utils/getSizeLegendItem.js +15 -0
  85. package/dist/utils/getSizeLegendItem.js.map +1 -0
  86. package/dist/utils/numberFormat.d.ts +1 -0
  87. package/dist/utils/numberFormat.js +9 -4
  88. package/dist/utils/numberFormat.js.map +1 -1
  89. package/package.json +7 -5
  90. package/dist/_virtual/react-dom-server-legacy.browser.production.min.js.map +0 -1
  91. package/dist/_virtual/react-dom-server.browser.production.min.js +0 -5
  92. package/dist/_virtual/react-dom-server.browser.production.min.js.map +0 -1
  93. package/dist/_virtual/react-dom.production.min.js +0 -5
  94. package/dist/_virtual/react-dom.production.min.js.map +0 -1
  95. package/dist/_virtual/react-jsx-runtime.production.min.js +0 -5
  96. package/dist/_virtual/react-jsx-runtime.production.min.js.map +0 -1
  97. package/dist/_virtual/react.production.min.js +0 -5
  98. package/dist/_virtual/react.production.min.js.map +0 -1
  99. package/dist/_virtual/scheduler.production.min.js +0 -5
  100. package/dist/_virtual/scheduler.production.min.js.map +0 -1
  101. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +0 -3622
  102. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js.map +0 -1
  103. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0 -1235
  104. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js.map +0 -1
  105. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -3601
  106. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server.browser.development.js.map +0 -1
  107. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +0 -1256
  108. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js.map +0 -1
  109. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js +0 -13457
  110. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.development.js.map +0 -1
  111. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js +0 -5177
  112. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js.map +0 -1
  113. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js +0 -33
  114. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js.map +0 -1
  115. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/server.browser.js +0 -16
  116. package/dist/node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/server.browser.js.map +0 -1
  117. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js +0 -605
  118. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js.map +0 -1
  119. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -29
  120. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js.map +0 -1
  121. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js +0 -1274
  122. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js.map +0 -1
  123. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js +0 -209
  124. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js.map +0 -1
  125. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js.map +0 -1
  126. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js.map +0 -1
  127. package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.development.js +0 -278
  128. package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.development.js.map +0 -1
  129. package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js +0 -214
  130. package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js.map +0 -1
  131. package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/index.js.map +0 -1
@@ -1,99 +1,100 @@
1
- var V = Object.defineProperty;
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
- import { j as F } from "../_virtual/jsx-runtime.js";
5
- import { c as Z } from "../_virtual/client.js";
6
- import { Error as $ } from "../common/Error.js";
7
- import { BLACK as D } from "../constants.js";
8
- import { DEFAULT_DOT_AES as tt, LEGEND_OFFSET as et } from "../scatterplot/constants.js";
9
- import { isCategoricalAes as X, isContinuousAes as q } from "../types/common.js";
1
+ var q = Object.defineProperty;
2
+ var k = (n, t, e) => t in n ? q(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var L = (n, t, e) => k(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import { j as O } from "../_virtual/jsx-runtime.js";
5
+ import { c as J } from "../_virtual/client.js";
6
+ import { Error as Q } from "../common/Error.js";
7
+ import { BLACK as V } from "../constants.js";
8
+ import { DEFAULT_DOT_AES as Y, LEGEND_OFFSET as Z } from "../scatterplot/constants.js";
9
+ import { isCategoricalAes as U, isContinuousAes as X } from "../types/common.js";
10
10
  import "../types/discrete.js";
11
11
  import "../types/scatterplot.js";
12
12
  import "../types/heatmap.js";
13
13
  import "../types/dendro.js";
14
14
  import "../types/histogram.js";
15
15
  import "../types/bubble.js";
16
- import { getContinuousLegendTicks as it } from "../utils/getContinuousLegendTicks.js";
17
- import { getContinuousLegendWidth as st, getDiscreteLegendWidth as ot } from "../utils/getLegendWidth.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
- import { updateLinksHeight as at, updateNodesHorizontalPosition as lt } from "./getHierarchyData.js";
22
- import b from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js";
23
- import ct from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js";
24
- import { sqrt as J } from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/pow.js";
25
- import pt from "../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/cluster.js";
26
- function O(n, t) {
27
- if (X(t))
16
+ import { getContinuousLegendTicks as $ } from "../utils/getContinuousLegendTicks.js";
17
+ import { getContinuousLegendWidth as D, getDiscreteLegendWidth as tt } from "../utils/getLegendWidth.js";
18
+ import { TextMeasurer as B } from "../utils/TextMeasurer/TextMeasurer.js";
19
+ import { Chart as et } from "./components/Chart.js";
20
+ import { MARGIN as M, HEIGHT as j, WIDTH as K, MAX_HEATMAP_WIDTH as it, COLOR_NULL as y, MAX_LEGEND_HEIGHT as st, HEATMAP_LEFT_OFFSET as P } from "./constants.js";
21
+ import { updateLinksHeight as ot, updateNodesHorizontalPosition as rt } from "./getHierarchyData.js";
22
+ import { getSizeLegendItem as ht } from "../utils/getSizeLegendItem.js";
23
+ import N from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js";
24
+ import nt from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js";
25
+ import at from "../node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/cluster.js";
26
+ import { sqrt as lt } from "../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/pow.js";
27
+ function R(n, t) {
28
+ if (U(t))
28
29
  return (e) => t.valuesMap[String(n.getColumnValue(t.columnName.value, e))];
29
- if (q(t)) {
30
- const { domain: e, range: s } = t, c = J().domain(e).range(s);
31
- return (h) => {
32
- const o = c(Number(n.getColumnValue(t.columnName.value, h)));
30
+ if (X(t)) {
31
+ const { domain: e, range: s } = t, c = lt().domain(e).range(s);
32
+ return (a) => {
33
+ const o = c(Number(n.getColumnValue(t.columnName.value, a)));
33
34
  return Math.max(1, o);
34
35
  };
35
36
  }
36
37
  return (e) => t;
37
38
  }
38
- function dt(n, t) {
39
+ function ct(n, t) {
39
40
  return {
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)
41
+ nodeShape: R(n, t.nodeShape),
42
+ nodeColor: R(n, t.nodeColor),
43
+ nodeSize: R(n, t.nodeSize),
44
+ lineShape: R(n, t.lineShape),
45
+ lineColor: R(n, t.lineColor)
45
46
  };
46
47
  }
47
- const mt = (n, t) => {
48
+ const pt = (n, t) => {
48
49
  const e = Math.min(...t), s = Math.max(...t);
49
50
  if (e === s) {
50
51
  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);
52
+ for (let d = 1; d < n / 2 + 1; d++)
53
+ o.push(e + d), o.unshift(e - d);
53
54
  return o;
54
55
  }
55
56
  if (n < 2)
56
57
  return [e, s];
57
- const c = (s - e) / (n - 1), h = [];
58
+ const c = (s - e) / (n - 1), a = [];
58
59
  for (let o = 0; o < n - 1; o++)
59
- h.push(e + c * o);
60
- return h.push(s), h;
60
+ a.push(e + c * o);
61
+ return a.push(s), a;
61
62
  };
62
- function ut(n, t = 1, e, s) {
63
+ function dt(n, t = 1, e, s) {
63
64
  const c = (n < 16 ? 40 : n < 49 ? 32 : 24) * t;
64
65
  return Math.max(Math.min(c, s ?? 1 / 0), e ?? -1 / 0);
65
66
  }
66
- class Ft {
67
+ class It {
67
68
  constructor() {
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
- treeHeight: k,
69
+ L(this, "component", /* @__PURE__ */ O.jsx(O.Fragment, {}));
70
+ L(this, "reactRoot", null);
71
+ L(this, "parentNode", null);
72
+ L(this, "rootNode", null);
73
+ L(this, "chartSizes", {
74
+ treeWidth: K,
75
+ treeHeight: j,
75
76
  heatmapWidth: 0,
76
77
  heatmapHeight: 0,
77
- totalWidth: j + j + N.LEFT + N.RIGHT,
78
- totalHeight: k + N.TOP + N.BOTTOM,
78
+ totalWidth: K + K + M.LEFT + M.RIGHT,
79
+ totalHeight: j + M.TOP + M.BOTTOM,
79
80
  labelsOffset: 0,
80
- marginLeft: N.LEFT,
81
- marginRight: N.RIGHT,
82
- marginTop: N.TOP,
83
- marginBottom: N.BOTTOM
81
+ marginLeft: M.LEFT,
82
+ marginRight: M.RIGHT,
83
+ marginTop: M.TOP,
84
+ marginBottom: M.BOTTOM
84
85
  });
85
- E(this, "legend", { width: 0, height: 0, items: [] });
86
+ L(this, "legend", { width: 0, height: 0, items: [] });
86
87
  // heatmap scales and step
87
- E(this, "heatmapScales", {
88
- x: b().domain(["null"]).range([1]),
89
- y: b().domain(["null"]).range([1])
88
+ L(this, "heatmapScales", {
89
+ x: N().domain(["null"]).range([1]),
90
+ y: N().domain(["null"]).range([1])
90
91
  });
91
- E(this, "heatmapStep", { x: 0, y: 0 });
92
- E(this, "heatmapColorScale", {
93
- scale: b([]),
92
+ L(this, "heatmapStep", { x: 0, y: 0 });
93
+ L(this, "heatmapColorScale", {
94
+ scale: N([]),
94
95
  getter: () => "white"
95
96
  });
96
- E(this, "heatmapLabels", []);
97
+ L(this, "heatmapLabels", []);
97
98
  }
98
99
  clear() {
99
100
  var t;
@@ -103,30 +104,30 @@ class Ft {
103
104
  });
104
105
  }
105
106
  init(t) {
106
- this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = Z.createRoot(this.rootNode));
107
+ this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = J.createRoot(this.rootNode));
107
108
  }
108
109
  updateHeatmapScales(t, e, s) {
109
110
  if (t === null) {
110
111
  this.chartSizes.heatmapWidth = 0;
111
112
  return;
112
113
  }
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(
114
+ const { xKeysByGroups: c, xGroupKeys: a, xKeys: o, yKeys: d } = t, g = 5, S = a.map((i) => c[i].length), w = S.reduce((i, r) => i + r, 0), W = this.chartSizes.treeHeight / d.length, b = Math.min(
114
115
  Math.max(
115
- (nt - (f.filter((i) => i > 0).length - 1) * S) / A,
116
+ (it - (S.filter((i) => i > 0).length - 1) * g) / w,
116
117
  s.minCellWidth
117
118
  ),
118
119
  s.maxCellWidth
119
- ), y = [];
120
+ ), v = [];
120
121
  let C = 0;
121
- h.forEach((i) => {
122
+ a.forEach((i) => {
122
123
  const r = c[i];
123
124
  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);
125
+ v.push(C), C += b;
126
+ }), r.length > 0 && (C += g);
127
+ }), this.heatmapScales.x = N().domain(o).range(v), this.heatmapScales.y = N().domain(d).range(d.map((i, r) => r * W)), this.heatmapStep.x = b, this.heatmapStep.y = W;
128
+ const { colorsList: f, colorsMap: x } = e.aes;
129
+ if (e.valueType === "continuous" && f) {
130
+ const i = nt().domain(pt(f.length, t.meta.valueExtent)).range(f);
130
131
  this.heatmapColorScale = {
131
132
  scale: i,
132
133
  getter: (r) => i(r)
@@ -135,26 +136,26 @@ class Ft {
135
136
  if (e.valueType === "discrete" && x) {
136
137
  const i = Object.keys(x).filter((r) => t.meta.uniqueValues.has(r));
137
138
  this.heatmapColorScale = {
138
- scale: b(
139
+ scale: N(
139
140
  i,
140
141
  i.map((r) => x[r])
141
- ).unknown(G),
142
- getter: (r) => r ? x[r] ?? G : G
142
+ ).unknown(y),
143
+ getter: (r) => r ? x[r] ?? y : y
143
144
  };
144
145
  }
145
- if (e.valueType === "stringSource" && T) {
146
- const i = [...t.meta.uniqueValues], r = b(
146
+ if (e.valueType === "stringSource" && f) {
147
+ const i = [...t.meta.uniqueValues], r = N(
147
148
  i,
148
- i.map((z, H) => T[H % T.length])
149
- ).unknown(G);
149
+ i.map((z, H) => f[H % f.length])
150
+ ).unknown(y);
150
151
  this.heatmapColorScale = {
151
152
  scale: r,
152
- getter: (z) => z ? r(z) : G
153
+ getter: (z) => z ? r(z) : y
153
154
  };
154
155
  }
155
156
  this.chartSizes.heatmapWidth = this.heatmapScales.x(t.xKeys[t.xKeys.length - 1]) + this.heatmapStep.x;
156
157
  }
157
- updateLegendSize(t, e, s, c, h, o) {
158
+ updateLegendSize(t, e, s, c, a, o) {
158
159
  if (!t.show) {
159
160
  this.legend = {
160
161
  width: 0,
@@ -163,157 +164,157 @@ class Ft {
163
164
  };
164
165
  return;
165
166
  }
166
- const p = new K("600 14px Arial"), S = 16, f = 48, A = 20, M = 24;
167
- function v(d, a) {
167
+ const d = new B("600 14px Arial"), g = 16, S = 48, w = 20, W = 24;
168
+ function b(l, h) {
168
169
  return Math.max(
169
- ...d.map((m) => p.getTextWidth(String(m)) + A),
170
- p.getTextWidth(a)
170
+ ...l.map((p) => d.getTextWidth(String(p)) + w),
171
+ d.getTextWidth(h)
171
172
  );
172
173
  }
173
- const y = [];
174
- [s.nodeColor, s.nodeShape, s.lineColor].filter(X).map((d) => d.columnName).forEach((d) => {
175
- const a = e[d.value];
176
- if (a.usedAes.length === 0 || !a.aesMap)
174
+ const v = [];
175
+ [s.nodeColor, s.nodeShape, s.lineColor].filter(U).map((l) => l.columnName).forEach((l) => {
176
+ const h = e[l.value];
177
+ if (h.usedAes.length === 0 || !h.aesMap)
177
178
  return;
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
+ const p = l.label ?? l.value, E = h.values, T = {};
180
+ E.forEach((m) => {
181
+ T[m] || (T[m] = { ...Y }), h.usedAes.forEach((u) => {
182
+ var A, _, G;
183
+ (u === "dotFill" || u === "lineColor") && (T[m].color = ((A = h.aesMap[m]) == null ? void 0 : A[u]) ?? V), u === "dotShape" && (T[m].shape = ((_ = h.aesMap[m]) == null ? void 0 : _[u]) ?? "21"), u === "dotSize" && (T[m].size = ((G = h.aesMap[m]) == null ? void 0 : G[u]) ?? 3);
183
184
  });
184
- }), y.push({
185
- columnKey: m,
186
- data: u,
187
- values: a.values,
188
- labels: a.labels
185
+ }), v.push({
186
+ columnKey: p,
187
+ data: T,
188
+ values: h.values,
189
+ labels: h.labels
189
190
  });
190
191
  });
191
- const T = [];
192
- let x = 0, i = 0, r = 0, z = Math.min(this.chartSizes.treeHeight, ht);
193
- if (c && h) {
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 = {
192
+ const f = [];
193
+ let x = 0, i = 0, r = 0, z = Math.min(this.chartSizes.treeHeight, st);
194
+ if (c && a) {
195
+ const l = o.valueType, h = c.label ?? c.value;
196
+ if (l === "continuous") {
197
+ const p = this.heatmapColorScale.scale, E = $(p, a.meta.valueExtent, 4), m = {
197
198
  id: "heatmapValue",
198
199
  type: "continuous",
199
- width: st(L, a),
200
+ width: D(E, h),
200
201
  height: z,
201
202
  left: 0,
202
203
  top: 0,
203
- title: a,
204
- scale: m,
205
- values: L,
204
+ title: h,
205
+ scale: p,
206
+ values: E,
206
207
  labels: {}
207
208
  };
208
- T.push(l), i = l.height + f, x = l.width;
209
+ f.push(m), i = m.height + S, x = m.width;
209
210
  } else {
210
- const m = this.heatmapColorScale.scale, L = ot(m, a), u = m.domain(), l = u.length * S, g = {
211
+ const p = this.heatmapColorScale.scale, E = tt(p, h), T = p.domain(), m = T.length * g, u = {
211
212
  id: "heatmapValue",
212
213
  type: "discrete",
213
- width: L,
214
- height: l,
214
+ width: E,
215
+ height: m,
215
216
  left: 0,
216
217
  top: 0,
217
- title: a,
218
- scale: m,
219
- values: u,
218
+ title: h,
219
+ scale: p,
220
+ values: T,
220
221
  labels: {}
221
222
  };
222
- T.push(g), i = g.height + f, x = g.width;
223
+ f.push(u), i = u.height + S, x = u.width;
223
224
  }
224
225
  }
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;
234
- }), q(s.nodeSize)) {
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(
237
- l.map((I) => w[I]),
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;
226
+ if (v.map(({ columnKey: l, labels: h, values: p, data: E }) => {
227
+ i > z && (i = 0, r += x + W);
228
+ const T = l, m = b(
229
+ p.map((F) => h[F]),
230
+ T
231
+ ), u = p.length * g;
232
+ u > z && (z = u);
233
+ const A = N().domain(p).range(p.map((F) => E[F])), _ = r, G = i;
234
+ f.push({ id: l, type: "nodes", width: m, height: u, left: _, top: G, title: T, scale: A, values: p, labels: h }), x = m, i += u + S;
235
+ }), X(s.nodeSize)) {
236
+ i > z && (i = 0, r += x + W);
237
+ const l = ht(s.nodeSize), h = b(
238
+ l.values.map((m) => l.labels[m]),
239
+ l.title
240
+ ), p = (l.scale(Math.max(...l.values)) * 2 + 4) * l.values.length;
241
+ p > z && (z = p);
242
+ const E = r, T = i;
243
+ f.push({ ...l, width: h, height: p, left: E, top: T }), x = h, i += p + S;
243
244
  }
244
- const H = r + x + 2 * et, B = z;
245
+ const H = r + x + 2 * Z, I = z;
245
246
  this.legend = {
246
247
  width: H,
247
- height: B,
248
- items: T
248
+ height: I,
249
+ items: f
249
250
  };
250
251
  }
251
252
  updateChartSizes(t, e, s) {
252
253
  const c = s.leaves().length;
253
254
  this.chartSizes.treeWidth = e ? t.width / 2 : t.width;
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;
255
+ const a = dt(c, t.scale, t.minCellHeight, t.maxCellHeight) * c;
256
+ this.chartSizes.treeHeight = a, this.chartSizes.heatmapHeight = a, this.chartSizes.marginLeft = t.marginLeft, this.chartSizes.marginRight = t.marginRight, this.chartSizes.marginBottom = t.marginBottom, this.chartSizes.marginTop = t.marginTop;
256
257
  }
257
258
  updateTotalSizes(t) {
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;
259
+ this.chartSizes.totalWidth = this.chartSizes.treeWidth + this.chartSizes.heatmapWidth + this.legend.width + this.chartSizes.marginLeft + this.chartSizes.marginRight, t && (this.chartSizes.totalWidth += P), this.legend.width > 0 && (this.chartSizes.totalWidth += P), this.chartSizes.totalHeight = Math.max(this.chartSizes.treeHeight, this.legend.height) + this.chartSizes.marginTop + this.chartSizes.marginBottom;
259
260
  }
260
261
  prepareTableLabels(t) {
261
- const e = new K("bold 14px Arial"), s = "…";
262
+ const e = new B("bold 14px Arial"), s = "…";
262
263
  if (this.heatmapStep.x < 12 || !t) {
263
264
  this.heatmapLabels = [];
264
265
  return;
265
266
  }
266
267
  const c = this.heatmapStep.x - 4;
267
- this.heatmapLabels = t.xKeys.map((h) => {
268
- const o = t.meta.xLabels[h];
269
- let p = e.getTextWidth(o);
270
- if (p < c)
268
+ this.heatmapLabels = t.xKeys.map((a) => {
269
+ const o = t.meta.xLabels[a];
270
+ let d = e.getTextWidth(o);
271
+ if (d < c)
271
272
  return o;
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 : "";
273
+ let g = o, S = g == null ? void 0 : g.length;
274
+ for (; d > c && S > 0; )
275
+ S--, g = (o == null ? void 0 : o.substring(0, S)) + s, d = e.getTextWidth(g);
276
+ return S > 0 ? g : "";
276
277
  });
277
278
  }
278
279
  addLabelsWidthToTreeArea(t, e) {
279
280
  if (!e)
280
281
  return;
281
- const s = t.leaves(), c = new K("bold 14px Manrope");
282
- let h = 0;
282
+ const s = t.leaves(), c = new B("bold 14px Manrope");
283
+ let a = 0;
283
284
  s.forEach((o) => {
284
285
  if (!o.data.label)
285
286
  return;
286
- const p = c.getTextWidth(o.data.label), S = o.y + p - this.chartSizes.treeWidth + 8;
287
- S > h && (h = S);
288
- }), this.chartSizes.treeWidth += h;
287
+ const d = c.getTextWidth(o.data.label), g = o.y + d - this.chartSizes.treeWidth + 8;
288
+ g > a && (a = g);
289
+ }), this.chartSizes.treeWidth += a;
289
290
  }
290
- render(t, e, s, c, h, o, p, S, f, A, M, v, y, C, T, x, i, r) {
291
- var a;
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);
291
+ render(t, e, s, c, a, o, d, g, S, w, W, b, v, C, f, x, i, r) {
292
+ var h;
293
+ this.updateChartSizes(e.size, C, s), this.updateHeatmapScales(C, f, e.size), this.updateLegendSize(e.legend, x, W, v, C, f), this.prepareTableLabels(C);
294
+ const z = a === "top" ? [this.chartSizes.treeWidth, this.chartSizes.treeHeight] : [this.chartSizes.treeHeight, this.chartSizes.treeWidth];
295
+ at().size(z).separation(() => 1)(s);
295
296
  const H = s;
296
- at(
297
+ ot(
297
298
  H,
298
- h === "top" ? this.chartSizes.treeHeight : this.chartSizes.treeWidth,
299
+ a === "top" ? this.chartSizes.treeHeight : this.chartSizes.treeWidth,
299
300
  i === "alignLeavesToLine"
300
- ), lt(H), this.addLabelsWidthToTreeArea(H, f), this.updateTotalSizes(C);
301
- const B = dt(t, M), d = /* @__PURE__ */ F.jsx(
302
- rt,
301
+ ), rt(H), this.addLabelsWidthToTreeArea(H, S), this.updateTotalSizes(C);
302
+ const I = ct(t, W), l = /* @__PURE__ */ O.jsx(
303
+ et,
303
304
  {
304
305
  chartSizes: this.chartSizes,
305
306
  chartSettings: e,
306
307
  nodes: H.descendants(),
307
308
  links: H.links(),
308
309
  connectionType: c,
309
- rootPosition: h,
310
+ rootPosition: a,
310
311
  edgeInheritance: o,
311
- showNodes: p,
312
- showEdges: S,
313
- showLeavesLabels: f,
314
- showNodesLabels: A,
315
- aesGetters: B,
316
- labels: v,
312
+ showNodes: d,
313
+ showEdges: g,
314
+ showLeavesLabels: S,
315
+ showNodesLabels: w,
316
+ aesGetters: I,
317
+ labels: b,
317
318
  heatmapData: C,
318
319
  heatmapScales: this.heatmapScales,
319
320
  heatmapStep: this.heatmapStep,
@@ -323,14 +324,14 @@ class Ft {
323
324
  onClick: r
324
325
  }
325
326
  );
326
- this.component = d, (a = this.reactRoot) == null || a.render(d);
327
+ this.component = l, (h = this.reactRoot) == null || h.render(l);
327
328
  }
328
329
  renderError(t) {
329
330
  var e;
330
- (e = this.reactRoot) == null || e.render(/* @__PURE__ */ F.jsx($, { message: t }));
331
+ (e = this.reactRoot) == null || e.render(/* @__PURE__ */ O.jsx(Q, { message: t }));
331
332
  }
332
333
  }
333
334
  export {
334
- Ft as default
335
+ It as default
335
336
  };
336
337
  //# sourceMappingURL=ChartRenderer.js.map