Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ import json
|
|
15 |
from matplotlib.ticker import MaxNLocator
|
16 |
import matplotlib.font_manager as font_manager
|
17 |
import numpy as np
|
18 |
-
|
19 |
|
20 |
# team_games_df = pd.read_csv('data/team_games_all.csv',index_col=[0])
|
21 |
# player_games_df = pd.read_csv('data/player_games_cards.csv',index_col=[0]).sort_values(by='date').reset_index(drop=True)
|
@@ -197,7 +197,11 @@ app_ui = ui.page_fluid(
|
|
197 |
ui.input_select("position_select", "Position",position_dict,width=1,size=1,selectize=False,selected='All'),
|
198 |
ui.input_date("date", "Date input",value = datetime.today().date() - timedelta(days=1),min='2023-10-10', max=datetime.today().date() - timedelta(days=1)),
|
199 |
ui.input_switch("rookie_switch", "Rookies Only"),
|
|
|
200 |
ui.output_table("result"),
|
|
|
|
|
|
|
201 |
width=3),
|
202 |
|
203 |
|
@@ -340,6 +344,7 @@ def server(input, output, session):
|
|
340 |
|
341 |
@output
|
342 |
@render.table
|
|
|
343 |
def result():
|
344 |
if input.rookie_switch():
|
345 |
|
@@ -357,6 +362,7 @@ def server(input, output, session):
|
|
357 |
|
358 |
@output
|
359 |
@render.plot(alt="A histogram")
|
|
|
360 |
def plot():
|
361 |
|
362 |
team_select_list = [input.team_select()]
|
|
|
15 |
from matplotlib.ticker import MaxNLocator
|
16 |
import matplotlib.font_manager as font_manager
|
17 |
import numpy as np
|
18 |
+
from shiny import App, Inputs, Outputs, Session, reactive, render, req, ui
|
19 |
|
20 |
# team_games_df = pd.read_csv('data/team_games_all.csv',index_col=[0])
|
21 |
# player_games_df = pd.read_csv('data/player_games_cards.csv',index_col=[0]).sort_values(by='date').reset_index(drop=True)
|
|
|
197 |
ui.input_select("position_select", "Position",position_dict,width=1,size=1,selectize=False,selected='All'),
|
198 |
ui.input_date("date", "Date input",value = datetime.today().date() - timedelta(days=1),min='2023-10-10', max=datetime.today().date() - timedelta(days=1)),
|
199 |
ui.input_switch("rookie_switch", "Rookies Only"),
|
200 |
+
ui.input_action_button("go", "Generate",class_="btn-primary"),
|
201 |
ui.output_table("result"),
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
width=3),
|
206 |
|
207 |
|
|
|
344 |
|
345 |
@output
|
346 |
@render.table
|
347 |
+
@reactive.event(input.go, ignore_none=False)
|
348 |
def result():
|
349 |
if input.rookie_switch():
|
350 |
|
|
|
362 |
|
363 |
@output
|
364 |
@render.plot(alt="A histogram")
|
365 |
+
@reactive.event(input.go, ignore_none=False)
|
366 |
def plot():
|
367 |
|
368 |
team_select_list = [input.team_select()]
|