").css("opacity",".5").text(a))},getPlain:function(e){return e[r]}}}};function show_mvp_data(e){var a={};e.forEach(function(e){a.hasOwnProperty(e.UID)||(a[e.UID]={Name:e.Name,FN:e.FN,LN:e.LN,UID:e.UID,Team:e.Team,TeamUID:e.TeamUID,"1st":UTIL.list.any([1997,2001,2002,2003,2004,2005,2006,2007,2008,2010,2011,2012,2013],e.Season)?"N/A":0,"2nd":2016<=e.Season?0:"N/A","3rd":2016<=e.Season?0:"N/A","4th":2016<=e.Season?0:"N/A","5th":2016<=e.Season?0:"N/A",Value:0}),a[e.UID][{"1st":"1st","2nd":"2nd","3rd":"3rd","4th":"4th","5th":"5th",Points:"Value"}[e.Type]]=e.Value});var r=[];Object.keys(a).forEach(function(e){r.push(a[e])});var t=TABULIZE.COL.Number.MAKE("Points","Value"),e=[TABULIZE.COL.Index.MAKE(),PLAYERNAMECOL.MAKE("Player","Name","FN","LN","UID",!1),TEAMNAMECOL.MAKE("Team","Team","TeamUID",!1),MAYBE_NA_INT.MAKE("1st","1st"),MAYBE_NA_INT.MAKE("2nd","2nd"),MAYBE_NA_INT.MAKE("3rd","3rd"),MAYBE_NA_INT.MAKE("4th","4th"),MAYBE_NA_INT.MAKE("5th","5th"),t,{type:TABULIZE.COL.Custom,head:"",fill:function(e,a){$("
").css({display:"inline-block","background-color":UTIL.colors.search_team(a.Team),color:UTIL.colors.search_team(a.Team),width:.5*a.Value+"px"}).html(" ").appendTo(e)},getPlain:function(e){return""}}],t=[{column:t,comparer:TABULIZE.COL.getComparer(t),direction:"down"}];TABULIZE.populate($("#av-wrapper > table"),{columns:e,sorters:t},r)}function show_all_team_data(e){var a={};e.forEach(function(e){a.hasOwnProperty(e.UID)||(a[e.UID]={Name:e.Name,FN:e.FN,LN:e.LN,UID:e.UID,Team:e.Team,TeamUID:e.TeamUID,Extra:e.Extra,"1st":0,"2nd":0,Value:0}),a[e.UID][{"1st":"1st","2nd":"2nd",Points:"Value"}[e.Type]]=e.Value});var r=[];Object.keys(a).forEach(function(e){0===a[e]["1st"]&&0===a[e]["2nd"]&&(a[e]["1st"]=a[e]["2nd"]="N/A"),r.push(a[e])});var t=TABULIZE.COL.Integer.MAKE("Points","Value"),e=[TABULIZE.COL.Index.MAKE(),TABULIZE.COL.String.MAKE("Position","Extra",!1),PLAYERNAMECOL.MAKE("Player","Name","FN","LN","UID",!1),TEAMNAMECOL.MAKE("Team","Team","TeamUID",!1),MAYBE_NA_INT.MAKE("1st","1st"),MAYBE_NA_INT.MAKE("2nd","2nd"),t],t=[{column:t,comparer:TABULIZE.COL.getComparer(t),direction:"down"}];$("#av-wrapper > p").text("Positional requirements may result in top-five vote getters not making First Team. After 2005, vote totals are only available for players who made one of the two available teams.").show(),TABULIZE.populate($("#av-wrapper > table"),{columns:e,sorters:t},r)}function show_other_data(e,a){var r=TABULIZE.COL.Integer.MAKE("Votes","Value"),t=[TABULIZE.COL.Index.MAKE(),{Player:PLAYERNAMECOL.MAKE("Player","Name","FN","LN","UID",!1),Coach:COACHNAMECOL.MAKE("Coach","Name"),Executive:null}[e[0].IndType],TEAMNAMECOL.MAKE("Team","Team","TeamUID",!1),r];"All-Rookie Team"!==a?t=t.concat([TABULIZE.COL.Percentage.MAKE("Share","Share",2,!0),{type:TABULIZE.COL.Custom,head:"",fill:function(e,a){$("").css({display:"inline-block","background-color":UTIL.colors.search_team(a.Team),color:UTIL.colors.search_team(a.Team),width:200*a.Share+"px"}).html(" ").appendTo(e)},getPlain:function(e){return""}}]):$("#additional > p").text("After 2005, vote totals for All-Rookie Team were only publicized for players who made the team.").show(),r=[{column:r,comparer:TABULIZE.COL.getComparer(r),direction:"down"}],TABULIZE.populate($("#av-wrapper > table"),{columns:t,sorters:r},e)}function show_message(e,a){var r,t={"Rookie of the Year":{years:[1997],message:"Rookie of the Year was not awarded until 1998."},"Most Improved Player":{years:[1997,1998,1999],message:"Most Improved Player was not awarded until 2000."},"Sixth Player of the Year":{years:[1997,1998,1999,2e3,2001,2002,2003,2004,2005,2006],message:"Sixth Player of the Year was not awarded until 2007."},"Newcomer of the Year":{years:[1997].concat(UTIL.create_range_list(2e3,UTIL.date.get_year(UTIL.date.TODAY)+1)),message:"Newcomer of the Year was only awarded in 1998 and 1999."},"Kim Perrot Sportsmanship Award":{years:[1997,2005],message:"Vote totals are not currently available for the Sportsmanship Award in 1997 or 2005."},MVP:{2008:"MVP voting included a fan voting (25%) component in 2008, accounting for the final decimal values. Only the top 25 vote-getters were reported.",2014:"Only the top 5 MVP vote-getters were reported in 2014."},"All-Rookie Team":{2021:"All-Rookie Team vote totals were not publicized in 2021.",years:[1997,1998,1999,2e3,2001,2002,2003,2004],message:"The All-Rookie Team was not awarded until 2005."},"All-Defensive Team":{2021:"All-Defensive Team vote totals were not publicized in 2021.",years:[1997,1998,1999,2e3,2001,2002,2003,2004],message:"The All-Defensive Teams were not awarded until 2005."},"All-WNBA Team":{2015:"The WNBA release lists Tina Charles as earning 167 points and 24 First Team votes, which is not mathematically possible, so only her points total is listed here.",2014:"The WNBA release lists Maya Moore as earning 180 points and 38 First Team votes, which is not mathematically possible, so her point total reflects being a unanimous First Team selection."}};t.hasOwnProperty(a)&&(r=null,t[a].hasOwnProperty("years")&&UTIL.list.any(t[a].years,e)?r=t[a].message:t[a].hasOwnProperty(e)&&(r=t[a][e]),r&&$("#av-wrapper > p").text(r).show())}function makeColumnSorter(e,a){return{column:e,comparer:TABULIZE.COL.getComparer(e),direction:a}}function MAKE_BOOL_COL(e,r){return{type:TABULIZE.COL.Custom,head:e,fill:function(e,a){e.html(a[r]?"✓":"-")},comparer:function(e,a){return(e[r]?1:0)-(a[r]?1:0)},getPlain:function(e){return e[r]?"Yes":"No"}}}var records={closest:{label:"Closest vote",supports:["All-Defensive Team","All-WNBA Team","All-Rookie Team","Coach of the Year","Defensive Player of the Year","MVP","Most Improved Player","Newcomer of the Year","Rookie of the Year","Sixth Player of the Year"],make:function(t){var e=new UTIL.Set(t.map(function(e){return e.Season})).map(function(a){var r=t.filter(function(e){return e.Season===a}).sorted(function(e,a){return a.Value-e.Value}),e={Season:a,First:r[0],Second:1").prop("href",UTIL.wnba.players.get_player_url(e.UID)).prop("title","View the player page for "+e.Name).prop("target","_blank").text(e.Name).appendTo($("").appendTo(a))}):a.text("N/A")},getPlain:function(e){return e.Second?e.Second.reduce(function(e,a){return 0").prop("href",UTIL.wnba.coaches.get_coach_url(e.Name)).prop("title","View the coach page for "+e.Name).prop("target","_blank").text(e.Name).appendTo($("").appendTo(a))}):a.text("N/A")},getPlain:function(e){return e.Second?e.Second.reduce(function(e,a){return 0").css({display:"inline-block","background-color":UTIL.colors.search_team(a.Team),color:UTIL.colors.search_team(a.Team),width:200*a.Share+"px"}).html(" ").appendTo(e)},getPlain:function(e){return""}}],a="MVP"===a?"Share = Total / 10 × # Media Votes
The WNBA released limited MVP voting data in 2008 and 2014.":null;return{data:e.filter(function(e){return"MVP"!==e.Award||"Points"===e.Type}),columns:n,sorters:[makeColumnSorter(t,"down"),makeColumnSorter(r,"down"),makeColumnSorter(o,"up")],message:a}}},large_all_share:{label:"All-time share",supports:["Coach of the Year","Defensive Player of the Year","Most Improved Player","Sixth Player of the Year","MVP"],make:function(e,a){var r=[],t={};e.forEach(function(e){var a;t.hasOwnProperty(e.UID)||(t[e.UID]={Seasons:[],Name:e.Name,FN:e.FN,LN:e.LN,UID:e.UID,NSeasons:e.NSeasons,NSeasonsMIP:e.NSeasonsMIP,NSeasons6POTY:e.NSeasons6POTY,Value:0,Share:0,NSeasonsRV:0,NWins:0},r.push(t[e.UID])),"MVP"===e.Award&&"Points"!==e.Type||(t[e.UID].Value+=e.Value,t[e.UID].Share+=100*e.Share,t[e.UID].NSeasonsRV++,e.Winner&&t[e.UID].NWins++,a="NSeasons","Most Improved Player"===e.Award&&(a="NSeasonsMIP"),"Sixth Player of the Year"===e.Award&&(a="NSeasons6POTY"),t[e.UID].PerSeasonsShare=t[e.UID].Share/t[e.UID][a])});var o=TABULIZE.COL.Number.MAKE("Total","Value"),n=TABULIZE.COL.Number.MAKE("Normalized Total","Share",2,!0),s=[TABULIZE.COL.Index.MAKE(),{Player:PLAYERNAMECOL.MAKE("Player","Name","FN","LN","UID",!1),Coach:COACHNAMECOL.MAKE("Coach","Name"),Executive:null}[e[0].IndType],TABULIZE.COL.Integer.MAKE({Player:"# Seasons Played",Coach:"# Seasons Coached",Executive:null}[e[0].IndType],"NSeasons"),TABULIZE.COL.Integer.MAKE("# Seasons Receiving Votes","NSeasonsRV"),TABULIZE.COL.Integer.MAKE("# Wins","NWins"),o,n,TABULIZE.COL.Number.MAKE("Normalized per Season","PerSeasonsShare",2,!0)],e="Normalized Total = Sum of 100 × Total / Total Points Available in Year
# Seasons Played is adjusted to reflect only the years the award was given.";return"MVP"===a&&(e+="
The WNBA released limited MVP voting data in 2008 and 2014."),{data:r,columns:s,sorters:[makeColumnSorter(n,"down"),makeColumnSorter(o,"down")],message:e}}},num_rv_season:{label:"# Receiving Votes (by Season)",supports:["Coach of the Year","Defensive Player of the Year","Most Improved Player","Rookie of the Year","Sixth Player of the Year","MVP","Newcomer of the Year"],make:function(e,a){var r=[],t={};e.forEach(function(e){t.hasOwnProperty(e.Season)||(t[e.Season]={Season:e.Season,Count:0},r.push(t[e.Season])),"MVP"===e.Award&&"Points"!==e.Type||t[e.Season].Count++});var o=TABULIZE.COL.Number.MAKE("# Receiving Votes","Count"),e=TABULIZE.COL.IntegerDisplayedAsString.MAKE("Season","Season"),e=[TABULIZE.COL.Index.MAKE(),e,o],a="MVP"===a?"The WNBA released limited MVP voting data in 2008 and 2014, only revealing the top-5 in the MVP results in 2014. The 2008 MVP vote also included a fan vote component.":null;return{data:r,columns:e,sorters:[makeColumnSorter(o,"down")],message:a}}},num_rv_team:{label:"# Receiving Votes (by Team)",supports:["Coach of the Year","Defensive Player of the Year","Most Improved Player","Rookie of the Year","Sixth Player of the Year","MVP","Newcomer of the Year"],make:function(e,a){var r=[],t={};e.forEach(function(e){t.hasOwnProperty(e.Team)||(t[e.Team]={Team:e.Team,TeamUID:e.TeamUID,Count:0},r.push(t[e.Team])),"MVP"===e.Award&&"Points"!==e.Type||t[e.Team].Count++});var o=TABULIZE.COL.Number.MAKE("# Receiving Votes","Count"),e=[TABULIZE.COL.Index.MAKE(),TEAMNAMECOL.MAKE("Team","Team","TeamUID"),o],a="MVP"===a?"The WNBA released limited MVP voting data in 2008 and 2014, only revealing the top-5 in the MVP results in 2014. The 2008 MVP vote also included a fan vote component.":null;return{data:r,columns:e,sorters:[makeColumnSorter(o,"down")],message:a}}},num_rv_team_season:{label:"# Receiving Votes (by Season + Team)",supports:["Defensive Player of the Year","Most Improved Player","Rookie of the Year","Sixth Player of the Year","MVP","Newcomer of the Year"],make:function(e,a){var r=[],t={};e.forEach(function(e){var a=e.Team+"~"+e.Season;t.hasOwnProperty(a)||(t[a]={Team:e.Team,TeamUID:e.TeamUID,Season:e.Season,Count:0},r.push(t[a])),"MVP"===e.Award&&"Points"!==e.Type||t[a].Count++});var o=TABULIZE.COL.Number.MAKE("# Receiving Votes","Count"),e=TABULIZE.COL.IntegerDisplayedAsString.MAKE("Season","Season"),e=[TABULIZE.COL.Index.MAKE(),e,TEAMNAMECOL.MAKE("Team","Team","TeamUID"),o],a="MVP"===a?"The WNBA released limited MVP voting data in 2008 and 2014, only revealing the top-5 in the MVP results in 2014. The 2008 MVP vote also included a fan vote component.":null;return{data:r,columns:e,sorters:[makeColumnSorter(o,"down")],message:a}}}};function getSupportedAwardsForRecords(){return new UTIL.Set(Object.keys(records).map(function(e){return records[e].supports}).reduce(function(e,a){return e.concat(a)},[])).toArray()}function show_record(e,a,r){records.hasOwnProperty(r)&&(UTIL.list.any(records[r].supports,a)?($("#av-wrapper > table").empty(),$("#av-wrapper > p").empty().hide(),(a=records[r].make(e,a)).message?$("#av-wrapper > p").html(a.message).show():$("#av-wrapper > p").hide(),TABULIZE.populate($("#av-wrapper > table"),{columns:a.columns,sorters:a.sorters},a.data)):($("#av-wrapper > table").hide(),$("#av-wrapper > p").text("Aggregated data not available for this award.").show()))}create_url_based_config({view:new StringConfigurationItem("votes"),season:new IntegerConfigurationItem(null),award:new StringConfigurationItem("MVP"),record:new StringConfigurationItem("large_share")}).add_config_change_callback(function(t){bind_change(t,"view",$("#filter-view")),$("#for-votes, #for-records").hide(),$("#for-"+t.get("view")).show(),UTIL.view.set_options($("#filter-record"),Object.keys(records).sort(function(e,a){return(e=records[e].label)<(a=records[a].label)?-1:a table").show(),"votes"===t.get("view")){var e=t.get("season")?parseInt(t.get("season")):AVDATA.getSeasons().backward()[0],a=AVDATA.get(e,t.get("award"));if(0 table").hide(),$("#av-wrapper > p").text("Data is not available for your current selection.").show();show_message(e,t.get("award"))}else{var r=getSupportedAwardsForRecords();if(UTIL.view.set_options_list($("#filter-award"),AVDATA.getAwards().filter(function(e){return UTIL.list.any(r,e)})),!UTIL.list.any(r,t.get("award")))return void t.set("award",r[0]);bind_change(t,"award",$("#filter-award")),show_record(AVDATA.getAll(t.get("award")),t.get("award"),t.get("record"))}o.done(),$("#av-wrapper").show()})})