Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify Edge attributes exist before setting #96

Merged
merged 1 commit into from
Apr 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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