Bertonlome commited on
Commit
a5ef90e
·
1 Parent(s): e7b5170

Highlight horizontal bidirectional arrows when most reliable track goes through UGV*

Browse files
Files changed (1) hide show
  1. python_dash_ia.py +20 -8
python_dash_ia.py CHANGED
@@ -304,6 +304,12 @@ def build_interdependence_figures(df, highlight_track=None):
304
  y = arrow["task"]
305
  x_left = agent_pos[arrow["left_agent"]]
306
  x_right = agent_pos[arrow["right_agent"]]
 
 
 
 
 
 
307
  # Draw left-to-right arrow
308
  fig.add_annotation(
309
  x=x_right, y=y, ax=x_left, ay=y,
@@ -311,8 +317,8 @@ def build_interdependence_figures(df, highlight_track=None):
311
  showarrow=True,
312
  arrowhead=2,
313
  arrowsize=1,
314
- arrowwidth=2,
315
- arrowcolor="black",
316
  opacity=0.9
317
  )
318
  # Draw right-to-left arrow
@@ -322,8 +328,8 @@ def build_interdependence_figures(df, highlight_track=None):
322
  showarrow=True,
323
  arrowhead=2,
324
  arrowsize=1,
325
- arrowwidth=2,
326
- arrowcolor="black",
327
  opacity=0.9
328
  )
329
 
@@ -560,6 +566,12 @@ def build_combined_interdependence_figure(df, highlight_track=None):
560
  y = arrow["task"]
561
  x_left = agent_pos[arrow["left_agent"]]
562
  x_right = agent_pos[arrow["right_agent"]]
 
 
 
 
 
 
563
  # Draw left-to-right arrow
564
  fig.add_annotation(
565
  x=x_right, y=y, ax=x_left, ay=y,
@@ -567,8 +579,8 @@ def build_combined_interdependence_figure(df, highlight_track=None):
567
  showarrow=True,
568
  arrowhead=2,
569
  arrowsize=1,
570
- arrowwidth=2,
571
- arrowcolor="black",
572
  opacity=0.9
573
  )
574
  # Draw right-to-left arrow
@@ -578,8 +590,8 @@ def build_combined_interdependence_figure(df, highlight_track=None):
578
  showarrow=True,
579
  arrowhead=2,
580
  arrowsize=1,
581
- arrowwidth=2,
582
- arrowcolor="black",
583
  opacity=0.9
584
  )
585
 
 
304
  y = arrow["task"]
305
  x_left = agent_pos[arrow["left_agent"]]
306
  x_right = agent_pos[arrow["right_agent"]]
307
+
308
+ # Check if most reliable track goes through UGV* for this task
309
+ is_highlighted = False
310
+ if highlight_track == "most_reliable":
311
+ is_highlighted = (y, "UGV*") in most_reliable_track
312
+
313
  # Draw left-to-right arrow
314
  fig.add_annotation(
315
  x=x_right, y=y, ax=x_left, ay=y,
 
317
  showarrow=True,
318
  arrowhead=2,
319
  arrowsize=1,
320
+ arrowwidth=4 if is_highlighted else 2,
321
+ arrowcolor="crimson" if is_highlighted else "black",
322
  opacity=0.9
323
  )
324
  # Draw right-to-left arrow
 
328
  showarrow=True,
329
  arrowhead=2,
330
  arrowsize=1,
331
+ arrowwidth=4 if is_highlighted else 2,
332
+ arrowcolor="crimson" if is_highlighted else "black",
333
  opacity=0.9
334
  )
335
 
 
566
  y = arrow["task"]
567
  x_left = agent_pos[arrow["left_agent"]]
568
  x_right = agent_pos[arrow["right_agent"]]
569
+
570
+ # Check if most reliable track goes through UGV* for this task
571
+ is_highlighted = False
572
+ if highlight_track == "most_reliable":
573
+ is_highlighted = (y, "UGV*") in most_reliable_track
574
+
575
  # Draw left-to-right arrow
576
  fig.add_annotation(
577
  x=x_right, y=y, ax=x_left, ay=y,
 
579
  showarrow=True,
580
  arrowhead=2,
581
  arrowsize=1,
582
+ arrowwidth=4 if is_highlighted else 2,
583
+ arrowcolor="crimson" if is_highlighted else "black",
584
  opacity=0.9
585
  )
586
  # Draw right-to-left arrow
 
590
  showarrow=True,
591
  arrowhead=2,
592
  arrowsize=1,
593
+ arrowwidth=4 if is_highlighted else 2,
594
+ arrowcolor="crimson" if is_highlighted else "black",
595
  opacity=0.9
596
  )
597