From ef95d4ffab7f3a2f9764513e07a30f6b4b20554d Mon Sep 17 00:00:00 2001 From: samreid Date: Thu, 18 Feb 2021 09:35:07 -0700 Subject: [PATCH] Remove zoom buttons from SeismographNode, see https://github.com/phetsims/scenery-phet/issues/652 --- js/SeismographNode.js | 36 +------------------------------- js/demo/GriddleDemoScreenView.js | 2 +- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/js/SeismographNode.js b/js/SeismographNode.js index 7f90765..eea77fc 100644 --- a/js/SeismographNode.js +++ b/js/SeismographNode.js @@ -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'; @@ -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; @@ -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, diff --git a/js/demo/GriddleDemoScreenView.js b/js/demo/GriddleDemoScreenView.js index 4b94634..3003f1f 100644 --- a/js/demo/GriddleDemoScreenView.js +++ b/js/demo/GriddleDemoScreenView.js @@ -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',