mermaid.frame.fit

mermaid.frame

fit(shape, label_cols, label_rows, pad) -> w, h, dc, dr

Size a box of a shape round a label

Returns the box's width and height in cells, and the offset of the label's first cell from the box's first cell. pad is the blank columns kept on each side of the label, 1 when not given.

A shape whose outline leans or curves into the box takes columns or rows from the label area, and the box grows by them: a subroutine's inner sides, a cylinder's lid, a pill's round ends, a rhombus's points, a leaning side.