base_url = "https://a.espncdn.com/combiner/i?img=/i/teamlogos/nba/500/"
teams = [{value: 'ATL', label:'ATL Hawks'},
{value: 'BKN', label: 'BKN Nets'},
{value: 'BOS', label: 'BOS Celtics'},
{value: 'CHA', label: 'CHA Hornettes'},
{value: 'CHI', label: 'CHI Bulls'},
{value: 'CLE', label: 'CLE Cavaliers'},
{value:'DAL', label: 'DAL Mavericks'},
{value: 'DEN', label:'DEN Nuggets'},
{value: 'DET', label: 'DET Pistons'},
{value: 'GSW', label: 'GS Warriors'},
{value: 'HOU', label: 'HOU Rockets'},
{value: 'IND', label: 'IND Pacers'},
{value: 'LAC', label: 'LA Clippers'},
{value: 'LAL', label: 'LA Lakers'},
{value: 'MEM', label: 'MEM Grizzlies'},
{value:'MIA', label:'MIA Heat'},
{value:'MIL', label:'MIL Bucks'},
{value:'MIN', label:'MIN Timberwolves'},
{value: 'NO', label: 'NO Pelicans'},
{value:'NYK', label:'NYK Knicks'},
{value: 'OKC', label: 'OKC Thunder'},
{value: 'ORL', label: 'ORL Magic'},
{value: 'PHI', label: 'PHI 76ers'},
{value: 'PHO', label: 'PHO Suns'},
{value:'POR', label: 'POR Trail Blazers'},
{value: 'SAC', label: 'SAC Kings'},
{value: 'SAS', label: 'SAS Spurs'},
{value: 'TOR', label: 'TOR Raptors'},
{value: 'UTAH', label: 'UTAH Jazz'},
{value: 'WAS', label: 'WAS Wizards'}]
positions = [
{value:'C', label: 'C'},
{value:'PF', label: 'PF'},
{value:'PG', label: 'PG'},
{value:'SF', label: 'SF'},
{value:'SG', label: 'SG'}]
values = [
{value:'pts', label: 'PTS'},
{value:'fga', label: 'FGA'},
{value:'fgm', label: 'FGM'},
{value:'fg_percent', label:'FG %'},
{value: 'x2pa', label:'2PA'},
{value: 'x2p', label:'2P'},
{value: 'x2p_percent', label:'2P %'},
{value: 'x3pa', label:'3PA'},
{value: 'x3p', label:'3P'},
{value: 'x3p_percent', label:'3P %'},
{value:'fta', label: 'FTA'},
{value:'ft', label: 'FT'},
{value: 'ft_percent', label:'FT %'}]
teamFormat = teams.map(d => ({value: d.value, label: "<div class='team-option' style='height:100%;'><img style='height:100%;;padding-right:5px;vertical-align:middle;'src="+base_url+d.value+".png><span style='vertical-align:middle;'></div>"+d.value+"</span></div>"}))
viewof selectedTeams = checkbox({
options: teamFormat,
value: teams.map(team => team.value),
orientation: 'vertical'
})
viewof selectedPositions = checkbox({
options: positions,
value: ["PG", "PF", "C","SF","SG"],
orientation: 'vertical'
})
viewof selectedValues = checkbox({
options: values,
value: ["fga",'fgm', "fg_percent", "pts"],
orientation: 'vertical'
})