We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 07b8b3c + 40ac0ed commit cff498eCopy full SHA for cff498e
diagrams/__init__.py
@@ -436,10 +436,13 @@ def __init__(
436
for k, v in self._default_edge_attrs.items():
437
self._attrs[k] = v
438
439
- # Graphviz complaining about using label for edges, so replace it with xlabel.
440
- self._attrs["xlabel"] = label
441
- self._attrs["color"] = color
442
- self._attrs["style"] = style
+ if label:
+ # Graphviz complaining about using label for edges, so replace it with xlabel.
+ self._attrs["xlabel"] = label
+ if color:
443
+ self._attrs["color"] = color
444
+ if style:
445
+ self._attrs["style"] = style
446
self._attrs.update(attrs)
447
448
def __sub__(self, other: Union["Node", "Edge", List["Node"]]):
0 commit comments