Themes
A theme decides how a map looks: colors, fonts, station glyphs, section boxes, the legend frame, and optionally layout spacing. It never changes what the map says.
Looking for how one SVG adapts to light and dark viewers? See Light and dark mode.
Concepts
Section titled “Concepts”Theme. A named set of fields, written as a YAML file.
Every built-in theme is such a file in src/nf_metro/themes/, loaded and checked exactly like one you write yourself.
Mode. A theme has a light and a dark palette of colors; sizes and shapes are the same in both.
An SVG carries both and follows the viewer’s color-scheme (see Light and dark mode).
%%metro mode: or --mode picks the palette baked into a PNG or a single-palette export.
A theme whose colors match in both palettes renders the same in either.
Stack. A theme value is a comma-separated list of themes, applied left to right. A later theme wins for every field it sets, and the light and dark palettes merge separately. A single name is a stack of one.
Base. Every stack starts from the default theme, so a theme only needs to set the fields it changes.
A map with no %%metro theme: renders with default alone.
%%metro style: is accepted as another spelling.
Layout block. A theme can also set some layout options, such as spacing.
The order of precedence is: a command-line flag, then a %%metro directive in the map, then the theme, then the built-in default.
Use a theme
Section titled “Use a theme”A color written on a line of the map is kept under every theme. To use a theme’s colors with an older map, see Using a theme with an older map.
Set the theme in the map, or on the command line:
%%metro theme: london-tubenf-metro render pipeline.mmd -o pipeline.svg --theme london-tube--theme replaces the map’s %%metro theme: entirely, so --theme default renders a map in the base theme whatever its own style says.
--mode light or --mode dark picks the palette a PNG bakes.
The built-in themes
Section titled “The built-in themes”Every map below is the same small pipeline, with only its %%metro theme: line changed.
Each SVG follows this site’s light or dark setting, so switch the site theme to see the other palette.
Each theme is a short file in src/nf_metro/themes/, and the files are the best worked examples of the format.
default
Section titled “default”default is the nf-core look; there is no nfcore theme.
Pick the light or dark variant with --mode light or --mode dark.
The base every stack starts from: filled section boxes with number badges, white capsules at stations, bold labels.
default.yaml sets every field the schema leaves without a default, so it is the template for a complete theme.
It is also the theme a map gets when it names none, so its eight-color line_colors palette (#2db572, #0570b0, #f5c542, #e63946, #9b59b6, #ff9800, #00bcd4, #795548) is what lines without a color take; see Line colors.
Rendered map
seqera
Section titled “seqera”Seqera brand colors and Inter type.
seqera.yaml replaces the fonts, sizes and both palettes, and leaves the shapes alone.
Rendered map
transparent
Section titled “transparent”One palette on a transparent canvas, for maps embedded on a page that supplies its own background.
transparent.yaml sets every color at the top level, so both palettes match.
Rendered map
london-tube
Section titled “london-tube”After TfL’s Line Diagram Standard and Colour Standard: tabs in the line’s color at one-line stations, bold capsules at interchanges, a buffer-stop bar at line ends, bundled lines edge to edge, unboxed dashed sections, station names in TfL Corporate Blue, and the TfL line colors.
station_glyph: tickinterchange_glyph: pillterminus_glyph: barlayout: { curve_radius_ratio: 3.5 }Rendered map
The standard’s own interchange idiom is rings.
Stack a file that sets interchange_glyph: ring on top of london-tube to get them: one ring over two lines, and a bridged chain from three up.
Line ends keep the bar, which reads better than a ring there.
Mermaid source
%%metro title: london-tube, rings.yaml%%metro theme: london-tube, rings.yaml%%metro line: short | Short reads%%metro line: long | Long reads%%metro line: rna | RNA%%metro file: reads | FASTQ%%metro file: report | HTML
graph LR subgraph prep [Prepare] reads[ ] trim[Trim] qc[QC] reads -->|short,long,rna| trim trim -->|short,long,rna| qc end subgraph analyse [Analyse] align[Align] assemble[Assemble] quant[Quantify] merge[Merge] align -->|short| merge assemble -->|long| merge quant -->|rna| merge end subgraph publish [Publish] summarise[Summarise] report[ ] summarise -->|short,long,rna| report end qc -->|short| align qc -->|long| assemble qc -->|rna| quant merge -->|short,long,rna| summariseRendered map
nyc-subway
Section titled “nyc-subway”After Massimo Vignelli’s 1972 diagram and its 2008 revival: every line its own color with only a hairline between them, a small solid black dot wherever a line stops, no separate interchange symbol, tight corners, Helvetica in black, and the legend as round route bullets. The palette is the MTA’s published route colors. In dark mode it takes the white-on-black of the 1970 Graphics Standards Manual’s sign panels.
station_glyph: dotinterchange_glyph: dotsdot_diameter: 0.65dot_ring_width: 0.325 # half the diameter: a solid dotlegend_swatch: bulletRendered map
paris-metro
Section titled “paris-metro”After the Île-de-France Mobilités metro plan: thin lines nearly touching, a white dot ringed in its line’s color at each stop, black-outlined white capsules at interchanges, wide soft corners, sections on a light gray panel, and a slate legend of numbered line discs.
The palette is the IDFM line referential, in line-number order, so the line carrying 1 is line 1’s yellow.
In dark mode the six darkest colors lighten to stay readable against the slate background.
station_glyph: dotdot_ring: lineinterchange_glyph: pilllegend_swatch: bulletline_codes: numberslayout: { curve_radius_ratio: 4.5 }Rendered map
tokyo-metro
Section titled “tokyo-metro”After the Tokyo subway route map and Tokyo Metro’s station numbering mark: every station is its number, a white face ringed in its line’s color around a letter and two digits. A station on several lines is one marker across them, ringed in dark gray. The letter is the station’s section, which the section badge also shows, and the digits count along the section’s flow; a nameless line end has no number and stops at a bar. The palette is Tokyo Metro’s nine line colors, then Toei’s four.
station_glyph: numberedinterchange_glyph: numberedterminus_glyph: barsection_codes: lettersRendered map
washington-metro
Section titled “washington-metro”After the Washington Metrorail map: very thick lines a hairline apart, a white dot ringed in black on every line at a stop, broad corners, the Capital Beltway’s pale gray-green band round each section, and legend discs carrying each line’s letter. The palette is WMATA’s six line colors.
station_glyph: dotinterchange_glyph: dotsdot_diameter: 1.0dot_ring_width: 0.26line_width: 9Rendered map
Line colors
Section titled “Line colors”One rule decides a line’s color: a color you write is kept under any theme; leave it off to follow the theme. A map that sets no %%metro theme: follows default, so lines without a color still come out colored: they take the eight colors of the default palette, in the order the lines are declared (green, blue, yellow, red, purple, orange, cyan, brown).
%%metro line: qc | QC | #2dd4bf%%metro line: align | Alignmentqc is #2dd4bf whatever the theme, and align takes its color from the theme’s palette.
nf-metro validate prints a note listing the lines whose own color differs from what the theme’s palette would give them.
This shows a hand-written map where it overrides the theme.
The note appears only when the theme’s light palette differs from the default theme’s, so default and transparent never show it.
It does not count towards --strict.
In order:
- The map’s own color wins. A line whose
%%metro line:directive names a color keeps it under every theme. - Otherwise the theme’s palette. A line with no color takes the palette color at its place in the map’s
%%metro line:declarations. Lines that pin a color still count for their place, so pinning one line does not move the others within the palette. Past the palette’s end the generated colors steer clear of the colors the map pins, so pinning a color can change which generated color a later line gets.
%%metro line: align | Alignment | #2dd4bf%%metro line: qc | QC%%metro line: call | CallingHere align is always #2dd4bf, qc takes the theme’s second color and call its third.
Every built-in theme has a palette, so a map that names no colors renders with distinct ones under all of them.
Write a color
Section titled “Write a color”No color: the line follows the theme's palette.%%metro line: plain | PlainPinned, in both modes.%%metro line: pinned | Pinned | #2dd4bfPinned: the light color, then the dark color.%%metro line: pair | Pair | #0570b0, #7ab8e6The same pair, in CSS light-dark() form.%%metro line: css | CSS form | light-dark(#0570b0, #7ab8e6)An empty color field takes the palette and keeps the style and inactive fields in place.%%metro line: styled | Styled | | dashed | inactiveA single color is the light color. Its dark color is the same color, lightened where it needs to be to reach 3:1 on the theme’s dark background. A pair is used as written. A line whose light and dark colors differ follows the viewer’s mode in an SVG, as the chrome does.
Palettes
Section titled “Palettes”A theme’s line_colors is its palette.
A map with more lines than the palette has colors gets a generated color for each extra line.
The generated color is the one farthest, in the perceptual OKLab space, from every color already in use.
That covers the palette, earlier extras, colors the map pins, the background, and the inactive gray.
Only colors readable at 3:1 on the light background are candidates.
In dark mode each generated color keeps its hue, lightened where it needs to be to reach 3:1 on the dark background, so a line keeps its identity across modes.
If the dark palette is shorter than the light one, a dark line past its end takes the light palette’s color at that place, lightened the same way.
The palette’s own colors are never changed, and the same map always gets the same extras.
Set line_colors at the top level for both palettes, or under light: and dark: to give each its own.
london-tube does both: the TfL colors in light mode, and in dark mode the same list with the Piccadilly, Metropolitan and Elizabeth colors lightened to stay readable, and the black Northern line turned near-white.
Follow the theme
Section titled “Follow the theme”A color written in a map is kept under every theme, and leaving it off makes the line follow the theme. To have a line follow the theme, remove its color.
Declaration order drives the palette.
Reordering the %%metro line: directives, or adding one in the middle, changes the theme colors of the lines that have none, and a line that pins a color keeps its place in the order.
Legend codes (the numbers and letters of line_codes) follow the same order, so a pinned line keeps its code too.
Using a theme with an older map
Section titled “Using a theme with an older map”Older maps set a color on every line. A color written in a map always wins, whatever the theme, so such a map keeps its own colors under every theme. To take a theme’s colors, remove the color from the lines.
%%metro theme: london-tube%%metro line: star | STAR alignment | #2db572%%metro line: salmon | Salmon | #ff8c00 | dashed%%metro theme: london-tube%%metro line: star | STAR alignment%%metro line: salmon | Salmon | dashedThe style and inactive fields stay where they are.
This command removes the color from every %%metro line: line of a file, including light, dark pairs and lines with a style or inactive after the color:
perl -i -pe 'if (/^(\s*%%metro line:)(.*)$/) { my ($h,$r)=($1,$2); my @f=split /\|/,$r,-1; for my $i (2..$#f) { (my $t=$f[$i])=~s/^\s+|\s+$//g; if ($t ne "" && $t !~ /^(solid|dashed|dotted|inactive)$/i) { splice @f,$i,1; last } } $_=$h.join("|",@f); s/\s+$//; $_.="\n" }' pipeline.mmdIn the playground, the Use theme colors for all lines button next to the theme selector does the same to the map in the editor.
nf-metro validate prints a note when a map’s own colors keep a theme’s colors from applying, for themes whose palette differs from default.
Station glyphs
Section titled “Station glyphs”Three fields pick how a station is drawn. The last column names a theme above that draws each one.
| Field | Value | Draws | See |
|---|---|---|---|
station_glyph | pill | a capsule | default |
| (one line) | tick | a tab in the line’s color, on the label’s side | london-tube |
dot | a dot on the line, sized by dot_diameter and outlined by dot_ring_width and dot_ring | nyc-subway, paris-metro, washington-metro | |
numbered | a station-number marker ringed in the line’s color | tokyo-metro | |
interchange_glyph | pill | one capsule across all the lines | default, london-tube, paris-metro |
| (several lines) | ring | a ring centered on the lines, or a bridged chain of them | london-tube with rings |
dots | a dot on each line | nyc-subway, washington-metro | |
numbered | one station-number marker across the lines, ringed in station_stroke | tokyo-metro | |
terminus_glyph | nub | a square-cornered box across the lines | default |
| (line end) | bar | a buffer-stop bar across the bundle | london-tube, tokyo-metro |
ring | rings, or the dots or numbered interchange glyph when the theme uses one | nyc-subway, washington-metro |
A line end with one line follows station_glyph, and its file icon always sits beyond the glyph.
With ring, ring_max_lines is the most lines on one track that a single ring covers, and ring_overflow decides what a wider bundle gets: chain, the fewest touching rings that cover it, bridged by a strip in the station fill; or grow, one ring whose inside widens to cover it.
Lines on separate tracks, as at a cross-track %%metro interchange: or a rail-mode station, get separate rings joined by a dumbbell link.
The legend shows each line as a length of line, or with legend_swatch: bullet as a disc in its color carrying its code (line_codes: letters or numbers), in black or white, whichever reads better.
Corner radius is a layout option, curve_radius_ratio: the radius at the line center as a multiple of the line width.
london-tube sets 3.5, the standard’s three line widths to the inside edge of the line, so its 4 px lines bend at 14 px.
Unset, corners bend at 10 px, and stroke_scale scales the radius either way.
Stack themes
Section titled “Stack themes”%%metro theme: seqera, london-tubeThis map takes the station glyphs, section style, fonts and line colors from london-tube, and every field london-tube leaves unset from seqera.
Under both lies default, which supplies anything neither sets.
Every stack starts from default; list only the themes you add on top.
A built-in theme sets only the fields its file lists.
london-tube, seqera therefore keeps the london-tube station tabs and capsules, because seqera does not set station_glyph or interchange_glyph, but takes the seqera colors and fonts.
Write your own theme
Section titled “Write your own theme”- Create a YAML file whose name ends in
.yamlor.yml. - Give it a
name, then set the fields you want to change. Top-level fields apply to both palettes, andlight:anddark:blocks override colors (andline_colors) for one palette. Sizes and shapes are top-level only, because a map is laid out once for both palettes. - Optionally, start from another theme with
extends:, and set layout options in alayout:block. - Add the file to a stack.
In
%%metro theme:the path is relative to the.mmdfile; on the command line it is relative to the working directory.
# yaml-language-server: $schema=https://raw.githubusercontent.com/seqeralabs/nf-metro/main/src/nf_metro/themes/theme.schema.jsonname: house-styleextends: london-tube # optional: a name, a file, or a list
label_font_size: 13station_glyph: tick
light: label_color: "#5a2d82" legend_stroke: "#5a2d82"dark: label_color: "#e5d4f5" legend_stroke: "#e5d4f5"
layout: y_spacing: 45%%metro theme: house_style.yamlextends: is shorthand for listing those themes earlier in the stack, so the line above is the same as %%metro theme: london-tube, house_style.yaml.
A theme without extends: sits directly on default, like every stack.
A color left empty takes the field its description names: icon and badge colors take the station colors, the marker outline and station-number codes take station_stroke, and knockout_fill (label halos and open markers) takes the background, or white on a transparent canvas.
nf-metro checks the whole file against the theme’s JSON Schema before it renders anything.
An unknown field, a value of the wrong type or out of range (including .inf and .nan), a color it cannot read, a size inside light: or dark:, an unknown layout: option, or two files that extend each other stops the render with an error that names the file and the path to the bad value, such as $.light.label_color.
Font families, font weights and dash patterns accept only the characters CSS needs for them.
The schema ships with nf-metro as nf_metro/themes/theme.schema.json and is generated from the same definitions as the field reference below.
The first line of the example above points editors that use the YAML language server (VS Code’s YAML extension, for one) at it, so they complete field names and flag mistakes as you type.
Any other JSON Schema tool can validate a theme file against it too.
The SVG names the theme’s font and the viewer’s browser draws it, so name a font your readers have, followed by fallbacks.
The transit themes ask for the faces their standards use (Gill Sans standing in for Johnston, Helvetica, Parisine, Frutiger) and fall back to common sans faces.
PNG output, --embed-font and --text-to-paths draw every theme in the bundled Inter face, so the output is the same on any machine.
Field reference
Section titled “Field reference”Every field of the Theme schema (src/nf_metro/render/style.py) can be set in a theme file.
Default is the schema’s own default, which the default theme overrides for some fields.
A color is a hex value, an rgb()/hsl() function, a CSS color name, transparent or none.
Canvas and text
Section titled “Canvas and text”| Field | Value | Default | Effect |
|---|---|---|---|
background_fill | color | from default | Canvas fill. none leaves the canvas transparent. |
title_color | color | from default | Map title text. |
title_font_size | number | from default | Map title size, px. |
title_font_weight | normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | bold | Map title weight. |
label_color | color | from default | Station label text. |
label_font_family | text | from default | CSS font stack for station labels, and for every other text element. |
label_font_size | number | from default | Station label size, px. |
label_font_weight | normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | from default | Station label weight (bold, normal, 600, …). |
label_halo_width | number | 3 | Width of the knockout halo behind station labels, px. 0 disables it. |
knockout_fill | color | empty | Halo behind station labels and the inside of open markers. Empty takes the background, or white on a transparent canvas. |
caption_color | color | rgba(200, 200, 200, 0.85) | %%metro caption: text. |
caption_font_size | number | 11 | Caption size, px. |
watermark_color | color | rgba(150, 150, 150, 0.6) | The attribution line. |
canvas_padding | number | 60 | Margin around the map on every side, px. |
Sections
Section titled “Sections”| Field | Value | Default | Effect |
|---|---|---|---|
section_fill | color | from default | Section box fill. transparent draws an outline only. |
section_stroke | color | from default | Section box outline. |
section_label_color | color | from default | Section titles and group captions. |
section_label_font_size | number | from default | Section title size, px. |
section_label_font_weight | normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | bold | Section title weight. |
uppercase_section_labels | true | false | false | Draw section titles in capitals. |
section_label_letter_spacing | number | 0 | Extra space between section title letters, px. |
section_stroke_width | number | 1 | Section box outline width, px. |
section_stroke_dasharray | text | empty | SVG dash pattern for the section outline, px (2 4). Empty is solid. |
section_corner_radius | number | 8 | Section box corner radius, px. |
number_sections | true | false | true | Draw the numbered badge beside each section title. Off, titles start where the badge would be. |
section_badge_fill | color | empty | Number badge fill. Empty takes station_stroke. |
section_badge_text_color | color | empty | Number badge digit. Empty takes station_fill. |
section_badge_font_size | number | 12 | Number badge digit size, px. |
group_rule_width | number | 1.5 | Width of the rule under a station group’s caption, px. |
group_rule_opacity | number | 0.45 | Opacity of the rule under a station group’s caption, 0 to 1. |
section_codes | numbers | letters | numbers | How sections are coded on their badges and in station-number codes: numbers (1, 2, …) or letters (A, B, …). |
Legend
Section titled “Legend”| Field | Value | Default | Effect |
|---|---|---|---|
legend_fill | color | from default | Legend box fill. |
legend_stroke | color | empty | Legend box outline. Empty draws none. |
legend_text_color | color | from default | Legend text. |
legend_font_size | number | from default | Legend text size, px. |
legend_stroke_width | number | 0 | Legend outline width, px. 0 draws none. |
legend_corner_radius | number | 6 | Legend box corner radius, px. |
legend_padding | number | 12 | Space inside the legend box, px. |
legend_line_height | number | 24 | Height of each legend row, px. |
legend_swatch_width | number | 24 | Length of each line swatch, px. |
legend_swatch | line | bullet | line | How the legend shows each line: line, a length of the line, or bullet, a disc in the line’s color carrying the line’s code. |
line_codes | letters | numbers | letters | The code each line carries on a legend bullet, in declaration order: letters (A, B, …) or numbers (1, 2, …). |
Stations
Section titled “Stations”| Field | Value | Default | Effect |
|---|---|---|---|
station_fill | color | from default | Inside of station capsules, interchange rings and the strip bridging a chain of them. |
station_stroke | color | from default | Outline of station capsules and interchange rings, and the bar line end. |
station_stroke_width | number | from default | Station capsule outline width, px. |
station_radius | number | 5 | Station capsule end radius, px. |
marker_stroke | color | empty | Outline of %%metro marker: glyphs and their legend swatches. Empty takes station_stroke. |
station_glyph | pill | tick | dot | numbered | pill | How a station on one line is drawn. pill draws a capsule. tick draws a tab in the line’s color on the label’s side, and a bar across the line’s end (a buffer stop) at a terminus. dot draws a dot on the line. numbered draws a station-number marker: a ring in the line’s color around the station’s code. |
interchange_glyph | pill | ring | dots | numbered | pill | How a station on several lines is drawn. pill draws a capsule across them. ring draws one ring centered on the lines, or a chain of touching rings bridged by a strip when the lines are too wide for one. dots draws a dot on each line. numbered draws a station-number marker across the lines, ringed in station_stroke; a nameless line end has no number, and takes terminus_glyph. |
terminus_glyph | nub | bar | ring | nub | How a line end shared by several lines is drawn. nub is a square-cornered box across the lines in the station colors; bar is a buffer-stop bar across the whole bundle, as thick as a tab and overhanging the outermost lines by a tab’s length; ring draws interchange rings, or the dots or numbered interchange glyph when the theme draws interchanges with one. A line end with one line follows station_glyph. |
station_tick_width | number | 0.66 | Thickness of a tick tab along its line, and of a terminus bar, × line_width. |
station_tick_length | number | 0.66 | How far a tick tab reaches past the edge of its line, and how far a terminus bar overhangs each side, × line_width. |
ring_inner_diameter | number | 2 | Inside diameter of an interchange ring, × line_width. |
ring_stroke_width | number | 0.5 | Interchange ring outline width, × line_width. |
ring_bridge_width | number | 0.5 | Width of the strip bridging a chain of rings, × line_width. |
ring_max_lines | whole number | 3 | Most lines on one track a single ring of ring_inner_diameter covers, a count; a wider bundle follows ring_overflow. |
ring_overflow | chain | grow | chain | What a bundle wider than ring_max_lines gets: chain, a bridged chain of rings, or grow, one ring whose inside widens to cover it. |
dot_diameter | number | 1 | Outside diameter of a dot or dots station, × line_width. |
dot_ring_width | number | 0.25 | Width of a dot’s outline, × line_width. Half of dot_diameter draws a solid dot. |
dot_ring | station | line | station | Color of a dot’s outline: station, the station colors (station_stroke around station_fill), or line, the color of the line the dot sits on. |
number_marker_diameter | number | 3 | Outside diameter of a numbered station marker, × line_width; across several lines the marker also spans them. |
station_code_color | color | empty | Code on a numbered station marker. Empty takes station_stroke. |
| Field | Value | Default | Effect |
|---|---|---|---|
line_width | number | from default | Route stroke width, px. |
line_cap | round | butt | round | End caps of route strokes: round or butt. |
dashed_dasharray | text | 8,4 | SVG dash pattern of a dashed line, px. |
dotted_dasharray | text | 2,4 | SVG dash pattern of a dotted line, px. |
line_colors | list of colors | from default | Colors the map’s lines take in the order they are declared. Lines past the end of the list get generated colors, each as distinct as possible from those in use (including colors the map pins) and readable against the background. Set it under light: and dark: to give each palette its own. A line whose %%metro line: directive names a color keeps it. |
muted_line_color | color | #888888 | Grey for inactive lines and the stations, labels and icons only they touch. |
bridge_lines | true | false | true | Break the lower line where two unrelated lines cross. |
bridge_gap | number | 12 | Gap a line leaves either side of a line it hops over, px. |
chevron_size | number | 4 | Half-length and half-width of --directional chevrons, px. |
chevron_spacing | number | 64 | Distance between chevrons along a route, px. |
chevron_opacity | number | 0.75 | Chevron opacity, 0 to 1. |
chevron_color | color | empty | Chevron color. Empty takes the line’s color. |
File icons
Section titled “File icons”| Field | Value | Default | Effect |
|---|---|---|---|
icon_width | number | 28 | File icon width, px. |
icon_height | number | 32 | File icon height, px. |
icon_fold_size | number | 8 | Size of the folded corner, px. |
icon_corner_radius | number | 2 | Icon corner radius, px. |
icon_fill | color | empty | Icon fill. Empty takes station_fill. |
icon_stroke | color | empty | Icon outline. Empty takes station_stroke. |
icon_stroke_width | number | 1.5 | Icon outline width, px. |
icon_font_size | number | 7.5 | Size of the format label inside the icon, px. |
icon_text_color | color | #000000 | Format label inside the icon. |
icon_banner_fill | color | #222222 | Fill of the band across a file icon. |
icon_banner_text_color | color | #ffffff | File type text on the icon band. |
Animation
Section titled “Animation”| Field | Value | Default | Effect |
|---|---|---|---|
animation_ball_radius | number | 3 | Radius of --animate balls, px. |
animation_ball_fill | color | #ffffff | Ball fill. |
animation_ball_opacity | number | 0.9 | Ball opacity, 0 to 1. |
animation_ball_stroke | color | empty | Ball outline. Empty draws none. |
animation_ball_stroke_width | number | 1 | Ball outline width, px. |
animation_balls_per_line | whole number | 1 | Balls travelling along each route, a count. |
animation_speed | number | 80 | Ball speed, px per second. |
Chrome colors and host overrides
Section titled “Chrome colors and host overrides”These colors also emit a CSS custom property, so a page that inlines the SVG can recolor them (see var() for host overrides).
An empty value emits none, and a station color emits one only when its light and dark values differ.
| Field | Custom property |
|---|---|
background_fill | --nfm-map-bg |
title_color | --nfm-map-title-color |
label_color | --nfm-map-label-color |
station_code_color | --nfm-map-station-code-color |
caption_color | --nfm-map-caption-color |
section_fill | --nfm-map-section-fill |
section_stroke | --nfm-map-section-stroke |
section_label_color | --nfm-map-section-label-color |
legend_fill | --nfm-map-legend-bg |
legend_stroke | --nfm-map-legend-stroke |
legend_text_color | --nfm-map-legend-text-color |
marker_stroke | --nfm-map-marker-stroke |
station_stroke | --nfm-map-station-stroke |
station_fill | --nfm-map-station-fill |
Layout options
Section titled “Layout options”A layout: block takes these options, with the same values as their %%metro directives: x_spacing, y_spacing, section_x_gap, section_y_gap, section_x_padding, section_y_padding, track_gap, diamond_style, line_order, row_align, center_ports, compact_offsets, label_angle, label_offset, diagonal_run, curve_radius_ratio, font_scale, stroke_scale, logo_scale, legend_min_height, legend_logo_gap, directional.
A theme’s value applies only where the map has no directive for that option, and a command-line flag beats both.