Skip to content

Commit

Permalink
remove custom code for #37, alternative already in place
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed May 23, 2019
1 parent ec125f7 commit a619427
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions js/BarChartNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ define( function( require ) {
var PhetFont = require( 'SCENERY_PHET/PhetFont' );
var RichText = require( 'SCENERY/nodes/RichText' );
var VBox = require( 'SCENERY/nodes/VBox' );
var Vector2 = require( 'DOT/Vector2' );

/**
* @constructor
Expand Down Expand Up @@ -186,31 +185,6 @@ define( function( require ) {
for ( var i = 0; i < this.barNodes.length; i++ ) {
this.barNodes[ i ].update();
}
},

/**
* Get the location of a label in the bar chart. Useful for layout for other components relative to
* labels. Returns a Vector2 in the local coordinate frame from bounds of the label Node. Position Vector2
* from bounds specified by location parameter, which can be one of the layout getters like "centerTop",
* "rightBottom", etc. See Node.js.
*
* @param {number} barIndex - index of the bar whose label you want for the location information
* @param {string} location - A Node layout getter that returns Vector2 like centerBottom, leftTop, etc...
*
* @returns {Vector2}
*/
getBarLabelLocation( barIndex, location ) {
assert && assert( typeof barIndex === 'number' );
assert && assert( typeof location === 'string' );
assert && assert( barIndex > -1, 'No bar at barIndex' );
assert && assert( barIndex < this.barLabelNodes.length, 'No bar label at barIndex' );

// use index to get the label
const labelNode = this.barLabelNodes[ barIndex ];
const locationVector = labelNode[ location ];

assert && assert( locationVector instanceof Vector2, location + ' getter did not produce a location Vector2 from Node' );
return locationVector;
}
} );
} );

0 comments on commit a619427

Please sign in to comment.