Skip to content

Commit

Permalink
Update dependencies of updateIQRNode - see #167
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-blackman committed Jun 2, 2023
1 parent 23a2732 commit 3f7b831
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions js/variability/view/IQRNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import VariabilitySceneModel from '../model/VariabilitySceneModel.js';
import CAVConstants, { SHOW_OUTLIERS_PROPERTY } from '../../common/CAVConstants.js';
import optionize from '../../../../phet-core/js/optionize.js';
import NumberLineNode from '../../common/view/NumberLineNode.js';
import Multilink from '../../../../axon/js/Multilink.js';

type SelfOptions = {
parentContext: 'accordion' | 'info';
Expand Down Expand Up @@ -295,10 +296,19 @@ export default class IQRNode extends CAVPlotNode {
outlierDisplay.setChildren( outlierDisplayChildren );
};

sceneModel.objectChangedEmitter.addListener( updateIQRNode );
sceneModel.maxValueProperty.link( updateIQRNode );
sceneModel.minValueProperty.link( updateIQRNode );

Multilink.multilink( [ sceneModel.q1ValueProperty, sceneModel.q3ValueProperty ], ( q1Value, q3Value ) => {
if ( ( q1Value !== null && q3Value !== null ) || ( q1Value === null && q3Value === null ) ) {
updateIQRNode();
}
} );

sceneModel.medianValueProperty.link( updateIQRNode );
sceneModel.numberOfDataPointsProperty.link( updateIQRNode );
model.isIQRVisibleProperty.link( updateIQRNode );
model.selectedVariabilityMeasureProperty.link( updateIQRNode );
sceneModel.numberOfDataPointsProperty.link( updateIQRNode );
SHOW_OUTLIERS_PROPERTY.link( updateIQRNode );
}
}
Expand Down

0 comments on commit 3f7b831

Please sign in to comment.