liveBook · Manning

sankeyNetwork() function

As explained in Statistics Slam Dunk

The sankeyNetwork() function is a networkD3 function that constructs an interactive Sankey network visualization from nodes and links.

sankeyNetwork() renders an interactive Sankey diagram from node and link data. Nodes identify categories; links connect source nodes to target nodes and carry flow quantities. section 3.7

Prepare the visualization in four practical steps:

  • Hover over nodes or links to highlight connections and inspect names and flow quantities. section 3.7

NBA draft flow

An NBA draft analysis links birthplace, college attendance, age, position, pick segment, and win-share category. Counts from adjacent groupings supply link values, while the resulting chart shows how quantities move through the serial process.

How Statistics Slam Dunk covers it

How deep it goes
Explains node-link preparation, required mappings, display settings, and hover behavior without covering implementation internals.
Examples
Uses NBA draft data spanning birthplace, college attendance, age, position, pick segment, and win shares.
What it assumes
Assumes familiarity with R data frames and categorical counts while demonstrating the required Sankey data structure.
What you can do after
Build it from scratch by preparing nodes and links, mapping their columns, and rendering an interactive Sankey visualization.
How it connects
Connects Sankey diagrams with data frames, networkD3, dplyr, categorical variables, and flow quantities.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.