emphasis
The emphasis namespace draws the viewer's attention to a subgraph: sequential
path highlighting, a cascade BFS wave of size + glow, and focus +
context dimming that keeps a focus set bright while fading everything else. It
also owns the engine's click-to-dim and hover-ring behavior.
api.emphasis.focusContext(['valjean'], { contextOpacity: 0.12 });
api.emphasis.cascadeHighlight('valjean'); // wave expands hop by hop
api.emphasis.dimNeighborhood('valjean', 1); // dim outside the 1-hop neighborhood
api.emphasis.clearDim();
api.emphasis.setClickDimEnabled(true); // click a node → focus + dim the rest
api.emphasis.setEmphasisGlowEnabled(true); // hover ring (on by default)
Like api.animations, each effect returns an opaque ID
for stop / stopAll, and none is recorded in history. For worked examples, see
the Animations & emphasis guide.