Skip to content

Commit

Permalink
✨ added node.set_label_style()
Browse files Browse the repository at this point in the history
  • Loading branch information
ehne committed Aug 9, 2021
1 parent e50ff19 commit 7286d3a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pynode_next/node.py
Expand Up @@ -105,6 +105,18 @@ def set_label(self, value, label_id=0):
def label(self, label_id=0):
return self._labels[label_id]

def set_label_style(self, size=10, color=Color.GREY, outline=None, label_id=None):
"""Sets the style of any labels"""
if outline != None:
print("set_label_style(outline) is not supported by PyNode Next")
if label_id == None:
core.ax(lambda x: x.node(self._id).label('tr').size(size).color(str(color)))
core.ax(lambda x: x.node(self._id).label('tl').size(size).color(str(color)))
else:
label = ["tr", "tl"][label_id]
core.ax(lambda x: x.node(self._id).label(label).size(size).color(str(color)))
return self

def incident_edges(self):
"""Returns the incident edges through the node."""
return list(self._incident_edges)
Expand Down

0 comments on commit 7286d3a

Please sign in to comment.