nesticot commited on
Commit
5f4d665
·
1 Parent(s): e56607d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -157,7 +157,8 @@ app_ui = ui.page_fluid(
157
 
158
  ui.panel_sidebar(
159
  #ui.input_date_range("date_range_id", "Date range input",start = statcast_df.game_date.min(), end = statcast_df.game_date.max()),
160
- ui.input_select("id", "Select Skater",skater_dict,width=1),
 
161
  ui.input_numeric("last_game_id", "Select Last 'n' Games",value=1,width=1),
162
  #ui.input_select("ignore_id", "Remove Columns",['Position','Roster%'],multiple=True,selectize=True),
163
  width=2),
@@ -191,6 +192,18 @@ def server(input, output, session):
191
  sns.set_theme(style="whitegrid", palette="pastel")
192
  cmap = matplotlib.colors.LinearSegmentedColormap.from_list("", ["#4285F4","white","#FBBC04"])
193
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  player_id = int(input.id())
195
 
196
  last_games = input.last_game_id()
 
157
 
158
  ui.panel_sidebar(
159
  #ui.input_date_range("date_range_id", "Date range input",start = statcast_df.game_date.min(), end = statcast_df.game_date.max()),
160
+ ui.input_select("id", "Select Skater",skater_dict,width=1,selected=8480069,selectize=True),
161
+ #ui.input_select("id", "Select Skater",skater_dict,width=1),
162
  ui.input_numeric("last_game_id", "Select Last 'n' Games",value=1,width=1),
163
  #ui.input_select("ignore_id", "Remove Columns",['Position','Roster%'],multiple=True,selectize=True),
164
  width=2),
 
192
  sns.set_theme(style="whitegrid", palette="pastel")
193
  cmap = matplotlib.colors.LinearSegmentedColormap.from_list("", ["#4285F4","white","#FBBC04"])
194
 
195
+ try:
196
+ if sum(summary_2023.player_id.isin([int(input.id())]))<1:
197
+ fig, ax = plt.subplots(figsize=(10,16))
198
+ fig.set_facecolor('white')
199
+ fig.text(s=f'Select Player From List',x=0.5,y=0.5,fontsize=28,ha='center')
200
+ return
201
+ except ValueError:
202
+ fig, ax = plt.subplots(figsize=(10,16))
203
+ fig.set_facecolor('white')
204
+ fig.text(s=f'Select Player From List',x=0.5,y=0.5,fontsize=28,ha='center')
205
+ return
206
+
207
  player_id = int(input.id())
208
 
209
  last_games = input.last_game_id()