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: add edge e. At least one of its vertex must belong to the graph, the other being added automatically.
docstr_tok: ["add","edge","e.","At","least","one","of","its","vertex","must","belong","to","the","graph",",","the","other","being","added","automatically","."]
code: def add_edge(self, e):
      """
      add edge e. At least one of its vertex must belong to the graph, the other being added automatically.
      """
      if e in self.edgesPoset:
          return self.edgesPoset.get(e)
      x = e.v[0]
      y = e.v[1]
      if not ((x in self.verticesPoset) or (y in self.verticesPoset)):
          raise ValueError("unconnected edge")
      x = self.verticesPoset.add(x)
      y = self.verticesPoset.add(y)
      e.v = (x, y)
      e.attach()
      e = self.edgesPoset.add(e)
      x.component = self
      y.component = self
      if e.degree == 0:
          self.loops.add(e)
      return e
  
imports: from graphistry.layout.utils import Poset
label_desc: Use image node_id 5 for calling the GraphBase obj's underlying member method code with example usage: obj.add_edge(e) and returns: e, self