Add whitespace to GraphViz HTML for readability

This commit is contained in:
Daniel Rojas 2020-08-13 08:29:07 +02:00
parent 94faec536e
commit e3fb39f5ae
2 changed files with 41 additions and 39 deletions

View File

@ -192,12 +192,14 @@ class Harness:
wirehtml.append(' </tr>') wirehtml.append(' </tr>')
bgcolors = ['#000000'] + get_color_hex(connection_color, pad=pad) + ['#000000'] bgcolors = ['#000000'] + get_color_hex(connection_color, pad=pad) + ['#000000']
wirehtml.append(f'<tr><td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w{i}" height="{(2 * len(bgcolors))}">') wirehtml.append(f' <tr>')
wirehtml.append(f' <td colspan="3" border="0" cellspacing="0" cellpadding="0" port="w{i}" height="{(2 * len(bgcolors))}">')
wirehtml.append(' <table cellspacing="0" cellborder="0" border="0">') wirehtml.append(' <table cellspacing="0" cellborder="0" border="0">')
for j, bgcolor in enumerate(bgcolors[::-1]): # Reverse to match the curved wires when more than 2 colors for j, bgcolor in enumerate(bgcolors[::-1]): # Reverse to match the curved wires when more than 2 colors
wirehtml.append(f' <tr><td colspan="3" cellpadding="0" height="2" bgcolor="{bgcolor if bgcolor != "" else wv_colors.default_color}" border="0"></td></tr>') wirehtml.append(f' <tr><td colspan="3" cellpadding="0" height="2" bgcolor="{bgcolor if bgcolor != "" else wv_colors.default_color}" border="0"></td></tr>')
wirehtml.append(' </table>') wirehtml.append(' </table>')
wirehtml.append('</td></tr>') wirehtml.append(' </td>')
wirehtml.append(' </tr>')
if(cable.category == 'bundle'): # for bundles individual wires can have part information if(cable.category == 'bundle'): # for bundles individual wires can have part information
# create a list of wire parameters # create a list of wire parameters
wireidentification = [] wireidentification = []

View File

@ -48,7 +48,7 @@ def nested_html_table(rows):
html.append(' </td></tr>') html.append(' </td></tr>')
elif row is not None: elif row is not None:
html.append(' <tr><td>') html.append(' <tr><td>')
html.append(row) html.append(f' {row}')
html.append(' </td></tr>') html.append(' </td></tr>')
html.append('</table>') html.append('</table>')
return html return html