Global

Type Definitions

Command

Properties:
Name Type Attributes Description
phetioID string the id of the phet-io element
method string name of method to invoke
args Array.<*> <optional>
the parameters needed from the method to invoke
An object holding the data for a single invocation command. Each Command consists of the needed values to invoke one method call in the sim frame.
Type:
  • Object

LaunchSimulationOptions

Properties:
Name Type Default Description
queryString string "" appended to the simulation launch URL, can begin with '?' or '&' or neither
passThroughQueryParameters boolean | Array.<string> false Set to true if the query parameters from the wrapper should propagate through to the simulation. Also accepts a string array of the list of accepted query parameters, ignoring all the rest.
onEvent function | null null Callback called for each event from the simulation. Note that this listener is called for children events as well as the root. Listener has have two arguments; the first is the event object, and the second is the root event object. The event will either be the root event, or be a child/descendant of the root event. See the PhET-iO dev guide for more information.
onSimInitialized function no-op Callback after the sim has been fully initialized and is ready to be displayed. See PhetioClient.addSimulationInitializedListener for more info.
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. See PhetioClient.addPhetioInitializedListener for more info.
onError function no-op Callback called whenever an error is received from the sim. This listener exists for the lifetime of the wrapper. If wanting to add error listeners that can be removed, see PhetioClient.addErrorListener().
displaySim boolean true By default, the sim will be immediately displayed when it starts up. Set this flag to false in order to stay on the splash screen until after customizations have been applied to the sim from a wrapper. Display the sim manually by calling phetioClient.invoke( 'phetioEngine', 'displaySimulation' ).
simStartedMetadata Object {} This metadata will be logged to the PhET-iO data stream in the simStarted event on sim launch.
targetAPIVersion string CURRENT_VERSION This string tells PhetioClient what version the wrapper was written for, regardless of what the current version the wrapper is being used for is. This way PhetioClient can automatically migrate from old version APIs to new versions without changing wrapper code.
forwardZoomKeyboardEventsToSim boolean false Whether the zoom keyboard events should be forwarded to the sim. Typically important for a full-screen sim iframe.
The schema for the available options that can be passed to PhetioClient.launchSimulation()
Type:
  • Object

Documentation generated by JSDoc 3.6.11 on Wed Jan 31 2024 12:00:42 GMT-0700 (Mountain Standard Time) using the docdash theme.