def event_graph(event_file, team): if team is not None and event_file is not None: fig_shots = plotEvents("Shots", event_file, team, "Home") fig_assists = plotEvents("Assists to Shots", event_file, team, "Home") fig_crosses = plotEvents("Crosses", event_file, team, "Home") fig_set_plays = plotEvents("Set Plays", event_file, team, "Home") fig_progressive_passes = plotEvents("Progressive Passes", event_file, team, "Home") for x in [ fig_shots, fig_assists, fig_crosses, fig_set_plays, fig_progressive_passes, ]: # Change modebar drawing item colour so that it stands out (vs. grey) x.update_layout(newshape=dict(line_color="#00aaff")) return ( fig_shots, fig_assists, fig_crosses, fig_set_plays, fig_progressive_passes, ) else: fig = initial_figure_events() return fig, fig, fig, fig, fig
] }, ) ], type="default", ) ]), ), dbc.Col( dbc.Card(children=[ dcc.Loading( id="loading-icon2", children=[ dcc.Graph( style={'background-color': "black"}, id="events-shots", figure=initial_figure_events(), config={ "modeBarButtonsToAdd": [ "drawline", "drawopenpath", "drawcircle", "drawrect", "eraseshape", ], "modeBarButtonsToRemove": [ "toggleSpikelines", "pan2d", "autoScale2d", "resetScale2d", ], },