Skip to content

SimInfo

SimInfo is a diagnostic snapshot — sim name/version, screen names, browser user agent, viewport size, WebGL support, and (when running under PhET-iO) data-stream/wrapper metadata — collected once when a Sim starts up. Sim constructs exactly one internally (this.simInfo = new SimInfo( this ), an internal/private field); as a simulation author you don't construct one yourself or read it off sim directly. It exists mostly so PhET-iO's data stream can emit a simStarted event describing the environment, and to back the diagnostic info shown in the sim's About dialog.

ts
import type { SimInfoState } from 'scenerystack/sim';
// SimInfo itself is constructed internally by Sim; simulation code doesn't create instances directly.

This is a read-only diagnostic record, not a live/reactive object

Every field in SimInfoState is captured once, synchronously, at construction time (self.navigator.userAgent, window.innerWidth, etc.) — there are no Properties here to link() to, and nothing updates after the fact (e.g. resizing the browser window afterward doesn't change the captured window field). If you need live values for something SimInfo also captures — like viewport size — use Sim.dimensionProperty instead.

Constructor

ts
new SimInfo( sim: Sim )

Constructed once, internally, by Sim.

SimInfoState fields

FieldContents
simName, simVersion, repoNameThe sim's display name, version string, and repository name
screensOne { name, phetioID? } entry per entry in sim.screens
url, userAgent, language, referrer, randomSeedCaptured from location/navigator/document/the randomSeed query parameter at startup
windowThe browser viewport size at startup, as a "widthxheight" string
pixelRatio, isWebGLSupported, checkIE11StencilSupport, flagsRendering-capability diagnostics (device pixel ratio vs. backing-store ratio, WebGL availability, assorted browser input-capability flags)
screenPropertyValue, wrapperMetadata, dataStreamVersion, phetioCommandProcessorProtocolPopulated only when running under PhET-iO
  • Sim — constructs the single SimInfo instance and is the source of most of its data (simNameProperty, screens, version).