If you could review this part:
@app.callback([Output(“wins_pie”, “figure”),
Output(“side”, “figure”),
Output(“kda_bar”, “figure”),
Output(“stacked_bar”, “figure”),
Output(“top_all_time_wins”, “figure”),
Output(“top_friends”, “figure”),
Output(“top_win_friends”, “figure”)],
[Input(“info_button”, “n_clicks”)],
[State(“insert_id”, “value”)]
)
def update_fig(*args):
if not any(args):
raise PreventUpdate
else:
num_clicks, player_id = args
# get player info and make dataframes
if num_clicks > 0:
r = requests.get(f'https://api.opendota.com/api/players/{player_id}')
if r.ok:
player_df = pd.DataFrame(json.loads(r.text))
matches_link = f'https://api.opendota.com/api/players/{player_id}/matches?significant=0'
r = requests.get(matches_link)
player_matches_df = pd.DataFrame(json.loads(r.text))
player_heroes_link = f'https://api.opendota.com/api/players/{player_id}/heroes'
r = requests.get(player_heroes_link)
player_heroes_df = pd.DataFrame(json.loads(r.text))
player_peers = f'https://api.opendota.com/api/players/{player_id}/peers'
r = requests.get(player_peers)
player_peers_df = pd.DataFrame(json.loads(r.text))
I think this is the problematic part of the code. The layout is fine and the code after this part is also fine (it’s just cleaning data with Pandas), or at least i think so.
One problem that i had was that I couldn’t do the request part before the app because the script was running in circle (input → app runs → input shows again) so i did the “insert_id” field in the app.
Second was that I tried to add a feature with a dropdown containing a list of most played hero to display some stats but since the info about the heroes comes from request in the callback I couldn’t place it in the layout… Maybe chained callbacks would get the job done?
Another problem was that everytime I wanted to add an argument to this function (for example to make a dropdown with all heroes, not depending on API info) dash would throw errors about everything. First that json is wrong, then the error about scalar values needing index, then about return statement beeing wrong (or None), I’ve manage to fix it all, but then it thrown an error about missing column in axis, as if the data was already cleaned and those column were missing wich led to another error that was thrown when refreshing the app, the same error occured, missing columns.
As i said my coding skills are basic so the mistake is obviously on me, I just don’t know where. I would apreciate if you could tell me the normal order of doing those things 
Oh, the whole code (the same API requests) and plots works fine in a jupyter notebook so I guess that callback is what fails.
Thanks.