mijtsma3 commited on
Commit
748df7b
·
1 Parent(s): cc1a80e

Unit included in WND offset labels

Browse files
Files changed (1) hide show
  1. src/viz.py +4 -4
src/viz.py CHANGED
@@ -115,18 +115,18 @@ class Visualizer:
115
  color_index = (color_index + 1) % len(colors) # Update color index for the next trace
116
 
117
  # ----- Custom Tick and "Now" Label Logic -----
118
- tick_offsets = [-200, -100, 0, 100, 200]
119
  tick_vals = [current_time + offset for offset in tick_offsets]
120
  tick_texts = [f"{offset:+}" if offset != 0 else "Now" for offset in tick_offsets]
121
 
122
- # Replace +0 with "Now", rest: e.g., -200, -100, Now, +100, +200
123
  tick_texts = []
124
  for offset in tick_offsets:
125
  if offset == 0:
126
  tick_texts.append("Now")
127
  else:
128
- # always sign, e.g. "+200", "-100"
129
- tick_texts.append("{:+}".format(offset))
130
 
131
  # Update layout with manual ticks and custom 'Now' at both axes, with annotation reinforcing "Now"
132
  figure_handle.update_layout(
 
115
  color_index = (color_index + 1) % len(colors) # Update color index for the next trace
116
 
117
  # ----- Custom Tick and "Now" Label Logic -----
118
+ tick_offsets = [-180, -120, -60, 0, 60, 120, 180]
119
  tick_vals = [current_time + offset for offset in tick_offsets]
120
  tick_texts = [f"{offset:+}" if offset != 0 else "Now" for offset in tick_offsets]
121
 
122
+ # Replace +0 with "Now", rest: e.g., -180, -120, -60, Now, +60, +120, +180
123
  tick_texts = []
124
  for offset in tick_offsets:
125
  if offset == 0:
126
  tick_texts.append("Now")
127
  else:
128
+ # always sign and append (s), e.g. "+200(s)", "-100(s)"
129
+ tick_texts.append("{:+}(s)".format(offset))
130
 
131
  # Update layout with manual ticks and custom 'Now' at both axes, with annotation reinforcing "Now"
132
  figure_handle.update_layout(