From becb607a631452c31e54fbaa298940c5dc4ed1d3 Mon Sep 17 00:00:00 2001 From: Darcy LF Date: Sat, 14 Aug 2021 11:40:17 +1000 Subject: [PATCH] :sparkles: add edge.set_weight_style() --- pynode_next/edge.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pynode_next/edge.py b/pynode_next/edge.py index 0ee22b3..173ec7c 100644 --- a/pynode_next/edge.py +++ b/pynode_next/edge.py @@ -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