Have you ever created a segment with a short climb that just wasn’t quite long enough to be classified as a categorized climb in Strava? You make a good time on the climb of the segment but VAM is not calculated…
|A good effort, but no VAM to reward!|
Well, here’s a little bookmarklet that adds VAM to each segment in your ride. If it’s a downhill or flat segment, then the number won’t make much sense, but it is great for those short hard climbs. This bookmarklet only changes the page, not the backend data, so if you reload, the tweaked VAM numbers will be gone.
|After clicking the bookmarklet, note the updated VAM column!|
Note also that the numbers calculated are based on the displayed elevation, distance and time values, which have been rounded, so VAM may not always come out quite the same as Strava’s more accurate calculations.
To use this bookmarklet:
- Right click on the following link and add it to favorites or bookmarks.
- When on a Strava ride page, click the bookmarklet.
Here’s the original, formatted code behind the link.
var t = document.getElementsByTagName(‘tr’);
for(var i = 0; i < t.length; i++)
var tr = t[i];
if(tr.className == ‘segment’)
var td_dist = tr.cells,
td_elev = tr.cells,
td_vam = tr.cells,
td_time = tr.cells;
var tm = td_time.innerHTML.split(‘:’),
seconds = (parseInt(tm,10) * 60 + parseInt(tm,10)) * 60 + parseInt(tm,10),
elev = parseInt(td_elev.innerHTML),
dist = parseFloat(td_dist.innerHTML);
var VAM = Math.round(elev * 3600 / seconds);
var gradient = (elev / dist / 10).toFixed(1);
var s = VAM.toString() + ‘ (‘ + gradient + ‘%)’;
if(td_vam.innerHTML == ‘-‘ || td_vam.innerHTML.length > 4) td_vam.innerHTML = s;
else td_vam.innerHTML += ‘ ‘ + s;