Skip to content

Commit

Permalink
Add TODOS, see: #164
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed May 10, 2023
1 parent 5481698 commit 0ed4718
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
6 changes: 6 additions & 0 deletions js/common/model/CAVModel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// Copyright 2023, University of Colorado Boulder

/**
* TODO: Describe file, https://github.com/phetsims/center-and-variability/issues/164
*
* @author Sam Reid (PhET Interactive Simulations)
*/

import centerAndVariability from '../../centerAndVariability.js';
import NumberProperty from '../../../../axon/js/NumberProperty.js';
import BooleanProperty from '../../../../axon/js/BooleanProperty.js';
Expand Down
6 changes: 3 additions & 3 deletions js/common/model/CAVSceneModel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2022-2023, University of Colorado Boulder

/**
* Base class for the model in every screen.
* Base class for the scene model in a screen. The Median and Mean & Median screens only have one scene model.
* The Variability screen has 4 scene models.
*
* @author Chris Klusendorf (PhET Interactive Simulations)
* @author Sam Reid (PhET Interactive Simulations)
Expand Down Expand Up @@ -546,8 +547,7 @@ export default class CAVSceneModel extends PhetioObject implements TModel {
const angle = dotRandom.nextDoubleBetween( degreesToRadians( 25 ), degreesToRadians( 70 ) );
const v0 = Math.sqrt( Math.abs( x1 * Math.abs( CAVConstants.GRAVITY ) / Math.sin( 2 * angle ) ) );

const velocity = Vector2.createPolar( v0, angle );
soccerBall.velocityProperty.value = velocity;
soccerBall.velocityProperty.value = Vector2.createPolar( v0, angle );

soccerBall.targetXProperty.value = x1;

Expand Down
11 changes: 8 additions & 3 deletions js/common/view/SceneView.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// Copyright 2023, University of Colorado Boulder
/**
* TODO: Describe file, https://github.com/phetsims/center-and-variability/issues/164
*
* @author Sam Reid (PhET Interactive Simulations)
*/

import { Node } from '../../../../scenery/js/imports.js';
import SoccerBallNode from './SoccerBallNode.js';
Expand Down Expand Up @@ -170,19 +175,19 @@ export default class SceneView {
const soccerBallNode = soccerBallMap.get( stack[ i ] )!;
const selfZIndex = soccerBallNode.parent!.indexOfChild( soccerBallNode );

let isMisorded = false;
let isMisordered = false;

const lowerNeighborIndex = i - 1;
if ( lowerNeighborIndex >= 0 ) {
const lowerSoccerBall = soccerBallMap.get( stack[ lowerNeighborIndex ] )!;
const otherZIndex = lowerSoccerBall.parent!.indexOfChild( lowerSoccerBall );

if ( selfZIndex < otherZIndex ) {
isMisorded = true;
isMisordered = true;
}
}

if ( isMisorded ) {
if ( isMisordered ) {
soccerBallNode.moveToFront();
}
}
Expand Down
7 changes: 7 additions & 0 deletions js/variability/model/VariabilitySceneModel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
// Copyright 2022-2023, University of Colorado Boulder

/**
* TODO: Describe file, https://github.com/phetsims/center-and-variability/issues/164
*
* @author Sam Reid (PhET Interactive Simulations)
*/


import CAVSceneModel from '../../common/model/CAVSceneModel.js';
import centerAndVariability from '../../centerAndVariability.js';
import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js';
Expand Down
9 changes: 8 additions & 1 deletion js/variability/view/SceneRadioButtonGroup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// Copyright 2023, University of Colorado Boulder

/**
* TODO: Describe file, https://github.com/phetsims/center-and-variability/issues/164
*
* @author Sam Reid (PhET Interactive Simulations)
*/

import RectangularRadioButtonGroup, { RectangularRadioButtonGroupOptions } from '../../../../sun/js/buttons/RectangularRadioButtonGroup.js';
import centerAndVariability from '../../centerAndVariability.js';
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
Expand Down Expand Up @@ -36,7 +42,7 @@ export default class SceneRadioButtonGroup extends RectangularRadioButtonGroup<C
fontWeight: 'bold',
fill: 'white',

// Adjust for offcentering
// Adjust for off-centering
center: path.center.plusXY( -0.5, 0 ),
stroke: 'black',
lineWidth: 0.8
Expand All @@ -45,6 +51,7 @@ export default class SceneRadioButtonGroup extends RectangularRadioButtonGroup<C
children: [ path, text ]
} );
};

super( property, [ {
value: sceneModels[ 0 ],
createNode: tandem => createTShirtIcon( tandem, '1', '#7bb772' ),
Expand Down

0 comments on commit 0ed4718

Please sign in to comment.