@@ -53,18 +53,23 @@ def main():
53
53
54
54
df_station_metadata = load_station_metadata (district_number )
55
55
56
- map_placeholder = st .empty ( )
56
+ col1 , col2 = st .columns ([ 0.25 , 0.75 ] )
57
57
58
- station = st .selectbox ("Station" , df_station_metadata ["STATION_ID" ], index = None )
59
-
60
- quantity = st .multiselect ("Quantity" , ["VOLUME_SUM" , "OCCUPANCY_AVG" , "SPEED_FIVE_MINS" ])
61
-
62
- if station :
63
- num_lanes = int (df_station_metadata [df_station_metadata ["STATION_ID" ] == station ]["PHYSICAL_LANES" ].iloc [0 ])
64
- lane = st .multiselect (
65
- "Lane" ,
66
- list (range (1 , num_lanes + 1 )),
67
- )
58
+ with col1 :
59
+ station = st .selectbox ("Station" , df_station_metadata ["STATION_ID" ], index = None )
60
+ lane = None
61
+ if station :
62
+ num_lanes = int (df_station_metadata [df_station_metadata ["STATION_ID" ] == station ]["PHYSICAL_LANES" ].iloc [0 ])
63
+ lane = st .multiselect (
64
+ "Lane" ,
65
+ list (range (1 , num_lanes + 1 )),
66
+ )
67
+ quantity = st .multiselect ("Quantity" , ["VOLUME_SUM" , "OCCUPANCY_AVG" , "SPEED_FIVE_MINS" ])
68
+ days = st .multiselect ("Days" , get_available_days ())
69
+ station_data_button = st .button ("Load Station Data" , type = "primary" )
70
+
71
+ with col2 :
72
+ map_placeholder = st .empty ()
68
73
69
74
with map_placeholder :
70
75
if station :
@@ -73,15 +78,13 @@ def main():
73
78
else :
74
79
map_district_summary (df_station_metadata )
75
80
76
- days = st .multiselect ("Days" , get_available_days ())
77
-
78
- station_data_button = st .button ("Load Station Data" , type = "primary" )
79
-
80
81
error_placeholder = st .empty ()
81
82
plot_placeholder = st .empty ()
82
83
83
84
if station_data_button :
84
85
error_messages = []
86
+ if not station :
87
+ error_messages .append ("- Please select a station to proceed." )
85
88
if len (quantity ) == 0 or len (quantity ) > 2 :
86
89
error_messages .append ("- Please select one or two quantities to proceed." )
87
90
if not lane :
0 commit comments