Skip to content

Commit

Permalink
Rename iqr colors, see #170
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed May 13, 2023
1 parent 22f0d6f commit a7e9969
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions js/common/CAVColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const CAVColors = {

medianColorProperty: new ProfileColorProperty( centerAndVariability, 'medianColor', { default: '#f03000' } ),
meanColorProperty: new ProfileColorProperty( centerAndVariability, 'meanColor', { default: '#8500bd' } ),
iqrColorProperty: new ProfileColorProperty( centerAndVariability, 'iqrColor', { default: 'black' } ),
iqrLabelColorProperty: new ProfileColorProperty( centerAndVariability, 'iqrLabelColor', { default: 'black' } ),
madColorProperty: new ProfileColorProperty( centerAndVariability, 'madColor', { default: 'black' } ),
quartileColorProperty: new ProfileColorProperty( centerAndVariability, 'quartileColor', { default: new Color( '#99ffff' ).withAlpha( 0.55 ) } ),
iqrColorProperty: new ProfileColorProperty( centerAndVariability, 'iqrColor', { default: new Color( '#99ffff' ).withAlpha( 0.55 ) } ),
arrowStrokeProperty: new ProfileColorProperty( centerAndVariability, 'arrowStroke', { default: 'black' } ),
boxWhiskerStrokeColorProperty: new ProfileColorProperty( centerAndVariability, 'boxWhiskerStrokeColor', { default: 'black' } ),
madRectangleColorProperty: new ProfileColorProperty( centerAndVariability, 'madRectangleColorProperty', { default: new Color( '#cba3e6' ).withAlpha( 0.7 ) } ),
Expand Down
2 changes: 1 addition & 1 deletion js/variability/view/IQRInfoNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class IQRInfoNode extends VBox {
}

if ( isQuartile ) {
const backgroundCircle = new Circle( 12, { fill: CAVColors.quartileColorProperty } );
const backgroundCircle = new Circle( 12, { fill: CAVColors.iqrColorProperty } );
dataValueNode.addChild( backgroundCircle );
}

Expand Down
12 changes: 6 additions & 6 deletions js/variability/view/IQRNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class IQRNode extends CAVPlotNode {
} );

const iqrRectangle = new Rectangle( 0, 0, 0, 0, {
fill: CAVColors.quartileColorProperty
fill: CAVColors.iqrColorProperty
} );

const boxWhiskerLabelArrow = ( fillColor: ProfileColorProperty ) => {
Expand All @@ -68,7 +68,7 @@ export default class IQRNode extends CAVPlotNode {
centerY: 0
} ) ];
if ( isQuartile ) {
textNodeChildren.unshift( new Circle( 12, { fill: CAVColors.quartileColorProperty } ) );
textNodeChildren.unshift( new Circle( 12, { fill: CAVColors.iqrColorProperty } ) );
}
return new Node( { children: textNodeChildren, centerY: isQuartile ? -14 : -10 } );
};
Expand Down Expand Up @@ -121,10 +121,10 @@ export default class IQRNode extends CAVPlotNode {
const medianTextNode = boxWhiskerLabelText( CAVColors.medianColorProperty, CenterAndVariabilityStrings.medianStringProperty, false );
const medianLabelNode = new Node( { children: [ medianArrowNode, medianTextNode ], y: -32 } );

const minLabelNode = boxWhiskerLabel( CAVColors.iqrColorProperty, CenterAndVariabilityStrings.minStringProperty, false );
const maxLabelNode = boxWhiskerLabel( CAVColors.iqrColorProperty, CenterAndVariabilityStrings.maxStringProperty, false );
const q1LabelNode = boxWhiskerLabel( CAVColors.iqrColorProperty, CenterAndVariabilityStrings.q1StringProperty, true );
const q3LabelNode = boxWhiskerLabel( CAVColors.iqrColorProperty, CenterAndVariabilityStrings.q3StringProperty, true );
const minLabelNode = boxWhiskerLabel( CAVColors.iqrLabelColorProperty, CenterAndVariabilityStrings.minStringProperty, false );
const maxLabelNode = boxWhiskerLabel( CAVColors.iqrLabelColorProperty, CenterAndVariabilityStrings.maxStringProperty, false );
const q1LabelNode = boxWhiskerLabel( CAVColors.iqrLabelColorProperty, CenterAndVariabilityStrings.q1StringProperty, true );
const q3LabelNode = boxWhiskerLabel( CAVColors.iqrLabelColorProperty, CenterAndVariabilityStrings.q3StringProperty, true );

minLabelNode.y = maxLabelNode.y = -28;
q1LabelNode.y = q3LabelNode.y = -33;
Expand Down
5 changes: 2 additions & 3 deletions js/variability/view/VariabilityAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ export default class VariabilityAccordionBox extends CAVAccordionBox {
value: VariabilityMeasure.RANGE
}, {

// TODO: https://github.com/phetsims/center-and-variability/issues/170 rename color for this to match others
createNode: tandem => new VariabilityMeasureCheckbox( model.isIQRVisibleProperty, CenterAndVariabilityStrings.iqrStringProperty, iconGroup, CAVColors.quartileColorProperty, { tandem: tandem } ),
createNode: tandem => new VariabilityMeasureCheckbox( model.isIQRVisibleProperty, CenterAndVariabilityStrings.iqrStringProperty, iconGroup, CAVColors.iqrColorProperty, { tandem: tandem } ),
tandemName: 'iqrAccordionCheckbox',
value: VariabilityMeasure.IQR
}, {
Expand Down Expand Up @@ -161,7 +160,7 @@ export default class VariabilityAccordionBox extends CAVAccordionBox {
// tandem: options.tandem.createTandem( 'medianReadoutText' )
} );
const iqrReadoutText = new VariabilityReadoutText( iqrReadoutValueProperty, CenterAndVariabilityStrings.iqrEqualsValuePatternStringProperty, {
fill: CAVColors.iqrColorProperty,
fill: CAVColors.iqrLabelColorProperty,
visibleProperty: model.isIQRVisibleProperty
// tandem: options.tandem.createTandem( 'iqrReadoutText' )
} );
Expand Down

0 comments on commit a7e9969

Please sign in to comment.