Skip to content

Commit

Permalink
udpate doc/refactor screen summary node and PositionDescriber and sub…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jun 11, 2019
1 parent 8a99f01 commit 081bc5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion js/view/describers/ForceDescriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ define( require => {
} );
}

const region = this.positionDescriber.qualitativeDistance;
const region = this.positionDescriber.getQualitativeDistanceRegion();
return StringUtils.fillIn( regionForceClausePatternString, { region: region, forceClause: forceClause } );
}
}
Expand Down
18 changes: 8 additions & 10 deletions js/view/describers/PositionDescriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ define( require => {
units: unitsMetersString,
centerOffset: 0, // {number} the point considered the "center" of the track space

// {number} => {number}
convertDistanceMetric: distance => distance
// {function(number):number} - convert to display distance for PDOM descriptions
convertDistanceMetric: _.identity
}, options );

// @public
this.unit = options.unit;

// @private
this.units = options.units;
this.units = options.units; // {string}
this.centerOffset = options.centerOffset;
this.convertDistanceMetric = options.convertDistanceMetric;

Expand All @@ -143,7 +143,7 @@ define( require => {
// see https://github.com/phetsims/gravity-force-lab-basics/issues/88
this.useQuantitativeDistance = true;

// {StringProperty[]} - keep track of each Property created in the "aria-valuetext creator" creator function so
// {Property.<string>[]} - keep track of each Property created in the "aria-valuetext creator" creator function so
// that they can be reset
this._previousPositionRegionProperties = [];

Expand Down Expand Up @@ -189,19 +189,18 @@ define( require => {
*/
getObjectDistanceSummary() {
const distance = this.convertedDistance;
const { object1Label, object2Label, units } = this;

const qualitativeDistanceClause = StringUtils.fillIn(
distanceAndValueSummaryPatternString,
{
object1Label: object1Label,
object2Label: object2Label,
object1Label: this.object1Label,
object2Label: this.object2Label,
qualitativeDistanceFromEachOther: this.getQualitativeDistanceFromEachOther()
}
);
const quantitativeDistanceClause = StringUtils.fillIn(
centersExactlyPatternString,
{ distance: distance, units: units }
{ distance: distance, units: this.units }
);

let summary = StringUtils.fillIn( quantitativeAndQualitativePatternString, {
Expand Down Expand Up @@ -491,11 +490,10 @@ define( require => {
}

/**
* TODO: rename to `qualitativeDistanceString`
* Returns the qualitative distance (e.g. 'close')
* @returns {string}
*/
get qualitativeDistance() {
getQualitativeDistanceRegion() {
return DISTANCE_STRINGS[ this.getDistanceIndex( this.distanceBetween ) ];
}

Expand Down

0 comments on commit 081bc5e

Please sign in to comment.