code: def draw_networkx_labels(
      G=None,
      pos=None,
      chart=None,
      layer=None,
      nodelist=None,
      font_size=15,
      font_color="black",
      node_label="label",
      **kwargs,
  ):
      """Draw the nodes of the graph G.
  
      This draws only the nodes of the graph G.
  
      Parameters
      ----------
      G : graph
         A networkx graph
  
      pos : dictionary
         A dictionary with nodes as keys and positions as values.
         Positions should be sequences of length 2.
  
      nodelist : list, optional
         Draw only specified nodes (default G.nodes())
  
      font_size : scalar or string
         Size of nodes (default=15).  If an array is specified it must be the
         same length as nodelist.
  
      font_color : color string, or array of floats
         Node color. Can be a single color format string (default='r'),
         or a  sequence of colors with the same length as nodelist.
         If numeric values are specified they will be mapped to
         colors using the cmap and vmin,vmax parameters.  See
         matplotlib.scatter for more details.
  
      node_label : string
         The name of the node attribute to treat as a label.
  
      Returns
      -------
      viz: ``altair.Chart`` object
      """
      if layer is not None:
          node_chart = layer
  
      elif chart is not None:
          df_nodes = chart.layer[1].data
          node_chart = chart.layer[1]
  
      else:
          # Pandas dataframe of edges
          df_nodes = to_pandas_nodes(G, pos)
  
          # Build a chart
          node_chart = alt.Chart(df_nodes)
  
      marker_attrs = {}
      encoded_attrs = {}
  
      # ---------- Handle arguments ------------
  
      ###### node list argument
      if isinstance(nodelist, list):
          # Subset dataframe.
          df_nodes = df_nodes.loc[nodelist]
  
      elif nodelist is not None:
          raise Exception("nodelist must be a list or None.")
  
      ###### Node size
      if isinstance(font_size, str):
          encoded_attrs["size"] = alt.Size(font_size, legend=None)
  
      elif isinstance(font_size, int):
          marker_attrs["size"] = font_size
  
      else:
          raise Exception("node_size must be a string or int.")
  
      ###### node_color
      if not isinstance(font_color, str):
          raise Exception("node_color must be a string.")
  
      if font_color in df_nodes.columns:
          encoded_attrs["fill"] = font_color
  
      else:
          marker_attrs["fill"] = font_color
  
      # ---------- Construct visualization ------------
  
      node_chart = node_chart.mark_text(
          baseline="middle", **marker_attrs
      ).encode(
          x=alt.X(
              "x", axis=alt.Axis(grid=False, labels=False, ticks=False)
          ),
          y=alt.Y(
              "y", axis=alt.Axis(grid=False, labels=False, ticks=False)
          ),
          text=node_label,
          **encoded_attrs,
      )
  
      if chart is not None:
          chart.layer[1] = node_chart
  
      return node_chart
  
file_path: nx_altair/nx_altair/draw_altair.py
imports: import numpy
  import altair
  import networkx
  from .core import to_pandas_edges, to_pandas_edges_arrows, to_pandas_nodes
  from ._utils import is_arraylike
label_desc: Use image node_id 4 for calling a global function with example usage: draw_networkx_labels(G, pos, chart, layer, nodelist, font_size, font_color, node_label) and returns: node_chart