elli-teu commited on
Commit
27699f5
·
2 Parent(s): f23ed4a 0212e2c

Merge branch 'main' of https://huggingface.co/spaces/WheelyFunTimesTeam/WheelyFunTimes

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -116,7 +116,7 @@ def plot_graph_title(plot_df, stop, time):
116
  #st.line_chart(plot_df)
117
  # Create the Altair chart
118
  chart = alt.Chart(plot_df).mark_line(point=True, interpolate="step-after").encode(
119
- x=alt.X('stop_name:N', title="Stop name"), # Use column name as string
120
  y=alt.Y('Occupancy:N', title="Vehicle Occupancy Status (Categories)", sort=category_order, scale=alt.Scale(domain=category_order)), # Treat Y as categorical
121
  tooltip=["datetime", 'stop_name', 'Occupancy'] # Add tooltips for interactivity
122
  ).properties(
@@ -299,6 +299,8 @@ def main():
299
 
300
  buses_df, bus_list, short_bus = get_buses()
301
 
 
 
302
  # Sidebar section for searching buses
303
  st.sidebar.title("Search for your desired bus")
304
 
 
116
  #st.line_chart(plot_df)
117
  # Create the Altair chart
118
  chart = alt.Chart(plot_df).mark_line(point=True, interpolate="step-after").encode(
119
+ x=alt.X('stop_name:N', title="Stop name", sort=plot_df["stop_name"]), # Use column name as string
120
  y=alt.Y('Occupancy:N', title="Vehicle Occupancy Status (Categories)", sort=category_order, scale=alt.Scale(domain=category_order)), # Treat Y as categorical
121
  tooltip=["datetime", 'stop_name', 'Occupancy'] # Add tooltips for interactivity
122
  ).properties(
 
299
 
300
  buses_df, bus_list, short_bus = get_buses()
301
 
302
+ short_bus = sorted(short_bus)
303
+
304
  # Sidebar section for searching buses
305
  st.sidebar.title("Search for your desired bus")
306