mermaid.flowchart.route.frame

mermaid.flowchart.route

frame(placed, metrics) -> frame

Turn a placed flowchart into a frame

placed is what mermaid.flowchart.place.assign returns. metrics holds flow, "down" or "right", and flip, true when the diagram runs against that: up, or to the left. In cells it holds lead, the cells between a box and the first track after it, tail, the cells between the last track and a box, pitch, the cells a track takes, and group_pad, the cells between a subgraph's frame and a box in it.

The frame holds a box and its label's texts for each node, a knockout text for each edge's text, a route for each edge, and a group with its title for each subgraph that holds a node. A route runs from the edge's from to its to, whichever way it was laid out, so a marker names the end the source gave it.

A layer and a channel are laid along the flow, and a track runs across it. The frame's cells come last: a place across the flow and one along it become a column and a row by the diagram's direction. A box, a label and a marker are placed after that, so none is ever turned or mirrored.

A channel after a box starts with lead cells, and a channel before a box ends with tail, where the arrowheads stand. A link with a marker at its upper end has one lead cell at least: the marker needs a straight cell beside its port. A link with a marker at each end has two.