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.
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
new SimInfo( sim: Sim )Constructed once, internally, by Sim.
SimInfoState fields
| Field | Contents |
|---|---|
simName, simVersion, repoName | The sim's display name, version string, and repository name |
screens | One { name, phetioID? } entry per entry in sim.screens |
url, userAgent, language, referrer, randomSeed | Captured from location/navigator/document/the randomSeed query parameter at startup |
window | The browser viewport size at startup, as a "widthxheight" string |
pixelRatio, isWebGLSupported, checkIE11StencilSupport, flags | Rendering-capability diagnostics (device pixel ratio vs. backing-store ratio, WebGL availability, assorted browser input-capability flags) |
screenPropertyValue, wrapperMetadata, dataStreamVersion, phetioCommandProcessorProtocol | Populated only when running under PhET-iO |
Related
- Sim — constructs the single
SimInfoinstance and is the source of most of its data (simNameProperty,screens,version).