Skip to content

Commit dbc836d

Browse files
committed
✨ Add node.set_size() and node.size()
1 parent 7e737c3 commit dbc836d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pynode_next/node.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, id=None, value=None):
1818

1919
self._incident_edges = []
2020
self._color = Color.DARK_GREY
21-
21+
self._size = 12
2222
self._attrs = {}
2323

2424
self._labels = {}
@@ -36,6 +36,16 @@ def value(self):
3636
"""Returns the node's value."""
3737
return self._value
3838

39+
def set_size(self, size=12):
40+
"""Sets the size of a node"""
41+
self._size = size
42+
core.ax(lambda x: x.node(self._id).size(size))
43+
return self
44+
45+
def size(self):
46+
"""Returns the node's size"""
47+
return self._size
48+
3949
def set_color(self, color=Color.DARK_GREY):
4050
"""Sets the node's color to the Color object specified."""
4151
self._color = color

0 commit comments

Comments
 (0)