microboard-temp 0.13.48 → 0.13.50

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.
@@ -3956,11 +3956,12 @@ var init_Settings = __esm(() => {
3956
3956
  MAX_CARD_SIZE: 500,
3957
3957
  CONNECTOR_ITEM_OFFSET: 20,
3958
3958
  FG_SPRING_K: 0.2,
3959
- FG_TARGET_GAP: 20,
3960
- FG_REPULSION: 500,
3959
+ FG_TARGET_GAP: 50,
3960
+ FG_REPULSION: 100,
3961
3961
  FG_MIN_DIST_SQ: 100,
3962
3962
  FG_DAMPING: 0.6,
3963
3963
  FG_SLEEP_THRESHOLD: 0.5,
3964
+ FG_TICK_MS: 16,
3964
3965
  GRAVITY_G: 80,
3965
3966
  GRAVITY_G_CENTER: 120,
3966
3967
  GRAVITY_DAMPING: 0.96,
@@ -60683,7 +60684,9 @@ class ForceGraphEngine {
60683
60684
  lastSyncedPositions = new Map;
60684
60685
  activeComponents = new Map;
60685
60686
  isPhysicsEmit = false;
60686
- TICK_MS = 33;
60687
+ get TICK_MS() {
60688
+ return conf.FG_TICK_MS;
60689
+ }
60687
60690
  SYNC_MS = 300;
60688
60691
  MIN_MOVE_PX = 0.05;
60689
60692
  constructor(board) {
@@ -60821,19 +60824,8 @@ class ForceGraphEngine {
60821
60824
  }
60822
60825
  return visited;
60823
60826
  }
60824
- calibrateTargetGap(nodeIds) {
60825
- let totalMaxDim = 0;
60826
- let count = 0;
60827
- for (const id of nodeIds) {
60828
- const item = this.board.items.getById(id);
60829
- if (!item)
60830
- continue;
60831
- const mbr = item.getMbr();
60832
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
60833
- count++;
60834
- }
60835
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
60836
- return avgMaxDim * 1.5;
60827
+ calibrateTargetGap(_nodeIds) {
60828
+ return conf.FG_TARGET_GAP;
60837
60829
  }
60838
60830
  getActiveNodeIds() {
60839
60831
  const all6 = new Set;
package/dist/cjs/index.js CHANGED
@@ -3956,11 +3956,12 @@ var init_Settings = __esm(() => {
3956
3956
  MAX_CARD_SIZE: 500,
3957
3957
  CONNECTOR_ITEM_OFFSET: 20,
3958
3958
  FG_SPRING_K: 0.2,
3959
- FG_TARGET_GAP: 20,
3960
- FG_REPULSION: 500,
3959
+ FG_TARGET_GAP: 50,
3960
+ FG_REPULSION: 100,
3961
3961
  FG_MIN_DIST_SQ: 100,
3962
3962
  FG_DAMPING: 0.6,
3963
3963
  FG_SLEEP_THRESHOLD: 0.5,
3964
+ FG_TICK_MS: 16,
3964
3965
  GRAVITY_G: 80,
3965
3966
  GRAVITY_G_CENTER: 120,
3966
3967
  GRAVITY_DAMPING: 0.96,
@@ -60683,7 +60684,9 @@ class ForceGraphEngine {
60683
60684
  lastSyncedPositions = new Map;
60684
60685
  activeComponents = new Map;
60685
60686
  isPhysicsEmit = false;
60686
- TICK_MS = 33;
60687
+ get TICK_MS() {
60688
+ return conf.FG_TICK_MS;
60689
+ }
60687
60690
  SYNC_MS = 300;
60688
60691
  MIN_MOVE_PX = 0.05;
60689
60692
  constructor(board) {
@@ -60821,19 +60824,8 @@ class ForceGraphEngine {
60821
60824
  }
60822
60825
  return visited;
60823
60826
  }
60824
- calibrateTargetGap(nodeIds) {
60825
- let totalMaxDim = 0;
60826
- let count = 0;
60827
- for (const id of nodeIds) {
60828
- const item = this.board.items.getById(id);
60829
- if (!item)
60830
- continue;
60831
- const mbr = item.getMbr();
60832
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
60833
- count++;
60834
- }
60835
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
60836
- return avgMaxDim * 1.5;
60827
+ calibrateTargetGap(_nodeIds) {
60828
+ return conf.FG_TARGET_GAP;
60837
60829
  }
60838
60830
  getActiveNodeIds() {
60839
60831
  const all6 = new Set;
package/dist/cjs/node.js CHANGED
@@ -3956,11 +3956,12 @@ var init_Settings = __esm(() => {
3956
3956
  MAX_CARD_SIZE: 500,
3957
3957
  CONNECTOR_ITEM_OFFSET: 20,
3958
3958
  FG_SPRING_K: 0.2,
3959
- FG_TARGET_GAP: 20,
3960
- FG_REPULSION: 500,
3959
+ FG_TARGET_GAP: 50,
3960
+ FG_REPULSION: 100,
3961
3961
  FG_MIN_DIST_SQ: 100,
3962
3962
  FG_DAMPING: 0.6,
3963
3963
  FG_SLEEP_THRESHOLD: 0.5,
3964
+ FG_TICK_MS: 16,
3964
3965
  GRAVITY_G: 80,
3965
3966
  GRAVITY_G_CENTER: 120,
3966
3967
  GRAVITY_DAMPING: 0.96,
@@ -63158,7 +63159,9 @@ class ForceGraphEngine {
63158
63159
  lastSyncedPositions = new Map;
63159
63160
  activeComponents = new Map;
63160
63161
  isPhysicsEmit = false;
63161
- TICK_MS = 33;
63162
+ get TICK_MS() {
63163
+ return conf.FG_TICK_MS;
63164
+ }
63162
63165
  SYNC_MS = 300;
63163
63166
  MIN_MOVE_PX = 0.05;
63164
63167
  constructor(board) {
@@ -63296,19 +63299,8 @@ class ForceGraphEngine {
63296
63299
  }
63297
63300
  return visited;
63298
63301
  }
63299
- calibrateTargetGap(nodeIds) {
63300
- let totalMaxDim = 0;
63301
- let count = 0;
63302
- for (const id of nodeIds) {
63303
- const item = this.board.items.getById(id);
63304
- if (!item)
63305
- continue;
63306
- const mbr = item.getMbr();
63307
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
63308
- count++;
63309
- }
63310
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
63311
- return avgMaxDim * 1.5;
63302
+ calibrateTargetGap(_nodeIds) {
63303
+ return conf.FG_TARGET_GAP;
63312
63304
  }
63313
63305
  getActiveNodeIds() {
63314
63306
  const all6 = new Set;
@@ -3963,11 +3963,12 @@ var init_Settings = __esm(() => {
3963
3963
  MAX_CARD_SIZE: 500,
3964
3964
  CONNECTOR_ITEM_OFFSET: 20,
3965
3965
  FG_SPRING_K: 0.2,
3966
- FG_TARGET_GAP: 20,
3967
- FG_REPULSION: 500,
3966
+ FG_TARGET_GAP: 50,
3967
+ FG_REPULSION: 100,
3968
3968
  FG_MIN_DIST_SQ: 100,
3969
3969
  FG_DAMPING: 0.6,
3970
3970
  FG_SLEEP_THRESHOLD: 0.5,
3971
+ FG_TICK_MS: 16,
3971
3972
  GRAVITY_G: 80,
3972
3973
  GRAVITY_G_CENTER: 120,
3973
3974
  GRAVITY_DAMPING: 0.96,
@@ -60426,7 +60427,9 @@ class ForceGraphEngine {
60426
60427
  lastSyncedPositions = new Map;
60427
60428
  activeComponents = new Map;
60428
60429
  isPhysicsEmit = false;
60429
- TICK_MS = 33;
60430
+ get TICK_MS() {
60431
+ return conf.FG_TICK_MS;
60432
+ }
60430
60433
  SYNC_MS = 300;
60431
60434
  MIN_MOVE_PX = 0.05;
60432
60435
  constructor(board) {
@@ -60564,19 +60567,8 @@ class ForceGraphEngine {
60564
60567
  }
60565
60568
  return visited;
60566
60569
  }
60567
- calibrateTargetGap(nodeIds) {
60568
- let totalMaxDim = 0;
60569
- let count = 0;
60570
- for (const id of nodeIds) {
60571
- const item = this.board.items.getById(id);
60572
- if (!item)
60573
- continue;
60574
- const mbr = item.getMbr();
60575
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
60576
- count++;
60577
- }
60578
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
60579
- return avgMaxDim * 1.5;
60570
+ calibrateTargetGap(_nodeIds) {
60571
+ return conf.FG_TARGET_GAP;
60580
60572
  }
60581
60573
  getActiveNodeIds() {
60582
60574
  const all6 = new Set;
package/dist/esm/index.js CHANGED
@@ -3956,11 +3956,12 @@ var init_Settings = __esm(() => {
3956
3956
  MAX_CARD_SIZE: 500,
3957
3957
  CONNECTOR_ITEM_OFFSET: 20,
3958
3958
  FG_SPRING_K: 0.2,
3959
- FG_TARGET_GAP: 20,
3960
- FG_REPULSION: 500,
3959
+ FG_TARGET_GAP: 50,
3960
+ FG_REPULSION: 100,
3961
3961
  FG_MIN_DIST_SQ: 100,
3962
3962
  FG_DAMPING: 0.6,
3963
3963
  FG_SLEEP_THRESHOLD: 0.5,
3964
+ FG_TICK_MS: 16,
3964
3965
  GRAVITY_G: 80,
3965
3966
  GRAVITY_G_CENTER: 120,
3966
3967
  GRAVITY_DAMPING: 0.96,
@@ -60419,7 +60420,9 @@ class ForceGraphEngine {
60419
60420
  lastSyncedPositions = new Map;
60420
60421
  activeComponents = new Map;
60421
60422
  isPhysicsEmit = false;
60422
- TICK_MS = 33;
60423
+ get TICK_MS() {
60424
+ return conf.FG_TICK_MS;
60425
+ }
60423
60426
  SYNC_MS = 300;
60424
60427
  MIN_MOVE_PX = 0.05;
60425
60428
  constructor(board) {
@@ -60557,19 +60560,8 @@ class ForceGraphEngine {
60557
60560
  }
60558
60561
  return visited;
60559
60562
  }
60560
- calibrateTargetGap(nodeIds) {
60561
- let totalMaxDim = 0;
60562
- let count = 0;
60563
- for (const id of nodeIds) {
60564
- const item = this.board.items.getById(id);
60565
- if (!item)
60566
- continue;
60567
- const mbr = item.getMbr();
60568
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
60569
- count++;
60570
- }
60571
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
60572
- return avgMaxDim * 1.5;
60563
+ calibrateTargetGap(_nodeIds) {
60564
+ return conf.FG_TARGET_GAP;
60573
60565
  }
60574
60566
  getActiveNodeIds() {
60575
60567
  const all6 = new Set;
package/dist/esm/node.js CHANGED
@@ -3958,11 +3958,12 @@ var init_Settings = __esm(() => {
3958
3958
  MAX_CARD_SIZE: 500,
3959
3959
  CONNECTOR_ITEM_OFFSET: 20,
3960
3960
  FG_SPRING_K: 0.2,
3961
- FG_TARGET_GAP: 20,
3962
- FG_REPULSION: 500,
3961
+ FG_TARGET_GAP: 50,
3962
+ FG_REPULSION: 100,
3963
3963
  FG_MIN_DIST_SQ: 100,
3964
3964
  FG_DAMPING: 0.6,
3965
3965
  FG_SLEEP_THRESHOLD: 0.5,
3966
+ FG_TICK_MS: 16,
3966
3967
  GRAVITY_G: 80,
3967
3968
  GRAVITY_G_CENTER: 120,
3968
3969
  GRAVITY_DAMPING: 0.96,
@@ -62883,7 +62884,9 @@ class ForceGraphEngine {
62883
62884
  lastSyncedPositions = new Map;
62884
62885
  activeComponents = new Map;
62885
62886
  isPhysicsEmit = false;
62886
- TICK_MS = 33;
62887
+ get TICK_MS() {
62888
+ return conf.FG_TICK_MS;
62889
+ }
62887
62890
  SYNC_MS = 300;
62888
62891
  MIN_MOVE_PX = 0.05;
62889
62892
  constructor(board) {
@@ -63021,19 +63024,8 @@ class ForceGraphEngine {
63021
63024
  }
63022
63025
  return visited;
63023
63026
  }
63024
- calibrateTargetGap(nodeIds) {
63025
- let totalMaxDim = 0;
63026
- let count = 0;
63027
- for (const id of nodeIds) {
63028
- const item = this.board.items.getById(id);
63029
- if (!item)
63030
- continue;
63031
- const mbr = item.getMbr();
63032
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
63033
- count++;
63034
- }
63035
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
63036
- return avgMaxDim * 1.5;
63027
+ calibrateTargetGap(_nodeIds) {
63028
+ return conf.FG_TARGET_GAP;
63037
63029
  }
63038
63030
  getActiveNodeIds() {
63039
63031
  const all6 = new Set;
@@ -11,7 +11,7 @@ export declare class ForceGraphEngine {
11
11
  /** Set to true while we are emitting a physics sync operation, so the
12
12
  * board-event subscription below doesn't double-update lastSyncedPositions. */
13
13
  private isPhysicsEmit;
14
- private readonly TICK_MS;
14
+ private get TICK_MS();
15
15
  private readonly SYNC_MS;
16
16
  private readonly MIN_MOVE_PX;
17
17
  constructor(board: Board);
@@ -53,8 +53,9 @@ export declare class ForceGraphEngine {
53
53
  /** BFS through connector graph starting from `startNodeId`. */
54
54
  private bfsComponent;
55
55
  /**
56
- * Auto-calibrate spring target gap from the average max(w, h) of nodes in the component.
57
- * Larger nodes longer springs so items visually breathe.
56
+ * Returns the edge-to-edge rest gap for the component.
57
+ * Using a fixed gap (conf.FG_TARGET_GAP) keeps spring forces predictable
58
+ * and ensures fast settling regardless of node size.
58
59
  */
59
60
  private calibrateTargetGap;
60
61
  private getActiveNodeIds;
@@ -259,6 +259,7 @@ export declare const conf: {
259
259
  FG_MIN_DIST_SQ: number;
260
260
  FG_DAMPING: number;
261
261
  FG_SLEEP_THRESHOLD: number;
262
+ FG_TICK_MS: number;
262
263
  GRAVITY_G: number;
263
264
  GRAVITY_G_CENTER: number;
264
265
  GRAVITY_DAMPING: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.48",
3
+ "version": "0.13.50",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",