microboard-temp 0.13.16 → 0.13.18

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.
@@ -4676,10 +4676,10 @@ var conf = {
4676
4676
  MAX_CARD_SIZE: 500,
4677
4677
  CONNECTOR_ITEM_OFFSET: 20,
4678
4678
  FG_SPRING_K: 3,
4679
- FG_TARGET_GAP: 60,
4679
+ FG_TARGET_GAP: 20,
4680
4680
  FG_REPULSION: 400000,
4681
- FG_DAMPING: 0.8,
4682
- FG_SLEEP_THRESHOLD: 0.5,
4681
+ FG_DAMPING: 0.5,
4682
+ FG_SLEEP_THRESHOLD: 2,
4683
4683
  GRAVITY_G: 80,
4684
4684
  GRAVITY_G_CENTER: 120,
4685
4685
  GRAVITY_DAMPING: 0.96,
@@ -54575,6 +54575,29 @@ class GravityEngine {
54575
54575
  }
54576
54576
 
54577
54577
  // src/ForceGraph/ForceGraphEngine.ts
54578
+ class UnionFind {
54579
+ parent = new Map;
54580
+ find(id) {
54581
+ if (!this.parent.has(id))
54582
+ this.parent.set(id, id);
54583
+ const root3 = this.parent.get(id);
54584
+ if (root3 !== id) {
54585
+ const canonical = this.find(root3);
54586
+ this.parent.set(id, canonical);
54587
+ return canonical;
54588
+ }
54589
+ return root3;
54590
+ }
54591
+ union(a2, b) {
54592
+ const ra = this.find(a2);
54593
+ const rb = this.find(b);
54594
+ if (ra !== rb)
54595
+ this.parent.set(ra, rb);
54596
+ }
54597
+ sameComponent(a2, b) {
54598
+ return this.find(a2) === this.find(b);
54599
+ }
54600
+ }
54578
54601
  var EXCLUDED_TYPES = new Set(["Connector", "Comment"]);
54579
54602
 
54580
54603
  class ForceGraphEngine {
@@ -54640,6 +54663,13 @@ class ForceGraphEngine {
54640
54663
  });
54641
54664
  }
54642
54665
  const snap = Array.from(snapMap.values());
54666
+ const uf = new UnionFind;
54667
+ for (const connector of this.getConnectors()) {
54668
+ const { startItem, endItem } = connector.getConnectedItems();
54669
+ if (startItem && endItem) {
54670
+ uf.union(startItem.getId(), endItem.getId());
54671
+ }
54672
+ }
54643
54673
  const ax = new Map;
54644
54674
  const ay = new Map;
