Help us shape the future of Go! Take the 2026 Go Developer Survey

route

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package route draws connections D2 leaves to a pluggable router: those that cross between nested layouts, such as swimlane steps in different lanes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lanes

func Lanes(horizontal bool) d2graph.RouteEdges

Lanes returns a router that draws connections between swimlanes at right angles. horizontal says the lanes are rows, with the flow running to the right; otherwise they are columns and the flow runs downwards.

Swimlanes are a matrix: lanes along one axis, ranks of the flow along the other, with every rank lined up across lanes. The gaps between ranks (corridors) and between lanes (gutters) are therefore empty, so a route that runs only through them never crosses a step:

  • forward to the next free rank: leave the step's far end, turn in the corridor just before the target, and enter the target's near end;
  • anything else (loops, skipped ranks): leave the step's side, run along the gutter to that corridor, then turn into the target.

D2 draws connections inside one lane itself; lanes stretch their steps to a common width, so those are straight.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL