Draws the edge as a line with the given stroke and strokewidth (increased with Edge.weight). Override this method in a subclass for custom drawing.
(self, weighted=False, directed=False)
| 251 | weight = property(_get_weight, _set_weight) |
| 252 | |
| 253 | def draw(self, weighted=False, directed=False): |
| 254 | """ Draws the edge as a line with the given stroke and strokewidth (increased with Edge.weight). |
| 255 | Override this method in a subclass for custom drawing. |
| 256 | """ |
| 257 | w = weighted and self.weight or 0 |
| 258 | line( |
| 259 | self.node1.x, |
| 260 | self.node1.y, |
| 261 | self.node2.x, |
| 262 | self.node2.y, stroke=self.stroke, strokewidth=self.strokewidth+w) |
| 263 | if directed: |
| 264 | self.draw_arrow(stroke=self.stroke, strokewidth=self.strokewidth+w) |
| 265 | |
| 266 | def draw_arrow(self, **kwargs): |
| 267 | """ Draws the direction of the edge as an arrow on the rim of the receiving node. |
nothing calls this directly
no test coverage detected