map

map.setAutoFit

setAutoFit(enabled: boolean, options?: object): void

Subscribe / unsubscribe an automatic fitToNodes listener.

When enabled, MapApi listens to the store's "graph:deltaApplied" event and, after a short debounce, calls fitToNodes so the camera follows data changes. The initial state is also fitted immediately (covers the "fit existing data on enable" use case).

Auto-fit is a no-op while the map is disabled — the listener stays active but each callback short-circuits because fitToNodes early-returns. This means enableMap() after a data load will not retroactively fit; call fitToNodes() once manually, or toggle setAutoFit(false); setAutoFit(true).

enabledbooleantrue to start listening, false to stop.
optionsobjectdebounce in ms (default 200) + animation duration in ms (default 600).

Returns: void