system
400.wtf

400.wtf / system / docs · docs/ADR/0015-route-network-model.md

ADR-0015 — Route lines as a transit network

Status: Accepted (2026-10-10, revises the DS-2 route line)

Context

The DS-2 RouteLine colored each segment by its station’s line, so one route changed color from station to station. Transit maps never do that. The owner’s reference (the São Paulo network around Luz, Sé and Barra Funda) shows how it should work: a line is one continuous color; a station served by several lines is an interchange drawn as a single capsule with one dot per line; lines run in parallel, continue past stops that aren’t theirs, and branch.

Decision

  • RouteMap is the model. stations sets row order. Each line lists its stations in that order and draws one continuous track of its color, running past rows it doesn’t serve. A station on several lines renders as an interchange capsule. branches let a line split at one of its stations: the branch leaves on its own lane with a 45° jog while the trunk continues.
  • Lanes are assigned first-fit over occupied row intervals, so a lane freed by an ended line is reused. Line order is lane preference.
  • Tracks extend slightly past terminal stations. A casing is generated only where a line would vanish into its surface (< 1.4:1); see the 2026-10-10 revision below.
  • RouteLine is now the one-line case of RouteMap: one route, one color. Per-station line colors were removed from its API.
  • StationMarker takes lines for inline interchanges (capsule of dots).
  • Rendering: SVG for tracks and stops (aria-hidden), an ordered list of real links for the stations, each with its lines spelled out for assistive tech.

Revision (2026-10-10)

The casing threshold moved from 3:1 to 1.4:1: at 3:1 only yellow on paper was cased, which looked accidental. A neutral graphite line was added for routes that aren’t categories, and stations may carry a note (+ noteLine chip) so a single route can still show each stop’s category without mixing line colors.

Consequences

  • Not yet supported: branches that rejoin (loops), walking transfers between stations (the dotted São Bento ↔ Pedro II link), and lines that enter mid-map from another line’s lane. Add them when real content needs them.
  • An interchange capsule spans every lane between its outer lines. A line in between that doesn’t stop there passes under the capsule, so lines that interchange should be listed next to each other.
  • Reka UI inside hydrated islands exposed a duplicate-Vue problem in dev (packages/ds carries its own dev copy). Fixed with vite.resolve.dedupe: ["vue"].