PhetioQueryParameters

PhetioQueryParameters

Query parameters that control the PhET-iO framework, and how it interfaces with the PhET-iO Simulation. This is not an object defined in the global scope, but rather it serves as documentation about available query parameters. Note: the "flag" type for query parameters does not expect a value for the key, but rather just the presence of the key itself.

Members

(static) phetioConsoleLog :string|null

Specify the format of the log of the PhET-iO data stream to the console. Possible options:
  • 'json': emit json to the console
  • 'colorized': emit formatted, human readable logging to the console.
  • null: default, no logging to the console.
Type:
  • string | null
Example
?phetioConsoleLog=colorized

(static) phetioEmitHighFrequencyEvents :boolean

Defaults to true, if set to false, the data stream will skip events that heavily spam the data stream. This can be useful for understanding the data stream through user events (clicking in the sim and seeing those events). Note that setting this to false will break the simulation for recording and playback because (in part) of the omission of model step events to the data stream.
Type:
  • boolean
Example
?phetioEmitHighFrequencyEvents=true

(static) phetioEmitStates :boolean

When the simulation starts up, it emits its initial state in an 'initialState' event. This query parameter specifies which additional events should be emitted, at the end of every X frames (see ?phetioEmitStatesInterval). If the state has not changed from the last emitted state, then a new state will not be emitted until the next time the state is different.
Type:
  • boolean
Example
?phetioEmitStates=true

(static) phetioEmitStatesInterval :number

If phetioEmitStates is enabled, this parameter sets the frame period to emit states to the data stream. If the value is 1, then a state will be emitted every frame, but only if the state differs from the previously emitted state. If the value is 2, a state will potentially be emitted every other frame. Defaults to ?phetioEmitStatesInterval=1, which attempts to emit every frame if the state has changed. To emit about one frame per second, use ?phetioEmitStatesInterval=60 (will depend on actual frame rate and on the hardware).
Type:
  • number
Example
// Emit a state event ever 100 frames
?phetioEmitStatesInterval=100

(static) phetioStandalone :flag

Causes a phet-io simulation to launch, even without a wrapper's "go-ahead" step. This allows you to run a PhET-iO Simulation that is not embedded in a wrapper iframe.
Type:
  • flag
Example
?phetioStandalone