# Energy flow diagram

> A one-page Sankey diagram for a university estates team: four energy sources flowing to five uses, with each band as wide as its GWh and labelled. The numbers are text and the bands are shapes, so a new year means editing both.

- The design, as a .vd file: https://getv.design/library/site-energy-sankey.vd
- Its page: https://getv.design/library/site-energy-sankey

## How it was made

Drafted from this prompt:

> A Sankey diagram of Northgate University's energy: 41 GWh a year from gas, grid electricity, rooftop solar and the heat network, flowing to heating, labs, lighting, IT and catering.

Then refined:

- Labelled each band with its GWh at the end where it meets its use.
- Widened the diagram and made it taller by putting the title on one line, so the one GWh solar bands are wide enough to carry a label.
- Made the bands more solid so the colours read against the dark background.

## Make it yours

- "Change the solar figure to 4 GWh for next year."
- "Add a sixth use called transport."
- "Colour the bands by use instead of by source."

## The source

```vd
version 12
kind design
title "Northgate energy flow"
$night = #0B1D2C
$grid = #3D8BFD
$solar = #FFC845
$gas = #F26B38
$heat = #C0392B
$ink = #F2F6FA
$mute = #9FB3C8
$rule = #2A4157
$k = 17
$ngap = 24
$m = 80

font head = "Exo 2"
  fallback "system-ui, sans-serif"
  face asset=exo-2-600 weight=600
  face asset=exo-2-700 weight=700

font body = "Titillium Web"
  fallback "system-ui, sans-serif"
  face asset=titillium-web-400 weight=400
  face asset=titillium-web-600 weight=600

asset exo-2-600 = font/woff2 hash=sha256-fd2112e53440975a4885179f3d09058787b97b711e7e141c55fcaecaf48fbcb6 bytes=17264 license=OFL
asset exo-2-700 = font/woff2 hash=sha256-96c87b1597aed754e0ad45970883774e851a390788e7fba7b3f49f8d1f6e5a6b bytes=17220 license=OFL
asset titillium-web-400 = font/woff2 hash=sha256-861b80b49d2a634d8746e2e45c672309d9ba69a2fdd95da2af034d7a1d09b3f9 bytes=12344 license=OFL
asset titillium-web-600 = font/woff2 hash=sha256-f356ff5613e1b6789a47ae3bd6b72fa6fb61d44493811bcb758fb4229b7a8bcb bytes=12116 license=OFL

frame page x=0 y=0 w=1920 h=1080 background=night
  text title x=$m y=44 w=1760 h=70 font=head size=56 weight=700 lineHeight=1.1 letterSpacing=-1 fill=ink
    "Heating takes half of our 41 GWh, and gas supplies most of it"
  text sub x=$m y=(@title.bottom + 14) w=1320 h=34 font=body size=26 fill=mute
    "Northgate University, energy in and out over a year, in GWh"

  vector band.gas.heating x=446 y=200 w=1054 h=216 view="446 200 1054 216" d="M 446 212 C 973.0 212 973.0 200 1500 200 L 1500 404 C 973.0 404 973.0 416 446 416 Z" fill=gas opacity=0.75
  vector band.gas.catering x=446 y=416 w=1054 h=216 view="446 416 1054 216" d="M 446 416 C 973.0 416 973.0 581 1500 581 L 1500 632 C 973.0 632 973.0 467 446 467 Z" fill=gas opacity=0.75
  vector band.gas.labs x=446 y=467 w=1054 h=223 view="446 467 1054 223" d="M 446 467 C 973.0 467 973.0 656 1500 656 L 1500 690 C 973.0 690 973.0 501 446 501 Z" fill=gas opacity=0.75
  vector band.heat.heating x=446 y=404 w=1054 h=240 view="446 404 1054 240" d="M 446 525 C 973.0 525 973.0 404 1500 404 L 1500 523 C 973.0 523 973.0 644 446 644 Z" fill=heat opacity=0.75
  vector band.grid.heating x=446 y=523 w=1054 h=179 view="446 523 1054 179" d="M 446 668 C 973.0 668 973.0 523 1500 523 L 1500 557 C 973.0 557 973.0 702 446 702 Z" fill=grid opacity=0.75
  vector band.grid.labs x=446 y=690 w=1054 h=114 view="446 690 1054 114" d="M 446 702 C 973.0 702 973.0 690 1500 690 L 1500 792 C 973.0 792 973.0 804 446 804 Z" fill=grid opacity=0.75
  vector band.grid.lighting x=446 y=804 w=1054 h=80 view="446 804 1054 80" d="M 446 804 C 973.0 804 973.0 833 1500 833 L 1500 884 C 973.0 884 973.0 855 446 855 Z" fill=grid opacity=0.75
  vector band.grid.it x=446 y=855 w=1054 h=121 view="446 855 1054 121" d="M 446 855 C 973.0 855 973.0 925 1500 925 L 1500 976 C 973.0 976 973.0 906 446 906 Z" fill=grid opacity=0.75
  vector band.solar.labs x=446 y=792 w=1054 h=155 view="446 792 1054 155" d="M 446 930 C 973.0 930 973.0 792 1500 792 L 1500 809 C 973.0 809 973.0 947 446 947 Z" fill=solar opacity=0.75
  vector band.solar.lighting x=446 y=884 w=1054 h=80 view="446 884 1054 80" d="M 446 947 C 973.0 947 973.0 884 1500 884 L 1500 901 C 973.0 901 973.0 964 446 964 Z" fill=solar opacity=0.75
  vector band.solar.it x=446 y=964 w=1054 h=29 view="446 964 1054 29" d="M 446 964 C 973.0 964 973.0 976 1500 976 L 1500 993 C 973.0 993 973.0 981 446 981 Z" fill=solar opacity=0.75

  rect node.gas x=420 y=212 w=26 h=(17 * $k) fill=gas
  rect node.heat x=420 y=(@node.gas.bottom + $ngap) w=26 h=(7 * $k) fill=heat
  rect node.grid x=420 y=(@node.heat.bottom + $ngap) w=26 h=(14 * $k) fill=grid
  rect node.solar x=420 y=(@node.grid.bottom + $ngap) w=26 h=(3 * $k) fill=solar
  rect node.heating x=1500 y=200 w=26 h=(21 * $k) fill=ink
  rect node.catering x=1500 y=(@node.heating.bottom + $ngap) w=26 h=(3 * $k) fill=ink
  rect node.labs x=1500 y=(@node.catering.bottom + $ngap) w=26 h=(9 * $k) fill=ink
  rect node.lighting x=1500 y=(@node.labs.bottom + $ngap) w=26 h=(4 * $k) fill=ink
  rect node.it x=1500 y=(@node.lighting.bottom + $ngap) w=26 h=(4 * $k) fill=ink

  text bl.gas.heating x=1390 y=283.0 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=ink
    "12"
  text bl.gas.catering x=1390 y=587.5 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=ink
    "3"
  text bl.gas.labs x=1390 y=654.0 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=ink
    "2"
  text bl.heat.heating x=1390 y=444.5 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=ink
    "7"
  text bl.grid.heating x=1390 y=521.0 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=ink
    "2"
  text bl.grid.labs x=1390 y=722.0 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=ink
    "6"
  text bl.grid.lighting x=1390 y=839.5 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=ink
    "3"
  text bl.grid.it x=1390 y=931.5 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=ink
    "3"
  text bl.solar.labs x=1390 y=778.5 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=night
    "1"
  text bl.solar.lighting x=1390 y=870.5 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=night
    "1"
  text bl.solar.it x=1390 y=962.5 w=90 h=30 font=body size=22 weight=600 align=right valign=middle fill=night
    "1"

  text lab.gas x=$m y=(@node.gas.cy - 36) w=(@node.gas.left - $m - 24) h=36 font=head size=30 weight=600 align=right valign=bottom fill=ink
    "Gas"
  text val.gas x=$m y=(@node.gas.cy + 2) w=(@node.gas.left - $m - 24) h=34 font=body size=28 align=right fill=mute
    "17 GWh"
  text lab.heat x=$m y=(@node.heat.cy - 36) w=(@node.heat.left - $m - 24) h=36 font=head size=30 weight=600 align=right valign=bottom fill=ink
    "Heat network"
  text val.heat x=$m y=(@node.heat.cy + 2) w=(@node.heat.left - $m - 24) h=34 font=body size=28 align=right fill=mute
    "7 GWh"
  text lab.grid x=$m y=(@node.grid.cy - 36) w=(@node.grid.left - $m - 24) h=36 font=head size=30 weight=600 align=right valign=bottom fill=ink
    "Grid electricity"
  text val.grid x=$m y=(@node.grid.cy + 2) w=(@node.grid.left - $m - 24) h=34 font=body size=28 align=right fill=mute
    "14 GWh"
  text lab.solar x=$m y=(@node.solar.cy - 36) w=(@node.solar.left - $m - 24) h=36 font=head size=30 weight=600 align=right valign=bottom fill=ink
    "Rooftop solar"
  text val.solar x=$m y=(@node.solar.cy + 2) w=(@node.solar.left - $m - 24) h=34 font=body size=28 align=right fill=mute
    "3 GWh"
  text lab.heating x=(@node.heating.right + 24) y=(@node.heating.cy - 36) w=330 h=36 font=head size=30 weight=600 valign=bottom fill=ink
    "Heating"
  text val.heating x=(@node.heating.right + 24) y=(@node.heating.cy + 2) w=330 h=34 font=body size=28 fill=mute
    "21 GWh, 51%"
  text lab.catering x=(@node.catering.right + 24) y=(@node.catering.cy - 36) w=330 h=36 font=head size=30 weight=600 valign=bottom fill=ink
    "Catering"
  text val.catering x=(@node.catering.right + 24) y=(@node.catering.cy + 2) w=330 h=34 font=body size=28 fill=mute
    "3 GWh, 7%"
  text lab.labs x=(@node.labs.right + 24) y=(@node.labs.cy - 36) w=330 h=36 font=head size=30 weight=600 valign=bottom fill=ink
    "Labs"
  text val.labs x=(@node.labs.right + 24) y=(@node.labs.cy + 2) w=330 h=34 font=body size=28 fill=mute
    "9 GWh, 22%"
  text lab.lighting x=(@node.lighting.right + 24) y=(@node.lighting.cy - 36) w=330 h=36 font=head size=30 weight=600 valign=bottom fill=ink
    "Lighting"
  text val.lighting x=(@node.lighting.right + 24) y=(@node.lighting.cy + 2) w=330 h=34 font=body size=28 fill=mute
    "4 GWh, 10%"
  text lab.it x=(@node.it.right + 24) y=(@node.it.cy - 36) w=330 h=36 font=head size=30 weight=600 valign=bottom fill=ink
    "IT"
  text val.it x=(@node.it.right + 24) y=(@node.it.cy + 2) w=330 h=34 font=body size=28 fill=mute
    "4 GWh, 10%"
  text foot x=$m y=1020 w=1500 h=30 font=body size=22 fill=mute
    "Metered use, 2025/26. Each band is as wide as its GWh, so sources and uses both add to 41."
```
