Update app.py
Browse files
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.
|
| 111 |
-
ui.
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
ui.
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
ui.
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
ui.
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
ui.
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
-
|
| 142 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
|