Key Takeaways
- Adaptive 60° triangulation aligns orientation and edge lengths to container aspect ratios instead of locking portrait or widescreen canvases into fixed grids.
- Mesh-inward fan seeding and space-filling PBD relaxation expand crowded anchor pockets into open triangle interiors before scaling runs.
- Local density and collision-driven scale controllers keep sparse regions at 1.0x scale while keeping overlap strictly at 0.0 px.
When dozens of items attach to one topic anchor while adjacent triangles sit nearly empty, naive uniform scaling shrinks the entire graph down just to resolve one crowded pocket. Even well-separated nodes on the opposite side of the canvas become unreadable—a failure mode we call collateral shrink.
Fitting the 60° Lattice to Real Viewports
Before placing a single item, Stage 1 (createAdaptiveHexMeshStrategy and buildSimplexMesh) evaluates the container’s (width, height) aspect ratio:
- Orientation Selection: Landscape and ultrawide canvases favor
horizontaltriangle rows; tall mobile viewports automatically rotate toverticalcolumns with optimalwideFirstparity. - Adaptive Padding (
resolveDefaultInnerPadding): Margins scale smoothly between32 pxand48 pxwith viewport size, letting equilateral triangle edges grow pastminSideLength: 130to fill the available frame rather than clustering in the center.
Adaptive Hex Lattice
Maximizes 60° side length s inside viewport (W × H)
Fixed Grid Lattice
Pins exact vertex count K = cols × rows across resizes
Fanning Pockets Into Open Triangle Interiors
Instead of shrinking every node immediately upon collision, Stage 4 separates spatial relaxation from scale selection using composable LayoutSeeder × PositionRelaxer × ScaleController pipelines:
- Inward-Fan Seeding (
createMeshInwardFanSeeder): Co-located anchors along shared edges or vertices are fanned deliberately toward the open interior of their covering simplex triangles rather than stacking on a single point. - Space-Filling PBD (
createSpaceFillingPbdRelaxer): Iterative Position-Based Dynamics + SAT projection disperses dense clusters outward within triangle boundaries (covering-triangle containment), leaving well-spaced single-cluster halos unconstrained. - Localized Scale Control: After dispersion settles,
createDensityPriorScaleController(createLocalAdaptiveLayoutStrategy) computes smooth radial crowd gradients (crowdRadiusPx: 76,minLocalScale: 0.35), orcreateCollisionLocalScaleController(createCollisionDrivenLayoutStrategy) shrinks only pockets still experiencing local hull contact—leaving sparse items at a crisp1.0x.
Uniform PBD Layout
Global α preserves exact node ratios across all triangles
Collision-Local Pocket Layout
Only colliding pockets shrink; sparse triangles stay at 1.0x
Whether you pick createPbdUniformLayoutStrategy for strict cross-corpus size comparability or createLocalAdaptiveLayoutStrategy for maximum legibility in skewed real-world distributions, every solved frame preserves overlapCount === 0 and strict triangle containment.