Zsailer / nx_altair

Draw interactive NetworkX graphs with Altair
MIT License
224 stars 26 forks source link

Nodes argument of draw_networkx_nodes not respected #22

Open erlebach opened 3 years ago

erlebach commented 3 years ago

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)
T-Flet commented 5 months ago

This issue was fixed by PR https://github.com/Zsailer/nx_altair/pull/19, which is accepted in my fork (which was originally made precisely to have a version with fixes from issues and PRs).

The fork has now been detached and released as its own library, altair-nx, because the original has been inactive since 2020 and because the fork diverged from it considerably after a full code-base rework and the implementation of new features (e.g. curved edges, self loops, and much greater customisability).