Spaces:
Build error
Build error
Commit ·
950d506
1
Parent(s): 2333d87
Refactor Gradio interface: Update layout and instructions
Browse files
app.py
CHANGED
|
@@ -85,19 +85,26 @@ def check_route(airport_selections, aircraft_type):
|
|
| 85 |
|
| 86 |
# Gradio Interface
|
| 87 |
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
| 88 |
-
gr.Markdown("##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
# Place components in two columns for results and map
|
| 91 |
with gr.Row():
|
| 92 |
with gr.Column():
|
| 93 |
-
airport_selector = gr.Dropdown(airport_options, multiselect=True, label="Select Airports (IATA - Name)", value=["JFK - John F Kennedy Intl - United States", "
|
| 94 |
aircraft_selector = gr.Dropdown(aircraft_options, label="Select Aircraft Type", value="Airbus A350-900")
|
| 95 |
check_button = gr.Button("Check Route Feasibility")
|
| 96 |
-
result_output = gr.HTML(label="Feasibility Result (Route, Fuel, Refueling Info)")
|
| 97 |
-
|
| 98 |
-
with gr.Column():
|
| 99 |
gr.Markdown("## Route Map")
|
| 100 |
map_output = gr.HTML(label="Interactive Route Map with Refueling Sectors")
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
# Connect the button click to the check_route function
|
| 103 |
check_button.click(
|
|
|
|
| 85 |
|
| 86 |
# Gradio Interface
|
| 87 |
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
| 88 |
+
gr.Markdown("## Flight Route Planner - [[GitHub]](https://github.com/souvik0306/Flight_Route_Optimization)")
|
| 89 |
+
# Step-wise instructions
|
| 90 |
+
gr.Markdown("""
|
| 91 |
+
### Instructions
|
| 92 |
+
1. **Select Airports:** Choose multiple airports from the dropdown list to form your route.
|
| 93 |
+
2. **Select Aircraft Type:** Pick the type of aircraft you plan to use for the route.
|
| 94 |
+
3. **Check Route Feasibility:** Click the 'Check Route Feasibility' button to see the results, including the optimal route, fuel requirements, and refueling sectors.
|
| 95 |
+
""")
|
| 96 |
|
| 97 |
# Place components in two columns for results and map
|
| 98 |
with gr.Row():
|
| 99 |
with gr.Column():
|
| 100 |
+
airport_selector = gr.Dropdown(airport_options, multiselect=True, label="Select Airports (IATA - Name)", value=["JFK - John F Kennedy Intl - United States", "SIN - Changi Intl - Singapore", "LHR - Heathrow - United Kingdom"])
|
| 101 |
aircraft_selector = gr.Dropdown(aircraft_options, label="Select Aircraft Type", value="Airbus A350-900")
|
| 102 |
check_button = gr.Button("Check Route Feasibility")
|
|
|
|
|
|
|
|
|
|
| 103 |
gr.Markdown("## Route Map")
|
| 104 |
map_output = gr.HTML(label="Interactive Route Map with Refueling Sectors")
|
| 105 |
+
|
| 106 |
+
with gr.Column():
|
| 107 |
+
result_output = gr.HTML(label="Feasibility Result (Route, Fuel, Refueling Info)")
|
| 108 |
|
| 109 |
# Connect the button click to the check_route function
|
| 110 |
check_button.click(
|