Skip to content

Commit 3e116c6

Browse files
committed
waterfall/cvo-waterfall: Add a title and 5-minute bars
1 parent ac83d98 commit 3e116c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

waterfall/cvo-waterfall.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060
last_stop = stop
6161

6262
print('<svg viewBox="0 0 {} {}" xmlns="http://www.w3.org/2000/svg">'.format(last_stop, y))
63+
duration = datetime.timedelta(seconds=last_stop)
64+
time_scale = 5
65+
for i in range(1 + int(last_stop // (time_scale*60))):
66+
print(' <line x1="{x}" x2="{x}" y1="0%" y2="100%" stroke="gray" style="stroke-opacity: 0.5;"><title>{minutes} minutes</title></line>'.format(
67+
x=i * time_scale * 60,
68+
minutes=i * time_scale))
6369
for rectangle in rectangles:
6470
print(' {}'.format(rectangle))
71+
print(' <text x="50%" y="20" text-anchor="middle">CVO manifests, duration {}</text>'.format(duration))
6572
print('</svg>')

0 commit comments

Comments
 (0)