Map graph not displayed after deployment

Hi guys
I have used a call back function to switch between two types of maps in my covid 19 dashboard , on my local host it was working well but once I deployed the app it stopped working ,
this is call back function :

Output(“graph”, “figure”),
Input(“selection”, “value”))
def display_animated_graph(selection):
if selection==‘Trajectory of Pandemic’:

            fig = px.choropleth(df_country, locations="Countrycode", color = "total_cases",
                                    hover_name= "Country",animation_frame=date,
                                    hover_data = df[['total_cases','new_cases','total_deaths']],

            fig.update_layout(transition={'duration':1000},paper_bgcolor='#000000',geo=dict(bgcolor= '#000000'),margin=dict(l=0,r=0,t=0,b=0))
            fig.update_traces(marker_line_color='rgba(255,255,255,0)', selector=dict(type='choroplethmapbox'))
            fig = px.choropleth(df_country, locations="Countrycode", color = "total_cases",
                                    hover_name= "Country",
                                    hover_data = ['total_cases','new_cases','total_deaths'],
            fig.update_layout(paper_bgcolor='#000000',geo=dict(bgcolor= '#000000'),
                            title=f"Cumulative Cases since the start of pandemic untill {yesterdays_date}")

    return fig

if name==‘main’:
app.run_server(debug=True, port=8000)
the app is available here
and view my code visit my repo here and help me address this problem
GitHub - Datascientist88/Dash_Dashboard_COVID19_NO_ONE
just what is wrong what my call back function in order to rectify it and learn from my mistake
thanks lovely community

It looks like the update request is timing out after 30s… It is difficult to say exactly why without any info about the deployment environment, but you can try to generate the two plots in the global environment and just switch between them using the callback (they don’t depend on other inputs).


Thank you very much indeed for your kind cooperation and advice I will do exactly what you told me
With best regards

Hi beloved companions at plotly dash community
I would like to thank you very much indeed for your answers ,the problem is solved by just transferring the map plots into a global environment to reduce the load time and the delay that causes call back failure
the code is accessible at my repository on github GitHub - Datascientist88/Dash_Dashboard_COVID19_NO_ONE
and the application is accessible at :
I would like to take this opportunity and extend my heart_felt gratitude to all plotly community members for their kind cooperation
and special thanks are extended to @jlfsjunior @adamschroeder for their dedication to provide me with all the assistance I asked for
this part I modified in my work :
with best regards