Just for readability's sake I think these definitions should be moved up next to the definitionsof `DiagramOpts` etc.