Source. [f39887883e633725]

dia = frame 1 . vsep 2 $
  [ hsep 3 . map centerY $
    [ vsep 1 . map center $
      [ mconcat
        [ text "b" <> rect 1 0.1 # lw none # fc white
        , hrule 9
        ]
      , hcat (replicate 3 a)
      ]
    ]

  , hsep 3 . map centerY $
    [ vsep 1 . map center $
      [ mconcat
        [ text "b" <> rect 1 0.1 # lw none # fc white
        , hrule 10
        ]
      , hcat (replicate 3 a ++ [r])
      ]
    ]
  ]
  where
    a = text "a" <> rect 3 1 # fc lightblue
    r = text "r" <> rect 1 1 # fc lightgreen