class_docstr: A connected graph of Vertex/Edge objects. A GraphBase is a *component* of a Graph that contains a connected set of Vertex and Edges.
  
  Attributes:
      verticesPoset (Poset[Vertex]): the partially ordered set of vertices of the graph.
      edgesPoset (Poset[Edge]): the partially ordered set of edges of the graph.
      loops (set[Edge]): the set of *loop* edges (of degree 0).
      directed (bool): indicates if the graph is considered *oriented* or not.
class_docstr_tok: ["A","connected","graph","of","Vertex\/Edge","objects",".","A","GraphBase","is","a","*","component","*","of","a","Graph","that","contains","a","connected","set","of","Vertex","and","Edges",".","Attributes",":","verticesPoset","(","Poset","[","Vertex","]",")",":","the","partially","ordered","set","of","vertices","of","the","graph",".","edgesPoset","(","Poset","[","Edge","]",")",":","the","partially","ordered","set","of","edges","of","the","graph",".","loops","(","set","[","Edge","]",")",":","the","set","of","*","loop","*","edges","(","of","degree","0",")",".","directed","(","bool",")",":","indicates","if","the","graph","is","considered","*","oriented","*","or","not","."]
docstr: remove Vertex x and all associated edges.
docstr_tok: ["remove","Vertex","x","and","all","associated","edges","."]
code: def remove_vertex(self, x):
      """
      remove Vertex x and all associated edges.
      """
      if x not in self.verticesPoset:
          return
      vertices = (
          x.neighbors()
      )  # get all neighbor vertices to check paths
      edges = x.detach()  # remove the edges from x and neighbors list
      # now we need to check if all neighbors are still connected,
      # and it is sufficient to check if one of them is connected to
      # all others:
      v0 = vertices.pop(0)
      for v in vertices:
          if not self.path(v0, v):
              # repair everything and raise exception if not connected:
              for e in edges:
                  e.attach()
              raise ValueError(x)
      # remove edges and vertex from internal sets:
      for e in edges:
          self.edgesPoset.remove(e)
      x = self.verticesPoset.remove(x)
      x.component = None
      return x
  
imports: from graphistry.layout.utils import Poset
label_desc: Use image node_id 7 for calling the GraphBase obj's underlying member method code with example usage: obj.remove_vertex(x) and returns: x