code: def clear(self):
          
          
          
          dict.clear(self)
          self.nodes = []
          self.edges = []
          self.root  = None
          
          self.layout.i = 0
          self.alpha = 0
docs: Remove nodes and edges and reset the layout.