Skip to content

Commit

Permalink
phetioFeatured change requests, #345
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jul 28, 2023
1 parent 56d3d94 commit d08e0cd
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 13 deletions.
3 changes: 2 additions & 1 deletion js/common/model/DataProbe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export default class DataProbe extends PhetioObject {

// PhetioObjectOptions
isDisposable: false,
phetioState: false // to prevent serialization, because we don't have an IO Type
phetioState: false, // to prevent serialization, because we don't have an IO Type
phetioFeatured: true
}, providedOptions );

super( options );
Expand Down
3 changes: 2 additions & 1 deletion js/common/model/GenerationClock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export default class GenerationClock extends PhetioObject {
// PhetioObjectOptions
isDisposable: false,
phetioState: false, // to prevent serialization, because we don't have an IO Type
phetioDocumentation: 'the clock that marks the duration of a generation'
phetioDocumentation: 'the clock that marks the duration of a generation',
phetioFeatured: true
}, providedOptions );

super( options );
Expand Down
6 changes: 4 additions & 2 deletions js/common/model/PopulationModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export default class PopulationModel extends PhetioObject {
// PhetioObjectOptions
isDisposable: false,
phetioState: false, // to prevent serialization, because we don't have an IO Type
phetioDocumentation: 'model elements that are specific to the Population feature'
phetioDocumentation: 'model elements that are specific to the Population feature',
phetioFeatured: true
}, providedOptions );

super( options );
Expand Down Expand Up @@ -201,7 +202,8 @@ export default class PopulationModel extends PhetioObject {
numberType: 'Integer',
range: new Range( 0, Y_MAXIMUMS.length - 1 ),
tandem: options.tandem.createTandem( 'yZoomLevelProperty' ),
phetioDocumentation: 'Zooms in and out by selecting a pre-set y-axis range. The smaller the value, the larger the y-axis range.'
phetioDocumentation: 'Zooms in and out by selecting a pre-set y-axis range. The smaller the value, the larger the y-axis range.',
phetioFeatured: true
} );

this.yRangeProperty = new DerivedProperty(
Expand Down
3 changes: 2 additions & 1 deletion js/common/model/ProportionsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export default class ProportionsModel extends PhetioObject {
// PhetioObjectOptions
isDisposable: false,
phetioState: false, // to prevent serialization, because we don't have an IO Type
phetioDocumentation: 'model elements that are specific to the Proportions feature'
phetioDocumentation: 'model elements that are specific to the Proportions feature',
phetioFeatured: true
}, providedOptions );

super( options );
Expand Down
8 changes: 5 additions & 3 deletions js/common/view/AddMutationsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

import DerivedProperty from '../../../../axon/js/DerivedProperty.js';
import optionize, { combineOptions, EmptySelfOptions, optionize3 } from '../../../../phet-core/js/optionize.js';
import optionize, { combineOptions, EmptySelfOptions, optionize4 } from '../../../../phet-core/js/optionize.js';
import StrictOmit from '../../../../phet-core/js/types/StrictOmit.js';
import PickRequired from '../../../../phet-core/js/types/PickRequired.js';
import { AlignBox, AlignBoxOptions, AlignGroup, HBox, HBoxOptions, Image, Node, NodeOptions, Rectangle, TColor, Text, VBox, VBoxOptions } from '../../../../scenery/js/imports.js';
Expand Down Expand Up @@ -43,8 +43,10 @@ export default class AddMutationsPanel extends NaturalSelectionPanel {

public constructor( genePool: GenePool, providedOptions: AddMutationsPanelOptions ) {

const options = optionize3<AddMutationsPanelOptions, SelfOptions, StrictOmit<NaturalSelectionPanelOptions, 'tandem'>>()(
{}, NaturalSelectionConstants.PANEL_OPTIONS, providedOptions );
const options = optionize4<AddMutationsPanelOptions, SelfOptions, StrictOmit<NaturalSelectionPanelOptions, 'tandem'>>()(
{}, NaturalSelectionConstants.PANEL_OPTIONS, {
visiblePropertyOptions: { phetioFeatured: true }
}, providedOptions );

// All allele icons have the same effective width and height.
const iconsAlignGroup = new AlignGroup();
Expand Down
3 changes: 2 additions & 1 deletion js/common/view/pedigree/PedigreeGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export default class PedigreeGraphNode extends Node {

// NodeOptions
phetioVisiblePropertyInstrumented: false,
isDisposable: false
isDisposable: false,
phetioFeatured: true
}, providedOptions );

const backgroundNode = new Rectangle( 0, 0, options.graphWidth, options.graphHeight, {
Expand Down
3 changes: 2 additions & 1 deletion js/common/view/population/DataProbeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export default class DataProbeNode extends Node {

// NodeOptions
cursor: 'ew-resize', // east-west arrows, <->
isDisposable: false
isDisposable: false,
phetioFeatured: true
}, providedOptions );

const dataProbe = populationModel.dataProbe;
Expand Down
10 changes: 8 additions & 2 deletions js/common/view/population/PopulationGenerationScroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export default class PopulationGenerationScroller extends HBox {
const backButton = new ArrowButton( 'left', back,
combineOptions<ArrowButtonOptions>( {
tandem: options.tandem.createTandem( 'backButton' ),
enabledPropertyOptions: { phetioReadOnly: true }
enabledPropertyOptions: {
phetioReadOnly: true, // see https://github.com/phetsims/natural-selection/issues/344
phetioFeatured: false // see https://github.com/phetsims/natural-selection/issues/345
}
}, NaturalSelectionConstants.ARROW_BUTTON_OPTIONS )
);

Expand All @@ -85,7 +88,10 @@ export default class PopulationGenerationScroller extends HBox {
const forwardButton = new ArrowButton( 'right', forward,
combineOptions<ArrowButtonOptions>( {
tandem: options.tandem.createTandem( 'forwardButton' ),
enabledPropertyOptions: { phetioReadOnly: true }
enabledPropertyOptions: {
phetioReadOnly: true, // see https://github.com/phetsims/natural-selection/issues/344
phetioFeatured: false // see https://github.com/phetsims/natural-selection/issues/345
}
}, NaturalSelectionConstants.ARROW_BUTTON_OPTIONS )
);

Expand Down
5 changes: 4 additions & 1 deletion js/common/view/population/PopulationGraphNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ export default class PopulationGraphNode extends Node {
touchAreaYDilation: 4,
left: boundsRectangle.left,
top: boundsRectangle.top,
tandem: options.tandem.createTandem( 'yZoomButtonGroup' )
tandem: options.tandem.createTandem( 'yZoomButtonGroup' ),
visiblePropertyOptions: {
phetioFeatured: true
}
} );

// Dimensions of the 2D grid (sans tick marks) in view coordinates
Expand Down

0 comments on commit d08e0cd

Please sign in to comment.