benediktstroebl commited on
Commit
6102327
·
1 Parent(s): 74258c3

headline fix

Browse files
Files changed (1) hide show
  1. utils/viz.py +5 -5
utils/viz.py CHANGED
@@ -123,19 +123,19 @@ def create_flow_chart(steps):
123
  assessment = analysis.get('assessment', 'No assessment available.')
124
  success = analysis.get('success', True) # Assuming True if not specified
125
  action_type = analysis.get('action_type', 'other') # Default to 'other' if not specified
126
- step_outline = analysis.get('step_outline', '')
127
 
128
  # Set node color and shape based on attributes
129
  node_colors.append(color_map[success])
130
  node_shapes.append(shape_map.get(action_type, 'circle'))
131
 
132
  # Wrap text to improve readability
133
- wrapped_description = '<br>'.join(textwrap.wrap(description, width=50))
134
- wrapped_assessment = '<br>'.join(textwrap.wrap(assessment, width=50))
135
- wrapped_outline = textwrap.shorten(step_outline, width=30, placeholder='')
136
  wrapped_outline = '' if wrapped_outline == '' else f": {wrapped_outline}"
137
 
138
- node_text_outline = '' if wrapped_outline == '' else f":<br>{textwrap.shorten(step_outline, width=30, placeholder='')}"
139
  node_text.append(f"Step {i+1}{node_text_outline}")
140
 
141
  # Create formatted hover text without indentation
 
123
  assessment = analysis.get('assessment', 'No assessment available.')
124
  success = analysis.get('success', True) # Assuming True if not specified
125
  action_type = analysis.get('action_type', 'other') # Default to 'other' if not specified
126
+ step_headline = analysis.get('headline', '')
127
 
128
  # Set node color and shape based on attributes
129
  node_colors.append(color_map[success])
130
  node_shapes.append(shape_map.get(action_type, 'circle'))
131
 
132
  # Wrap text to improve readability
133
+ wrapped_description = '<br>'.join(textwrap.wrap(description, width=90, max_lines=10))
134
+ wrapped_assessment = '<br>'.join(textwrap.wrap(assessment, width=90, max_lines=10))
135
+ wrapped_outline = textwrap.shorten(step_headline, width=30, placeholder='')
136
  wrapped_outline = '' if wrapped_outline == '' else f": {wrapped_outline}"
137
 
138
+ node_text_outline = '' if wrapped_outline == '' else f":<br>{textwrap.shorten(step_headline, width=30, placeholder='')}"
139
  node_text.append(f"Step {i+1}{node_text_outline}")
140
 
141
  # Create formatted hover text without indentation