Docs Navigation (Stage 04)›

Density-Adaptive Layout

Disperses nodes into open triangle interiors, evaluates smooth radial crowd density, and polishes locally without global shrink.

Key Takeaways

  • Use when you want smooth, continuous radial scale gradients from dense hubs out toward sparse fringes without shrinking isolated regions.
  • Spreads pockets across open covering triangles first, then evaluates crowd pressure inside crowdRadiusPx and polishes locally.

Visual Mechanism

Crowd Kernel Radius R = 76 pxSmooth scale gradient from core → outer halo
Estimates smooth local crowd density within radius R prior to final convex SAT relaxation, producing gradual spatial scale transitions from dense cores to outer halos.

Factory Signature

Re-exported from @simplex-viz/core, @simplex-viz/svg, and @simplex-viz/reactStage 04 Overview →
createLocalAdaptiveLayoutStrategy(options?: DensityAdaptiveLayoutOptions): SimplexLayoutStrategy

Options & Defaults

crowdRadiusPxDefault: 76

number

Post-dispersion neighborhood kernel radius in world pixels used to estimate crowd density.

minLocalScaleDefault: 0.35

number

Target minimum scale factor assigned to items in high-density hubs.

warmStartDefault: true

boolean

Retains settled coordinates for existing items across updates.

Post-Dispersion Smooth Crowd-Density Scaling

Whereas Collision-Local Pocket Layout shrinks strictly those pairs that touch during relaxation, Density-Adaptive Layout pairs createMeshInwardFanSeeder() and createSpaceFillingPbdRelaxer() with createDensityPriorScaleController(). Co-located anchors first fan out across the open interior of their covering mesh triangles at 1.0x; a smooth radial spatial kernel (crowdRadiusPx) then measures true post-dispersion crowding so moderate pockets that fit comfortably stay at 1.0x, while genuinely congested hubs exhibit gradual core-to-fringe size transitions polished locally (0.0 px convex SAT clearance, zero global collateral shrink).

Usage Example

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

<SimplexTopicGraph
  items={items}
  layoutStrategy={createLocalAdaptiveLayoutStrategy({
    crowdRadiusPx: 84,
    minLocalScale: 0.35,
  })}
/>;