Skip to content

Commit

Permalink
✨ add edge.set_weight_style()
Browse files Browse the repository at this point in the history
  • Loading branch information
ehne committed Aug 14, 2021
1 parent 3985034 commit becb607
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pynode_next/edge.py
Expand Up @@ -84,6 +84,18 @@ def weight(self):
"""Returns the edge's weight. Returns an empty string if weight wasn't defined at init and hasn't been changed since."""
return self._weight

def set_weight_style(self, size=10, color=Color.GREY, outline=None):
"""Sets the edge's weight text style. These styles are not saved."""
if outline != None:
print("set_weight_style(outline) is not supported by PyNode_Next")

core.ax(
lambda x: self._dispatch_wrapper(
x, {"labels": {1: {"color": str(color), "size": size}}}
)
)
return self

def set_directed(self, directed=True):
"""Sets whether or not the edge is directed"""
self._directed = directed
Expand Down

0 comments on commit becb607

Please sign in to comment.