microboard-temp 0.13.47 → 0.13.49

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,8 +3956,8 @@ 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,
@@ -60758,6 +60758,7 @@ class ForceGraphEngine {
60758
60758
  wake() {
60759
60759
  if (this.activeComponents.size === 0)
60760
60760
  return;
60761
+ this.syncPositions();
60761
60762
  const activeIds = this.getActiveNodeIds();
60762
60763
  for (const item of this.board.items.listAll()) {
60763
60764
  if (!activeIds.has(item.getId()))
@@ -60820,19 +60821,8 @@ class ForceGraphEngine {
60820
60821
  }
60821
60822
  return visited;
60822
60823
  }
60823
- calibrateTargetGap(nodeIds) {
60824
- let totalMaxDim = 0;
60825
- let count = 0;
60826
- for (const id of nodeIds) {
60827
- const item = this.board.items.getById(id);
60828
- if (!item)
60829
- continue;
60830
- const mbr = item.getMbr();
60831
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
60832
- count++;
60833
- }
60834
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
60835
- return avgMaxDim * 1.5;
60824
+ calibrateTargetGap(_nodeIds) {
60825
+ return conf.FG_TARGET_GAP;
60836
60826
  }
60837
60827
  getActiveNodeIds() {
60838
60828
  const all6 = new Set;
package/dist/cjs/index.js CHANGED
@@ -3956,8 +3956,8 @@ 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,
@@ -60758,6 +60758,7 @@ class ForceGraphEngine {
60758
60758
  wake() {
60759
60759
  if (this.activeComponents.size === 0)
60760
60760
  return;
60761
+ this.syncPositions();
60761
60762
  const activeIds = this.getActiveNodeIds();
60762
60763
  for (const item of this.board.items.listAll()) {
60763
60764
  if (!activeIds.has(item.getId()))
@@ -60820,19 +60821,8 @@ class ForceGraphEngine {
60820
60821
  }
60821
60822
  return visited;
60822
60823
  }
60823
- calibrateTargetGap(nodeIds) {
60824
- let totalMaxDim = 0;
60825
- let count = 0;
60826
- for (const id of nodeIds) {
60827
- const item = this.board.items.getById(id);
60828
- if (!item)
60829
- continue;
60830
- const mbr = item.getMbr();
60831
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
60832
- count++;
60833
- }
60834
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
60835
- return avgMaxDim * 1.5;
60824
+ calibrateTargetGap(_nodeIds) {
60825
+ return conf.FG_TARGET_GAP;
60836
60826
  }
60837
60827
  getActiveNodeIds() {
60838
60828
  const all6 = new Set;
package/dist/cjs/node.js CHANGED
@@ -3956,8 +3956,8 @@ 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,
@@ -63233,6 +63233,7 @@ class ForceGraphEngine {
63233
63233
  wake() {
63234
63234
  if (this.activeComponents.size === 0)
63235
63235
  return;
63236
+ this.syncPositions();
63236
63237
  const activeIds = this.getActiveNodeIds();
63237
63238
  for (const item of this.board.items.listAll()) {
63238
63239
  if (!activeIds.has(item.getId()))
@@ -63295,19 +63296,8 @@ class ForceGraphEngine {
63295
63296
  }
63296
63297
  return visited;
63297
63298
  }
63298
- calibrateTargetGap(nodeIds) {
63299
- let totalMaxDim = 0;
63300
- let count = 0;
63301
- for (const id of nodeIds) {
63302
- const item = this.board.items.getById(id);
63303
- if (!item)
63304
- continue;
63305
- const mbr = item.getMbr();
63306
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
63307
- count++;
63308
- }
63309
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
63310
- return avgMaxDim * 1.5;
63299
+ calibrateTargetGap(_nodeIds) {
63300
+ return conf.FG_TARGET_GAP;
63311
63301
  }
63312
63302
  getActiveNodeIds() {
63313
63303
  const all6 = new Set;
@@ -3963,8 +3963,8 @@ 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,
@@ -60501,6 +60501,7 @@ class ForceGraphEngine {
60501
60501
  wake() {
60502
60502
  if (this.activeComponents.size === 0)
60503
60503
  return;
60504
+ this.syncPositions();
60504
60505
  const activeIds = this.getActiveNodeIds();
60505
60506
  for (const item of this.board.items.listAll()) {
60506
60507
  if (!activeIds.has(item.getId()))
@@ -60563,19 +60564,8 @@ class ForceGraphEngine {
60563
60564
  }
60564
60565
  return visited;
60565
60566
  }
60566
- calibrateTargetGap(nodeIds) {
60567
- let totalMaxDim = 0;
60568
- let count = 0;
60569
- for (const id of nodeIds) {
60570
- const item = this.board.items.getById(id);
60571
- if (!item)
60572
- continue;
60573
- const mbr = item.getMbr();
60574
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
60575
- count++;
60576
- }
60577
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
60578
- return avgMaxDim * 1.5;
60567
+ calibrateTargetGap(_nodeIds) {
60568
+ return conf.FG_TARGET_GAP;
60579
60569
  }
60580
60570
  getActiveNodeIds() {
60581
60571
  const all6 = new Set;
package/dist/esm/index.js CHANGED
@@ -3956,8 +3956,8 @@ 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,
@@ -60494,6 +60494,7 @@ class ForceGraphEngine {
60494
60494
  wake() {
60495
60495
  if (this.activeComponents.size === 0)
60496
60496
  return;
60497
+ this.syncPositions();
60497
60498
  const activeIds = this.getActiveNodeIds();
60498
60499
  for (const item of this.board.items.listAll()) {
60499
60500
  if (!activeIds.has(item.getId()))
@@ -60556,19 +60557,8 @@ class ForceGraphEngine {
60556
60557
  }
60557
60558
  return visited;
60558
60559
  }
60559
- calibrateTargetGap(nodeIds) {
60560
- let totalMaxDim = 0;
60561
- let count = 0;
60562
- for (const id of nodeIds) {
60563
- const item = this.board.items.getById(id);
60564
- if (!item)
60565
- continue;
60566
- const mbr = item.getMbr();
60567
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
60568
- count++;
60569
- }
60570
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
60571
- return avgMaxDim * 1.5;
60560
+ calibrateTargetGap(_nodeIds) {
60561
+ return conf.FG_TARGET_GAP;
60572
60562
  }
60573
60563
  getActiveNodeIds() {
60574
60564
  const all6 = new Set;
package/dist/esm/node.js CHANGED
@@ -3958,8 +3958,8 @@ 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,
@@ -62958,6 +62958,7 @@ class ForceGraphEngine {
62958
62958
  wake() {
62959
62959
  if (this.activeComponents.size === 0)
62960
62960
  return;
62961
+ this.syncPositions();
62961
62962
  const activeIds = this.getActiveNodeIds();
62962
62963
  for (const item of this.board.items.listAll()) {
62963
62964
  if (!activeIds.has(item.getId()))
@@ -63020,19 +63021,8 @@ class ForceGraphEngine {
63020
63021
  }
63021
63022
  return visited;
63022
63023
  }
63023
- calibrateTargetGap(nodeIds) {
63024
- let totalMaxDim = 0;
63025
- let count = 0;
63026
- for (const id of nodeIds) {
63027
- const item = this.board.items.getById(id);
63028
- if (!item)
63029
- continue;
63030
- const mbr = item.getMbr();
63031
- totalMaxDim += Math.max(mbr.getWidth(), mbr.getHeight());
63032
- count++;
63033
- }
63034
- const avgMaxDim = count > 0 ? totalMaxDim / count : 100;
63035
- return avgMaxDim * 1.5;
63024
+ calibrateTargetGap(_nodeIds) {
63025
+ return conf.FG_TARGET_GAP;
63036
63026
  }
63037
63027
  getActiveNodeIds() {
63038
63028
  const all6 = new Set;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.47",
3
+ "version": "0.13.49",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",