nx_altair icon indicating copy to clipboard operation
nx_altair copied to clipboard

Nodes argument of draw_networkx_nodes not respected

Open erlebach opened this issue 3 years ago • 1 comments

HI,

The code below can be found in the method draw_networkx_nodes . I added a line that computes node_chart in the event a subset of nodes is specified via the nodelist argument. Without this line, the entire graph is drawn regardless of the nodelist argument.

   # ---------- Handle arguments ------------

    ###### node list argument
    if isinstance(nodelist, list):
        # Subset dataframe.
        df_nodes = df_nodes.loc[nodelist]
        # Build a chart (GE)  <<<<< ADDED THESE TWO LINES
        node_chart = alt.Chart(df_nodes)

erlebach avatar May 12 '21 03:05 erlebach