class_docstr: Visual for displaying graphs or networks.
  
  Parameters
  ----------
  adjacency_mat : array or sparse
      The adjacency matrix of the graph.
  directed : bool
      Whether the graph is directed or not. If True, then this visual will
      draw arrows for the directed edges.
  layout : str
      They layout to use.
  animate : bool
      Whether or not to animate.
  line_color : str or :class:`vispy.color.colormap.ColorMap`
      The color to use for the edges.
  line_width : number
      The edge thickness.
  arrow_type : str
      The kind of arrow head to use. See :class:`vispy.visuals.ArrowHead`
      for more information.
  arrow_size : number
      The size of the arrow head.
  node_symbol : string
      The marker to use for nodes. See
      :class:`vispy.visuals.MarkersVisual` for more information.
  node_size : number
      The size of the node
  border_color : str or :class:`vispy.color.colormap.ColorMap`
      The border color for nodes.
  face_color : str or :class:`vispy.color.colormap.ColorMap`
      The face color for nodes.
  border_width : number
      The border size for nodes.
  
  See Also
  --------
  ArrowVisual, MarkersVisual
class_docstr_tok: ["Visual","for","displaying","graphs","or","networks",".","Parameters","--","--","--","--","--","adjacency_mat",":","array","or","sparse","The","adjacency","matrix","of","the","graph",".","directed",":","bool","Whether","the","graph","is","directed","or","not",".","If","True",",","then","this","visual","will","draw","arrows","for","the","directed","edges",".","layout",":","str","They","layout","to","use",".","animate",":","bool","Whether","or","not","to","animate",".","line_color",":","str","or",":","class",":","`","vispy.color.colormap.ColorMap","`","The","color","to","use","for","the","edges",".","line_width",":","number","The","edge","thickness",".","arrow_type",":","str","The","kind","of","arrow","head","to","use",".","See",":","class",":","`","vispy.visuals.ArrowHead","`","for","more","information",".","arrow_size",":","number","The","size","of","the","arrow","head",".","node_symbol",":","string","The","marker","to","use","for","nodes",".","See",":","class",":","`","vispy.visuals.MarkersVisual","`","for","more","information",".","node_size",":","number","The","size","of","the","node","border_color",":","str","or",":","class",":","`","vispy.color.colormap.ColorMap","`","The","border","color","for","nodes",".","face_color",":","str","or",":","class",":","`","vispy.color.colormap.ColorMap","`","The","face","color","for","nodes",".","border_width",":","number","The","border","size","for","nodes",".","See","Also","--","--","--","--","ArrowVisual",",","MarkersVisual"]
docstr: Set the data
  
  Parameters
  ----------
  adjacency_mat : ndarray | None
      The adjacency matrix.
  **kwargs : dict
      Keyword arguments to pass to the arrows.
docstr_tok: ["Set","the","data","Parameters","--","--","--","--","--","adjacency_mat",":","ndarray","|","None","The","adjacency","matrix",".","*","*","kwargs",":","dict","Keyword","arguments","to","pass","to","the","arrows","."]
code: def set_data(self, adjacency_mat=None, **kwargs):
      """Set the data
  
      Parameters
      ----------
      adjacency_mat : ndarray | None
          The adjacency matrix.
      **kwargs : dict
          Keyword arguments to pass to the arrows.
      """
      if adjacency_mat is not None:
          if adjacency_mat.shape[0] != adjacency_mat.shape[1]:
              raise ValueError("Adjacency matrix should be square.")
  
          self._adjacency_mat = adjacency_mat
  
      for k in self._arrow_attributes:
          if k in kwargs:
              translated = (
                  self._arrow_kw_trans[k]
                  if k in self._arrow_kw_trans
                  else k
              )
  
              setattr(self._edges, translated, kwargs.pop(k))
  
      arrow_kwargs = {}
      for k in self._arrow_kwargs:
          if k in kwargs:
              translated = (
                  self._arrow_kw_trans[k]
                  if k in self._arrow_kw_trans
                  else k
              )
  
              arrow_kwargs[translated] = kwargs.pop(k)
  
      node_kwargs = {}
      for k in self._node_kwargs:
          if k in kwargs:
              translated = (
                  self._node_kw_trans[k]
                  if k in self._node_kw_trans
                  else k
              )
  
              node_kwargs[translated] = kwargs.pop(k)
  
      if len(kwargs) > 0:
          raise TypeError(
              "%s.set_data() got invalid keyword arguments: %s"
              % (self.__class__.__name__, list(kwargs.keys()))
          )
  
      # some attributes should be set as properties
      node_properties = {}
      for k, v in list(node_kwargs.items()):
          if k in (self._node_properties_args):
              node_properties[k] = node_kwargs.pop(k)
  
      # The actual data is set in GraphVisual.animate_layout or
      # GraphVisual.set_final_layout
      self._arrow_data = arrow_kwargs
      self._node_data = node_kwargs
      self._node_properties = node_properties
  
      if not self._animate:
          self.set_final_layout()
  
file_path: vispy/vispy/visuals/graphs/graph.py
imports: from ..visual import CompoundVisual
  from ..line import ArrowVisual
  from ..markers import MarkersVisual
  from .None import layouts
label_desc: Use image node_id 12 for calling the GraphVisual obj's underlying member method code with example usage: obj.set_data(adjacency_mat) without return types