Skip to content

Commit

Permalink
Fine-tune cable appearance
Browse files Browse the repository at this point in the history
Add hack to make manufacturer / part number row have vertical separators, to be visually consistent with connectors.

In the future, connectors will have to be modified to be HTML tables instead of GraphViz record nodes, in order to support colored bands for the connector, or individual pins (#53). When this is implemented, a cleaner solution should be found for both connectors and cables.
  • Loading branch information
formatc1702 committed Jul 2, 2020
1 parent 9ed8997 commit 093b04a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/wireviz/Harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ def create_graph(self):
if cable.show_name:
html = f'{html}<tr><td colspan="{len(attributes)}">{cable.name}</td></tr>'
if(len(identification) > 0): # print an identification row if values specified
html = f'{html}<tr><td colspan="{len(attributes)}"><table border="0" cellspacing="0" cellpadding="0" cellborder="0"><tr>'
for attrib in identification:
html = f'{html}<td>{attrib}</td>'
html = f'{html}<tr><td colspan="{len(attributes)}" cellpadding="0"><table border="0" cellspacing="0" cellpadding="3" cellborder="1"><tr>'
for attrib in identification[0:-1]:
html = f'{html}<td sides="R">{attrib}</td>' # all columns except last have a border on the right (sides="R")
if len(identification) > 0:
html = f'{html}<td border="0">{identification[-1]}</td>' # last column has no border on the right because the enclosing table borders it
html = f'{html}</tr></table></td></tr>' # end identification row
html = f'{html}<tr>' # attribute row
for attrib in attributes:
Expand Down

0 comments on commit 093b04a

Please sign in to comment.