Yes, it is very clear. I imagine that season_data
has “Team” and “Position” as columns, so what you want is something like:
@app.callback(
Output("player-filter", "options"),
[
Input("season-filter", "value"),
Input("team-filter", "value"),
Input("pos-filter", "value")
])
def update_player_filter(season, team, position):
dff = season_data[season_data["Season"].isin(season)] if season else season_data
dff = dff[dff["Team"].isin(team)] if team else dff
dff = dff[dff["Position"].isin(position)] if position else dff
return [{'label': i, 'value': i} for i in dff["Player"].unique()]
Here I am explicitly using that an empty selection should return all seasons/teams/positions, because otherwise the user would need to select all one by one (there is no “select all” options). Of course, you could in principle add a “All” option in each dropdown and handle this case separately.