Skip to content

Commit

Permalink
Add metadataDefaults to IOType, create a sparse tree structure, phets…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Apr 14, 2021
1 parent cf3e50f commit 7a1f762
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/nodes/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ const ENABLED_PROPERTY_TANDEM_NAME = EnabledProperty.TANDEM_NAME;
const VISIBLE_PROPERTY_TANDEM_NAME = 'visibleProperty';
const INPUT_ENABLED_PROPERTY_TANDEM_NAME = 'inputEnabledProperty';

const PHET_IO_STATE_DEFAULT = false;

// Node options, in the order they are executed in the constructor/mutate()
const NODE_OPTION_KEYS = [
'children', // {Array.<Node>}- List of children to add (in order), see setChildren for more documentation
Expand Down Expand Up @@ -6701,7 +6703,7 @@ class Node extends PhetioObject {
}
} );

this.initializePhetioObject( { phetioType: Node.NodeIO, phetioState: false }, options );
this.initializePhetioObject( { phetioType: Node.NodeIO, phetioState: PHET_IO_STATE_DEFAULT }, options );

return this; // allow chaining
}
Expand Down Expand Up @@ -6946,7 +6948,10 @@ ParallelDOM.compose( Node );
// @public {IOType}
Node.NodeIO = new IOType( 'NodeIO', {
valueType: Node,
documentation: 'The base type for graphical and potentially interactive objects.'
documentation: 'The base type for graphical and potentially interactive objects.',
metadataDefaults: {
phetioState: PHET_IO_STATE_DEFAULT
}
} );

export default Node;

0 comments on commit 7a1f762

Please sign in to comment.