Skip to content

Atlas

Preview format: atlas turns a storyStoryThe compiled model, Story: one source, which every format reads. into an atlas: a map that stays in place while the text of each view scrolls by, the camera moving from one view to the next. Every scene is a view: a camera, a text, and the markers, routes and areas it shows. The base maps come from the Natural Earth data of @recit/geo, cut and projected at build time: the reader never loads a tile, a font or a geocoder.

recit dev and recit build open an atlas like any other format, and a Récit site publishes one with @recit/site-stories (publish.entries, <StoryEmbed slug="…" />), as the maps site of the repository does (sites/maps). A single map inside another format is the ::map block. @recit/atlas is a preview: it stays outside the 1.0 and a minor version may change it.

A minimal atlas

Markdowntour.md
--- title: Lorem Tour lang: en format: atlas projection: conic-conformal layout: side --- --- id=start camera=FR # Lorem ipsum Dolor sit amet, consectetur adipiscing elit. --- id=paris camera=[1.4,48.4,3.3,49.3] duration=4s ## Lorem in Paris Sed do eiusmod tempor incididunt ut labore. ::marker{lat=48.8566 lon=2.3522 label="Lorem"} --- id=south center=43.6,3.9 zoom=5 ## Dolor and Sit ::marker{lat=43.6047 lon=1.4442 label="Sit"} ::marker{lat=43.2965 lon=5.3698 label="Dolor"} ::route{from="Sit" to="Dolor" style=dashed reveal=draw}

The full example, in English and French with its JSON twin, is atlas-tour.

The camera of a view

Each view says what it frames, on its separator line:

AttributeWhat it frames
camera=FRa country, by its ISO 3166-1 code (alpha-2 or alpha-3)
camera=worldthe whole world, in Equal Earth
camera=[w,s,e,n]an extent in degrees: west, south, east, north
center=lat,lon zoom=5a center and a zoom from 1 (180° of longitude) to 12, each step halving the span
no camerathe extent of the view's layers; a view with neither is an error
duration=4show long the view lasts in a film made from the atlas

An unknown code, an extent out of bounds or a zoom past 12 is refused with the line of the view.

Layers

The layers of a view are written together at the end of its text, one per line. A layer line anywhere else is an error with its line, so that the Markdown and the JSON twin stay equivalent.

DirectiveWhat it draws
::marker{lat lon label}a place, by its coordinates; its label is the story's own text
::marker{place label}a populated place by its name (place="Lyon, FR"), resolved offline
::route{from to style reveal}a great-circle line between two markers (by label) or lat,lon points
::area{src label reveal}a GeoJSON file beside the story, never a URL

style is solid, dashed or dotted; reveal=draw traces a route as the view opens and reveal=fade fades an area in. A route end resolves against the markers of its view, then of the whole atlas.

place= names a place of the offline gazetteer of @recit/geo (Natural Earth populated places), as in a ::map: the atlas resolves it when it is built, without network, and its label is the place's name unless label= is written, so ::route{from="Lyon"} joins ::marker{place="Lyon"}. An unknown or ambiguous name is an error of its view. The JSON twin keeps place as written.

Reading it

  • Scrolling: the view whose text crosses the middle of the screen is the active one; the camera interpolates the projection to it, then reveals its layers.
  • Keyboard: the reader is one focusable region. Arrow Up and Down, Page Up and Down, Home and End move view by view; the buttons under the map do the same.
  • Reduced motion: with prefers-reduced-motion, each view appears settled, without a move.
  • Languages: the names of countries and regions come from Intl.DisplayNames. In a right-to-left language (lang: ar, as in examples/atlas-tour/atlas-tour.story.ar.md), logical CSS properties move the side text column to the inline-start side and flip the view navigation bar, while <svg> keeps direction: ltr: the projection never mirrors (north stays up, west stays left) and marker <text> labels keep their start anchor to the right of the dot. On desktop, the sticky map stage reserves the navigation bar's height so the « Made with Natural Earth » attribution stays visible across every view.

Settings

In the front matter, or for every atlas of a project in the atlas: section of recit.config.ts (the front matter wins, then the section, then the default):

SettingValuesDefault
projectionthe projections of ::mapequal-earth
basemapland, admin0, admin1, noneadmin0
layoutside, overlay, fullside
worldviewdefault (the de facto borders of Natural Earth), or a point of view: IN, MA… (maps)default
insetsnone, or auto: Guadeloupe, Martinique, French Guiana, Réunion and Mayotte in a column beside an atlas of FR (maps)none
TypeScriptrecit.config.ts
import { defineConfig } from "recit/config"; export default defineConfig({ atlas: { projection: "conic-conformal", basemap: "admin1", layout: "overlay" }, });

