Skip to content

Commit

Permalink
✨ Add node.set_size() and node.size()
Browse files Browse the repository at this point in the history
  • Loading branch information
ehne committed Aug 9, 2021
1 parent 7e737c3 commit dbc836d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pynode_next/node.py
Expand Up @@ -18,7 +18,7 @@ def __init__(self, id=None, value=None):

self._incident_edges = []
self._color = Color.DARK_GREY

self._size = 12
self._attrs = {}

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

def set_size(self, size=12):
"""Sets the size of a node"""
self._size = size
core.ax(lambda x: x.node(self._id).size(size))
return self

def size(self):
"""Returns the node's size"""
return self._size

def set_color(self, color=Color.DARK_GREY):
"""Sets the node's color to the Color object specified."""
self._color = color
Expand Down

0 comments on commit dbc836d

Please sign in to comment.