Skip to content

Commit 23b60b8

Browse files
committed
✨ add node.set_priority and node.priority
1 parent 7641f6e commit 23b60b8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pynode_next/node.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def __init__(self, id=None, value=None):
1919
self._incident_edges = []
2020
self._color = Color.DARK_GREY
2121
self._size = 12
22+
self._priority = 0
2223
self._attrs = {}
23-
2424
self._labels = {}
2525

2626
def id(self):
@@ -52,6 +52,15 @@ def size(self):
5252
"""Returns the node's size"""
5353
return self._size
5454

55+
def set_priority(self, value):
56+
"""Sets a node's priority value."""
57+
self._priority = value
58+
return self
59+
60+
def priority(self):
61+
"""Gets a node's priority"""
62+
return self._priority
63+
5564
def set_color(self, color=Color.DARK_GREY):
5665
"""Sets the node's color to the Color object specified."""
5766
self._color = color
@@ -116,7 +125,7 @@ def set_label_style(self, size=10, color=Color.GREY, outline=None, label_id=None
116125
label = ["tr", "tl"][label_id]
117126
core.ax(lambda x: x.node(self._id).label(label).size(size).color(str(color)))
118127
return self
119-
128+
120129
def incident_edges(self):
121130
"""Returns the incident edges through the node."""
122131
return list(self._incident_edges)

0 commit comments

Comments
 (0)