Closed samreid closed 5 years ago
After changes in #394, I added this code
model.onProperty.linkAttribute( incidentBeam, 'visible' );
model.onProperty.linkAttribute( transmittedBeam, 'visible' );
const wavelengthToColor = VisibleColor.wavelengthToColor;
const wavelengthPanel = new WaveInterferencePanel(
new NumberControl( wavelengthString, model.wavelengthProperty, new Range( 380, 780 ), {
titleNodeOptions: {
font: WaveInterferenceConstants.DEFAULT_FONT
},
numberDisplayOptions: {
font: new PhetFont( 14 ),
valuePattern: '{0} nm'
},
sliderOptions: {
trackNode: new SpectrumTrack( model.wavelengthProperty, {
minValue: 380,
maxValue: 780,
valueToColor: wavelengthToColor,
size: new Dimension2( 160, 20 )
} ),
thumbNode: new SpectrumThumb( model.wavelengthProperty, {
valueToColor: wavelengthToColor,
width: 25,
height: 25,
cursorHeight: 20
} )
},
layoutFunction: NumberControl.createLayoutFunction3( {
// alignTitle: 'left'
} )
} ), _.extend( PANEL_OPTIONS, {
left: laserPointerNode.left,
top: apertureScaleIndicatorNode.top,
xMargin: 6
} ) );
and now it looks like this:
I am hesitant to commit this until the API is finalized in scenery-phet, but I wanted to check that the pixel polishing is as-desired (from the screenshot). @arouinfar can you please comment?
@samreid the layout is looking great! I would suggest that the tweakers are made a bit smaller so their height matches the height of the wavelength readout.
I finished the prescribed updates, @arouinfar can you please review on phettest/master?
Look great! Thanks @samreid.
https://github.com/phetsims/wave-interference/issues/377 said:
Wavelength panel
However, some of this work is blocked by #394, so I've split it into this new issue.