Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
Add support for variable reachability threshold to single-point UI, see
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwigway committed Oct 15, 2015
1 parent 616af1a commit 81c71fc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/main/resources/messages/messages.en
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ analysis.show-settings=Show Settings
analysis.n-minutes={0} minutes
analysis.travel-time-range=Travel Time Range: {0}–{1} minutes

analysis.reachability-threshold=Minimum reachability: {0}%
analysis.reachability-threshold-tooltip=The minumum percentage of the time window that this destination must be accessible for for it to be considered in the average. For instance, if there is an express bus that affords access to a location for only the first half of the time window, that bus would be considered only if the threshold is less than 50%.

ledger.starting=Starting balance
ledger.ending=Ending balance
ledger.total=Total activity
Expand Down
17 changes: 15 additions & 2 deletions src/main/resources/public/javascripts/analysis-single.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@ var Analyst = Analyst || {};
_this.updateResults();
}).data('slider');

this.reachabilityThresholdSlider = this.$('#reachabilityThresholdSlider').slider({
formater: function(value) {
var pct = Math.round(value * 100);
_this.$('#reachabilityThresholdValue').html(window.Messages("analysis.reachability-threshold", pct));
return pct + '%';
}
}).on('slideStop', function(value) {

_this.updateResults();
}).data('slider');

this.mode = 'TRANSIT,WALK';

this.shapefiles.fetch({reset: true, data : {projectId: A.app.selectedProject}})
Expand Down Expand Up @@ -306,8 +317,9 @@ var Analyst = Analyst || {};

var bikeSpeed = (this.bikeSpeedSlider.getValue() * 1000 / 60 / 60 );
var walkSpeed = (this.walkSpeedSlider.getValue() * 1000 / 60 / 60 );
var walkTime = this.walkTimeSlider.getValue();
var bikeTime = this.bikeTimeSlider.getValue();
var walkTime = this.walkTimeSlider.getValue();
var bikeTime = this.bikeTimeSlider.getValue();
var reachabilityThreshold = this.reachabilityThresholdSlider.getValue();

this.scenario1 = this.scenarios.get(this.$('#scenario1').val());
this.scenario2 = this.scenarios.get(this.$('#scenario2').val());
Expand Down Expand Up @@ -387,6 +399,7 @@ var Analyst = Analyst || {};
minBikeTime: 10,
minCarTime: 10,
suboptimalMinutes: 5,
reachabilityThreshold: reachabilityThreshold,
analyst: true,
bikeSafe: 1,
bikeSlope: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ <h5 class="panel-title">
<label><span class="notes" id="bikeTimeValue"></span></label>
<input id="bikeTimeSlider" data-slider-id="bikeTimeSlider" style="width: 250px;" type="text" data-slider-min="1" data-slider-max="60" data-slider-step="1" data-slider-value="20"/>
</div>

<div class="form-group">
<!--
the reachability threshold, see extensive javadoc on the parameter in ProfileRequest.
This is more of an advanced parameter, in the new UI we should probably have some sort of "advanced settings" pane where
settings like this are hidden.
The default here is zero, which is not really a recommended value but was the hard-wired value until Analyst Server 0.7.26
-->
<label><span class="notes" id="reachabilityThresholdValue"></span></label>
<input id="reachabilityThresholdSlider" data-slider-id="reachabilityThresholdSlider" style="width: 250px;" type="text" data-slider-min="0" data-slider-max="1" data-slider-step="0.01" data-slider-value="0"/>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 81c71fc

Please sign in to comment.