# Critical path diagram

> A critical path diagram for Brindle Build's rear extension in Chester, 1920 × 1080, 1 page, with twelve tasks drawn to a scale of working days and the nine critical ones as one red line from groundwork to decoration. The critical tasks are one component whose width follows the duration, and the three other tasks are grey boxes with their float shown beside them.

- The design, as a .vd file: https://getv.design/library/critical-path-diagram.vd
- Its page: https://getv.design/library/critical-path-diagram

## How it was made

Drafted from this prompt:

> A critical path diagram for Brindle Build's rear extension. Show 12 tasks from groundwork to decoration with durations, mark the critical path in red and show float on the other tasks.

Then refined:

- Added the finish date, Wednesday 17 March 2027, at the end of the red line.
- Added a note under the brickwork saying what two lost days would do to the finish date.
- Made the red line taller and moved the whole diagram down to use the empty space.
- Renamed foundations to footings so the name fits its box.

## Make it yours

- "Make a critical path diagram for a house extension."
- "Show the finish date."
- "Increase the brickwork duration by two days."

## The source

```vd
version 12
kind design
title "Critical path diagram"
$blue = #123E6B
$paper = #F5F7FA
$red = #D64045
$grey = #8A94A0
$white = #FFFFFF
$x0 = 100
$u = 36
$line = 560
$rh = 120
$m = 60

font head = "Keania One"
  fallback "serif"
  face asset=keania-one-400 weight=400

font body = "M PLUS 1p"
  fallback "system-ui, sans-serif"
  face asset=m-plus-1p-400 weight=400
  face asset=m-plus-1p-700 weight=700

asset keania-one-400 = font/woff2 hash=sha256-7d856552b605c6960cae67c63f75da10b254f6d97c7e4b080d75cbf9df613aa5 bytes=10304 license=OFL
asset m-plus-1p-400 = font/woff2 hash=sha256-adf37c4857005a832f12b1f90262faf684d6b5b026295a44f05239710e1a049b bytes=18136 license=OFL
asset m-plus-1p-700 = font/woff2 hash=sha256-0db0f08594d953f4ec0428368e0540faab7dc85a8a9093d6221e84b4439b455d bytes=17952 license=OFL

frame page x=0 y=0 w=1920 h=1080 background=paper
  text title x=$m y=36 w=1100 h=140 font=head size=58 lineHeight=1.12 letterSpacing=-0.5 fill=blue
    "Nine of twelve tasks cannot slip without moving the finish"
  text sub x=$m y=(@title.bottom + 8) w=1100 h=34 font=body size=26 fill=blue
    "Brindle Build, rear extension in Chester, starting Monday 11 January 2027"
  text big.n x=1330 y=24 w=250 h=170 font=head size=150 lineHeight=1.1 letterSpacing=-2 align=right fill=red
    "48"
  text big.l x=(@big.n.right + 20) y=70 w=270 h=100 font=body size=30 weight=700 lineHeight=1.2 fill=blue
    "working days on the critical path"

  connector grid.0 x1=($x0 + $u * 0) y1=290 x2=($x0 + $u * 0) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.0.t x=($x0 + $u * 0 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "11 Jan"
  connector grid.1 x1=($x0 + $u * 5) y1=290 x2=($x0 + $u * 5) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.1.t x=($x0 + $u * 5 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "18 Jan"
  connector grid.2 x1=($x0 + $u * 10) y1=290 x2=($x0 + $u * 10) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.2.t x=($x0 + $u * 10 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "25 Jan"
  connector grid.3 x1=($x0 + $u * 15) y1=290 x2=($x0 + $u * 15) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.3.t x=($x0 + $u * 15 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "1 Feb"
  connector grid.4 x1=($x0 + $u * 20) y1=290 x2=($x0 + $u * 20) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.4.t x=($x0 + $u * 20 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "8 Feb"
  connector grid.5 x1=($x0 + $u * 25) y1=290 x2=($x0 + $u * 25) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.5.t x=($x0 + $u * 25 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "15 Feb"
  connector grid.6 x1=($x0 + $u * 30) y1=290 x2=($x0 + $u * 30) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.6.t x=($x0 + $u * 30 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "22 Feb"
  connector grid.7 x1=($x0 + $u * 35) y1=290 x2=($x0 + $u * 35) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.7.t x=($x0 + $u * 35 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "1 Mar"
  connector grid.8 x1=($x0 + $u * 40) y1=290 x2=($x0 + $u * 40) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.8.t x=($x0 + $u * 40 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "8 Mar"
  connector grid.9 x1=($x0 + $u * 45) y1=290 x2=($x0 + $u * 45) y2=880 stroke=grey strokeWidth=1 dash="3 7" opacity=0.55
  text grid.9.t x=($x0 + $u * 45 - 60) y=892 w=120 h=30 font=body size=22 align=center fill=blue
    "15 Mar"
  connector ruler x1=$x0 y1=880 x2=($x0 + $u * 48) y2=880 stroke=blue strokeWidth=3
  text ruler.t x=$x0 y=930 w=900 h=30 font=body size=22 fill=blue
    "Each tick is a Monday. Widths are working days."
  connector path.line x1=60 y1=$line x2=1892 y2=$line stroke=red strokeWidth=12 end=arrow
  ellipse path.start x=52 y=($line - 18) w=36 h=36 fill=red

  instance crit.1 component=crit x=($x0 + $u * 0 + 2) y=($line - $rh / 2) w=($u * 5 - 4)
    override crit.name
      "Groundwork"
    override crit.days
      "5 days"
  instance crit.2 component=crit x=($x0 + $u * 5 + 2) y=($line - $rh / 2) w=($u * 4 - 4)
    override crit.name
      "Footings"
    override crit.days
      "4 days"
  instance crit.3 component=crit x=($x0 + $u * 9 + 2) y=($line - $rh / 2) w=($u * 10 - 4)
    override crit.name
      "Brickwork"
    override crit.days
      "10 days"
  instance crit.4 component=crit x=($x0 + $u * 19 + 2) y=($line - $rh / 2) w=($u * 6 - 4)
    override crit.name
      "Roof structure"
    override crit.days
      "6 days"
  instance crit.5 component=crit x=($x0 + $u * 25 + 2) y=($line - $rh / 2) w=($u * 4 - 4)
    override crit.name
      "Roof covering"
    override crit.days
      "4 days"
  instance crit.6 component=crit x=($x0 + $u * 29 + 2) y=($line - $rh / 2) w=($u * 4 - 4)
    override crit.name
      "First fix electrics"
    override crit.days
      "4 days"
  instance crit.7 component=crit x=($x0 + $u * 33 + 2) y=($line - $rh / 2) w=($u * 6 - 4)
    override crit.name
      "Plastering"
    override crit.days
      "6 days"
  instance crit.8 component=crit x=($x0 + $u * 39 + 2) y=($line - $rh / 2) w=($u * 5 - 4)
    override crit.name
      "Kitchen and flooring"
    override crit.days
      "5 days"
  instance crit.9 component=crit x=($x0 + $u * 44 + 2) y=($line - $rh / 2) w=($u * 4 - 4)
    override crit.name
      "Decoration"
    override crit.days
      "4 days"
  rect off.1.box x=($x0 + $u * 5) y=380 w=($u * 2) h=26 fill=white stroke=grey strokeWidth=2
  rect off.1.slack x=($x0 + $u * 7) y=380 w=($u * 2) h=26 fill=none stroke=grey strokeWidth=2 dash="6 5"
  connector off.1.in x1=($x0 + $u * 5) y1=($line - $rh / 2) x2=($x0 + $u * 5) y2=406 stroke=grey strokeWidth=2 start=dot end=arrow
  connector off.1.out x1=($x0 + $u * 9) y1=406 x2=($x0 + $u * 9) y2=($line - $rh / 2) stroke=grey strokeWidth=2 end=arrow
  text off.1.name x=($x0 + $u * 5 - 4) y=(380 - 40) w=420 h=32 font=body size=24 weight=700 fill=blue
    "Drain connection, 2 days"
  text off.1.float x=($x0 + $u * 9 + 14) y=(380 - 3) w=200 h=32 font=body size=24 fill=blue
    "Float 2 " weight=700
    "days"
  rect off.2.box x=($x0 + $u * 25) y=380 w=($u * 2) h=26 fill=white stroke=grey strokeWidth=2
  rect off.2.slack x=($x0 + $u * 27) y=380 w=($u * 2) h=26 fill=none stroke=grey strokeWidth=2 dash="6 5"
  connector off.2.in x1=($x0 + $u * 25) y1=($line - $rh / 2) x2=($x0 + $u * 25) y2=406 stroke=grey strokeWidth=2 start=dot end=arrow
  connector off.2.out x1=($x0 + $u * 29) y1=406 x2=($x0 + $u * 29) y2=($line - $rh / 2) stroke=grey strokeWidth=2 end=arrow
  text off.2.name x=($x0 + $u * 25 - 4) y=(380 - 40) w=420 h=32 font=body size=24 weight=700 fill=blue
    "Windows and doors, 2 days"
  text off.2.float x=($x0 + $u * 29 + 14) y=(380 - 3) w=200 h=32 font=body size=24 fill=blue
    "Float 2 " weight=700
    "days"
  rect off.3.box x=($x0 + $u * 29) y=710 w=($u * 3) h=26 fill=white stroke=grey strokeWidth=2
  rect off.3.slack x=($x0 + $u * 32) y=710 w=($u * 1) h=26 fill=none stroke=grey strokeWidth=2 dash="6 5"
  connector off.3.in x1=($x0 + $u * 29) y1=($line + $rh / 2) x2=($x0 + $u * 29) y2=710 stroke=grey strokeWidth=2 start=dot end=arrow
  connector off.3.out x1=($x0 + $u * 33) y1=710 x2=($x0 + $u * 33) y2=($line + $rh / 2) stroke=grey strokeWidth=2 end=arrow
  text off.3.name x=($x0 + $u * 29 - 4) y=(710 + 38) w=420 h=32 font=body size=24 weight=700 fill=blue
    "First fix plumbing, 3 days"
  text off.3.float x=($x0 + $u * 33 + 14) y=(710 - 3) w=200 h=32 font=body size=24 fill=blue
    "Float 1 " weight=700
    "day"
  connector brick.mark x1=($x0 + $u * 14) y1=($line + $rh / 2) x2=($x0 + $u * 14) y2=770 stroke=red strokeWidth=3
  text brick.note x=($x0 + $u * 9) y=780 w=560 h=100 font=body size=24 lineHeight=1.3 fill=blue
    "Brickwork is the longest task. Two wet days there move the finish from Wednesday 17 March to Friday 19 March."
  text finish.note x=1400 y=426 w=480 h=36 font=body size=24 weight=700 lineHeight=1.2 align=right fill=blue
    "Finish: Wednesday 17 March 2027"
  connector finish.mark x1=($x0 + $u * 48) y1=($line - $rh / 2) x2=($x0 + $u * 48) y2=(@finish.note.bottom + 6) stroke=red strokeWidth=3

  rect key.red x=$m y=980 w=64 h=26 fill=red
  text key.red.t x=(@key.red.right + 16) y=972 w=700 h=40 font=body size=24 valign=middle fill=blue
    "Critical task: one day late and the finish moves a day"
  rect key.grey x=1050 y=980 w=64 h=26 fill=white stroke=grey strokeWidth=2
  rect key.slack x=(@key.grey.right) y=980 w=40 h=26 fill=none stroke=grey strokeWidth=2 dash="6 5"
  text key.grey.t x=(@key.slack.right + 16) y=972 w=700 h=40 font=body size=24 valign=middle fill=blue
    "Other task: the dashed part is its float"

frame crit x=0 y=1240 w=200 h=$rh component
  rect crit.bg x=0 y=0 w=(100%) h=(100%) fill=red
  text crit.name x=8 y=8 w=(100% - 16) h=62 font=body size=22 weight=700 lineHeight=1.15 valign=top fill=white
    "Task"
  text crit.days x=8 y=(100% - 36) w=(100% - 16) h=26 font=body size=22 fill=white
    "1 day"
```
