From 757402d63ed444df6e6e313ed84f466413c96c97 Mon Sep 17 00:00:00 2001 From: Marla Schulz Date: Fri, 28 Apr 2023 09:46:45 -0700 Subject: [PATCH] Remove unnecessary maps, see: https://github.com/phetsims/center-and-variability/issues/160 --- js/common/view/CAVPlotNode.ts | 9 +-------- js/common/view/CAVScreenView.ts | 5 ----- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/js/common/view/CAVPlotNode.ts b/js/common/view/CAVPlotNode.ts index 2cf34683..5aabaeb5 100644 --- a/js/common/view/CAVPlotNode.ts +++ b/js/common/view/CAVPlotNode.ts @@ -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'; @@ -82,11 +81,9 @@ export default class CAVPlotNode extends Node { backgroundNode.addChild( this.dotLayer ); - const map = new Map(); - // 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, { @@ -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; } ); } diff --git a/js/common/view/CAVScreenView.ts b/js/common/view/CAVScreenView.ts index 07c086e0..2f0769ca 100644 --- a/js/common/view/CAVScreenView.ts +++ b/js/common/view/CAVScreenView.ts @@ -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'; @@ -92,8 +91,6 @@ export default class CAVScreenView extends ScreenView { tandem: objectNodeGroupTandem.createTandem( 'inputEnabledProperty' ) } ); - const map = new Map(); - model.soccerBallGroup.map( ( soccerBall, index ) => { const soccerBallNode = new CAVObjectNode( soccerBall, model.isShowingPlayAreaMedianProperty, modelViewTransform, objectNodesInputEnabledProperty, { fill: null, // Only depict as a soccer ball @@ -145,8 +142,6 @@ export default class CAVScreenView extends ScreenView { } } ); - map.set( soccerBall, soccerBallNode ); - return soccerBallNode; } );