Docs Navigation (Stage 01)›

Adaptive Hex Lattice

Chooses orientation and staggered 60° row parity automatically to maximize triangle side length.

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

Wide Viewport (horizontal, wideFirst: true)max s (60°)resizeTall Aspect → vertical orientation
Evaluates horizontal vs. vertical axis orientations and staggered 60° row parity (wideFirst) to maximize equilateral triangle side length s inside viewport (W × H).

Factory Signature

Re-exported from @simplex-viz/core, @simplex-viz/svg, and @simplex-viz/reactStage 01 Overview →
createAdaptiveHexMeshStrategy<TItem>(overrideOptions?: MeshOptions): SimplexMeshStrategy<TItem>

Options & Defaults

innerPaddingDefault: 32–48 (adaptive)

number | undefined

Safe margin in pixels around the outer simplex lattice vertices; adapts smoothly on compact screens when omitted.

minSideLengthDefault: 130

number

Lower bound on equilateral triangle edge length (px) before stepping down K on small viewports.

maxSideLengthDefault: undefined

number | undefined

Optional upper cap on equilateral triangle edge length (px); when omitted, triangles scale freely to fill the canvas.

sideLengthDefault: undefined

number | undefined

Optional exact equilateral edge length override in world pixels.

maxClustersDefault: 14

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} />;