Spaces:
Running
Running
Update timeline_generator.py
Browse files- timeline_generator.py +3 -5
timeline_generator.py
CHANGED
@@ -79,7 +79,8 @@ def generate_timeline_diagram(json_input: str, output_format: str) -> str:
|
|
79 |
shape='plaintext',
|
80 |
fontsize='18',
|
81 |
fontweight='bold',
|
82 |
-
fontcolor=base_color
|
|
|
83 |
)
|
84 |
|
85 |
total_events = len(events)
|
@@ -148,10 +149,7 @@ def generate_timeline_diagram(json_input: str, output_format: str) -> str:
|
|
148 |
penwidth='2'
|
149 |
)
|
150 |
|
151 |
-
#
|
152 |
-
if title:
|
153 |
-
first_event_id = events[0].get('id', 'event_0')
|
154 |
-
dot.edge('title', first_event_id, style='invis')
|
155 |
|
156 |
# Set the layout engine to handle fixed positions
|
157 |
dot.engine = 'neato'
|
|
|
79 |
shape='plaintext',
|
80 |
fontsize='18',
|
81 |
fontweight='bold',
|
82 |
+
fontcolor=base_color,
|
83 |
+
pos="6,2!" # Centered at top (adjust x-coordinate based on timeline width)
|
84 |
)
|
85 |
|
86 |
total_events = len(events)
|
|
|
149 |
penwidth='2'
|
150 |
)
|
151 |
|
152 |
+
# No need to connect title to events - it stays at the top independently
|
|
|
|
|
|
|
153 |
|
154 |
# Set the layout engine to handle fixed positions
|
155 |
dot.engine = 'neato'
|