nesticot commited on
Commit
f85aab4
·
verified ·
1 Parent(s): 40eb83c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -42
app.py CHANGED
@@ -107,50 +107,46 @@ from shiny import App, reactive, ui, render
107
  from shiny.ui import h2, tags
108
 
109
  # Define the UI layout for the app
110
- app_ui = ui.page_fluid(
111
- ui.layout_sidebar(
112
- ui.panel_sidebar(
113
- # Row for selecting season and level
114
- ui.row(
115
- ui.column(4, ui.input_select('year_input', 'Select Season', year_list, selected=2024)),
116
- ui.column(4, ui.input_select('level_input', 'Select Level', level_dict)),
117
- ui.column(4, ui.input_select('type_input', 'Select Type', type_dict,selected='R'))
118
- ),
119
- # Row for the action button to get player list
120
- ui.row(ui.input_action_button("player_button", "Get Player List", class_="btn-primary")),
121
- # Row for selecting the player
122
- ui.row(ui.column(12, ui.output_ui('player_select_ui', 'Select Player'))),
123
- # Row for selecting the date range
124
- ui.row(ui.column(12, ui.output_ui('date_id', 'Select Date'))),
125
-
126
- # Rows for selecting plots and split options
127
- ui.row(
128
- ui.column(4, ui.input_select('plot_id_1', 'Plot Left', function_dict, multiple=False, selected='velocity_kdes')),
129
- ui.column(4, ui.input_select('plot_id_2', 'Plot Middle', function_dict, multiple=False, selected='tj_stuff_roling')),
130
- ui.column(4, ui.input_select('plot_id_3', 'Plot Right', function_dict, multiple=False, selected='break_plot'))
131
- ),
132
- ui.row(
133
- ui.column(6, ui.input_select('split_id', 'Select Split', split_dict, multiple=False)),
134
- ui.column(6, ui.input_numeric('rolling_window', 'Rolling Window (for tjStuff+ Plot)', min=1, value=50))
135
- ),
136
- ui.row(
137
- ui.column(6, ui.input_switch("switch", "Custom Team?", False)),
138
- ui.column(6, ui.input_select('logo_select', 'Select Custom Logo', image_dict_flip, multiple=False))
139
- ),
 
 
 
140
 
141
- # Row for the action button to generate plot
142
- ui.row(ui.input_action_button("generate_plot", "Generate Plot", class_="btn-primary")),
 
 
 
143
  ),
144
-
145
- ui.panel_main(
146
- ui.navset_tab(
147
- # Tab for game summary plot
148
- ui.nav("Pitching Summary",
149
- ui.output_text("status"),
150
- ui.output_plot('plot', width='2100px', height='2100px')
151
- ),
152
- )
153
- )
154
  )
155
  )
156
 
 
107
  from shiny.ui import h2, tags
108
 
109
  # Define the UI layout for the app
110
+ app_ui = ui.page_sidebar(
111
+ ui.sidebar(
112
+ # Row for selecting season and level
113
+ ui.row(
114
+ ui.column(4, ui.input_select('year_input', 'Select Season', year_list, selected=2024)),
115
+ ui.column(4, ui.input_select('level_input', 'Select Level', level_dict)),
116
+ ui.column(4, ui.input_select('type_input', 'Select Type', type_dict,selected='R'))
117
+ ),
118
+ # Row for the action button to get player list
119
+ ui.row(ui.input_action_button("player_button", "Get Player List", class_="btn-primary")),
120
+ # Row for selecting the player
121
+ ui.row(ui.column(12, ui.output_ui('player_select_ui', 'Select Player'))),
122
+ # Row for selecting the date range
123
+ ui.row(ui.column(12, ui.output_ui('date_id', 'Select Date'))),
124
+
125
+ # Rows for selecting plots and split options
126
+ ui.row(
127
+ ui.column(4, ui.input_select('plot_id_1', 'Plot Left', function_dict, multiple=False, selected='velocity_kdes')),
128
+ ui.column(4, ui.input_select('plot_id_2', 'Plot Middle', function_dict, multiple=False, selected='tj_stuff_roling')),
129
+ ui.column(4, ui.input_select('plot_id_3', 'Plot Right', function_dict, multiple=False, selected='break_plot'))
130
+ ),
131
+ ui.row(
132
+ ui.column(6, ui.input_select('split_id', 'Select Split', split_dict, multiple=False)),
133
+ ui.column(6, ui.input_numeric('rolling_window', 'Rolling Window (for tjStuff+ Plot)', min=1, value=50))
134
+ ),
135
+ ui.row(
136
+ ui.column(6, ui.input_switch("switch", "Custom Team?", False)),
137
+ ui.column(6, ui.input_select('logo_select', 'Select Custom Logo', image_dict_flip, multiple=False))
138
+ ),
139
+
140
+ # Row for the action button to generate plot
141
+ ui.row(ui.input_action_button("generate_plot", "Generate Plot", class_="btn-primary")),
142
+ ),
143
 
144
+ # Main content area with tabs (placed directly in page_sidebar)
145
+ ui.navset_tab(
146
+ ui.nav_panel("Pitching Summary",
147
+ ui.output_text("status"),
148
+ ui.output_plot('plot', width='2100px', height='2100px')
149
  ),
 
 
 
 
 
 
 
 
 
 
150
  )
151
  )
152