Skip to content

Commit

Permalink
Rename MedianPlotNode => MeanAndMedianPlotNode, see #170
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed May 10, 2023
1 parent 114b01a commit 1e421a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions js/mean-and-median/view/MeanAndMedianAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import Bounds2 from '../../../../dot/js/Bounds2.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import centerAndVariability from '../../centerAndVariability.js';
import MeanAndMedianModel from '../model/MeanAndMedianModel.js';
import MedianPlotNode from './MedianPlotNode.js';
import MeanAndMedianPlotNode from './MeanAndMedianPlotNode.js';
import TopRepresentationCheckboxGroup from '../../common/view/TopRepresentationCheckboxGroup.js';
import VerticalCheckboxGroup from '../../../../sun/js/VerticalCheckboxGroup.js';
import CAVConstants from '../../common/CAVConstants.js';

const MARGIN = 12.5;

export default class MeanAndMedianAccordionBox extends CAVAccordionBox {
private readonly medianPlotNode: MedianPlotNode;
private readonly medianPlotNode: MeanAndMedianPlotNode;

public constructor( model: MeanAndMedianModel, layoutBounds: Bounds2, tandem: Tandem, top: number, playAreaNumberLineNode: Node ) {
const iconGroup = new AlignGroup();
Expand All @@ -30,8 +30,7 @@ export default class MeanAndMedianAccordionBox extends CAVAccordionBox {
// There is only one scene in the mean and median screen
const sceneModel = model.selectedSceneModelProperty.value;

// TODO: https://github.com/phetsims/center-and-variability/issues/170 Why is this called the MedianPlotNode?
const medianPlotNode = new MedianPlotNode( model, sceneModel, {
const meanAndMedianPlotNode = new MeanAndMedianPlotNode( model, sceneModel, {
tandem: tandem.createTandem( 'plotNode' )
} ).mutate( {
bottom: backgroundNode.height
Expand All @@ -47,7 +46,7 @@ export default class MeanAndMedianAccordionBox extends CAVAccordionBox {
} );

backgroundNode.addChild( checkboxGroup );
backgroundNode.addChild( medianPlotNode );
backgroundNode.addChild( meanAndMedianPlotNode );

super( backgroundNode, {
titleNode: new Text( CenterAndVariabilityStrings.distanceInMetersStringProperty, {
Expand All @@ -60,7 +59,7 @@ export default class MeanAndMedianAccordionBox extends CAVAccordionBox {
}
);

this.medianPlotNode = medianPlotNode;
this.medianPlotNode = meanAndMedianPlotNode;
}

public alignWithPlayAreaNumberLineNode( x: number ): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type CAVPlotOptions = NodeOptions & PickRequired<NodeOptions, 'tandem'>;
// Prevent the median bar node from going off the top of the accordion box
const MARGIN_TO_TOP_OF_ACCORDION_BOX = 4;

export default class MedianPlotNode extends CAVPlotNode {
export default class MeanAndMedianPlotNode extends CAVPlotNode {

private readonly medianBarNode = new MedianBarNode( {
notchDirection: 'down',
Expand Down Expand Up @@ -80,4 +80,4 @@ export default class MedianPlotNode extends CAVPlotNode {
}
}

centerAndVariability.register( 'MedianPlotNode', MedianPlotNode );
centerAndVariability.register( 'MeanAndMedianPlotNode', MeanAndMedianPlotNode );

0 comments on commit 1e421a5

Please sign in to comment.