Skip to main content

TraceEngine

from v9.4status Work-in-Progress

TraceEngine owns mounted trace-view state below React. Hosts sync durable inputs into it, dispatch semantic interactions into it, and subscribe when selected refs or serialized expanded process ids need to be persisted.

import {TraceEngine} from '@deck.gl-community/trace-layers/trace';

Main operations

  • new TraceEngine(inputs): mount one engine around primary and optional secondary graphs
  • sync(inputs): replace durable host inputs without remounting the viewer
  • dispatch(action): apply semantic selection and collapse interactions
  • subscribe(listener): receive TraceEngineUpdate notifications
  • getSnapshot(): read the immutable renderer snapshot consumed by DeckTraceGraph
  • getPreparedScene(): read prepared foreground and overview scenes for low-level composition
  • getDiagnostics(...): read cheap engine diagnostics and optional retained-size estimates

Host boundary

Keep durable host state small: TraceGraph, settings, paths, selected SpanRefs, color scheme, and serialized expanded process ids. Let the mounted engine own transient selected dependency refs, collapse runtime state, prepared layouts, and prepared scenes.

See DeckTraceGraph and Rendering traces.