Skip to content

Commit

Permalink
Remove unnecessary maps, see: #160
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Apr 28, 2023
1 parent 253393f commit 757402d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 1 addition & 8 deletions js/common/view/CAVPlotNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import centerAndVariability from '../../centerAndVariability.js';
import { ManualConstraint, Node, NodeOptions, Rectangle, TColor, Text } from '../../../../scenery/js/imports.js';
import optionize from '../../../../phet-core/js/optionize.js';
import CAVModel from '../model/CAVModel.js';
import CAVObject from '../model/CAVObject.js';
import CAVObjectNode from './CAVObjectNode.js';
import CAVObjectType from '../model/CAVObjectType.js';
import ModelViewTransform2 from '../../../../phetcommon/js/view/ModelViewTransform2.js';
Expand Down Expand Up @@ -82,11 +81,9 @@ export default class CAVPlotNode extends Node {

backgroundNode.addChild( this.dotLayer );

const map = new Map<CAVObject, CAVObjectNode>();

// TODO: This overlaps with draggingEnabled
const dotPlotObjectNodesDraggableProperty = new BooleanProperty( false );
model.soccerBallGroup.map( soccerBall => {
model.soccerBallGroup.forEach( soccerBall => {

// TODO: This should be new DataPointNode
const dotNode = new CAVObjectNode( soccerBall, model.isShowingTopMedianProperty, modelViewTransform, dotPlotObjectNodesDraggableProperty, {
Expand All @@ -97,10 +94,6 @@ export default class CAVPlotNode extends Node {
} );

this.dotLayer.addChild( dotNode );

// TODO: Why in a map?
map.set( soccerBall, dotNode );
return dotNode;
} );
}

Expand Down
5 changes: 0 additions & 5 deletions js/common/view/CAVScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import ModelViewTransform2 from '../../../../phetcommon/js/view/ModelViewTransfo
import CAVObjectNode from './CAVObjectNode.js';
import { AlignBox, ManualConstraint, Node } from '../../../../scenery/js/imports.js';
import CAVObjectType from '../model/CAVObjectType.js';
import CAVObject from '../model/CAVObject.js';
import ArrowNode from '../../../../scenery-phet/js/ArrowNode.js';
import EraserButton from '../../../../scenery-phet/js/buttons/EraserButton.js';
import PredictionSlider from './PredictionSlider.js';
Expand Down Expand Up @@ -92,8 +91,6 @@ export default class CAVScreenView extends ScreenView {
tandem: objectNodeGroupTandem.createTandem( 'inputEnabledProperty' )
} );

const map = new Map<CAVObject, CAVObjectNode>();

model.soccerBallGroup.map( ( soccerBall, index ) => {
const soccerBallNode = new CAVObjectNode( soccerBall, model.isShowingPlayAreaMedianProperty, modelViewTransform, objectNodesInputEnabledProperty, {
fill: null, // Only depict as a soccer ball
Expand Down Expand Up @@ -145,8 +142,6 @@ export default class CAVScreenView extends ScreenView {
}
} );

map.set( soccerBall, soccerBallNode );

return soccerBallNode;
} );

Expand Down

0 comments on commit 757402d

Please sign in to comment.