The following diagram includes a "legend right" and happens to have loads of space to the right in the diagram, but the diagram is extended downwards in order to make space for the legend. Would it be possible for the legend placement to first layout the rest of the diagram and then attempt to make use of free space before extending the diagram?

@startuml
[Thing A1] -> [Thing B1]
[Thing B1] -> [Thing C1]
[Thing A1] --> [Thing A2]
[Thing A2] --> [Thing A3]
legend right
Legendary
content
goes
here
endlegend
@enduml
(happy for answers to include suggestions of how I might go about implementing the feature and submitting a patch)