microboard-temp 0.13.52 → 0.13.54
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/cjs/browser.js +8 -8
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/node.js +8 -8
- package/dist/esm/browser.js +8 -8
- package/dist/esm/index.js +8 -8
- package/dist/esm/node.js +8 -8
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -3957,7 +3957,7 @@ var init_Settings = __esm(() => {
|
|
|
3957
3957
|
CONNECTOR_ITEM_OFFSET: 20,
|
|
3958
3958
|
FG_SPRING_K: 0.2,
|
|
3959
3959
|
FG_TARGET_GAP: 50,
|
|
3960
|
-
FG_REPULSION:
|
|
3960
|
+
FG_REPULSION: 100,
|
|
3961
3961
|
FG_MIN_DIST_SQ: 100,
|
|
3962
3962
|
FG_DAMPING: 0.6,
|
|
3963
3963
|
FG_SLEEP_THRESHOLD: 0.5,
|
|
@@ -60911,7 +60911,7 @@ class ForceGraphEngine {
|
|
|
60911
60911
|
const maxDimA = Math.max(s1.w, s1.h);
|
|
60912
60912
|
const maxDimB = Math.max(s2.w, s2.h);
|
|
60913
60913
|
const targetDist = (maxDimA + maxDimB) * 0.5 + Math.max(maxDimA, maxDimB);
|
|
60914
|
-
const force = (dist - targetDist)
|
|
60914
|
+
const force = (dist - targetDist) * conf.FG_SPRING_K;
|
|
60915
60915
|
const fx = dx / dist * force;
|
|
60916
60916
|
const fy = dy / dist * force;
|
|
60917
60917
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) + fx);
|
|
@@ -60927,12 +60927,12 @@ class ForceGraphEngine {
|
|
|
60927
60927
|
continue;
|
|
60928
60928
|
const dx = s2.cx - s1.cx;
|
|
60929
60929
|
const dy = s2.cy - s1.cy;
|
|
60930
|
-
const
|
|
60931
|
-
const
|
|
60932
|
-
const
|
|
60933
|
-
const
|
|
60934
|
-
const
|
|
60935
|
-
const force = conf.FG_REPULSION
|
|
60930
|
+
const centerDist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
60931
|
+
const halfA = Math.max(s1.w, s1.h) * 0.5;
|
|
60932
|
+
const halfB = Math.max(s2.w, s2.h) * 0.5;
|
|
60933
|
+
const edgeDist = Math.max(centerDist - halfA - halfB, 0);
|
|
60934
|
+
const edgeDistSq = Math.max(edgeDist * edgeDist, conf.FG_MIN_DIST_SQ);
|
|
60935
|
+
const force = conf.FG_REPULSION / edgeDistSq;
|
|
60936
60936
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) - dx * force);
|
|
60937
60937
|
ay.set(s1.id, (ay.get(s1.id) ?? 0) - dy * force);
|
|
60938
60938
|
ax.set(s2.id, (ax.get(s2.id) ?? 0) + dx * force);
|
package/dist/cjs/index.js
CHANGED
|
@@ -3957,7 +3957,7 @@ var init_Settings = __esm(() => {
|
|
|
3957
3957
|
CONNECTOR_ITEM_OFFSET: 20,
|
|
3958
3958
|
FG_SPRING_K: 0.2,
|
|
3959
3959
|
FG_TARGET_GAP: 50,
|
|
3960
|
-
FG_REPULSION:
|
|
3960
|
+
FG_REPULSION: 100,
|
|
3961
3961
|
FG_MIN_DIST_SQ: 100,
|
|
3962
3962
|
FG_DAMPING: 0.6,
|
|
3963
3963
|
FG_SLEEP_THRESHOLD: 0.5,
|
|
@@ -60911,7 +60911,7 @@ class ForceGraphEngine {
|
|
|
60911
60911
|
const maxDimA = Math.max(s1.w, s1.h);
|
|
60912
60912
|
const maxDimB = Math.max(s2.w, s2.h);
|
|
60913
60913
|
const targetDist = (maxDimA + maxDimB) * 0.5 + Math.max(maxDimA, maxDimB);
|
|
60914
|
-
const force = (dist - targetDist)
|
|
60914
|
+
const force = (dist - targetDist) * conf.FG_SPRING_K;
|
|
60915
60915
|
const fx = dx / dist * force;
|
|
60916
60916
|
const fy = dy / dist * force;
|
|
60917
60917
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) + fx);
|
|
@@ -60927,12 +60927,12 @@ class ForceGraphEngine {
|
|
|
60927
60927
|
continue;
|
|
60928
60928
|
const dx = s2.cx - s1.cx;
|
|
60929
60929
|
const dy = s2.cy - s1.cy;
|
|
60930
|
-
const
|
|
60931
|
-
const
|
|
60932
|
-
const
|
|
60933
|
-
const
|
|
60934
|
-
const
|
|
60935
|
-
const force = conf.FG_REPULSION
|
|
60930
|
+
const centerDist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
60931
|
+
const halfA = Math.max(s1.w, s1.h) * 0.5;
|
|
60932
|
+
const halfB = Math.max(s2.w, s2.h) * 0.5;
|
|
60933
|
+
const edgeDist = Math.max(centerDist - halfA - halfB, 0);
|
|
60934
|
+
const edgeDistSq = Math.max(edgeDist * edgeDist, conf.FG_MIN_DIST_SQ);
|
|
60935
|
+
const force = conf.FG_REPULSION / edgeDistSq;
|
|
60936
60936
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) - dx * force);
|
|
60937
60937
|
ay.set(s1.id, (ay.get(s1.id) ?? 0) - dy * force);
|
|
60938
60938
|
ax.set(s2.id, (ax.get(s2.id) ?? 0) + dx * force);
|
package/dist/cjs/node.js
CHANGED
|
@@ -3957,7 +3957,7 @@ var init_Settings = __esm(() => {
|
|
|
3957
3957
|
CONNECTOR_ITEM_OFFSET: 20,
|
|
3958
3958
|
FG_SPRING_K: 0.2,
|
|
3959
3959
|
FG_TARGET_GAP: 50,
|
|
3960
|
-
FG_REPULSION:
|
|
3960
|
+
FG_REPULSION: 100,
|
|
3961
3961
|
FG_MIN_DIST_SQ: 100,
|
|
3962
3962
|
FG_DAMPING: 0.6,
|
|
3963
3963
|
FG_SLEEP_THRESHOLD: 0.5,
|
|
@@ -63386,7 +63386,7 @@ class ForceGraphEngine {
|
|
|
63386
63386
|
const maxDimA = Math.max(s1.w, s1.h);
|
|
63387
63387
|
const maxDimB = Math.max(s2.w, s2.h);
|
|
63388
63388
|
const targetDist = (maxDimA + maxDimB) * 0.5 + Math.max(maxDimA, maxDimB);
|
|
63389
|
-
const force = (dist - targetDist)
|
|
63389
|
+
const force = (dist - targetDist) * conf.FG_SPRING_K;
|
|
63390
63390
|
const fx = dx / dist * force;
|
|
63391
63391
|
const fy = dy / dist * force;
|
|
63392
63392
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) + fx);
|
|
@@ -63402,12 +63402,12 @@ class ForceGraphEngine {
|
|
|
63402
63402
|
continue;
|
|
63403
63403
|
const dx = s2.cx - s1.cx;
|
|
63404
63404
|
const dy = s2.cy - s1.cy;
|
|
63405
|
-
const
|
|
63406
|
-
const
|
|
63407
|
-
const
|
|
63408
|
-
const
|
|
63409
|
-
const
|
|
63410
|
-
const force = conf.FG_REPULSION
|
|
63405
|
+
const centerDist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
63406
|
+
const halfA = Math.max(s1.w, s1.h) * 0.5;
|
|
63407
|
+
const halfB = Math.max(s2.w, s2.h) * 0.5;
|
|
63408
|
+
const edgeDist = Math.max(centerDist - halfA - halfB, 0);
|
|
63409
|
+
const edgeDistSq = Math.max(edgeDist * edgeDist, conf.FG_MIN_DIST_SQ);
|
|
63410
|
+
const force = conf.FG_REPULSION / edgeDistSq;
|
|
63411
63411
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) - dx * force);
|
|
63412
63412
|
ay.set(s1.id, (ay.get(s1.id) ?? 0) - dy * force);
|
|
63413
63413
|
ax.set(s2.id, (ax.get(s2.id) ?? 0) + dx * force);
|
package/dist/esm/browser.js
CHANGED
|
@@ -3964,7 +3964,7 @@ var init_Settings = __esm(() => {
|
|
|
3964
3964
|
CONNECTOR_ITEM_OFFSET: 20,
|
|
3965
3965
|
FG_SPRING_K: 0.2,
|
|
3966
3966
|
FG_TARGET_GAP: 50,
|
|
3967
|
-
FG_REPULSION:
|
|
3967
|
+
FG_REPULSION: 100,
|
|
3968
3968
|
FG_MIN_DIST_SQ: 100,
|
|
3969
3969
|
FG_DAMPING: 0.6,
|
|
3970
3970
|
FG_SLEEP_THRESHOLD: 0.5,
|
|
@@ -60654,7 +60654,7 @@ class ForceGraphEngine {
|
|
|
60654
60654
|
const maxDimA = Math.max(s1.w, s1.h);
|
|
60655
60655
|
const maxDimB = Math.max(s2.w, s2.h);
|
|
60656
60656
|
const targetDist = (maxDimA + maxDimB) * 0.5 + Math.max(maxDimA, maxDimB);
|
|
60657
|
-
const force = (dist - targetDist)
|
|
60657
|
+
const force = (dist - targetDist) * conf.FG_SPRING_K;
|
|
60658
60658
|
const fx = dx / dist * force;
|
|
60659
60659
|
const fy = dy / dist * force;
|
|
60660
60660
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) + fx);
|
|
@@ -60670,12 +60670,12 @@ class ForceGraphEngine {
|
|
|
60670
60670
|
continue;
|
|
60671
60671
|
const dx = s2.cx - s1.cx;
|
|
60672
60672
|
const dy = s2.cy - s1.cy;
|
|
60673
|
-
const
|
|
60674
|
-
const
|
|
60675
|
-
const
|
|
60676
|
-
const
|
|
60677
|
-
const
|
|
60678
|
-
const force = conf.FG_REPULSION
|
|
60673
|
+
const centerDist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
60674
|
+
const halfA = Math.max(s1.w, s1.h) * 0.5;
|
|
60675
|
+
const halfB = Math.max(s2.w, s2.h) * 0.5;
|
|
60676
|
+
const edgeDist = Math.max(centerDist - halfA - halfB, 0);
|
|
60677
|
+
const edgeDistSq = Math.max(edgeDist * edgeDist, conf.FG_MIN_DIST_SQ);
|
|
60678
|
+
const force = conf.FG_REPULSION / edgeDistSq;
|
|
60679
60679
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) - dx * force);
|
|
60680
60680
|
ay.set(s1.id, (ay.get(s1.id) ?? 0) - dy * force);
|
|
60681
60681
|
ax.set(s2.id, (ax.get(s2.id) ?? 0) + dx * force);
|
package/dist/esm/index.js
CHANGED
|
@@ -3957,7 +3957,7 @@ var init_Settings = __esm(() => {
|
|
|
3957
3957
|
CONNECTOR_ITEM_OFFSET: 20,
|
|
3958
3958
|
FG_SPRING_K: 0.2,
|
|
3959
3959
|
FG_TARGET_GAP: 50,
|
|
3960
|
-
FG_REPULSION:
|
|
3960
|
+
FG_REPULSION: 100,
|
|
3961
3961
|
FG_MIN_DIST_SQ: 100,
|
|
3962
3962
|
FG_DAMPING: 0.6,
|
|
3963
3963
|
FG_SLEEP_THRESHOLD: 0.5,
|
|
@@ -60647,7 +60647,7 @@ class ForceGraphEngine {
|
|
|
60647
60647
|
const maxDimA = Math.max(s1.w, s1.h);
|
|
60648
60648
|
const maxDimB = Math.max(s2.w, s2.h);
|
|
60649
60649
|
const targetDist = (maxDimA + maxDimB) * 0.5 + Math.max(maxDimA, maxDimB);
|
|
60650
|
-
const force = (dist - targetDist)
|
|
60650
|
+
const force = (dist - targetDist) * conf.FG_SPRING_K;
|
|
60651
60651
|
const fx = dx / dist * force;
|
|
60652
60652
|
const fy = dy / dist * force;
|
|
60653
60653
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) + fx);
|
|
@@ -60663,12 +60663,12 @@ class ForceGraphEngine {
|
|
|
60663
60663
|
continue;
|
|
60664
60664
|
const dx = s2.cx - s1.cx;
|
|
60665
60665
|
const dy = s2.cy - s1.cy;
|
|
60666
|
-
const
|
|
60667
|
-
const
|
|
60668
|
-
const
|
|
60669
|
-
const
|
|
60670
|
-
const
|
|
60671
|
-
const force = conf.FG_REPULSION
|
|
60666
|
+
const centerDist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
60667
|
+
const halfA = Math.max(s1.w, s1.h) * 0.5;
|
|
60668
|
+
const halfB = Math.max(s2.w, s2.h) * 0.5;
|
|
60669
|
+
const edgeDist = Math.max(centerDist - halfA - halfB, 0);
|
|
60670
|
+
const edgeDistSq = Math.max(edgeDist * edgeDist, conf.FG_MIN_DIST_SQ);
|
|
60671
|
+
const force = conf.FG_REPULSION / edgeDistSq;
|
|
60672
60672
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) - dx * force);
|
|
60673
60673
|
ay.set(s1.id, (ay.get(s1.id) ?? 0) - dy * force);
|
|
60674
60674
|
ax.set(s2.id, (ax.get(s2.id) ?? 0) + dx * force);
|
package/dist/esm/node.js
CHANGED
|
@@ -3959,7 +3959,7 @@ var init_Settings = __esm(() => {
|
|
|
3959
3959
|
CONNECTOR_ITEM_OFFSET: 20,
|
|
3960
3960
|
FG_SPRING_K: 0.2,
|
|
3961
3961
|
FG_TARGET_GAP: 50,
|
|
3962
|
-
FG_REPULSION:
|
|
3962
|
+
FG_REPULSION: 100,
|
|
3963
3963
|
FG_MIN_DIST_SQ: 100,
|
|
3964
3964
|
FG_DAMPING: 0.6,
|
|
3965
3965
|
FG_SLEEP_THRESHOLD: 0.5,
|
|
@@ -63111,7 +63111,7 @@ class ForceGraphEngine {
|
|
|
63111
63111
|
const maxDimA = Math.max(s1.w, s1.h);
|
|
63112
63112
|
const maxDimB = Math.max(s2.w, s2.h);
|
|
63113
63113
|
const targetDist = (maxDimA + maxDimB) * 0.5 + Math.max(maxDimA, maxDimB);
|
|
63114
|
-
const force = (dist - targetDist)
|
|
63114
|
+
const force = (dist - targetDist) * conf.FG_SPRING_K;
|
|
63115
63115
|
const fx = dx / dist * force;
|
|
63116
63116
|
const fy = dy / dist * force;
|
|
63117
63117
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) + fx);
|
|
@@ -63127,12 +63127,12 @@ class ForceGraphEngine {
|
|
|
63127
63127
|
continue;
|
|
63128
63128
|
const dx = s2.cx - s1.cx;
|
|
63129
63129
|
const dy = s2.cy - s1.cy;
|
|
63130
|
-
const
|
|
63131
|
-
const
|
|
63132
|
-
const
|
|
63133
|
-
const
|
|
63134
|
-
const
|
|
63135
|
-
const force = conf.FG_REPULSION
|
|
63130
|
+
const centerDist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
63131
|
+
const halfA = Math.max(s1.w, s1.h) * 0.5;
|
|
63132
|
+
const halfB = Math.max(s2.w, s2.h) * 0.5;
|
|
63133
|
+
const edgeDist = Math.max(centerDist - halfA - halfB, 0);
|
|
63134
|
+
const edgeDistSq = Math.max(edgeDist * edgeDist, conf.FG_MIN_DIST_SQ);
|
|
63135
|
+
const force = conf.FG_REPULSION / edgeDistSq;
|
|
63136
63136
|
ax.set(s1.id, (ax.get(s1.id) ?? 0) - dx * force);
|
|
63137
63137
|
ay.set(s1.id, (ay.get(s1.id) ?? 0) - dy * force);
|
|
63138
63138
|
ax.set(s2.id, (ax.get(s2.id) ?? 0) + dx * force);
|