side puts the text in a column beside the map, overlay in cards over it, full under it. basemap: "admin1" draws the regions of the country a view shows. The scene attribute camera= is in the camera of a view, and duration= sets the length of a view in a film.

The JSON twin

Every atlas has a typed JSON form, kind: "story" with format: "atlas", checked by AtlasSourceSchema of @recit/core/schema and its JSON Schema (https://recit.dev/schema/v1/atlas.json, x-recit-stability: preview). recit convert turns one into the other, and the round-trip test checks that both compile to the same views. In JSON, a view is { id, camera, layers?, body?, notes?, durationMs? }; its layers are the scene's layers.

KeyType / valuesEffect
scenesAtlasSceneSource[]Required in kind: "story". Views of the atlas, in scrolling order (--- separators in Markdown).
scenes.idstring (non-empty)Required. Stable view identifier across languages (--- id=…).
scenes.camera"world", "FR", [w, s, e, n] or { center, zoom }Framing of the view (camera= or center=lat,lon zoom=N, with zoom from 1 to 12). Omitted, a later view keeps the previous camera and the first frames layers.
scenes.durationMsinteger (> 0)Optional shot duration in milliseconds for the bridge to a film (duration=4s ↔ 4000).
scenes.layersAtlasLayer[]Optional marker, route and area layers parsed from the closing layer lines of the view.
scenes.bodystring or Record<string, string>Optional Markdown or MDX prose of the view before its closing layer lines (Scenes).
scenes.notesstring or Record<string, string>Optional author notes (:::notes; Scenes).
scenes.attrsRecord<string, string | number | boolean>Optional separator attributes (--- key=value) other than id, camera, center, zoom and duration.

Commands

CommandWhat it does
recit dev tour.mdthe atlas with live reload
recit build tour.md -o distprerendered in one language (--locale fr), nothing off-site
recit validate tour.mdthe story against its schema, with the line of each problem
recit convert tour.md --to json -o tour.jsonthe JSON twin; --to md goes back to Markdown
recit convert tour.md --to deck -o tour.deck.mdone slide per view
recit convert tour.md --to film -o tour.film.jsonone map shot per view, for recit render
recit convert tour.md --to webstory -o tour.webstory.mdone 9:16 card per view
recit convert events.md --to atlas -o events.atlas.mdthe map view of a calendar

A view with no camera and no layer, an unknown country code, an extent out of bounds or a zoom past 12 are errors with the file and the line, in the form ✖ tour.md:12 — …. Every command and its flags are in the CLI reference.

Bridges

Closed bridges, from @recit/atlas/bridge. The atlas owns its outgoing bridges; the one that comes in, from a calendar, is the exception written on the Bridges page.

From → toFunctionCommand
atlas → deckatlasToDeckrecit convert tour.md --to deck
atlas → filmatlasToFilmrecit convert tour.md --to film
atlas → webstoryatlasToWebstoryrecit convert tour.md --to webstory
calendar → atlascalendarToAtlasrecit convert events.md --to atlas
  • To a deck: each view becomes a slide with the same id, its text first, then a :::map framing what the camera framed (a centre and a zoom become their extent) with the view's layers. A view too dense for a slide is refused with its line, never summarised; a worldview other than default becomes the worldview= of each map, and layout is dropped with a warning. A view without a camera is framed on its markers, its place= markers included when the bridge is given the offline gazetteer (places, which recit convert passes); without it, such a view shows the world with a warning.
  • To a film: each view becomes a map shot. The camera moves from the view before to its own by interpolating the projection, then the routes and areas appear as their reveal says; the text is the voice-over, and duration= the length of the shot. The base map rides in the film, so recit render reads no asset.
  • To a webstory story: a title card, then each view becomes a 9:16 card with the same id, its text then its :::map, duration= as the card's dur. A view beyond the density of a card (40 words, 5 bullets) is refused with its line; views beyond the 30 cards of a story are left out with a warning. An area's file is written from the folder of -o, which must be the atlas's folder or above it: a story reads no file outside its folder.
  • From a calendar (calendarToAtlas, which reads the calendar model from @recit/time/calendar): the optional map view of a calendar. Its events whose place has a geo ([lat, lon]) become an atlas: a first view with all of them, then a view per event ahead, centred on its place, with its title, its date and its place. An event without geo stays off the map with a warning: nothing is geocoded, nothing is fetched.