Docs Navigation (Stage 01)›

Fixed Grid Lattice

Pins an exact (cols × rows) equilateral vertex grid across viewport resizes.

Key Takeaways

  • Use when your visualization requires a constant, predictable vertex count K = cols × rows across all screen sizes.
  • Ideal for static SSR exports, side-by-side cohort comparisons, and fixed taxonomy boards.

Visual Mechanism

Pinned Grid: cols = 3, rows = 2 (K = 6 invariant)0,00,10,21,01,11,2compactSame (r, c) indices · scaled side s'0,00,10,21,01,11,2
Locks an exact (cols × rows) vertex grid topology across viewport aspect changes, scaling equilateral edge length s uniformly without adding or dropping vertices.

Factory Signature

Re-exported from @simplex-viz/core, @simplex-viz/svg, and @simplex-viz/reactStage 01 Overview →
createFixedLatticeMeshStrategy<TItem>(config: FixedLatticeConfig): SimplexMeshStrategy<TItem>

Options & Defaults

colsDefault: required (≥ 2)

number

Exact number of columns in the staggered equilateral grid.

rowsDefault: required (≥ 2)

number

Exact number of rows in the staggered equilateral grid.

orientationDefault: 'auto'

'auto' | 'horizontal' | 'vertical'

Aligns the lattice major axis with the viewport aspect ratio when 'auto', or locks horizontal/vertical bases.

wideFirstDefault: true

boolean

Selects staggered parity of the first row/column.

innerPaddingDefault: 32–48 (adaptive)

number | undefined

Outer viewport margin in pixels when fitting side length.

sideLengthDefault: undefined

number | undefined

Pins an exact world-space edge length instead of scaling to viewport.

Deterministic Fixed Topology

Whereas Adaptive Hex Lattice adjusts vertex count dynamically, Fixed Grid Lattice locks the exact planar graph (cols × rows) across every resize. By default (orientation: 'auto'), the grid aligns its longer axis with the canvas aspect ratio (landscape vs. mobile portrait) while scaling the equilateral side length s to fill the container—or keeping s constant when sideLength is explicitly specified.

Usage Example

import {
  SimplexTopicGraph,
  createFixedLatticeMeshStrategy,
} from '@simplex-viz/react';

// Exact 3 × 3 = 9 topic vertices in horizontal 60° rows:
const fixedNine = createFixedLatticeMeshStrategy({
  cols: 3,
  rows: 3,
  orientation: 'horizontal',
  wideFirst: true,
});

<SimplexTopicGraph items={items} meshStrategy={fixedNine} />;