v3.0.0
2026-11-25 · GitHub release · Diff
A rebuilt theme system with stackable theme files and five transit-agency themes, Snakemake input, and a tidy-up of the public surface that makes this a major release.
Theme stacks and theme files
Section titled “Theme stacks and theme files”%%metro style:, --theme and a per-output theme= take a comma-separated list of built-in names and YAML theme files, merged left to right over the default base.
A theme file sets any field of the theme schema for both palettes, extends other themes, and can set look-related layout options in a layout: block.
Every built-in theme is itself such a file, and a JSON Schema ships with nf-metro so editors can complete and check them.
See the Themes page.
Themes can now set station and section shapes (tab-and-ring station glyphs, outline width and dash, number badges, legend frame), line-end glyphs (nub, bar, ring), the colours lines take (line_colors), and a long list of values that used to be fixed.
Five transit themes ship in the box, each after its operator’s published standards: london-tube, nyc-subway, paris-metro, tokyo-metro and washington-metro.
curve_radius_ratio sets the corner radius as a multiple of the theme’s line width, as a directive, a --curve-radius-ratio flag or a theme layout: option.
Snakemake input
Section titled “Snakemake input”nf-metro render --from snakemake and nf-metro convert turn snakemake --rulegraph or --dag output into a metro map.
This is experimental.
nf-metro convert --lines graph|sections chooses how a converted map’s lines are drawn.
Other additions
Section titled “Other additions”%%metro number: 0hides a section’s number badge, and a subgraph whose ID starts with_is a hidden section that keeps its grid cell but draws no box.%%metro output:paths take per-output overrides (animate,mode=,theme=,scale=,raster_width=), so onenf-metro renderpass writes a static SVG, an animated SVG and a light/dark PNG pair.- The interactive HTML page follows the map’s mode, and moves its legend under the map on narrow viewports.
Routing and layout
Section titled “Routing and layout”Concentric arc corners: parallel lines turning together share one centre and draw as circular arcs, so bundles keep their lines touching through a turn. Animated dots ride the drawn strokes, and share forks fairly. Fanned bundles stay concentric at wide line widths. Several source-fork, merge-feeder and bypass placements were fixed (#2170, #2175, #2192, #2193, #2199, #2209), and directional chevrons follow their strokes through corners (#2177).
Breaking changes
Section titled “Breaking changes”This release cleans up names and defaults ahead of a stable public surface. The full list is in the changelog. The ones most likely to need action:
- Theme names.
nfcoreis nowdefault(a map that still says%%metro style: nfcorewarns and renders the same).lightistransparent, and thedark,lightand mode-suffixed names are gone: pick the palette with--modeor%%metro mode:. An unknown name passed to--themeraises an error. - Dependencies.
rich,rich-click,pyyamlandjsonschemaare core dependencies, and thevalidateextra is gone. A recipe or lockfile that lists dependencies by hand must add them. - CLI.
--from-nextflowis now--from nextflow.nf-metro renderprints the paths it wrote as YAML on stdout. - Action and hook. The GitHub Action and pre-commit hook no longer force
--theme default, so a map’s own%%metro style:applies in CI. - Hidden sections. A section whose ID starts with
_no longer draws a box. - Python API. Theme fields are renamed,
Themeis frozen,resolve_theme(graph, mode=None)replaces the old signature,render_stringtakes options only throughconfig=RenderConfig(...), and the manifest API moved tonf_metro.manifest.