class_docstr: Graph is high-level Element representing both nodes and edges.
  A Graph may be defined in an abstract form representing just
  the abstract edges between nodes and optionally may be made
  concrete by supplying a Nodes Element defining the concrete
  positions of each node. If the node positions are supplied
  the EdgePaths (defining the concrete edges) can be inferred
  automatically or supplied explicitly.
  
  The constructor accepts regular columnar data defining the edges
  or a tuple of the abstract edges and nodes, or a tuple of the
  abstract edges, nodes, and edgepaths.
class_docstr_tok: ["Graph","is","high-level","Element","representing","both","nodes","and","edges",".","A","Graph","may","be","defined","in","an","abstract","form","representing","just","the","abstract","edges","between","nodes","and","optionally","may","be","made","concrete","by","supplying","a","Nodes","Element","defining","the","concrete","positions","of","each","node",".","If","the","node","positions","are","supplied","the","EdgePaths","(","defining","the","concrete","edges",")","can","be","inferred","automatically","or","supplied","explicitly",".","The","constructor","accepts","regular","columnar","data","defining","the","edges","or","a","tuple","of","the","abstract","edges","and","nodes",",","or","a","tuple","of","the","abstract","edges",",","nodes",",","and","edgepaths","."]
code: def __init__(self, data, kdims=None, vdims=None, **params):
      if isinstance(data, tuple):
          data = data + (None,) * (3 - len(data))
          edges, nodes, edgepaths = data
      elif isinstance(data, type(self)):
          edges, nodes, edgepaths = data, data.nodes, data._edgepaths
      else:
          edges, nodes, edgepaths = data, None, None
  
      if nodes is not None:
          node_info = None
          if isinstance(nodes, self.node_type):
              pass
          elif not isinstance(nodes, Dataset) or nodes.ndims == 3:
              nodes = self.node_type(nodes)
          else:
              node_info = nodes
              nodes = None
      else:
          node_info = None
      if edgepaths is not None and not isinstance(
          edgepaths, self.edge_type
      ):
          edgepaths = self.edge_type(edgepaths)
  
      self._nodes = nodes
      self._edgepaths = edgepaths
      super().__init__(edges, kdims=kdims, vdims=vdims, **params)
      if node_info is not None:
          self._add_node_info(node_info)
      self._validate()
  
imports: from collections import defaultdict
  from types import FunctionType
  import numpy
  import pandas
  import param
  from ..core import Dataset, Dimension, Element2D
  from ..core.accessors import Redim
  from ..core.operation import Operation
  from ..core.util import is_dataframe, max_range, search_indices
  from .chart import Points
  from .path import Path
  from .util import circular_layout, connect_edges_pd, connect_tri_edges_pd, quadratic_bezier, split_path
label_desc: Use image node_id 1 to create a new Graph object from inherited base classes: Dataset, Element2D with example: obj = Graph(data, kdims, vdims)