code: def to_chart(G, pos):
      """Construct a single Altair Chart for"""
      # Build node layer
      node_df = to_pandas_nodes(G, pos)
      node_layer = alt.Chart(node_df)
  
      # Build edge layer
      edge_df = to_pandas_edges(G, pos)
      edge_layer = alt.Chart(edge_df)
  
      # Layer chart
      chart = alt.LayerChart(layer=(edge_layer, node_layer))
      chart = despine(chart)
      return chart
  
file_path: nx_altair/nx_altair/core.py
imports: import pandas
  import networkx
  import altair
  from ._utils import despine
label_desc: Use image node_id 4 for calling a global function with example usage: to_chart(G, pos) and returns: chart