@almadar/ui 5.114.0 → 5.116.0
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.
- package/dist/avl/index.cjs +24 -6
- package/dist/avl/index.js +24 -6
- package/dist/components/index.cjs +24 -6
- package/dist/components/index.js +24 -6
- package/dist/providers/index.cjs +24 -6
- package/dist/providers/index.js +24 -6
- package/dist/runtime/index.cjs +24 -6
- package/dist/runtime/index.js +24 -6
- package/package.json +3 -3
package/dist/avl/index.cjs
CHANGED
|
@@ -37405,7 +37405,7 @@ var init_GraphCanvas = __esm({
|
|
|
37405
37405
|
nodesRef.current = simNodes;
|
|
37406
37406
|
if (layout === "force") {
|
|
37407
37407
|
let iterations = 0;
|
|
37408
|
-
const maxIterations =
|
|
37408
|
+
const maxIterations = 300;
|
|
37409
37409
|
const tick = () => {
|
|
37410
37410
|
const nodes = nodesRef.current;
|
|
37411
37411
|
const centerX = w / 2;
|
|
@@ -37435,9 +37435,9 @@ var init_GraphCanvas = __esm({
|
|
|
37435
37435
|
const dx = target.x - source.x;
|
|
37436
37436
|
const dy = target.y - source.y;
|
|
37437
37437
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
37438
|
-
const w2 = edge.weight ?? 1;
|
|
37439
|
-
const linkTarget = linkDistance * (
|
|
37440
|
-
const force = (dist - linkTarget) * 0.
|
|
37438
|
+
const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
|
|
37439
|
+
const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
|
|
37440
|
+
const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
|
|
37441
37441
|
const fx = dx / dist * force;
|
|
37442
37442
|
const fy = dy / dist * force;
|
|
37443
37443
|
source.fx += fx;
|
|
@@ -37445,9 +37445,27 @@ var init_GraphCanvas = __esm({
|
|
|
37445
37445
|
target.fx -= fx;
|
|
37446
37446
|
target.fy -= fy;
|
|
37447
37447
|
}
|
|
37448
|
+
const centroids = /* @__PURE__ */ new Map();
|
|
37448
37449
|
for (const node of nodes) {
|
|
37449
|
-
|
|
37450
|
-
|
|
37450
|
+
const g = node.group ?? "__none__";
|
|
37451
|
+
let c = centroids.get(g);
|
|
37452
|
+
if (!c) {
|
|
37453
|
+
c = { x: 0, y: 0, n: 0 };
|
|
37454
|
+
centroids.set(g, c);
|
|
37455
|
+
}
|
|
37456
|
+
c.x += node.x;
|
|
37457
|
+
c.y += node.y;
|
|
37458
|
+
c.n += 1;
|
|
37459
|
+
}
|
|
37460
|
+
for (const node of nodes) {
|
|
37461
|
+
const c = centroids.get(node.group ?? "__none__");
|
|
37462
|
+
if (c && c.n > 1) {
|
|
37463
|
+
node.fx += (c.x / c.n - node.x) * 0.04;
|
|
37464
|
+
node.fy += (c.y / c.n - node.y) * 0.04;
|
|
37465
|
+
} else {
|
|
37466
|
+
node.fx += (centerX - node.x) * 0.01;
|
|
37467
|
+
node.fy += (centerY - node.y) * 0.01;
|
|
37468
|
+
}
|
|
37451
37469
|
}
|
|
37452
37470
|
const damping = 0.9;
|
|
37453
37471
|
for (const node of nodes) {
|
package/dist/avl/index.js
CHANGED
|
@@ -37359,7 +37359,7 @@ var init_GraphCanvas = __esm({
|
|
|
37359
37359
|
nodesRef.current = simNodes;
|
|
37360
37360
|
if (layout === "force") {
|
|
37361
37361
|
let iterations = 0;
|
|
37362
|
-
const maxIterations =
|
|
37362
|
+
const maxIterations = 300;
|
|
37363
37363
|
const tick = () => {
|
|
37364
37364
|
const nodes = nodesRef.current;
|
|
37365
37365
|
const centerX = w / 2;
|
|
@@ -37389,9 +37389,9 @@ var init_GraphCanvas = __esm({
|
|
|
37389
37389
|
const dx = target.x - source.x;
|
|
37390
37390
|
const dy = target.y - source.y;
|
|
37391
37391
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
37392
|
-
const w2 = edge.weight ?? 1;
|
|
37393
|
-
const linkTarget = linkDistance * (
|
|
37394
|
-
const force = (dist - linkTarget) * 0.
|
|
37392
|
+
const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
|
|
37393
|
+
const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
|
|
37394
|
+
const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
|
|
37395
37395
|
const fx = dx / dist * force;
|
|
37396
37396
|
const fy = dy / dist * force;
|
|
37397
37397
|
source.fx += fx;
|
|
@@ -37399,9 +37399,27 @@ var init_GraphCanvas = __esm({
|
|
|
37399
37399
|
target.fx -= fx;
|
|
37400
37400
|
target.fy -= fy;
|
|
37401
37401
|
}
|
|
37402
|
+
const centroids = /* @__PURE__ */ new Map();
|
|
37402
37403
|
for (const node of nodes) {
|
|
37403
|
-
|
|
37404
|
-
|
|
37404
|
+
const g = node.group ?? "__none__";
|
|
37405
|
+
let c = centroids.get(g);
|
|
37406
|
+
if (!c) {
|
|
37407
|
+
c = { x: 0, y: 0, n: 0 };
|
|
37408
|
+
centroids.set(g, c);
|
|
37409
|
+
}
|
|
37410
|
+
c.x += node.x;
|
|
37411
|
+
c.y += node.y;
|
|
37412
|
+
c.n += 1;
|
|
37413
|
+
}
|
|
37414
|
+
for (const node of nodes) {
|
|
37415
|
+
const c = centroids.get(node.group ?? "__none__");
|
|
37416
|
+
if (c && c.n > 1) {
|
|
37417
|
+
node.fx += (c.x / c.n - node.x) * 0.04;
|
|
37418
|
+
node.fy += (c.y / c.n - node.y) * 0.04;
|
|
37419
|
+
} else {
|
|
37420
|
+
node.fx += (centerX - node.x) * 0.01;
|
|
37421
|
+
node.fy += (centerY - node.y) * 0.01;
|
|
37422
|
+
}
|
|
37405
37423
|
}
|
|
37406
37424
|
const damping = 0.9;
|
|
37407
37425
|
for (const node of nodes) {
|
|
@@ -36794,7 +36794,7 @@ var init_GraphCanvas = __esm({
|
|
|
36794
36794
|
nodesRef.current = simNodes;
|
|
36795
36795
|
if (layout === "force") {
|
|
36796
36796
|
let iterations = 0;
|
|
36797
|
-
const maxIterations =
|
|
36797
|
+
const maxIterations = 300;
|
|
36798
36798
|
const tick = () => {
|
|
36799
36799
|
const nodes = nodesRef.current;
|
|
36800
36800
|
const centerX = w / 2;
|
|
@@ -36824,9 +36824,9 @@ var init_GraphCanvas = __esm({
|
|
|
36824
36824
|
const dx = target.x - source.x;
|
|
36825
36825
|
const dy = target.y - source.y;
|
|
36826
36826
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
36827
|
-
const w2 = edge.weight ?? 1;
|
|
36828
|
-
const linkTarget = linkDistance * (
|
|
36829
|
-
const force = (dist - linkTarget) * 0.
|
|
36827
|
+
const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
|
|
36828
|
+
const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
|
|
36829
|
+
const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
|
|
36830
36830
|
const fx = dx / dist * force;
|
|
36831
36831
|
const fy = dy / dist * force;
|
|
36832
36832
|
source.fx += fx;
|
|
@@ -36834,9 +36834,27 @@ var init_GraphCanvas = __esm({
|
|
|
36834
36834
|
target.fx -= fx;
|
|
36835
36835
|
target.fy -= fy;
|
|
36836
36836
|
}
|
|
36837
|
+
const centroids = /* @__PURE__ */ new Map();
|
|
36837
36838
|
for (const node of nodes) {
|
|
36838
|
-
|
|
36839
|
-
|
|
36839
|
+
const g = node.group ?? "__none__";
|
|
36840
|
+
let c = centroids.get(g);
|
|
36841
|
+
if (!c) {
|
|
36842
|
+
c = { x: 0, y: 0, n: 0 };
|
|
36843
|
+
centroids.set(g, c);
|
|
36844
|
+
}
|
|
36845
|
+
c.x += node.x;
|
|
36846
|
+
c.y += node.y;
|
|
36847
|
+
c.n += 1;
|
|
36848
|
+
}
|
|
36849
|
+
for (const node of nodes) {
|
|
36850
|
+
const c = centroids.get(node.group ?? "__none__");
|
|
36851
|
+
if (c && c.n > 1) {
|
|
36852
|
+
node.fx += (c.x / c.n - node.x) * 0.04;
|
|
36853
|
+
node.fy += (c.y / c.n - node.y) * 0.04;
|
|
36854
|
+
} else {
|
|
36855
|
+
node.fx += (centerX - node.x) * 0.01;
|
|
36856
|
+
node.fy += (centerY - node.y) * 0.01;
|
|
36857
|
+
}
|
|
36840
36858
|
}
|
|
36841
36859
|
const damping = 0.9;
|
|
36842
36860
|
for (const node of nodes) {
|
package/dist/components/index.js
CHANGED
|
@@ -36749,7 +36749,7 @@ var init_GraphCanvas = __esm({
|
|
|
36749
36749
|
nodesRef.current = simNodes;
|
|
36750
36750
|
if (layout === "force") {
|
|
36751
36751
|
let iterations = 0;
|
|
36752
|
-
const maxIterations =
|
|
36752
|
+
const maxIterations = 300;
|
|
36753
36753
|
const tick = () => {
|
|
36754
36754
|
const nodes = nodesRef.current;
|
|
36755
36755
|
const centerX = w / 2;
|
|
@@ -36779,9 +36779,9 @@ var init_GraphCanvas = __esm({
|
|
|
36779
36779
|
const dx = target.x - source.x;
|
|
36780
36780
|
const dy = target.y - source.y;
|
|
36781
36781
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
36782
|
-
const w2 = edge.weight ?? 1;
|
|
36783
|
-
const linkTarget = linkDistance * (
|
|
36784
|
-
const force = (dist - linkTarget) * 0.
|
|
36782
|
+
const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
|
|
36783
|
+
const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
|
|
36784
|
+
const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
|
|
36785
36785
|
const fx = dx / dist * force;
|
|
36786
36786
|
const fy = dy / dist * force;
|
|
36787
36787
|
source.fx += fx;
|
|
@@ -36789,9 +36789,27 @@ var init_GraphCanvas = __esm({
|
|
|
36789
36789
|
target.fx -= fx;
|
|
36790
36790
|
target.fy -= fy;
|
|
36791
36791
|
}
|
|
36792
|
+
const centroids = /* @__PURE__ */ new Map();
|
|
36792
36793
|
for (const node of nodes) {
|
|
36793
|
-
|
|
36794
|
-
|
|
36794
|
+
const g = node.group ?? "__none__";
|
|
36795
|
+
let c = centroids.get(g);
|
|
36796
|
+
if (!c) {
|
|
36797
|
+
c = { x: 0, y: 0, n: 0 };
|
|
36798
|
+
centroids.set(g, c);
|
|
36799
|
+
}
|
|
36800
|
+
c.x += node.x;
|
|
36801
|
+
c.y += node.y;
|
|
36802
|
+
c.n += 1;
|
|
36803
|
+
}
|
|
36804
|
+
for (const node of nodes) {
|
|
36805
|
+
const c = centroids.get(node.group ?? "__none__");
|
|
36806
|
+
if (c && c.n > 1) {
|
|
36807
|
+
node.fx += (c.x / c.n - node.x) * 0.04;
|
|
36808
|
+
node.fy += (c.y / c.n - node.y) * 0.04;
|
|
36809
|
+
} else {
|
|
36810
|
+
node.fx += (centerX - node.x) * 0.01;
|
|
36811
|
+
node.fy += (centerY - node.y) * 0.01;
|
|
36812
|
+
}
|
|
36795
36813
|
}
|
|
36796
36814
|
const damping = 0.9;
|
|
36797
36815
|
for (const node of nodes) {
|
package/dist/providers/index.cjs
CHANGED
|
@@ -35535,7 +35535,7 @@ var init_GraphCanvas = __esm({
|
|
|
35535
35535
|
nodesRef.current = simNodes;
|
|
35536
35536
|
if (layout === "force") {
|
|
35537
35537
|
let iterations = 0;
|
|
35538
|
-
const maxIterations =
|
|
35538
|
+
const maxIterations = 300;
|
|
35539
35539
|
const tick = () => {
|
|
35540
35540
|
const nodes = nodesRef.current;
|
|
35541
35541
|
const centerX = w / 2;
|
|
@@ -35565,9 +35565,9 @@ var init_GraphCanvas = __esm({
|
|
|
35565
35565
|
const dx = target.x - source.x;
|
|
35566
35566
|
const dy = target.y - source.y;
|
|
35567
35567
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
35568
|
-
const w2 = edge.weight ?? 1;
|
|
35569
|
-
const linkTarget = linkDistance * (
|
|
35570
|
-
const force = (dist - linkTarget) * 0.
|
|
35568
|
+
const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
|
|
35569
|
+
const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
|
|
35570
|
+
const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
|
|
35571
35571
|
const fx = dx / dist * force;
|
|
35572
35572
|
const fy = dy / dist * force;
|
|
35573
35573
|
source.fx += fx;
|
|
@@ -35575,9 +35575,27 @@ var init_GraphCanvas = __esm({
|
|
|
35575
35575
|
target.fx -= fx;
|
|
35576
35576
|
target.fy -= fy;
|
|
35577
35577
|
}
|
|
35578
|
+
const centroids = /* @__PURE__ */ new Map();
|
|
35578
35579
|
for (const node of nodes) {
|
|
35579
|
-
|
|
35580
|
-
|
|
35580
|
+
const g = node.group ?? "__none__";
|
|
35581
|
+
let c = centroids.get(g);
|
|
35582
|
+
if (!c) {
|
|
35583
|
+
c = { x: 0, y: 0, n: 0 };
|
|
35584
|
+
centroids.set(g, c);
|
|
35585
|
+
}
|
|
35586
|
+
c.x += node.x;
|
|
35587
|
+
c.y += node.y;
|
|
35588
|
+
c.n += 1;
|
|
35589
|
+
}
|
|
35590
|
+
for (const node of nodes) {
|
|
35591
|
+
const c = centroids.get(node.group ?? "__none__");
|
|
35592
|
+
if (c && c.n > 1) {
|
|
35593
|
+
node.fx += (c.x / c.n - node.x) * 0.04;
|
|
35594
|
+
node.fy += (c.y / c.n - node.y) * 0.04;
|
|
35595
|
+
} else {
|
|
35596
|
+
node.fx += (centerX - node.x) * 0.01;
|
|
35597
|
+
node.fy += (centerY - node.y) * 0.01;
|
|
35598
|
+
}
|
|
35581
35599
|
}
|
|
35582
35600
|
const damping = 0.9;
|
|
35583
35601
|
for (const node of nodes) {
|
package/dist/providers/index.js
CHANGED
|
@@ -35490,7 +35490,7 @@ var init_GraphCanvas = __esm({
|
|
|
35490
35490
|
nodesRef.current = simNodes;
|
|
35491
35491
|
if (layout === "force") {
|
|
35492
35492
|
let iterations = 0;
|
|
35493
|
-
const maxIterations =
|
|
35493
|
+
const maxIterations = 300;
|
|
35494
35494
|
const tick = () => {
|
|
35495
35495
|
const nodes = nodesRef.current;
|
|
35496
35496
|
const centerX = w / 2;
|
|
@@ -35520,9 +35520,9 @@ var init_GraphCanvas = __esm({
|
|
|
35520
35520
|
const dx = target.x - source.x;
|
|
35521
35521
|
const dy = target.y - source.y;
|
|
35522
35522
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
35523
|
-
const w2 = edge.weight ?? 1;
|
|
35524
|
-
const linkTarget = linkDistance * (
|
|
35525
|
-
const force = (dist - linkTarget) * 0.
|
|
35523
|
+
const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
|
|
35524
|
+
const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
|
|
35525
|
+
const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
|
|
35526
35526
|
const fx = dx / dist * force;
|
|
35527
35527
|
const fy = dy / dist * force;
|
|
35528
35528
|
source.fx += fx;
|
|
@@ -35530,9 +35530,27 @@ var init_GraphCanvas = __esm({
|
|
|
35530
35530
|
target.fx -= fx;
|
|
35531
35531
|
target.fy -= fy;
|
|
35532
35532
|
}
|
|
35533
|
+
const centroids = /* @__PURE__ */ new Map();
|
|
35533
35534
|
for (const node of nodes) {
|
|
35534
|
-
|
|
35535
|
-
|
|
35535
|
+
const g = node.group ?? "__none__";
|
|
35536
|
+
let c = centroids.get(g);
|
|
35537
|
+
if (!c) {
|
|
35538
|
+
c = { x: 0, y: 0, n: 0 };
|
|
35539
|
+
centroids.set(g, c);
|
|
35540
|
+
}
|
|
35541
|
+
c.x += node.x;
|
|
35542
|
+
c.y += node.y;
|
|
35543
|
+
c.n += 1;
|
|
35544
|
+
}
|
|
35545
|
+
for (const node of nodes) {
|
|
35546
|
+
const c = centroids.get(node.group ?? "__none__");
|
|
35547
|
+
if (c && c.n > 1) {
|
|
35548
|
+
node.fx += (c.x / c.n - node.x) * 0.04;
|
|
35549
|
+
node.fy += (c.y / c.n - node.y) * 0.04;
|
|
35550
|
+
} else {
|
|
35551
|
+
node.fx += (centerX - node.x) * 0.01;
|
|
35552
|
+
node.fy += (centerY - node.y) * 0.01;
|
|
35553
|
+
}
|
|
35536
35554
|
}
|
|
35537
35555
|
const damping = 0.9;
|
|
35538
35556
|
for (const node of nodes) {
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -34900,7 +34900,7 @@ var init_GraphCanvas = __esm({
|
|
|
34900
34900
|
nodesRef.current = simNodes;
|
|
34901
34901
|
if (layout === "force") {
|
|
34902
34902
|
let iterations = 0;
|
|
34903
|
-
const maxIterations =
|
|
34903
|
+
const maxIterations = 300;
|
|
34904
34904
|
const tick = () => {
|
|
34905
34905
|
const nodes = nodesRef.current;
|
|
34906
34906
|
const centerX = w / 2;
|
|
@@ -34930,9 +34930,9 @@ var init_GraphCanvas = __esm({
|
|
|
34930
34930
|
const dx = target.x - source.x;
|
|
34931
34931
|
const dy = target.y - source.y;
|
|
34932
34932
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
34933
|
-
const w2 = edge.weight ?? 1;
|
|
34934
|
-
const linkTarget = linkDistance * (
|
|
34935
|
-
const force = (dist - linkTarget) * 0.
|
|
34933
|
+
const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
|
|
34934
|
+
const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
|
|
34935
|
+
const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
|
|
34936
34936
|
const fx = dx / dist * force;
|
|
34937
34937
|
const fy = dy / dist * force;
|
|
34938
34938
|
source.fx += fx;
|
|
@@ -34940,9 +34940,27 @@ var init_GraphCanvas = __esm({
|
|
|
34940
34940
|
target.fx -= fx;
|
|
34941
34941
|
target.fy -= fy;
|
|
34942
34942
|
}
|
|
34943
|
+
const centroids = /* @__PURE__ */ new Map();
|
|
34943
34944
|
for (const node of nodes) {
|
|
34944
|
-
|
|
34945
|
-
|
|
34945
|
+
const g = node.group ?? "__none__";
|
|
34946
|
+
let c = centroids.get(g);
|
|
34947
|
+
if (!c) {
|
|
34948
|
+
c = { x: 0, y: 0, n: 0 };
|
|
34949
|
+
centroids.set(g, c);
|
|
34950
|
+
}
|
|
34951
|
+
c.x += node.x;
|
|
34952
|
+
c.y += node.y;
|
|
34953
|
+
c.n += 1;
|
|
34954
|
+
}
|
|
34955
|
+
for (const node of nodes) {
|
|
34956
|
+
const c = centroids.get(node.group ?? "__none__");
|
|
34957
|
+
if (c && c.n > 1) {
|
|
34958
|
+
node.fx += (c.x / c.n - node.x) * 0.04;
|
|
34959
|
+
node.fy += (c.y / c.n - node.y) * 0.04;
|
|
34960
|
+
} else {
|
|
34961
|
+
node.fx += (centerX - node.x) * 0.01;
|
|
34962
|
+
node.fy += (centerY - node.y) * 0.01;
|
|
34963
|
+
}
|
|
34946
34964
|
}
|
|
34947
34965
|
const damping = 0.9;
|
|
34948
34966
|
for (const node of nodes) {
|
package/dist/runtime/index.js
CHANGED
|
@@ -34856,7 +34856,7 @@ var init_GraphCanvas = __esm({
|
|
|
34856
34856
|
nodesRef.current = simNodes;
|
|
34857
34857
|
if (layout === "force") {
|
|
34858
34858
|
let iterations = 0;
|
|
34859
|
-
const maxIterations =
|
|
34859
|
+
const maxIterations = 300;
|
|
34860
34860
|
const tick = () => {
|
|
34861
34861
|
const nodes = nodesRef.current;
|
|
34862
34862
|
const centerX = w / 2;
|
|
@@ -34886,9 +34886,9 @@ var init_GraphCanvas = __esm({
|
|
|
34886
34886
|
const dx = target.x - source.x;
|
|
34887
34887
|
const dy = target.y - source.y;
|
|
34888
34888
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
34889
|
-
const w2 = edge.weight ?? 1;
|
|
34890
|
-
const linkTarget = linkDistance * (
|
|
34891
|
-
const force = (dist - linkTarget) * 0.
|
|
34889
|
+
const w2 = Math.min(1, Math.max(0, edge.weight ?? 1));
|
|
34890
|
+
const linkTarget = linkDistance * (0.5 + (1 - w2) * 1.5);
|
|
34891
|
+
const force = (dist - linkTarget) * (0.04 + 0.1 * w2);
|
|
34892
34892
|
const fx = dx / dist * force;
|
|
34893
34893
|
const fy = dy / dist * force;
|
|
34894
34894
|
source.fx += fx;
|
|
@@ -34896,9 +34896,27 @@ var init_GraphCanvas = __esm({
|
|
|
34896
34896
|
target.fx -= fx;
|
|
34897
34897
|
target.fy -= fy;
|
|
34898
34898
|
}
|
|
34899
|
+
const centroids = /* @__PURE__ */ new Map();
|
|
34899
34900
|
for (const node of nodes) {
|
|
34900
|
-
|
|
34901
|
-
|
|
34901
|
+
const g = node.group ?? "__none__";
|
|
34902
|
+
let c = centroids.get(g);
|
|
34903
|
+
if (!c) {
|
|
34904
|
+
c = { x: 0, y: 0, n: 0 };
|
|
34905
|
+
centroids.set(g, c);
|
|
34906
|
+
}
|
|
34907
|
+
c.x += node.x;
|
|
34908
|
+
c.y += node.y;
|
|
34909
|
+
c.n += 1;
|
|
34910
|
+
}
|
|
34911
|
+
for (const node of nodes) {
|
|
34912
|
+
const c = centroids.get(node.group ?? "__none__");
|
|
34913
|
+
if (c && c.n > 1) {
|
|
34914
|
+
node.fx += (c.x / c.n - node.x) * 0.04;
|
|
34915
|
+
node.fy += (c.y / c.n - node.y) * 0.04;
|
|
34916
|
+
} else {
|
|
34917
|
+
node.fx += (centerX - node.x) * 0.01;
|
|
34918
|
+
node.fy += (centerY - node.y) * 0.01;
|
|
34919
|
+
}
|
|
34902
34920
|
}
|
|
34903
34921
|
const damping = 0.9;
|
|
34904
34922
|
for (const node of nodes) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.116.0",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
120
|
"@almadar/core": "^10.29.0",
|
|
121
|
-
"@almadar/evaluator": "^2.
|
|
121
|
+
"@almadar/evaluator": "^2.30.0",
|
|
122
122
|
"@almadar/logger": "^1.9.0",
|
|
123
123
|
"@almadar/runtime": "^6.33.0",
|
|
124
|
-
"@almadar/std": "^16.
|
|
124
|
+
"@almadar/std": "^16.140.0",
|
|
125
125
|
"@almadar/syntax": "^1.11.0",
|
|
126
126
|
"@dnd-kit/core": "^6.3.1",
|
|
127
127
|
"@dnd-kit/sortable": "^10.0.0",
|