A Sankey diagram is a type of flow chart used to visualize the distribution or movement of quantities through a system. Named after Captain Matthew Sankey, who first used it in 1898 to depict energy efficiency in steam engines, the diagram uses arrows or paths whose widths are proportional to the quantity they represent. This makes Sankey diagrams particularly effective for showing how resources, energy, information etc, are allocated across categories. They are especially useful for identifying dominant flows, bottlenecks, or imbalances within a process or dataset.
It occured to be that it might be an interesting way to display the breakdown of marks in an exam paper.
This Sankey diagram provides a visual breakdown of how marks were distributed across the A2 Component 2 (2023) Physics paper. It begins with a single “Total Marks” block, which then splits into individual physics topics, such as Circular Motion, Electric Fields, and Nuclear Decay. Each topic node flows into different styles of questions—Calculation, Explanation, Graphing/Data, or Recall—based on how the marks were awarded.
The diagram makes it easy to see which topics carried the most weight (e.g., Oscillations and Electric Fields received high totals) and which styles of questions were most common across the paper. Calculation-heavy topics dominate the assessment (obviously), while Graphing/Data and Recall play smaller but still significant roles.
Show the code
# Install if neededlibrary(networkD3)# Define nodes with Total Marks firstnodes <-data.frame(name =c("Total Marks","Circular Motion", "Gravitational Fields", "Electric Fields", "Capacitance","Magnetic Fields", "Nuclear Decay", "Nuclear Energy", "Thermodynamics","Oscillations", "Astrophysics", "Data Analysis","Calculation", "Explanation", "Graphing/Data"))# Define total marks per topic (names MUST match exactly with nodes$name)topic_totals <-c(8, # Circular Motion7, # Gravitational Fields9, # Electric Fields8, # Capacitance7, # Magnetic Fields8, # Nuclear Decay8, # Nuclear Energy9, # Thermodynamics9, # Oscillations9, # Astrophysics8# Data Analysis)# Topics names must align with node indices 1–11topic_links <-data.frame(source =0,target =1:11,value = topic_totals)# Style links from topics (1–11) to styles (12–14)style_links <-data.frame(source =c(1, 1, # Circular Motion2, 2, # Gravitational Fields3, 3, # Electric Fields4, 4, # Capacitance5, 5, # Magnetic Fields6, 6, # Nuclear Decay7, 7, # Nuclear Energy8, 8, # Thermodynamics9, 9, # Oscillations10,10, # Astrophysics11,11# Data Analysis ),target =c(12, 13,12, 13,12, 14,14, 13,12, 13,12, 13,12, 13,12, 13,12, 13,12, 13,14, 13 ),value =c(6, 2,5, 2,5, 4,5, 3,5, 2,4, 4,6, 2,5, 4,7, 2,5, 4,6, 2 ))# Combine both sets of linkslinks <-rbind(topic_links, style_links)# Draw Sankey diagramsankeyNetwork(Links = links, Nodes = nodes, Source ="source",Target ="target", Value ="value", NodeID ="name",fontSize =12, nodeWidth =30,sinksRight =FALSE)