Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -396,7 +396,14 @@ def create_filtered_marey(t_nom, t_del, t_adj, infra, view_mode, selected_train_
|
|
| 396 |
if view_mode in ["All Scenarios", "Resolved Only"]: add_lines(t_adj, 'auto', 'solid', "(Resolved)", 1.0, True, width=4)
|
| 397 |
|
| 398 |
fig.update_layout(
|
| 399 |
-
title=dict(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 400 |
xaxis_title="Time",
|
| 401 |
yaxis_title="Station / distance",
|
| 402 |
yaxis=dict(tickmode='array', tickvals=infra.distances, ticktext=infra.stations, gridcolor='rgba(174,199,255,0.12)', zeroline=False),
|
|
@@ -404,9 +411,18 @@ def create_filtered_marey(t_nom, t_del, t_adj, infra, view_mode, selected_train_
|
|
| 404 |
plot_bgcolor='rgba(0,0,0,0)',
|
| 405 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 406 |
font=dict(color='#eaf2ff'),
|
| 407 |
-
legend=dict(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 408 |
hoverlabel=dict(bgcolor='#111936', font_color='#f8fbff', bordercolor='rgba(174,199,255,0.22)'),
|
| 409 |
-
margin=dict(l=58, r=24, t=
|
| 410 |
height=650
|
| 411 |
)
|
| 412 |
return fig
|
|
@@ -599,7 +615,14 @@ def simulate_capacity_vs_reliability(infra, fleet_profiles, delay_data, max_trai
|
|
| 599 |
station_distances = list(dist_map.values())
|
| 600 |
|
| 601 |
best_marey_fig.update_layout(
|
| 602 |
-
title=dict(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 603 |
xaxis_title="Time",
|
| 604 |
yaxis_title="Station / distance",
|
| 605 |
xaxis=dict(tickformat="%H:%M", tickangle=-35, gridcolor='rgba(174,199,255,0.10)', zeroline=False),
|
|
@@ -610,12 +633,12 @@ def simulate_capacity_vs_reliability(infra, fleet_profiles, delay_data, max_trai
|
|
| 610 |
gridcolor='rgba(174,199,255,0.12)',
|
| 611 |
zeroline=False
|
| 612 |
),
|
| 613 |
-
plot_bgcolor='rgba(
|
| 614 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 615 |
font=dict(color='#eaf2ff'),
|
| 616 |
hoverlabel=dict(bgcolor='#111936', font_color='#f8fbff', bordercolor='rgba(174,199,255,0.22)'),
|
| 617 |
showlegend=False,
|
| 618 |
-
margin=dict(l=72, r=24, t=
|
| 619 |
)
|
| 620 |
|
| 621 |
# Returning 5 elements, matching what run_economic_analysis expects!
|
|
|
|
| 396 |
if view_mode in ["All Scenarios", "Resolved Only"]: add_lines(t_adj, 'auto', 'solid', "(Resolved)", 1.0, True, width=4)
|
| 397 |
|
| 398 |
fig.update_layout(
|
| 399 |
+
title=dict(
|
| 400 |
+
text=f"Marey Diagram 路 {view_mode}",
|
| 401 |
+
x=0.02,
|
| 402 |
+
y=0.98,
|
| 403 |
+
xanchor='left',
|
| 404 |
+
yanchor='top',
|
| 405 |
+
font=dict(size=16, color='#f8fbff')
|
| 406 |
+
),
|
| 407 |
xaxis_title="Time",
|
| 408 |
yaxis_title="Station / distance",
|
| 409 |
yaxis=dict(tickmode='array', tickvals=infra.distances, ticktext=infra.stations, gridcolor='rgba(174,199,255,0.12)', zeroline=False),
|
|
|
|
| 411 |
plot_bgcolor='rgba(0,0,0,0)',
|
| 412 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 413 |
font=dict(color='#eaf2ff'),
|
| 414 |
+
legend=dict(
|
| 415 |
+
orientation='h',
|
| 416 |
+
yanchor='top',
|
| 417 |
+
y=-0.20,
|
| 418 |
+
xanchor='center',
|
| 419 |
+
x=0.5,
|
| 420 |
+
bgcolor='rgba(8,14,32,0.62)',
|
| 421 |
+
bordercolor='rgba(174,199,255,0.14)',
|
| 422 |
+
borderwidth=1
|
| 423 |
+
),
|
| 424 |
hoverlabel=dict(bgcolor='#111936', font_color='#f8fbff', bordercolor='rgba(174,199,255,0.22)'),
|
| 425 |
+
margin=dict(l=58, r=24, t=70, b=120),
|
| 426 |
height=650
|
| 427 |
)
|
| 428 |
return fig
|
|
|
|
| 615 |
station_distances = list(dist_map.values())
|
| 616 |
|
| 617 |
best_marey_fig.update_layout(
|
| 618 |
+
title=dict(
|
| 619 |
+
text=f"Optimal Space-Time Diagram 路 {best_tph} Trains/Hour",
|
| 620 |
+
x=0.02,
|
| 621 |
+
y=0.98,
|
| 622 |
+
xanchor='left',
|
| 623 |
+
yanchor='top',
|
| 624 |
+
font=dict(size=16, color='#f8fbff')
|
| 625 |
+
),
|
| 626 |
xaxis_title="Time",
|
| 627 |
yaxis_title="Station / distance",
|
| 628 |
xaxis=dict(tickformat="%H:%M", tickangle=-35, gridcolor='rgba(174,199,255,0.10)', zeroline=False),
|
|
|
|
| 633 |
gridcolor='rgba(174,199,255,0.12)',
|
| 634 |
zeroline=False
|
| 635 |
),
|
| 636 |
+
plot_bgcolor='rgba(0,0,0,0)',
|
| 637 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 638 |
font=dict(color='#eaf2ff'),
|
| 639 |
hoverlabel=dict(bgcolor='#111936', font_color='#f8fbff', bordercolor='rgba(174,199,255,0.22)'),
|
| 640 |
showlegend=False,
|
| 641 |
+
margin=dict(l=72, r=24, t=70, b=64)
|
| 642 |
)
|
| 643 |
|
| 644 |
# Returning 5 elements, matching what run_economic_analysis expects!
|