code: def layout_igraph(
      self: Plottable,
      layout: str,
      directed: Optional[bool] = None,
      use_vids: bool = False,
      bind_position: bool = True,
      x_out_col: str = "x",
      y_out_col: str = "y",
      play: Optional[int] = 0,
      params: dict = {},
  ) -> Plottable:
      """Compute graph layout using igraph algorithm. For a list of layouts, see layout_algs or igraph documentation.
  
      :param layout: Name of an igraph.Graph.layout method like `sugiyama`
      :type layout: str
  
      :param directed: During the to_igraph conversion, whether to be directed. If None, try directed and then undirected. (default None)
      :type directed: Optional[bool]
  
      :param use_vids: Whether to use igraph vertex ids (non-negative integers) or arbitary node ids (False, default)
      :type use_vids: bool
  
      :param bind_position: Whether to call bind(point_x=, point_y=) (default True)
      :type bind_position: bool
  
      :param x_out_col: Attribute to write x position to. (default 'x')
      :type x_out_col: str
  
      :param y_out_col: Attribute to write x position to. (default 'y')
      :type y_out_col: str
  
      :param play: If defined, set settings(url_params={'play': play}). (default 0)
      :type play: Optional[str]
  
      :param params: Any named parameters to pass to the underlying igraph method
      :type params: dict
  
      :returns: Plotter
      :rtype: Plotter
  
      **Example: Sugiyama layout**
          ::
  
              import graphistry, pandas as pd
              edges = pd.DataFrame({'s': ['a','b','c','d'], 'd': ['b','c','d','e']})
              g = graphistry.edges(edges, 's', 'd')
              g2 = g.layout_igraph('sugiyama')
              assert 'x' in g2._nodes
              g2.plot()
  
      **Example: Change which column names are generated**
          ::
  
              import graphistry, pandas as pd
              edges = pd.DataFrame({'s': ['a','b','c','d'], 'd': ['b','c','d','e']})
              g = graphistry.edges(edges, 's', 'd')
              g2 = g.layout_igraph('sugiyama', x_out_col='my_x', y_out_col='my_y')
              assert 'my_x' in g2._nodes
              assert g2._point_x == 'my_x'
              g2.plot()
  
      **Example: Pass parameters to layout methods - Sort nodes by degree**
          ::
  
              import graphistry, pandas as pd
              edges = pd.DataFrame({'s': ['a','b','c','d'], 'd': ['b','c','d','e']})
              g = graphistry.edges(edges, 's', 'd')
              g2 = g.get_degrees()
              assert 'degree' in g._nodes.columns
              g3 = g.layout_igraph('sugiyama', params={'layers': 'degree'})
              g3.plot()
      """
  
      try:
          ig = self.to_igraph(
              directed=True if directed is None else directed,
              use_vids=use_vids,
          )
          layout_df = pd.DataFrame(
              [x for x in ig.layout(layout, **params)]
          )
      except NotImplementedError as e:
          if directed is None:
              ig = self.to_igraph(directed=False, use_vids=use_vids)
              layout_df = pd.DataFrame(
                  [x for x in ig.layout(layout, **params)]
              )
          else:
              raise e
  
      g2 = self.from_igraph(ig)
      g2 = g2.nodes(
          g2._nodes.assign(
              **{x_out_col: layout_df[0], y_out_col: layout_df[1]}
          )
      )
      if bind_position:
          g2 = g2.bind(point_x=x_out_col, point_y=y_out_col)
      if play is not None:
          g2 = g2.layout_settings(play=play)
      return g2
  
file_path: pygraphistry/graphistry/plugins/igraph.py
imports: import pandas
  from typing import Any, List, Optional
  from graphistry.constants import NODE
  from graphistry.Plottable import Plottable
  from graphistry.util import setup_logger
label_desc: Use image node_id 4 for calling a global function with example usage: layout_igraph(layout, directed, use_vids, bind_position, x_out_col, y_out_col, play, params) and returns: g2