Skip to content

Commit

Permalink
remove label for top tick mark in many-photons mode, see #52
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Nov 19, 2024
1 parent d0b92a2 commit 68c8a39
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
36 changes: 24 additions & 12 deletions js/common/view/QuantumMeasurementHistogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,26 +181,38 @@ export default class QuantumMeasurementHistogram extends Node {
valuePattern: QuantumMeasurementStrings.eventsPerSecondPatternStringProperty,
rotation: textRotation
};
leftNumberDisplay = new NumberDisplay( leftNumberProperty, NUMBER_DISPLAY_RANGE, combineOptions<NumberDisplayOptions>(
rateDisplayOptions, options.numberDisplayOptions, {
leftNumberDisplay = new NumberDisplay(
leftNumberProperty,
NUMBER_DISPLAY_RANGE,
combineOptions<NumberDisplayOptions>( rateDisplayOptions, options.numberDisplayOptions, {
textOptions: { fill: options.matchLabelColors ? options.leftFillColorProperty : 'black' }
} ) );
rightNumberDisplay = new NumberDisplay( rightNumberProperty, NUMBER_DISPLAY_RANGE, combineOptions<NumberDisplayOptions>(
rateDisplayOptions, options.numberDisplayOptions, {
} )
);
rightNumberDisplay = new NumberDisplay(
rightNumberProperty,
NUMBER_DISPLAY_RANGE,
combineOptions<NumberDisplayOptions>( rateDisplayOptions, options.numberDisplayOptions, {
textOptions: { fill: options.matchLabelColors ? options.rightFillColorProperty : 'black' }
} ) );
} )
);
}
else {
leftNumberDisplay = new NumberDisplay( leftNumberProperty, NUMBER_DISPLAY_RANGE, combineOptions<NumberDisplayOptions>(
{}, options.numberDisplayOptions, {
leftNumberDisplay = new NumberDisplay(
leftNumberProperty,
NUMBER_DISPLAY_RANGE,
combineOptions<NumberDisplayOptions>( {}, options.numberDisplayOptions, {
rotation: textRotation,
textOptions: { fill: options.matchLabelColors ? options.leftFillColorProperty : 'black' }
} ) );
rightNumberDisplay = new NumberDisplay( rightNumberProperty, NUMBER_DISPLAY_RANGE, combineOptions<NumberDisplayOptions>(
{}, options.numberDisplayOptions, {
} )
);
rightNumberDisplay = new NumberDisplay(
rightNumberProperty,
NUMBER_DISPLAY_RANGE,
combineOptions<NumberDisplayOptions>( {}, options.numberDisplayOptions, {
rotation: textRotation,
textOptions: { fill: options.matchLabelColors ? options.rightFillColorProperty : 'black' }
} ) );
} )
);
}

// Create the histogram bars for the right and left sides.
Expand Down
14 changes: 1 addition & 13 deletions js/photons/view/PhotonsExperimentSceneView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
import BooleanProperty from '../../../../axon/js/BooleanProperty.js';
import DerivedProperty from '../../../../axon/js/DerivedProperty.js';
import StringProperty from '../../../../axon/js/StringProperty.js';
import Utils from '../../../../dot/js/Utils.js';
import Vector2 from '../../../../dot/js/Vector2.js';
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import WithRequired from '../../../../phet-core/js/types/WithRequired.js';
import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import PlayPauseButton from '../../../../scenery-phet/js/buttons/PlayPauseButton.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import { HBox, Node, NodeOptions, RichText, Text, VBox } from '../../../../scenery/js/imports.js';
Expand Down Expand Up @@ -114,17 +112,7 @@ export default class PhotonsExperimentSceneView extends Node {

const histogramTickMarkLabelProperty = model.laser.emissionMode === 'singlePhoton' ?
new StringProperty( '1.0' ) :
new DerivedProperty(
[
QuantumMeasurementStrings.eventsPerSecondPatternStringProperty,
verticalValueProperty,
horizontalValueProperty
],
( eventsPerSecondPatternString, verticalValue, horizontalValue ) => {
const displayValue = Utils.roundSymmetric( verticalValue + horizontalValue );
return StringUtils.fillIn( eventsPerSecondPatternString, { value: displayValue } );
}
);
new StringProperty( '' );

// Create the histogram that shows the detection counts for the vertical and horizontal detectors.
const countHistogram = new QuantumMeasurementHistogram(
Expand Down

0 comments on commit 68c8a39

Please sign in to comment.