Adaptive Hex Lattice
Chooses orientation and staggered 60° row parity automatically to maximize triangle side length.
- Stage 01: Mesh Triangulation
- Stage Default
- 2 min read
- Updated 2026-11-15
Key Takeaways
- Default choice for responsive browser atlases and varying collection sizes.
- Automatically adapts lattice orientation (horizontal vs. vertical) and row parity to viewport aspect ratio.
- Pairs with any tag, embedding, or similarity clustering strategy.
Visual Mechanism
Factory Signature
@simplex-viz/core, @simplex-viz/svg, and @simplex-viz/reactStage 01 Overview →createAdaptiveHexMeshStrategy<TItem>(overrideOptions?: MeshOptions): SimplexMeshStrategy<TItem>Options & Defaults
number | undefined
Safe margin in pixels around the outer simplex lattice vertices; adapts smoothly on compact screens when omitted.
number
Lower bound on equilateral triangle edge length (px) before stepping down K on small viewports.
number | undefined
Optional upper cap on equilateral triangle edge length (px); when omitted, triangles scale freely to fill the canvas.
number | undefined
Optional exact equilateral edge length override in world pixels.
number
Maximum vertex budget K allocated by the adaptive lattice.
How Adaptive Hex Lattice Works
Adaptive Hex Lattice evaluates candidate staggered hexagonal grids (rows, cols, orientation, wideFirst) for the active cluster budget K (informed by clusteringStrategy.estimateClusterCount or tag diversity, clamped to [3, maxClusters]).
Every face in the generated mesh is an exact 60° equilateral triangle with height h = s · √3 / 2. Evaluating both horizontal and vertical primary axes—and whether even or odd rows carry the extra vertex (wideFirst)—maximizes usable canvas area and aspect-ratio alignment across widescreen, square, and portrait mobile viewports without distorting barycentric angles.
Usage Example
import {
SimplexTopicGraph,
createAdaptiveHexMeshStrategy,
} from '@simplex-viz/react';
const meshStrategy = createAdaptiveHexMeshStrategy({
innerPadding: 56,
minSideLength: 160,
maxClusters: 10,
});
<SimplexTopicGraph items={items} meshStrategy={meshStrategy} />;