MSW Rating

The MSW rating is calculated for you by our own algorithm. There are two components that make up the rating fadedRating and solidRating.

  • solidRating This is the solid stars for the rating, which signifies swell quality/power.
  • fadedRating This signifies the number of stars you should show for the portion of the overall rating that has been effected by the wind.
  • The two components together make up the overall rating. A solid 5 star rating (with zero faded dtars) is the best possible. A rating of 2 solid stars and 2 faded stars means the there is significant swell (4 stars worth) but a medium onshore wind reducing the wave quality. The solid stars must always be rendered first followed by the faded stars.

From a technical point of view you just need to render the solidRating first and then the fadedRating as the below JavaScript example shows.

var rating = [];

// Loop the solid rating on a single forecast object.
for (var i = 0; i < forecast.solidRating; i++) {
rating.push('');
}

// Loop the faded rating on a single forecast object.
for (var i = 0; i < forecast.fadedRating; i++) {
rating.push('');
}

document.getElementById("ratingContainer").innerHTML = rating.join(" ");