Skip to content

Commit

Permalink
Remove zoom buttons from SeismographNode, see phetsims/scenery-phet#652
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 18, 2021
1 parent e222a36 commit ef95d4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
36 changes: 1 addition & 35 deletions js/SeismographNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import Range from '../../dot/js/Range.js';
import deprecationWarning from '../../phet-core/js/deprecationWarning.js';
import merge from '../../phet-core/js/merge.js';
import ModelViewTransform2 from '../../phetcommon/js/view/ModelViewTransform2.js';
import ZoomButton from '../../scenery-phet/js/buttons/ZoomButton.js';
import Tandem from '../../tandem/js/Tandem.js';
import griddle from './griddle.js';
import XYChartNode from './XYChartNode.js';
Expand Down Expand Up @@ -89,7 +88,7 @@ class SeismographNode extends XYChartNode {
}, options );

assert && assert( options.modelViewTransformProperty === undefined, 'SeismographNode sets ModelViewTransform' );

assert && assert(options.verticalRanges.length===1,'SeismographNode is deprecated and no longer supports multiple vertical ranges, please use bamboo');
assert && assert( options.gridNodeOptions.modelViewTransformProperty === undefined, 'SeismographNode sets transform for GridNode' );
options.gridNodeOptions.modelViewTransformProperty = gridTransformProperty;

Expand Down Expand Up @@ -143,39 +142,6 @@ class SeismographNode extends XYChartNode {
}
} );

if ( options.verticalRanges.length > 1 ) {
const zoomButtonOptions = {
left: this.chartPanel.right + 5,
baseColor: '#97c7fa',
magnifyingGlassOptions: {
glassRadius: 6
},
xMargin: 5,
yMargin: 3
};

const zoomInButton = new ZoomButton( merge( {
in: true,
top: this.chartPanel.top,
listener: () => zoomLevelIndexProperty.value--,
tandem: options.tandem.createTandem( 'zoomInButton' )
}, zoomButtonOptions ) );
this.addChild( zoomInButton );

const zoomOutButton = new ZoomButton( merge( {
in: false,
top: zoomInButton.bottom + 5,
listener: () => zoomLevelIndexProperty.value++,
tandem: options.tandem.createTandem( 'zoomOutButton' )
}, zoomButtonOptions ) );
this.addChild( zoomOutButton );

zoomLevelIndexProperty.link( zoomLevelIndex => {
zoomOutButton.enabled = zoomLevelIndex < options.verticalRanges.length - 1;
zoomInButton.enabled = zoomLevelIndex > 0;
} );
}

const viewSpanWidth = gridTransformProperty.get().modelToViewDeltaX( this.majorVerticalLineSpacing );
const spanNode = new SpanNode( spanLabelNode, viewSpanWidth, {
left: this.chartPanel.left,
Expand Down
2 changes: 1 addition & 1 deletion js/demo/GriddleDemoScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ const demoSeismographNode = layoutBounds => {
fill: 'white'
} ),
horizontalAxisLabelNode: new Text( 'time (s)', { fill: 'white' } ),
verticalRanges: [ new Range( -1, 1 ), new Range( -2, 2 ), new Range( -3, 3 ) ]
verticalRanges: [ new Range( -1, 1 ) ]
} );
const panel = new Panel( seismographNode, {
fill: 'gray',
Expand Down

0 comments on commit ef95d4f

Please sign in to comment.