@almadar/ui 4.41.2 → 4.41.3
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 +14 -8
- package/dist/avl/index.js +14 -8
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -52647,15 +52647,21 @@ function layoutOrbitals(count, containerW, containerH) {
|
|
|
52647
52647
|
const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
|
|
52648
52648
|
const rows = Math.ceil(count / cols);
|
|
52649
52649
|
const edgePad = 24;
|
|
52650
|
-
const
|
|
52651
|
-
const
|
|
52652
|
-
const
|
|
52653
|
-
const
|
|
52654
|
-
const
|
|
52655
|
-
const
|
|
52650
|
+
const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
|
|
52651
|
+
const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
|
|
52652
|
+
const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
|
|
52653
|
+
const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
|
|
52654
|
+
const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
|
|
52655
|
+
const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
|
|
52656
|
+
const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
|
|
52657
|
+
const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
|
|
52658
|
+
const gridW = (cols - 1) * stepX;
|
|
52659
|
+
const gridH = (rows - 1) * stepY;
|
|
52660
|
+
const originX = (containerW - gridW) / 2;
|
|
52661
|
+
const originY = (containerH - gridH) / 2;
|
|
52656
52662
|
return Array.from({ length: count }, (_, i) => ({
|
|
52657
|
-
cx:
|
|
52658
|
-
cy:
|
|
52663
|
+
cx: originX + i % cols * stepX,
|
|
52664
|
+
cy: originY + Math.floor(i / cols) * stepY
|
|
52659
52665
|
}));
|
|
52660
52666
|
}
|
|
52661
52667
|
var avlOczWireId = 0;
|
package/dist/avl/index.js
CHANGED
|
@@ -52601,15 +52601,21 @@ function layoutOrbitals(count, containerW, containerH) {
|
|
|
52601
52601
|
const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
|
|
52602
52602
|
const rows = Math.ceil(count / cols);
|
|
52603
52603
|
const edgePad = 24;
|
|
52604
|
-
const
|
|
52605
|
-
const
|
|
52606
|
-
const
|
|
52607
|
-
const
|
|
52608
|
-
const
|
|
52609
|
-
const
|
|
52604
|
+
const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
|
|
52605
|
+
const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
|
|
52606
|
+
const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
|
|
52607
|
+
const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
|
|
52608
|
+
const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
|
|
52609
|
+
const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
|
|
52610
|
+
const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
|
|
52611
|
+
const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
|
|
52612
|
+
const gridW = (cols - 1) * stepX;
|
|
52613
|
+
const gridH = (rows - 1) * stepY;
|
|
52614
|
+
const originX = (containerW - gridW) / 2;
|
|
52615
|
+
const originY = (containerH - gridH) / 2;
|
|
52610
52616
|
return Array.from({ length: count }, (_, i) => ({
|
|
52611
|
-
cx:
|
|
52612
|
-
cy:
|
|
52617
|
+
cx: originX + i % cols * stepX,
|
|
52618
|
+
cy: originY + Math.floor(i / cols) * stepY
|
|
52613
52619
|
}));
|
|
52614
52620
|
}
|
|
52615
52621
|
var avlOczWireId = 0;
|