mermaid.flowchart.order.sweep

mermaid.flowchart.order

sweep(layered) -> layered

Order each layer of a layered graph to cross few links

layered is what mermaid.flowchart.rank.layers returns. Each layer's table is put in its new order, and each layout node gets its position in order, from 1. layered.crossings holds the crossings left. Returns the table it was given.