Skip to content

Commit

Permalink
Remove NumberDisplay parts of SolarSystemCommonTextNumberDisplay, see p…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 16, 2023
1 parent 4265d91 commit f294003
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions js/view/SolarSystemCommonTextNumberDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,12 @@
*/

import TReadOnlyProperty from '../../../axon/js/TReadOnlyProperty.js';
import { EmptySelfOptions, optionize3 } from '../../../phet-core/js/optionize.js';
import Range from '../../../dot/js/Range.js';
import NumberDisplay, { NumberDisplayOptions } from '../../../scenery-phet/js/NumberDisplay.js';
import SolarSystemCommonConstants from '../SolarSystemCommonConstants.js';
import DerivedProperty from '../../../axon/js/DerivedProperty.js';
import SolarSystemCommonStrings from '../../../solar-system-common/js/SolarSystemCommonStrings.js';
import StringUtils from '../../../phetcommon/js/util/StringUtils.js';
import solarSystemCommon from '../solarSystemCommon.js';

export default class SolarSystemCommonTextNumberDisplay extends NumberDisplay {
//REVIEW: Ummm... I don't see this constructor ever getting used. Can we remove it, and not extend NumberDisplay?
//REVIEW: Perhaps we can just move combinePowerString to somewhere else common, and remove this file?
public constructor( numberProperty: TReadOnlyProperty<number | null>, displayRange: Range, providedOptions?: NumberDisplayOptions ) {
super(
numberProperty,
displayRange,
optionize3<NumberDisplayOptions, EmptySelfOptions, NumberDisplayOptions>()( {}, {
backgroundFill: null,
backgroundStroke: null,
textOptions: SolarSystemCommonConstants.TEXT_OPTIONS,
decimalPlaces: 1,
useRichText: true,

//REVIEW: layoutOptions like this should be provided at the client usage. It's not great to hardcode client uses
//REVIEW: in the type itself. Let's move this to the client!
layoutOptions: {
align: 'left'
}
}, providedOptions )
);
}

export default class SolarSystemCommonTextNumberDisplay {
public static combinePowerString( unitStringProperty: TReadOnlyProperty<string>, powerStringProperty: TReadOnlyProperty<number> ): TReadOnlyProperty<string> {
return new DerivedProperty( [ unitStringProperty, powerStringProperty, SolarSystemCommonStrings.pattern.unitsPowerStringProperty ], ( string, power, pattern ) => {
if ( power === 1 ) {
Expand Down

0 comments on commit f294003

Please sign in to comment.