Skip to content

Commit 8aed324

Browse files
committed
🐛 fix #37 edge.width() returns width not weight now
1 parent fd37b7a commit 8aed324

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pynode_next/edge.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def __init__(self, source, target, weight="", directed=False):
1212

1313
self._weight = weight
1414

15-
self._thickness = 2
15+
self._width = 2
1616
self._priority = 0
1717
self._color = Color.LIGHT_GREY
1818

@@ -111,15 +111,15 @@ def directed(self):
111111
"""Returns whether or not the edge is directed"""
112112
return self._directed
113113

114-
def set_width(self, weight=2):
114+
def set_width(self, width=2):
115115
"""Sets the thickness of the edge."""
116-
self._thickness = weight
117-
self.__ax(lambda x: self._dispatch_wrapper(x, {"thickness": weight}))
116+
self._width = width
117+
self.__ax(lambda x: self._dispatch_wrapper(x, {"thickness": width}))
118118
return self
119119

120120
def width(self):
121121
"""Returns the thickness of the edge."""
122-
return self._weight
122+
return self._width
123123

124124
def set_priority(self, value):
125125
"""Sets the edge's priority value."""
@@ -134,7 +134,7 @@ def highlight(self, color=None, width=None):
134134
if color is None:
135135
color = self._color
136136
if width is None:
137-
width = self._thickness * 2
137+
width = self._width * 2
138138

139139
self.__ax(
140140
lambda x: self._dispatch_wrapper(
@@ -145,7 +145,7 @@ def highlight(self, color=None, width=None):
145145
pause(500)
146146
self.__ax(
147147
lambda x: self._dispatch_wrapper(
148-
x, {"color": str(self._color), "thickness": self._thickness}
148+
x, {"color": str(self._color), "thickness": self._width}
149149
)
150150
)
151151
return self
@@ -196,7 +196,7 @@ def _data(self):
196196
"target": str(self._target),
197197
"directed": self._directed,
198198
"labels": {1: {"text": str(self._weight)}},
199-
"thickness": self._thickness,
199+
"thickness": self._width,
200200
}
201201
}
202202
}

0 commit comments

Comments
 (0)