Type Definitions
InvocationData
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
phetioID |
string | The id of the instance | |
method |
string | name of method to invoke | |
args |
Array.<*> |
<optional> |
the parameters needed from the method to invoke. |
LaunchSimOptions
Type:
- Object
Properties:
Name | Type | Default | Description |
---|---|---|---|
passThroughQueryParameters |
boolean | true | True if the query parameters from the wrapper should propagate through to the simulation. |
phetioEventsListener |
function | null | null | called when any message is delivered from the simulation |
callback |
function | no-op | called after the phet-io sim's "launch" command is called |
onSimInitialized |
function | no-op | Callback after the sim has been fully initialized and is ready to be displayed. |
onPhETiOInitialized |
function | no-op | Callback after the PhET-iO layer in the simulation frame is ready for communication. It can receive some PhET-iO commands (such as adding listeners or customization expressions) before the sim starts to launch. |
emitStates |
boolean | false | Whether states should be emitted in the data stream every frame. Can be overriden by the phetioEmitStates query parameter. |
emitInputEvents |
boolean | false | Whether input events should be emitted in the data stream every frame. Can be overriden by the phetioEmitInputEvents query parameter |
simStartedMetadata |
Object | {} | This metadata will be logged to the PhET-iO event stream in the simStarted event on sim launch. |
supplySimStartedMetadata |
boolean | true | Determines whether or not to give the sim metadata from the wrapper to be emitted in the simStartedEvent on the events stream. See simStartedMetadata for the object proper. Note: This flag is used for backwards compatibility in the api-diff wrapper, and can be removed once all published sims have the phetio.setSimStartedMetadata method. |
PhetioQueryParameters
Available query parameters to customize and manipulate the phet-io interface.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
phetioEmitDeltas |
boolean | When running a simulation using phetio.js, outputs states and deltas within the phetioEvents data stream, see phetio.js |
phetioEmitEmptyDeltas |
boolean | when emitting deltas using phetio.js (see phetioEmitDeltas) emit deltas that are empty, to simplify playback in some systems like Metacog. |
phetioEmitInputEvents |
boolean | emit the Scenery input events such as pointer moves, presses, releases, dt values and window resizes to support playback in a live simulation. |
phetioEmitStates |
boolean | when running a simulation using phetio.js, outputs the state at the end of every frame |
phetioEmitStatesInterval |
number | What is the frame rate of emitting states (if phetioEmitState) is enabled, and the state has changed? |
phetioEmitHighFrequencyEvents |
boolean | If turned to false, the event stream will skip events tagged as high frequency |
phetioLog |
string | null | Specifies where to log phetioEvents. Valid values: null - no logging; "console" - stream to console in JSON format; "lines" - stream colorized human-readable events to the console (Chrome and Firefox only) |
phetioStandalone |
boolean | Causes a phet-io simulation to launch, even without a wrapper "go-ahead" step (invoking phetio.launchSimulation). |
phetioThrowSimErrors |
boolean | Throw an internal sim error instead of passing it back out of the sim. A handy feature for testing and debugging. |