diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py
index c92053e..d47aa04 100644
--- a/src/wireviz/Harness.py
+++ b/src/wireviz/Harness.py
@@ -59,40 +59,27 @@ class Harness:
for key, connector in self.connectors.items():
if connector.category == 'ferrule':
- subtype = f', {connector.subtype}' if connector.subtype else ''
- color = wv_colors.translate_color(connector.color, self.color_mode) if connector.color else ''
- infostring = f'{connector.type}{subtype} {color}'
- # id = identification
- identification = [connector.manufacturer,
- f'MPN: {connector.manufacturer_part_number}' if connector.manufacturer_part_number else '',
- f'IPN: {connector.internal_part_number}' if connector.internal_part_number else '']
- identification = list(filter(None, identification))
- if(len(identification) > 0):
- infostring = f'{infostring}
'
- for attrib in identification:
- infostring = f'{infostring}{attrib}, '
- infostring = infostring[:-2] # remove trainling comma and space
+ rows = [[connector.type, connector.subtype, connector.color, '' if connector.color else None],
+ [connector.manufacturer,
+ f'MPN: {connector.manufacturer_part_number}' if connector.manufacturer_part_number else None,
+ f'IPN: {connector.internal_part_number}' if connector.internal_part_number else None]]
+ rows = [list(filter(None, row)) for row in rows] # remove missing attributes
- infostring_l = infostring if connector.ports_right else ''
- infostring_r = infostring if connector.ports_left else ''
+ html = '
'
+ for row in rows:
+ if len(row) > 0:
+ html = f'{html}'
+ for cell in row:
+ html = f'{html}| {cell} | '
+ html = f'{html}
|
'
+ html = f'{html}
'
- # INFO: Leaving this one as a string.format form because f-strings do not work well with triple quotes
- colorbar = f' | ' if connector.color else ''
- dot.node(key, shape='none',
- style='filled',
- margin='0',
- orientation='0' if connector.ports_left else '180',
- label='''<
+ if connector.color: # add color bar next to color info, if present
+ colorbar = f' | '
+ html = html.replace(' | ', colorbar)
-
- | {infostring_l} |
- {colorbar}
- {infostring_r} |
-
-
-
- >'''.format(infostring_l=infostring_l, infostring_r=infostring_r, colorbar=colorbar))
+ dot.node(key, label=f'<{html}>', shape='none', margin='0', style='filled', fillcolor='white')
else: # not a ferrule
identification = [connector.manufacturer,