class_docstr: A GraphItem displays graph information as
  a set of nodes connected by lines (as in 'graph theory', not 'graphics'). 
  Useful for drawing networks, trees, etc.
class_docstr_tok: ["A","GraphItem","displays","graph","information","as","a","set","of","nodes","connected","by","lines","(","as","in","'graph","theory","'",",","not","'graphics","'",")",".","Useful","for","drawing","networks",",","trees",",","etc","."]
docstr: Change the data displayed by the graph. 
  
  ==============  =======================================================================
  **Arguments:**
  pos             (N,2) array of the positions of each node in the graph.
  adj             (M,2) array of connection data. Each row contains indexes
                  of two nodes that are connected or None to hide lines
  pen             The pen to use when drawing lines between connected
                  nodes. May be one of:
               
                    * QPen
                    * a single argument to pass to pg.mkPen
                    * a record array of length M
                      with fields (red, green, blue, alpha, width). Note
                      that using this option may have a significant performance
                      cost.
                    * None (to disable connection drawing)
                    * 'default' to use the default foreground color.
               
  symbolPen       The pen(s) used for drawing nodes.
  symbolBrush     The brush(es) used for drawing nodes.
  ``**opts``      All other keyword arguments are given to
                  :func:`ScatterPlotItem.setData() <pyqtgraph.ScatterPlotItem.setData>`
                  to affect the appearance of nodes (symbol, size, brush,
                  etc.)
  ==============  =======================================================================
docstr_tok: ["Change","the","data","displayed","by","the","graph",".","==============","=======================================================================","*","*","Arguments",":","*","*","pos","(","N,2",")","array","of","the","positions","of","each","node","in","the","graph",".","adj","(","M,2",")","array","of","connection","data",".","Each","row","contains","indexes","of","two","nodes","that","are","connected","or","None","to","hide","lines","pen","The","pen","to","use","when","drawing","lines","between","connected","nodes",".","May","be","one","of",":","*","QPen","*","a","single","argument","to","pass","to","pg.mkPen","*","a","record","array","of","length","M","with","fields","(","red",",","green",",","blue",",","alpha",",","width",")",".","Note","that","using","this","option","may","have","a","significant","performance","cost",".","*","None","(","to","disable","connection","drawing",")","*","'default","'","to","use","the","default","foreground","color",".","symbolPen","The","pen","(","s",")","used","for","drawing","nodes",".","symbolBrush","The","brush","(","es",")","used","for","drawing","nodes",".","``","*","*","opts","``","All","other","keyword","arguments","are","given","to",":","func",":","`","ScatterPlotItem.setData","(",")","<","pyqtgraph.ScatterPlotItem.setData",">","`","to","affect","the","appearance","of","nodes","(","symbol",",","size",",","brush",",","etc",".",")","==============","======================================================================="]
code: def setData(self, **kwds):
      """
      Change the data displayed by the graph.
  
      ==============  =======================================================================
      **Arguments:**
      pos             (N,2) array of the positions of each node in the graph.
      adj             (M,2) array of connection data. Each row contains indexes
                      of two nodes that are connected or None to hide lines
      pen             The pen to use when drawing lines between connected
                      nodes. May be one of:
  
                        * QPen
                        * a single argument to pass to pg.mkPen
                        * a record array of length M
                          with fields (red, green, blue, alpha, width). Note
                          that using this option may have a significant performance
                          cost.
                        * None (to disable connection drawing)
                        * 'default' to use the default foreground color.
  
      symbolPen       The pen(s) used for drawing nodes.
      symbolBrush     The brush(es) used for drawing nodes.
      ``**opts``      All other keyword arguments are given to
                      :func:`ScatterPlotItem.setData() <pyqtgraph.ScatterPlotItem.setData>`
                      to affect the appearance of nodes (symbol, size, brush,
                      etc.)
      ==============  =======================================================================
      """
      if "adj" in kwds:
          self.adjacency = kwds.pop("adj")
          if (
              hasattr(self.adjacency, "__len__")
              and len(self.adjacency) == 0
          ):
              self.adjacency = None
          elif (
              self.adjacency is not None
              and self.adjacency.dtype.kind not in "iu"
          ):
              raise Exception(
                  "adjacency must be None or an array of either int or unsigned type."
              )
          self._update()
      if "pos" in kwds:
          self.pos = kwds["pos"]
          self._update()
      if "pen" in kwds:
          self.setPen(kwds.pop("pen"))
          self._update()
  
      if "symbolPen" in kwds:
          kwds["pen"] = kwds.pop("symbolPen")
      if "symbolBrush" in kwds:
          kwds["brush"] = kwds.pop("symbolBrush")
      self.scatter.setData(**kwds)
      self.informViewBoundsChanged()
  
file_path: pyqtgraph/pyqtgraph/graphicsItems/GraphItem.py
imports: import numpy
  from ..None import functions
  from ..None import getConfigOption
  from ..Qt import QtCore, QtGui
  from .GraphicsObject import GraphicsObject
  from .ScatterPlotItem import ScatterPlotItem
label_desc: Use image node_id 2 for calling the GraphItem obj's underlying member method code with example usage: obj.setData() without return types