54645
54675
  for (const s2 of snap) {
@@ -54671,6 +54701,8 @@ class ForceGraphEngine {
54671
54701
  for (let j = i + 1;j < snap.length; j++) {
54672
54702
  const s1 = snap[i];
54673
54703
  const s2 = snap[j];
54704
+ if (!uf.sameComponent(s1.id, s2.id))
54705
+ continue;
54674
54706
  const dx = s2.cx - s1.cx;
54675
54707
  const dy = s2.cy - s1.cy;
54676
54708
  const distSq = dx * dx + dy * dy + this.SOFTENING_SQ;
package/dist/cjs/index.js CHANGED
@@ -4676,10 +4676,10 @@ var conf = {
4676
4676
  MAX_CARD_SIZE: 500,
4677
4677
  CONNECTOR_ITEM_OFFSET: 20,
4678
4678
  FG_SPRING_K: 3,
4679
- FG_TARGET_GAP: 60,
4679
+ FG_TARGET_GAP: 20,
4680
4680
  FG_REPULSION: 400000,
4681
- FG_DAMPING: 0.8,
4682
- FG_SLEEP_THRESHOLD: 0.5,
4681
+ FG_DAMPING: 0.5,
4682
+ FG_SLEEP_THRESHOLD: 2,
4683
4683
  GRAVITY_G: 80,
4684
4684
  GRAVITY_G_CENTER: 120,
4685
4685
  GRAVITY_DAMPING: 0.96,
@@ -54575,6 +54575,29 @@ class GravityEngine {
54575
54575
  }
54576
54576
 
54577
54577
  // src/ForceGraph/ForceGraphEngine.ts
54578
+ class UnionFind {
54579
+ parent = new Map;
54580
+ find(id) {
54581
+ if (!this.parent.has(id))
54582
+ this.parent.set(id, id);
54583
+ const root3 = this.parent.get(id);
54584
+ if (root3 !== id) {
54585
+ const canonical = this.find(root3);
54586
+ this.parent.set(id, canonical);
54587
+ return canonical;
54588
+ }
54589
+ return root3;
54590
+ }
54591
+ union(a2, b) {
54592
+ const ra = this.find(a2);
54593
+ const rb = this.find(b);
54594
+ if (ra !== rb)
54595
+ this.parent.set(ra, rb);
54596
+ }
54597
+ sameComponent(a2, b) {
54598
+ return this.find(a2) === this.find(b);
54599
+ }
54600
+ }
54578
54601
  var EXCLUDED_TYPES = new Set(["Connector", "Comment"]);
54579
54602
 
54580
54603
  class ForceGraphEngine {
@@ -54640,6 +54663,13 @@ class ForceGraphEngine {
54640
54663
  });
54641
54664
  }
54642
54665
  const snap = Array.from(snapMap.values());
54666
+ const uf = new UnionFind;
54667
+ for (const connector of this.getConnectors()) {
54668
+ const { startItem, endItem } = connector.getConnectedItems();
54669
+ if (startItem && endItem) {
54670
+ uf.union(startItem.getId(), endItem.getId());
54671
+ }
54672
+ }
54643
54673
  const ax = new Map;
54644
54674
  const ay = new Map;
54645
54675
  for (const s2 of snap) {
@@ -54671,6 +54701,8 @@ class ForceGraphEngine {
54671
54701
  for (let j = i + 1;j < snap.length; j++) {
54672
54702
  const s1 = snap[i];
54673
54703
  const s2 = snap[j];
54704
+ if (!uf.sameComponent(s1.id, s2.id))
54705
+ continue;
54674
54706
  const dx = s2.cx - s1.cx;
54675
54707
  const dy = s2.cy - s1.cy;
54676
54708
  const distSq = dx * dx + dy * dy + this.SOFTENING_SQ;
package/dist/cjs/node.js CHANGED
@@ -5713,10 +5713,10 @@ var conf = {
5713
5713
  MAX_CARD_SIZE: 500,
5714
5714
  CONNECTOR_ITEM_OFFSET: 20,
5715
5715
  FG_SPRING_K: 3,
5716
- FG_TARGET_GAP: 60,
5716
+ FG_TARGET_GAP: 20,
5717
5717
  FG_REPULSION: 400000,
5718
- FG_DAMPING: 0.8,
5719
- FG_SLEEP_THRESHOLD: 0.5,
5718
+ FG_DAMPING: 0.5,
5719
+ FG_SLEEP_THRESHOLD: 2,
5720
5720
  GRAVITY_G: 80,
5721
5721
  GRAVITY_G_CENTER: 120,
5722
5722
  GRAVITY_DAMPING: 0.96,
@@ -57048,6 +57048,29 @@ class GravityEngine {
57048
57048
  }
57049
57049
 
57050
57050
  // src/ForceGraph/ForceGraphEngine.ts
57051
+ class UnionFind {
57052
+ parent = new Map;
57053
+ find(id) {
57054
+ if (!this.parent.has(id))
57055
+ this.parent.set(id, id);
57056
+ const root3 = this.parent.get(id);
57057
+ if (root3 !== id) {
57058
+ const canonical = this.find(root3);
57059
+ this.parent.set(id, canonical);
57060
+ return canonical;
57061
+ }
57062
+ return root3;
57063
+ }
57064
+ union(a2, b) {
57065
+ const ra = this.find(a2);
57066
+ const rb = this.find(b);
57067
+ if (ra !== rb)
57068
+ this.parent.set(ra, rb);
57069
+ }
57070
+ sameComponent(a2, b) {
57071
+ return this.find(a2) === this.find(b);
57072
+ }
57073
+ }
57051
57074
  var EXCLUDED_TYPES = new Set(["Connector", "Comment"]);
57052
57075
 
57053
57076
  class ForceGraphEngine {
@@ -57113,6 +57136,13 @@ class ForceGraphEngine {
57113
57136
  });
57114
57137
  }
57115
57138
  const snap = Array.from(snapMap.values());
57139
+ const uf = new UnionFind;
57140
+ for (const connector of this.getConnectors()) {
57141
+ const { startItem, endItem } = connector.getConnectedItems();
57142
+ if (startItem && endItem) {
57143
+ uf.union(startItem.getId(), endItem.getId());
57144
+ }
57145
+ }
57116
57146
  const ax = new Map;
57117
57147
  const ay = new Map;
57118
57148
  for (const s2 of snap) {
@@ -57144,6 +57174,8 @@ class ForceGraphEngine {
57144
57174
  for (let j = i + 1;j < snap.length; j++) {
57145
57175
  const s1 = snap[i];
57146
57176
  const s2 = snap[j];
57177
+ if (!uf.sameComponent(s1.id, s2.id))
57178
+ continue;
57147
57179
  const dx = s2.cx - s1.cx;
57148
57180
  const dy = s2.cy - s1.cy;
57149
57181
  const distSq = dx * dx + dy * dy + this.SOFTENING_SQ;
@@ -4496,10 +4496,10 @@ var conf = {
4496
4496
  MAX_CARD_SIZE: 500,
4497
4497
  CONNECTOR_ITEM_OFFSET: 20,
4498
4498
  FG_SPRING_K: 3,
4499
- FG_TARGET_GAP: 60,
4499
+ FG_TARGET_GAP: 20,
4500
4500
  FG_REPULSION: 400000,
4501
- FG_DAMPING: 0.8,
4502
- FG_SLEEP_THRESHOLD: 0.5,
4501
+ FG_DAMPING: 0.5,
4502
+ FG_SLEEP_THRESHOLD: 2,
4503
4503
  GRAVITY_G: 80,
4504
4504
  GRAVITY_G_CENTER: 120,
4505
4505
  GRAVITY_DAMPING: 0.96,
@@ -54404,6 +54404,29 @@ class GravityEngine {
54404
54404
  }
54405
54405
 
54406
54406
  // src/ForceGraph/ForceGraphEngine.ts
54407
+ class UnionFind {
54408
+ parent = new Map;
54409
+ find(id) {
54410
+ if (!this.parent.has(id))
54411
+ this.parent.set(id, id);
54412
+ const root3 = this.parent.get(id);
54413
+ if (root3 !== id) {
54414
+ const canonical = this.find(root3);
54415
+ this.parent.set(id, canonical);
54416
+ return canonical;
54417
+ }
54418
+ return root3;
54419
+ }
54420
+ union(a2, b) {
54421
+ const ra = this.find(a2);
54422
+ const rb = this.find(b);
54423
+ if (ra !== rb)
54424
+ this.parent.set(ra, rb);
54425
+ }
54426
+ sameComponent(a2, b) {
54427
+ return this.find(a2) === this.find(b);
54428
+ }
54429
+ }
54407
54430
  var EXCLUDED_TYPES = new Set(["Connector", "Comment"]);
54408
54431
 
54409
54432
  class ForceGraphEngine {
@@ -54469,6 +54492,13 @@ class ForceGraphEngine {
54469
54492
  });
54470
54493
  }
54471
54494
  const snap = Array.from(snapMap.values());
54495
+ const uf = new UnionFind;
54496
+ for (const connector of this.getConnectors()) {
54497
+ const { startItem, endItem } = connector.getConnectedItems();
54498
+ if (startItem && endItem) {
54499
+ uf.union(startItem.getId(), endItem.getId());
54500
+ }
54501
+ }
54472
54502
  const ax = new Map;
54473
54503
  const ay = new Map;
54474
54504
  for (const s2 of snap) {
@@ -54500,6 +54530,8 @@ class ForceGraphEngine {
54500
54530
  for (let j = i + 1;j < snap.length; j++) {
54501
54531
  const s1 = snap[i];
54502
54532
  const s2 = snap[j];
54533
+ if (!uf.sameComponent(s1.id, s2.id))
54534
+ continue;
54503
54535
  const dx = s2.cx - s1.cx;
54504
54536
  const dy = s2.cy - s1.cy;
54505
54537
  const distSq = dx * dx + dy * dy + this.SOFTENING_SQ;
package/dist/esm/index.js CHANGED
@@ -4489,10 +4489,10 @@ var conf = {
4489
4489
  MAX_CARD_SIZE: 500,
4490
4490
  CONNECTOR_ITEM_OFFSET: 20,
4491
4491
  FG_SPRING_K: 3,
4492
- FG_TARGET_GAP: 60,
4492
+ FG_TARGET_GAP: 20,
4493
4493
  FG_REPULSION: 400000,
4494
- FG_DAMPING: 0.8,
4495
- FG_SLEEP_THRESHOLD: 0.5,
4494
+ FG_DAMPING: 0.5,
4495
+ FG_SLEEP_THRESHOLD: 2,
4496
4496
  GRAVITY_G: 80,
4497
4497
  GRAVITY_G_CENTER: 120,
4498
4498
  GRAVITY_DAMPING: 0.96,
@@ -54397,6 +54397,29 @@ class GravityEngine {
54397
54397
  }
54398
54398
 
54399
54399
  // src/ForceGraph/ForceGraphEngine.ts
54400
+ class UnionFind {
54401
+ parent = new Map;
54402
+ find(id) {
54403
+ if (!this.parent.has(id))
54404
+ this.parent.set(id, id);
54405
+ const root3 = this.parent.get(id);
54406
+ if (root3 !== id) {
54407
+ const canonical = this.find(root3);
54408
+ this.parent.set(id, canonical);
54409
+ return canonical;
54410
+ }
54411
+ return root3;
54412
+ }
54413
+ union(a2, b) {
54414
+ const ra = this.find(a2);
54415
+ const rb = this.find(b);
54416
+ if (ra !== rb)
54417
+ this.parent.set(ra, rb);
54418
+ }
54419
+ sameComponent(a2, b) {
54420
+ return this.find(a2) === this.find(b);
54421
+ }
54422
+ }
54400
54423
  var EXCLUDED_TYPES = new Set(["Connector", "Comment"]);
54401
54424
 
54402
54425
  class ForceGraphEngine {
@@ -54462,6 +54485,13 @@ class ForceGraphEngine {
54462
54485
  });
54463
54486
  }
54464
54487
  const snap = Array.from(snapMap.values());
54488
+ const uf = new UnionFind;
54489
+ for (const connector of this.getConnectors()) {
54490
+ const { startItem, endItem } = connector.getConnectedItems();
54491
+ if (startItem && endItem) {
54492
+ uf.union(startItem.getId(), endItem.getId());
54493
+ }
54494
+ }
54465
54495
  const ax = new Map;
54466
54496
  const ay = new Map;
54467
54497
  for (const s2 of snap) {
@@ -54493,6 +54523,8 @@ class ForceGraphEngine {
54493
54523
  for (let j = i + 1;j < snap.length; j++) {
54494
54524
  const s1 = snap[i];
54495
54525
  const s2 = snap[j];
54526
+ if (!uf.sameComponent(s1.id, s2.id))
54527
+ continue;
54496
54528
  const dx = s2.cx - s1.cx;
54497
54529
  const dy = s2.cy - s1.cy;
54498
54530
  const distSq = dx * dx + dy * dy + this.SOFTENING_SQ;
package/dist/esm/node.js CHANGED
@@ -5273,10 +5273,10 @@ var conf = {
5273
5273
  MAX_CARD_SIZE: 500,
5274
5274
  CONNECTOR_ITEM_OFFSET: 20,
5275
5275
  FG_SPRING_K: 3,
5276
- FG_TARGET_GAP: 60,
5276
+ FG_TARGET_GAP: 20,
5277
5277
  FG_REPULSION: 400000,
5278
- FG_DAMPING: 0.8,
5279
- FG_SLEEP_THRESHOLD: 0.5,
5278
+ FG_DAMPING: 0.5,
5279
+ FG_SLEEP_THRESHOLD: 2,
5280
5280
  GRAVITY_G: 80,
5281
5281
  GRAVITY_G_CENTER: 120,
5282
5282
  GRAVITY_DAMPING: 0.96,
@@ -56865,6 +56865,29 @@ class GravityEngine {
56865
56865
  }
56866
56866
 
56867
56867
  // src/ForceGraph/ForceGraphEngine.ts
56868
+ class UnionFind {
56869
+ parent = new Map;
56870
+ find(id) {
56871
+ if (!this.parent.has(id))
56872
+ this.parent.set(id, id);
56873
+ const root3 = this.parent.get(id);
56874
+ if (root3 !== id) {
56875
+ const canonical = this.find(root3);
56876
+ this.parent.set(id, canonical);
56877
+ return canonical;
56878
+ }
56879
+ return root3;
56880
+ }
56881
+ union(a2, b) {
56882
+ const ra = this.find(a2);
56883
+ const rb = this.find(b);
56884
+ if (ra !== rb)
56885
+ this.parent.set(ra, rb);
56886
+ }
56887
+ sameComponent(a2, b) {
56888
+ return this.find(a2) === this.find(b);
56889
+ }
56890
+ }
56868
56891
  var EXCLUDED_TYPES = new Set(["Connector", "Comment"]);
56869
56892
 
56870
56893
  class ForceGraphEngine {
@@ -56930,6 +56953,13 @@ class ForceGraphEngine {
56930
56953
  });
56931
56954
  }
56932
56955
  const snap = Array.from(snapMap.values());
56956
+ const uf = new UnionFind;
56957
+ for (const connector of this.getConnectors()) {
56958
+ const { startItem, endItem } = connector.getConnectedItems();
56959
+ if (startItem && endItem) {
56960
+ uf.union(startItem.getId(), endItem.getId());
56961
+ }
56962
+ }
56933
56963
  const ax = new Map;
56934
56964
  const ay = new Map;
56935
56965
  for (const s2 of snap) {
@@ -56961,6 +56991,8 @@ class ForceGraphEngine {
56961
56991
  for (let j = i + 1;j < snap.length; j++) {
56962
56992
  const s1 = snap[i];
56963
56993
  const s2 = snap[j];
56994
+ if (!uf.sameComponent(s1.id, s2.id))
56995
+ continue;
56964
56996
  const dx = s2.cx - s1.cx;
56965
56997
  const dy = s2.cy - s1.cy;
56966
56998
  const distSq = dx * dx + dy * dy + this.SOFTENING_SQ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.16",
3
+ "version": "0.13.18",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",