Skip to content

Commit

Permalink
Merge pull request #96 from RyanMillerC/fix-masked-edge-attrs
Browse files Browse the repository at this point in the history
Verify Edge attributes exist before setting
  • Loading branch information
mingrammer authored Apr 17, 2020
2 parents 07b8b3c + 40ac0ed commit cff498e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions diagrams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,13 @@ def __init__(
for k, v in self._default_edge_attrs.items():
self._attrs[k] = v

# Graphviz complaining about using label for edges, so replace it with xlabel.
self._attrs["xlabel"] = label
self._attrs["color"] = color
self._attrs["style"] = style
if label:
# Graphviz complaining about using label for edges, so replace it with xlabel.
self._attrs["xlabel"] = label
if color:
self._attrs["color"] = color
if style:
self._attrs["style"] = style
self._attrs.update(attrs)

def __sub__(self, other: Union["Node", "Edge", List["Node"]]):
Expand Down

0 comments on commit cff498e

Please sign in to comment.