Bläddra i källkod

Verify Edge attributes exist before setting

pull/96/head
Ryan Miller 4 år sedan
förälder
incheckning
40ac0edc68
1 ändrade filer med 7 tillägg och 4 borttagningar
  1. +7
    -4
      diagrams/__init__.py

+ 7
- 4
diagrams/__init__.py Visa fil

@@ -436,10 +436,13 @@ class Edge:
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"]]):


Laddar…
Avbryt
Spara