Skip to content

Explorer features, layout, extension, and diagram guidance

The explorer is one HTML file made of five main script blocks: model (the data), validator, core (layout, edge lifting and routing, and the Data view's layout and lines, no DOM), rdf (RDF mapping, no DOM) and engine (rendering and interaction, SVG), plus icons (the built-in icon set and the icon helpers, no DOM), icon-data (library icons the build resolved), mermaid (the map as Mermaid text and back, no DOM), editor, history and tools. No build step, no libraries. It runs from file://. The scripts in scripts/ run the validator, core, rdf and mermaid blocks of a page in Node, so command-line checks see exactly what the browser computes.

What the page does

Map view (default)

  • Nested boxes. The map starts at view.startLevel. A box with children shows a + N inside badge; clicking the badge or double-clicking the box opens it in place, and its children appear inside a dashed boundary. − close collapses it and everything opened below it. Layout and camera animate (skipped under prefers-reduced-motion).
  • Level buttons L1–L4 (keys 1–4) open every box above that level and fit the result. Only levels that exist in the model are shown. The highlighted button follows what is actually open.
  • Edge lifting. Each edge is declared once, between specific elements. It is drawn between the nearest visible ancestors of its ends, so closed boxes carry the relationships of their contents. Edges that land on the same pair merge into one arrow, labelled with the edges' summary if one is given, else first label +N. An edge that ends up inside a single box is hidden.
  • Arrow style. The edges ▾ menu in the toolbar picks right-angled arrows that run in the gutters on separate lanes (default) or straight ones; E switches between them. See "Arrow styles".
  • Beyond the view. Zoomed in, the border of the map names where the arrows that leave the view go. See "Beyond the view".
  • Arrow routing (straight style). An arrow is a straight line between box centres unless a closed box lies on it; then it bends around the corners of the boxes in the way, with rounded bends. See "How layout is decided".
  • Lifecycles. Boxes of type state are drawn as pills (dot = initial, double border = final), their transitions as arrows, a self-transition as a loop.
  • Images. A box with images carries a picture badge with the count (bottom left; on a state, on its bottom edge; on an open box, in its header). A click opens the first image in the lightbox. See "Images".
  • Icons. A box, an arrow, a schema, an entity or a scenario with an icon shows it: before the tag of a closed box, before the title of an open one, at the start of an arrow's label (a small round badge at its middle when labels are off), next to the label on IN / OUT rows. See "Icons".
  • Flows. flows ▾ in the toolbar (W) paints scenarios on the map, each in its colour. See "Flows on the map".
  • Selection. Clicking a box selects it and the panel shows its details. Clicking empty canvas or Esc clears it.
  • Several boxes. Ctrl + click (⌘ + click on macOS, where Ctrl + click opens the context menu; Shift + click works everywhere) adds a box to the selection or takes it out; a plain click selects only that box again. From the keyboard: Ctrl / ⌘ / Shift + Enter on a focused box. Works on the Map and the Pinned board; the Dynamic view keeps a single selection. The panel then lists the selected boxes (click one to centre it, × to take it out), the relationships between them, and what they use and are used by together; P or "Pin all" pins every selected box (or unpins them all when all are pinned).
  • Connections. A click on an arrow, or on an IN or OUT row (labels in the boxes), selects that connection rather than a box; Ctrl / ⌘ / Shift + click adds more. See "Selecting connections".
  • Zoomed out (below 34 %), a plain click on a closed box adds it to the selection and keeps a large copy of it beside it; a click on it again lets it go. See "Reading the map zoomed out".
  • What stays bright. The selected boxes, everything inside them, and every box at the other end of one of their visible (possibly merged) arrows keep full strength, with the union taken for several selected boxes. Their arrows are drawn thicker and their labels in full (a folded label is revealed). Every other box, arrow and label fades. An open box around a bright box fades only a little, so its frame and title still give context. Fading is opacity only, so it reads the same in light and dark themes; a theme can tune it with --dim-node (default .3), --dim-frame (.85) and --dim-edge (.16).
  • Pan and zoom. Drag to pan, wheel or pinch to zoom at the pointer, + / − / fit buttons, F to fit. Below 34% zoom, sub-lines, arrow labels and variant dots hide to keep the overview legible, and the map is read differently: each box shows only its name, large; the pointer on a box shows it at a readable size; a click collects boxes. See "Reading the map zoomed out".
  • Hiding boxes. "Hide on the map" in a box's panel (or "Hide all on the map" with several selected), or X, leaves the selected boxes out of the map: a view filter, the model does not change. A hidden box is not drawn, nor anything inside it, and every relationship with an end in it is left out (it is not moved onto the open box around it, which would claim that box has it; the panel's Uses / Used by lists still name it). The rest is laid out again without it, and a fitted map is fitted again. A chip in the status bar says N hidden ▾ · show all: ▾ lists them above the bar, each with show; show all or Shift+X brings them all back. Anything that shows a box (search, a link in the panel, focus_element, zoom_to, going to a change) shows it again. The minimap and the Mermaid text follow (the text's %% c4-explorer: line says hidden=…, so an edited text reads back without taking the hidden boxes for removed ones); the Pinned board, the Dynamic view and the Data view do not. In the URL as hide=web,minio; for scripts ARCH_EXPLORER.api.hidden() and setHidden(ids, hide).
  • Moving boxes. A reader can rearrange the map for themselves: a view of their own, the model does not change. This is not pinning (the Pinned board's P).
  • Fixed in place, or free to move. Every box starts fixed in place. A box shows a round button with a thumbtack at its top right corner while the pointer is on it (on a touch screen, while it is selected). Clicking or tapping it frees the box to move: the button turns the accent colour, shows the thumbtack struck through, and stays shown. Clicking it again fixes the box in place where it now is. The panel of a selected box has the same switch as a button, Free to move / Fix in place (aria-pressed), for the keyboard. A box alone in its group has no button, and edit mode shows none.
  • Moving. Drag a box that is free to move with the mouse, a finger or a pen; a drag on a fixed box still pans the map. While it is selected, ← → ↑ ↓ also move it one place. A box moves only within its own group (its siblings), by edit mode's rules: dropped onto another box, the two swap; dropped between two columns or rows, or past the last one, it gets a new column or row there. While it is dragged, its arrows follow it: they are routed again at most once a frame, as if the box stood where it is (the flows on them and the frame beyond the view too). Let go, the group is laid out and its arrows routed exactly as with at in the model, so no arrow crosses a box. A click still selects, a double-click still opens, a pinch still zooms, and a press on a box's badges and buttons still does what it did.
  • Kept in this browser, per project, like the pins (localStorage key architecture-explorer-moves:<project id>, not in the URL), together with the model's cells the moves were made on. When the model's layout of that group changes (an edit, another version of the page), the model wins there. Which boxes are free is not kept: on a reload, the moves are back and every box is fixed in place.
  • Reset. A chip in the status bar (after the hidden boxes, when they show) says N moved · reset layout. reset layout puts every box back where the model has it, all fixed in place.
  • What follows the moves. The minimap and the SVG, PNG and HTML exports draw the map as shown, without the buttons. Entering edit mode keeps them: the moved groups' cells are written into the model as at (each group whole, renumbered from 0), as one undoable step (Ctrl+Z puts the model's layout back), and the reader's moves are let go, since the model has them now. The model, its downloads, layoutOf and the agent tools (get_layout) keep the model's cells. For scripts: ARCH_EXPLORER.api.moves() (group → { id: [col, row] }; '' is the top level), setFree(id, on) and resetMoves(). The core's setCells(map) and baseCell(id) lay the moved cells out.
  • Arranging the boxes. arrange ▾ in the toolbar (or R on the map) places the boxes so that fewer arrows cross, bend or run behind a box. Outside edit mode the result is the reader's own moves (above): the model does not change.
  • Four ways. Tidy: the fewest crossings and bends, whatever the shape; a box keeps its cell unless moving it pays, and people stay above the software. Flow left → right: each box left of what it calls. Flow top → bottom: each box above what it calls. Layers: people, then the software, then data stores and external systems, a row each (a group of one kind is layered by its calls). In a cycle one arrow has to go back. Flow and layers keep their rule first and only then cross as little as they can, so they may cross more than Tidy.
  • Where. whole map: every open box with two or more boxes shown, the innermost first, then the top level; each group is arranged with the ones before it already in place. this box (a box selected): the boxes in it when it is open with two or more showing, else the boxes around it (its group).
  • How it chooses (the core's arrange(gid, { strategy }), one group): candidates are the cells now, layered orders (callers first, each rank then sorted by the mean place of its neighbours, sweeping down and up, as rows and as columns) and, for Tidy, grids two to five columns wide. A short local search (swaps, moves to an empty cell) improves them on a quick score of straight segments; the best three and the cells now are then laid out and routed by the page's own router, and for groups of up to 14 boxes a few more swaps are tried the same way. The routed score counts, most weight first: arrows left behind a box, crossings, arrows through an open box they have nothing in, arrows lying on another, folded labels and bends, then the length, the shape (close to the view's proportions, few empty cells) and how many boxes moved. The new cells are used only when they score better than the cells now. No randomness: the same model and view give the same cells. A group takes up to about 200 ms (the example: 15 groups in about 1.4 s); the page arranges one group at a time with a pause between, so it stays responsive, and the button reads arranging….
  • What it shows. The map animates to the new cells and a fitted map stays fitted; the status bar says N moved · reset layout. A line in the menu, repeated as a message in the status bar, says what changed, for example Tidy · the whole map: 1 of 3 groups changed · crossings 15 → 6 · bends 80 → 72 · your view only, or already as good as this way gets, nothing moved. undo goes back to the moves from before the last arrangement; reset layout puts every box back where the model has it.
  • In edit mode the cells are written into the model as at on every box of each group that changed, through the editor: checked by the validator, one undo step named Arrange (Tidy) (Ctrl+Z). The rail's arrange button (after Properties) opens the same menu; its undo is the editor's, and reset layout is not shown.
  • For scripts and agents: ARCH_EXPLORER.api.arrange(strategy, scope, opts) (tidy, flow-x, flow-y, layers; scope map, box or a box id, which is opened first; opts.dry only works the cells out, as cells) returns a Promise of { strategy, where, groups: [{ box, name, changed, before, after }], changed, before, after, applied }, applied being view, model or none; arrangeMenu(open, focus); undoArrange(). The tool arrange_boxes (strategy, box, reset): outside edit mode it changes the reader's view like the menu; in edit mode it works the cells out, then asks the reader in the bar like an edit. check-model.mjs --arrange [way] prints the same suggestion per group as at cells to copy into model.js. Not in the URL.
  • Limits. A box stays in its group, and an open box is placed with the size it has now. Groups are arranged one after the other, not together. The page does not arrange by itself: on load the model's at (or the automatic placement) is the layout. Measured on the example (labels in the boxes, Tidy, each group on its own): the API service 15 → 6 crossings, the worker 5 → 1, the task routes 47 → 27; over its 15 groups 217 → 178 crossings and 992 → 964 bends, the top level and the system already as good as it gets. Not worth doing at load: it takes about 1.4 s, and against the automatic placement alone (the example without at) it gives 202 → 182.
  • Minimap (bottom left, hidden on phones) shows all visible boxes and the viewport (a tinted frame). The boxes are in colour, a hue per type from the theme's palette: people in the accent colour, systems a lighter accent, containers teal, components violet, code grey, data stores gold, states green, external systems the external colour, neighbouring systems dashed; a highlighted box (kind a tone) in its tone. An open box is its dashed frame, tinted by depth as on the map, drawn under what is inside it. With a selection (or flows on the map), what fades on the map fades in the minimap too, and the selected boxes are ringed. The Data view's minimap draws each entity in its schema's colour. Press anywhere on it to move the view there, then drag to move it along; grabbed inside the frame, the frame keeps the spot where it was grabbed (mouse, touch and pen). The Data view's minimap works the same. The – button in its corner (or O) minimizes it to a small ▣ minimap chip that brings it back; the status bar then moves left. Remembered per browser and written to the URL (mm=min).
  • Status bar (along the bottom of the map, between the ? and the zoom buttons; #stbar). One line of chips, in this order: what is open (open: Image Annotation Tool · API service), selected (selected API service, or the connection) or playing (flow in … · step n/N, sequence in … · step n) (#crumb); the boxes hidden (N hidden ▾ · show all, #hidbar; the list opens upward); the boxes moved (N moved · reset layout, #movbar); the editor's message while editing (with its ✕); and the latest message (what was hidden, what an arrangement did: role="status", it fades after about 8 s, later while the pointer or the focus is on the bar). Each box named in the first chip is a button: an open one is fitted, another centred. The top left of the map is free.
  • With room to spare the usage hint follows the chips (drag to pan · scroll to zoom · …), cut short with "…".
  • Too long for the bar (many boxes selected, a long message, a phone), the chips run sideways in a loop like a ticker, at about 38 px a second, fading at both ends. The pointer or the keyboard focus in the bar (or the list of hidden boxes open) holds it still, so its buttons can be clicked; the copy that follows the chips for the loop is aria-hidden and out of the tab order, and a click on one of its buttons clicks the chip it copies.
  • With reduced motion (prefers-reduced-motion) nothing moves: the line is cut at the right edge, and under the pointer or the focus it shows everything, wrapped, the bar growing upward.
  • Fitting the map keeps the boxes clear of the chips, as of the minimap and the zoom buttons; the frame beyond the view keeps its chips clear of them too. Under 820 px the bar sits between the ? and the zoom buttons without the hint, and above the flows legend or the flow's bar when they take the bottom row.
  • Arrow labels: the labels ▾ menu picks labels in the boxes (the default: the button reads labels: in boxes ▾; see "Labels in the boxes"), labels on the arrows (labels ▾) or no labels (labels: off ▾); L cycles through the three. On the arrows, a label is one line up to 16 characters, else two lines of up to 20, and is slid along its arrow to avoid boxes, the header (title strip and buttons) of open boxes, and other labels.
  • Placement order. Labels of the selected box's arrows are placed first and are always drawn in full. The others follow, the most constrained first (fewest spots clear of boxes), so long arrows with many possible spots give way to short ones.
  • Decluttering. A label that would still overlap another label, a box or an open box's header is not drawn in full. Its arrow carries a small ··· marker instead (in the arrow's colour, on a free spot of the arrow). The full label appears there, above everything else, while the pointer is on the arrow or the marker; clicking or tapping either keeps it shown until the next click elsewhere; selecting either end box shows it in full. A label is never hidden without a marker. Markers follow the labels setting and the low-zoom rule.
  • Busy gutters are widened before anything is folded (see "How layout is decided", step 3), so markers are the exception. check-model.mjs counts them per group.
  • An arrow's card. With the pointer on an IN or OUT row (labels in the boxes), or on an arrow (labels on the arrows: on its marker or the arrow itself; labels off: the arrow), a card shows after a moment (at once when moving from one row to the next): the direction (INTO API service / OUT OF Web app), both ends with their icon, level and tag, the arrow's summary, up to six of the relationships behind it (label, inner ends, dashed, variants; +N more), the scenario steps that travel along it, each in its scenario's colour with its step numbers, its note, and what a click does. Keyboard focus on a row shows the same card under it. It hides when the pointer leaves, on a press or a scroll, while dragging, on a touch screen and in edit mode (which has its own card).

Details panel

Right column on desktop, bottom sheet under 820 px. Folding it away: the handle on the right edge of the views (›, or I) hides the panel, so the map, the Pinned board, the Dynamic view and the history bar get the whole width; the map keeps what it showed (re-fitted if it was fitted, else the same centre and zoom, animated unless the reader asks for reduced motion). Folded, the handle reads ‹ details and carries a dot while something is selected. The panel does not reopen by itself when a box is selected: the reader folded it to make room and selects boxes all the time, so it stays folded until the handle or I brings it back. Under 820 px the same state folds the bottom sheet to one line (details ▴); a click anywhere on that line unfolds it. Remembered per browser and written to the URL (panel=closed). For the selected box: ancestor breadcrumb (clickable), level and tag, name, sub, desc, notes, action buttons (open/close, show on map, pin), technology chips, variant chips, source path and link, children, and Uses / Used by lists (Transitions to / Reached from for a state). Those lists include the relationships of everything inside the box and say which inner element each comes from; every entry navigates to the other end.

A box with images shows them as a gallery (see "Images"); so does a relationship with images, in the panel of either end box.

With several boxes selected: the selected boxes (each entry centres its box, × takes it out), Pin all / Unpin all, Show all on map, Clear selection, Between them (relationships from inside one selected box to inside another), and Together they use / Together they are used by (relationships with one end inside the selection and the other outside it, naming the inner element).

With nothing selected the panel shows the welcome, How to explore: project.intro, node counts per level, the key reference, a legend built from the kinds actually used, and an explanation of the variant filter. That is the first time the project is opened in this browser. Once the reader has moved on from it (the panel has shown something else: a box, a connection, a scenario step), the guide is kept behind a round ? button at the start of the map's bottom line (before the hint; on a phone, at the bottom left of the map), also on the ? key: a card over the map with the same keys, legend and variant filter; Escape, its × or a click elsewhere closes it. The panel with nothing selected then shows the Overview: the project's name, project.intro, the counts per level and a line pointing to ?. The guide and the Overview end with a credit line: made with c4-model-agentic-plugin, linked to its repository, with the version the build stamped (<meta name="generator">); the stories page ends its sidebar with the same line and the deck's closing slide has a "made with" row. Remembered per project in this browser (localStorage key architecture-explorer-welcomed:<project id>).

Images

Pictures on a box, an arrow, a scenario or a step (images in data-model.md): screenshots of what a user sees, diagrams, photos, or mock-ups marked illustrative.

  • Gallery. In the details panel: each picture with its caption, its credit, its kind and, for a mock-up, an orange illustrative label. A picture that cannot be shown here (a missing file, a dead link) becomes a card with its alt text and why.
  • Lightbox. A click on a picture, or on a box's picture badge, shows it large with its caption, credit and alt text: ← → (or the ‹ › buttons) move through the list, Esc, ✕ or a click outside closes it and the focus goes back to what opened it. While it is open, Tab stays inside it and no page shortcut fires. It is a layer of the page, not a browser dialog, so nothing blocks scripts.
  • Dynamic view. A scenario's images are in the panel under its use case; a step's images (what the user sees there) appear while that step is current, and in the panel of the sequence inside a box.
  • Files and policies. Relative paths load from next to the page (the build copies them there); https URLs load from the web; data URIs are in the page. window.ARCH_IMAGE_POLICY = 'embedded' (the plugin's MCP view sets it) draws data URIs only: a web image is a card with an open ↗ link, a file a card saying it is not available there. Themes do not recolour images; the gallery and lightbox frame them on --code-bg.
  • For scripts and the editor: window.archImages (KINDS, TYPES, MAX_EMBED 400 KB, srcKind(src), check(image) → { errors, warnings }, fromFile(file, max) → a Promise of { src: data URI, bytes, type, name }), window.validateArchImage(image), and ARCH_EXPLORER.api.openImages(ref, i) / closeImages() with ref = n:<node id>, e:<edge index>, s:<scenario index> or st:<scenario index>:<step index>.

/ focuses the search box. It matches name, tag, path, sub-line and tech, and with a data layer entities (name, id, kind, IRI) and fields (name, type, IRI, or entity.field), lists up to 16 hits with their level and ancestry (an entity or field with its schema and where it lives; the Data view lists them first), supports arrow keys and Enter, and reveals the hit: opens its ancestors, selects it, centres the camera.

Variant filter

Present only when MODEL.variants exists. Each box carries one dot per variant (filled when the element exists in it). Choosing a variant in the toolbar fades boxes and arrows that do not belong to it, dims the matching entries in the panel lists, and removes the other steps from dynamic diagrams. Arrows that exist only in some variants are dashed and take that variant's tone.

Pinned board

A second view (B). Pin any box with P or the panel button. The board draws only the pinned boxes, each inside a frame for the box it belongs to, and the relationships between them, each edge lifted to its nearest pinned ancestor (an arrow between a box and a pin inside it is left out: the frame says it). This lets a reader compose a cross-level diagram, for example two externals, one container and three functions. It is laid out and routed by a core of its own, as the map is, from a model made of the pins and their frames.

  • Frames. The parent of a pinned box is drawn as a frame around it, styled like an open box on the map (dashed outline, its tag, icon and name), whatever its level. A parent that holds no pin of its own but two or more groups (pins under two of its components, say) frames them too, so they are shown together; a parent that would only wrap one frame is left out, so a code element pinned alone sits in its component's frame, not in three frames. A pinned box with pins inside it is drawn as their frame, marked pinned (accent outline and the pin mark): it reads as the box it is, opened on what was pinned in it. Top-level boxes (people, systems, externals) stand on their own.
  • Order, no gaps. Each group keeps the map's order: a box takes the cell its box has on the map (the reader's moves included), renumbered without the empty columns and rows. Unpinning closes the gaps and empty frames go; pinning one more box leaves the others in their order. A change of pins lays the board out again with the map's animation (the boxes move, the arrows are routed again when they stop).
  • A canvas. Drag to pan (on the board or a box), wheel or pinch to zoom at the pointer, the + / − / fit buttons, and F, +, − while the board shows. A double-click on a box zooms to it, on the empty board zooms in a step. The board opens fitted; a fitted board stays fitted when its view changes size or the pins change, otherwise the box nearest the middle of the view stays where it is. Below 34 % zoom the small text hides, as on the map. No minimap, and the camera is not in the URL (the map's is not either).
  • The selected pin shows ▲ (replace by its parent), ▼ N inside (replace by its children) and × unpin under it (in its header when it is a frame); P unpins it. A click selects (Ctrl / ⌘ / Shift + click adds), a click on an arrow selects one end, then the other; with a selection the unrelated boxes and arrows fade. Pins persist in localStorage per project; default pins restores MODEL.defaultPins, clear empties the board. Exports draw the whole board, whatever the camera.

Dynamic diagrams

A third view (D), present only when MODEL.scenarios is non-empty. For the chosen scenario:

  • Its flow colour. Every scenario has a colour (data-model.md, "Flow colours"): its arrows, step numbers, current step and the highlighted participants are drawn in it, and a swatch next to the picker shows it. The ☰ list gives each scenario its swatch; a step only in some variants keeps its variant's tone.

  • Scenario from the drop-down, or ☰ all scenarios (S): a modal listing every scenario with its desc, the elements it passes through at the container level, and its length. Write a desc for every scenario; the modal is where readers choose by it.

  • Draw at L1–L4, map (whatever is open on the map) or pins (your pinned boxes). Steps are lifted to that granularity; steps internal to one box are folded and counted; consecutive steps between the same pair merge.
  • As a collaboration diagram (boxes in columns by call depth, numbered arrows), a sequence diagram (sticky participant header and sticky step list), or a step table. Collaboration is the default at L1 and L2; from L3 on, and for map and pins, the sequence diagram is the default until the reader picks a style.
  • Collaboration columns follow message flow: the first sender is column 0 and each receiver sits one column right of whoever first sent to it. A participant that first appears as a sender (a worker picking up a job) is placed one column left of what it sends to. This only reads well if steps are written in the direction messages travel.
  • Step through with ◀ ▶, arrow keys, clicking any step, or play / space (1.5 s per step). The panel shows the current step, its variants and the underlying raw interactions with source paths; each links back to the map.
  • Zoom with the map's + − ⤢ buttons (bottom right), the keys + − F and 0 (100 %), and a pinch on touch. Fit (F, ⤢) is the view before any zoom: the collaboration diagram fitted in the view, the sequence fitted to its width (or centred). The collaboration diagram zooms like the map: the wheel zooms at the pointer (sideways it pans), a drag pans when zoomed, from half the fit to 250 % of its own size. The sequence diagram zooms like the map too: the wheel zooms at the pointer (and Ctrl + wheel, a trackpad pinch), Shift + wheel or a sideways swipe scrolls it sideways, a mouse drag pans it whenever it is larger than the view (also at the fit: the wheel no longer scrolls, so a drag is the way down a long sequence; the scroll bars still work), and a double-click on its empty space fits it again. Where it is no larger than the view there is nothing to scroll, so zooming in keeps the pointer's point only once it overflows. It scales as a whole, so the sticky participant header and step column stay aligned with their lanes; from 35 % of its own size to 300 %, or less where the step column would take more than half the view (on a phone, about 75 %). Under 55 % it is an overview: the messages' labels and the step list's text hide, the numbers and arrows stay, and a message or a step row still has its label in its tooltip. The step table has the same buttons for its text size (70 % to 200 %; Ctrl + wheel, pinch), since the table always fills the width and only the text needs to change. The zoom is kept while stepping and playing: when zoomed in, the current step (its arrow, label and both boxes; its row and message) is brought into view as it changes. A new scenario, level or style fits again. In the URL as dynzoom=2 (× the fit); ARCH_EXPLORER.api.dynZoom() and setDynZoom(s), and show_scenario's zoom. export ▾ → This view still saves the whole diagram, whatever the zoom.

Flows on the map

flows ▾ in the toolbar (or W) lists every scenario with its colour; tick one or several (or all / none) and their steps are painted on the map.

  • What is painted. Each flow's steps are lifted to the boxes the map shows, exactly as the Dynamic view does at map: a step that stays inside one box folds away, consecutive steps between the same two boxes merge, and the numbering is the Dynamic view's at map. Each step paints the arrow it travels along, in either direction, with a band in the flow's colour under the arrow; the arrow keeps its own colour on top (so compare mode's added, removed and changed arrows still read). A step between two boxes that no arrow joins is a dotted line in the flow's colour.
  • Step numbers. Each flow puts a chip on the arrow, near where the arrow starts, with its step numbers there (2·6; ↩3 when the step runs against the arrow, such as a reply; 1·4…11 when there are many). Chips are hidden below 34 % zoom, like labels.
  • Shared arrows: stripes. When several flows use one arrow, its band is divided into stripes, each flow taking every n-th 14 px dash, and their chips sit side by side. Stripes keep the arrow at its own width and in its own lane: right-angled arrows run 9 px apart in the gutters, so parallel offset lanes would spill onto the neighbouring arrows and read as arrows of their own. The chips keep the flows apart where colours are hard to tell (and for readers who do not see the colours).
  • Legend. A box at the top right of the map (bottom left under 820 px) lists the flows on, with their step counts at this level, ▶ (play that flow step by step on the whole map, see "A flow played on the map"), Dynamic › (the same scenario in the Dynamic view drawn at map, so the numbers match) and × to take one off; clear turns them all off. Its – button folds it to a one-line chip (the flows' colours and FLOWS · 3 +; a click unfolds it). Folded or not is remembered per browser and written to the URL (legend=min; legend=full unfolds it); until the reader or the URL chooses, it follows the width: folded under 820 px, where unfolded it would take much of the map.
  • Room for the legend. Fitting the map (F, the fit button, a level, the first view) and centring it on a box keep the boxes clear of what lies on top of the map: the legend, the minimap or its chip, the zoom buttons and the chips of the status bar. Each is kept clear either beside or above / below the boxes, whichever leaves them largest; where nothing covers the boxes, the fit is the plain centred one, and on a map too small for the usual margin the margin shrinks first. A fitted map is fitted again when the legend appears, goes, folds or unfolds, and when the map changes size (the window, the panel, the history bar); a map you panned or zoomed stays as you left it.
  • Fading. With nothing selected, the boxes the flows pass through and their arrows stay bright and the rest fades, as with a selection; their labels are placed first and in full. With a selection, the selection decides, and the bands and chips on arrows it fades fade too. Opening or closing boxes, the variant filter and the level buttons recompute the steps.
  • Off. none, clear or the last × removes every band, chip and fade. The state is #flows=annotate,review in the URL (so screenshot.mjs can draw it), the tool show_flows, and ARCH_EXPLORER.api.setFlows(ids); the legend's fold is ARCH_EXPLORER.api.setFlowLegend(folded) and flowLegendFolded().

Sequence inside a box (map)

Present only when MODEL.scenarios is non-empty; no model fields are needed. An open box that some scenario passes through gets a ⇅ sequence button in its header. It replaces the children drawn as boxes with a sequence diagram of one scenario, in place on the map, so the reader sees what happens inside a container without leaving it.

  • Lifelines are the box's children that take part in the scenario, plus the outside elements it talks to, as dashed grey cards: callers on the left, callees on the right. Outside elements are named as the map currently shows them (a closed container stands for everything in it).
  • Messages are the scenario steps that cross the box's border or run between two of its children, lifted to those lifelines, drawn in the scenario's flow colour. Steps that stay inside one child are folded and counted in the scenario bar; consecutive steps between the same two lifelines merge.
  • Scenario bar ‹ › cycles through the scenarios that pass through this box. The details panel lists them too ("Sequence inside").
  • Click a message to pick it: the panel shows the step, its underlying interactions with source paths, ◀ ▶ and Open in Dynamic (the same scenario on the Dynamic tab, one level below the box, on that step). ← → step, Esc clears.
  • ▶ play in the scenario bar (or space once a message is picked) walks through the messages, one every 1.5 s, panning the map to keep the current one in view. Any other action stops it.
  • Click a lifeline card to select that element. A selected element keeps its own messages bright and fades the rest. Its panel offers ⇅ Sequence inside again, which drills down: the child shows its own sequence and the parent goes back to boxes.
  • ▦ boxes goes back to the children as boxes, − close or a double-click closes the box, S toggles the selected box, and a level button (1–4) resets every box to boxes.
  • For layout and arrows a box showing its sequence counts as closed: map arrows route around it. They attach to the sequence itself, not to an IN / OUT tray (it has none, in every label mode), on the side facing the other box:
  • at a message row when messages of the shown scenario travel the arrow (between the lifeline of the box at its other end and one inside): the first such row. A dot marks where the arrow meets the border, and a chip outside it, in the scenario's colour, lists the step numbers of every row it stands for (1·9: steps 1 and 9). One port per arrow keeps the routing as clean as elsewhere; the chip names the other rows. A message that runs against the arrow (a reply) counts when no arrow runs its way;
  • at the participants' cards when no message travels it: at the cards' row, with a chip naming the inside participant its relationships end at (several such arrows are spread over the cards' height);
  • at the title strip when that participant takes no part in the scenario, or the relationship is the box's own. The pointer on an arrow lights its rows (or card), and the pointer on a row or a card lights the map arrows attached to it; a selected connection marks its rows. Another scenario (‹ ›) attaches the arrows to its own rows; ▦ boxes brings the tray back (labels in the boxes). The arrow card (pointer on an arrow) still lists everything the arrow carries.

A flow played on the map (collaboration inside a box)

Present only when MODEL.scenarios is non-empty; no model fields are needed. An open box that some scenario does something inside gets a ⇄ flow button in its header, left of ⇅ sequence (its panel: ⇄ Flow inside). It plays one scenario among the boxes drawn inside it, as a collaboration diagram drawn in place: the box and its children keep their layout (unless left to right is on, below), so the reader sees which parts take part in an action, in which order, along the arrows they already know.

  • Which steps. The scenario's steps with at least one end inside the box (the variant filter applies), lifted to the boxes drawn: an open child shows its own children taking the steps. A person's own steps count too, even with both ends outside the box (Admin → Admin upload page when the flow plays inside the API service), so the flow starts with whoever starts it. Other steps that stay outside the box are left out; consecutive steps between the same two boxes merge, as in the Dynamic view; the rest are numbered 1…N. A step with an end hidden on the map, or between a box and what holds it, is not drawn (the panel counts them).
  • How a step is drawn. Along the arrow it travels, in either direction (↩3 against the arrow); as a dotted line where no arrow joins the two boxes; as a ↻ 4 badge on a box's top edge for a step inside one box. A step from or to the outside runs along its arrow across the border, where a chip names the outside end (from Admin · L1, to MinIO · L2, ⇄ Web app · L2 both ways; left out when that box is right next to the border).
  • The people in it. Each person who is an end of a step, outside the box, takes part visibly. Near: when the person's own box is drawn within a fifth of the box's size (at least 160 units) of it, as the people above an open system are, that box stays bright, is ringed on its step, is framed with the box, and its steps run along its arrows (no border chip for it). Far: otherwise (at L3, where the people stand far above), an actor card (the person's icon, name and L1 · PERSON) is docked outside the box's border, one per person in the order they first act, beside the box each first talks to, on the side the flow comes in from (the left with left to right on; the side covering the fewest boxes that take part wins). Its steps run from the card to the box it talks to, numbered like the others, the current one's label under the card; the card is ringed on its step and faint before it. The camera frames the box with the near people, what they act on, and the cards. The other outside ends (stores, external systems, containers) keep their border chips.
  • Left to right (the bar's ⇢ left to right, cflow=lr; not on the whole map): while the flow plays, the boxes inside the box stand in the order the flow reaches them. The box a step enters by (or the first one) is in the first column; each box is a column right of the box that first reaches it; a column's boxes are in the order they come in, then sorted by the row of the box that reached them; the boxes the flow does not reach go in a row under them, in the order they had. It is a layout overlay (the core's setCells, as the reader's moves are), never stored as moves and not written by edit mode: turning it off, or leaving the flow, puts the boxes back. The choice is kept in this browser (localStorage key architecture-explorer-collab-lr) for the flows the reader starts; a link with collab= uses its own cflow. While it is on, the boxes of that group cannot be dragged.
  • The current step is drawn on top in the flow's colour with an arrowhead, a dot running along it (not with reduced motion) and its label beside its chip; both its ends are ringed in the flow's colour. The steps before it stay coloured (bands and filled chips), the ones after it are faint (dashed chips); a chip lists every step on that link, the current number underlined (past four: the first, the current, the last). With the labels in the boxes the IN and OUT rows carry the chips and the current row is outlined.
  • The rest of the map fades, as with flows on; a selection still decides what is bright. The minimap and the frame's beyond chips follow.
  • The bar (where the flows legend is; one row at the bottom under 820 px, between ? and the zoom buttons): the box, ✕, the scenario picker (the scenarios that do something inside the box), ⇢ left to right (only ⇢ on a phone), ‹ n / N ›, ▶ play (one step every 1.5 s, as the Dynamic view plays; from the start again on the last step), Dynamic › (the same scenario in the Dynamic view at map, on the step that holds the current one), and the current step: its number, from → to and its labels. The camera pans (never zooms) to keep the current step clear of the bar.
  • The panel shows the current step: from → to, a note when one end is outside, ◀ ▶ play, Open in Dynamic, About the box, ✕ Leave the flow, the underlying interactions with their source paths, images and data, every step (a click goes there) and how to read it.
  • Keys. ← → step, space plays or pauses (also on a focused box: it does not open or close it while a flow plays), Esc leaves.
  • The whole map. ▶ on a row of the flows legend plays that flow over the whole map as it is open (collab=*:<scenario>); the steps are those the legend counts.
  • What leaves it. ✕, Esc, closing or hiding the box, ⇅ sequence in it, choosing flows to paint (the painted flows wait while one plays, their legend hidden, and come back after) and edit mode (no ⇄ flow there). Opening or closing boxes inside, the variant filter and the label modes recompute the steps and keep the flow. An SVG or PNG export keeps the bands, chips and stubs, not the running dot.
  • For scripts and agents: ARCH_EXPLORER.api.collab() (box, scenario, step, steps, playing, current step, leftToRight, and people: each person taking part and whether it is shown as its own box or a card beside the box), collabScenarios(id), showCollab(id, scenarioId, step, play, leftToRight) (null id: the whole map; returns every step, numbered as drawn, a person's own step outside the box marked outside), collabLeftToRight(on), collabStep(i), closeCollab(); the tool show_collaboration (leftToRight, with box); get_view reports it as collaboration.

The map and a sequence side by side (⫴ split)

Present only when MODEL.scenarios is non-empty. V, ⫴ sequence in a flow's bar (see "A flow played on the map") or ⫴ with the map in the Dynamic view's toolbar opens a pane on the right of the map with the sequence diagram of the flow the map plays, and the two stay in step.

  • What opens. From the map: the flow that plays (inside an open box, or over the whole map); with none playing, the Dynamic view's scenario (else the first) is played over the whole map first. From the Dynamic view: that scenario over the whole map, on the step that holds the interaction the Dynamic view was on. The map is fitted in what is left of the width; the details panel folds while the pane is open and comes back after (I still opens it).
  • The same steps on both sides. The sequence is drawn from the flow's own steps, lifted to the boxes the map draws, so the map decides the lifelines: open a box on the map and its parts become lifelines, close it and they fold back into one (a level picked in the pane could not be drawn on the map, so the pane has none). A step inside one box is a small loop on its lifeline (↻ in the step list), as the map draws it as a ↻ badge. The pane's head says the scenario, the step and where the flow plays, with Dynamic › (the sequence on its own, in the Dynamic view) and ✕; the Dynamic view's toolbar is hidden.
  • One current step. Either side moves it: ← → and space (the flow's keys), the bar's ‹ › and ▶ play, a click on a message or a row of the sequence, a click on an arrow of the flow on the map (its next step there; past its last, its first). The map pans to keep the current message in view (it does not zoom); the sequence scrolls to its row.
  • Pointing across. A box selected on the map lights its lifeline in the sequence (an open box: the lifelines of the boxes drawn inside it), its card ringed in a dashed accent line; a click on a lifeline's card selects that box on the map. The pointer on a message or a row of the sequence lights its arrow on the map (as the pointer on the arrow does); the pointer on an arrow of the map (or an IN / OUT row) lights its messages in the sequence.
  • Zoom. The pane's sequence zooms as in the Dynamic view (see "Dynamic view"): the wheel at the pointer, Shift + wheel sideways, a drag pans, a double-click on its empty space fits, its own + − ⤢ buttons, and + − F 0 while the pointer or the focus is in the pane (elsewhere they zoom the map). The map is not moved by the pane's wheel.
  • Size. The pane's left edge drags (or ← → when it has the focus); the width is kept in this browser (localStorage key architecture-explorer-split-width). Under 820 px the map is above and the sequence below (no divider), and the details sheet waits until the pane closes.
  • Closing. ✕ in the pane, the bar's ⫴ sequence or V close the pane, and the flow goes on playing on the map. Esc, or anything that ends the flow (its ✕, edit mode, another view, a level button) closes both. The Mermaid panel (G) takes the pane's place.
  • Exports draw the map (the view the page is on); Dynamic › shows the sequence on its own, to export it.
  • URL and scripts. split=1 next to collab= (a reload opens the same flow, step and pane; a details panel folded by the split is not written as panel=closed). ARCH_EXPLORER.api.split(scenario, step) (scenario id or index, step from 1; none: the flow playing, else the first scenario) returns splitState(): { scenario, box, step, steps, playing }, or null when closed; closeSplit().

Labels in the boxes (IN and OUT)

The default (the labels ▾ menu's In the boxes; #labels=arrow or #labels=0 in the URL picks the others). Instead of a label on each arrow, every drawn box with arrows lists them under its body, and the arrows run to those lines.

  • Two sections. Under the body (a closed box's; an open box's frame and children) a tray holds IN · n (the arrows that arrive) and OUT · n (the arrows that leave). A section with no arrow is left out; a box with no arrow keeps its size. A box showing its sequence has no tray: its arrows go to its message rows (see "Sequence inside a box"). A click on a header (▸ folded, ▾ unfolded) folds or unfolds that section of that box. By default both are unfolded, so each box says what it calls and what calls it (a label shows at both ends); folding IN shows each label once, at the box that makes the call (labels are written from the caller's side).
  • Every box at once. In this mode the labels ▾ menu has ▸ IN / ▾ OUT under its entries: each folds or unfolds that section in every box (and drops the choices made for single boxes). The default for every box is in the URL (io=out, io=in, io=none; io=in,out is the default and not written); a single box's choice lasts for the visit.
  • Each row reads (in the labels ▾ menu, under the sections): box · label, the default (the box at the other end first, so who talks to whom reads at a glance: → API service · POST /orders for an OUT row, ← Web app · proxies /api/ for an IN row; when text must be cut, the label goes first), or label → box (what the arrow does first). In the URL as iorder=label; the default is not written.
  • Rows. An OUT row reads → target · label, an IN row ← source · label (label first: label → target, label ← source), in the arrow's colour; a self-transition of a state is an OUT row label ↻ (its loop stays drawn on the box). An arrow that merges several relationships is one row with its first label and +N (an edge's summary speaks for it, as on the arrow). Text that does not fit is cut with "…", the target's name first (down to 10 characters), then the label (box first: the label first); the arrow's card (see "Arrow labels") has it whole, with every label of a merged arrow, and with Long text on hover (the default) the row's whole words slide by under the pointer (see "Long text"). Past 6 rows a section shows 5 and a +K more row; its arrows meet there, and a click on it lists them all. Rows are sorted by where their other end is (top to bottom, then left to right), so the arrows leaving one side of a box cross little.
  • A click on a row selects that connection: the arrow behind the row, with every relationship of a merged (+N) row. Ctrl / ⌘ / Shift + click adds rows or takes them out, Ctrl / ⌘ / Shift + click on a header (IN · n, OUT · n) or on +K more selects all of them; a plain click on a header still folds it. See "Selecting connections".
  • An arrow's icon stands before the row's label (the row keeps room for it, so its text is cut a little sooner).
  • Where arrows attach. An arrow leaves its OUT row and arrives at its IN row, on the side of the row that faces the other end; when the two boxes stand above each other both ends are on the same side, so a line never loops around its own box (the Data view's rule for its row-to-row lines). The arrows of a folded section meet at its header (IN · 5 still shows five lines arriving there), those of a +K more row at that row. Right-angled arrows keep the map's router, gutters and lanes: only the ports change (from the rows instead of spread along a side), short arrows are routed first, a path pays for each line it would cross, and the stretches beside a box are put on lanes so that lines from rows one above the other nest. Straight arrows run from row to row.
  • Layout. A box is taller by its sections (a header 19 px, a row 17 px, at the default label size; the "Labels and arrows" size scales them), so rows and columns of the grid, the gutters, open boxes, the minimap, fit and zoom all follow. Switching to or from this mode, or folding a section, lays the map out again with the usual animation: a fitted map is fitted again; else the selection is centred at the same zoom; else the box nearest the middle of the view stays where it is (folding keeps the box clicked in place).
  • The rest of the map. Selection lights the rows of the arrows it lights and fades the others; the pointer on a row (or a header that gathers arrows) lights its arrows and the rows at their other ends, the pointer on an arrow its rows. With flows on, a row of an arrow a flow travels along gets the flow's colour and the chips with its step numbers (shortened to the first number, 2…, when they would crowd the text; an arrow with no row of its own keeps its chips on the arrow). In compare mode the rows of added, removed and changed arrows take those colours (a removed one struck through), and a header that gathers changed arrows too. Hidden boxes take their arrows and rows with them. The variant filter fades rows like arrows. Below 34 % zoom the row text hides, like arrow labels. This view exports draw the rows.
  • Not affected. The Pinned board (it has its own drawing, with labels on its arrows), the Dynamic view, the Data view (its line labels show unless labels are off) and the Mermaid export, which keeps labels on the arrows: Mermaid cannot attach an arrow to a line of text in a node.
  • For scripts and agents: ARCH_EXPLORER.api.labels() ({ mode, in, out, order }) and setLabels(mode, { in, out, order }); the tool set_labels (order: label or name); the core's setLabelMode, ioDefault, setIoDefault, setIoBox, setIoOrder. check-model.mjs reports the same groups in this mode on one LAYOUT line (crossings, lines lying on another, rows cut).

Selecting connections

What a reader points at is often a connection, not a box: "this call, and that one". Connections are selected by the relationships they carry (indexes of MODEL.edges), so a selection survives opening and closing boxes: an arrow is selected while it carries a selected relationship, and an arrow that splits when its box opens keeps every part selected.

  • With the labels in the boxes (the default): a plain click on an IN or OUT row selects that connection and nothing else; Ctrl / ⌘ / Shift + click on another row adds it (on a selected one, takes it out); Ctrl / ⌘ / Shift + click on a section's header (IN · n, OUT · n) selects all of that box's inputs or outputs (again, when they all are selected, takes them out), on +K more the arrows it gathers. A plain click on a header still folds or unfolds it, on +K more still lists every row.
  • On an arrow (in every label mode, at any zoom): a plain click selects that connection alone, as a click on its row does, and keeps its label shown (touch has no hover); a click on it again, when it alone is selected, lets it go. Ctrl / ⌘ / Shift + click on an arrow or on its label adds that connection or takes it out. In edit mode a click opens the arrow's card instead (see "Edit mode").
  • What is marked: the selected arrows are drawn thicker in the accent colour (their labels outlined), and their rows are marked at both ends (a folded section's header, or a +K more row, when it gathers one). Both ends of every selected connection stay bright; every other box, arrow and row fades, as with a selected box.
  • Mixed with boxes: Ctrl / ⌘ / Shift + click adds a box or a connection to whatever is selected, of either kind; a plain click on a box, a row, a search hit or a link in the panel starts again with only that. Bright is the union: the selected boxes with what is inside them and the other ends of their arrows, plus both ends of every selected connection. P and X act on the selected boxes. Esc, a click on the empty canvas or Clear selection clears both kinds.
  • The panel lists, for each selected arrow: its label (with its icon), its two ends (buttons that go to them), the relationships behind it (label, ends, where each end lives in the source, its index, compare mode's word on it: added, removed, changed; a click selects only that relationship, × takes it out), the flows whose steps travel along it, in either direction, numbered as the flows on the map number them (a click opens the Dynamic view on that step), and their images. Actions: Show on map (fits the ends), Select the ends (the boxes instead), Clear selection. Selected relationships the map does not draw now (an end hidden, or both ends in one closed box) are listed apart, each with a button that shows it. With boxes selected too, they are listed first.
  • Keyboard: rows are in the tab order after their box, with names for screen readers (Out: POST /orders, to API service); Enter or Space does what a click does, Ctrl / ⌘ / Shift + Enter adds; on a header, Enter folds and Ctrl + Enter selects them all. The focus stays on the row when the box is drawn again.
  • URL and agents: #rel=3,7 (relationship indexes, written while the Map is shown); the tool select_relationships (by index, add to keep what is selected); get_view returns relationships; for scripts ARCH_EXPLORER.api.selectRelationships(indexes, keepBoxes), selectedRelationships() and connections() (the arrows drawn for them: ends, label, relationships, which are selected).

Reading the map zoomed out

Below 34 % zoom (where the arrow labels and the IN / OUT rows' text already hide) a box's own text is too small to read; a whole system at L3 or L4 opens there. Three things take over, on the Map only:

  • Names, large. Each closed box shows only its name (and its icon, when there is room), at about 13 px on screen whatever the zoom: on one line, or two (split between words, at - _ / ., or between a lower-case letter and a capital, so AdminUploadPage splits too), as large as the box allows. Its tag, sub-line, IN / OUT rows and badges hide (its copy shows them, below). When the whole name would come out under 10.5 px, it may run past the box's sides, in ink on a halo of the map's background, and when even that is too small it is cut with "…". An open box's title grows along its header up to its buttons, or sits above its frame, on a halo, when the header is too small. The arrows still end at the boxes. The size menu's Names zoomed out: normal (#names=normal, remembered per browser) keeps every box's own text instead. Exports draw the normal text.
  • A magnifier. The pointer resting on a closed box for 300 ms (from one box to the next, at once), or the keyboard's focus on it, shows a copy of the box at a readable size (100 %, at most 320 px wide and about half the map high; less on a phone) beside it, never over it, kept on the map and clear of the controls and the handles, with a dashed line to the box: the box as it is drawn zoomed in, with its tag, name, sub-line, icon, badges and IN / OUT rows. It is a picture: a click goes through it to the map. It goes when the pointer leaves the box, at a press, a drag or the wheel. Not on touch, and not in edit mode (the editor's card is there). The cards of the rows (see "Labels in the boxes") wait until the map is zoomed in again; arrows keep theirs.
  • A click collects. A plain click (or a tap) on a closed box adds it to the selection and keeps its copy, with a ✕ and a line to the box, in the accent colour; clicking further boxes collects them too, so several can be compared side by side and the panel lists them as for any multiple selection. A click on a collected box again, or its ✕, lets it go (out of the selection too). Esc, or a click on the empty map, clears them all, as it clears the selection. Two clicks in a row still open a box; Ctrl / ⌘ / Shift + click, the + N inside, picture and data badges, and the arrows do what they always do; the rows, too small to aim at, count as the box. The copies keep apart from each other, from their boxes, from the other boxes collected and from the controls, follow the camera, and go when their box leaves the selection, opens, closes or hides. Zooming in past 34 % puts every copy away: the boxes can be read again, and the selection stays. In edit mode a click is the editor's, as always.

For scripts: ARCH_EXPLORER.api.zoomedOut() ({ below, at, bigNames, collected, hover, copies }), bigNames() and setBigNames(on). The copies are HTML over the map (#lzmag), so exports never draw them.

Icons

An icon on a box (node), an arrow (edge), a schema, an entity or a scenario, with an optional iconColor (data-model.md, "Icons"). Icons are open source and travel with the page:

  • The built-in set: 91 infrastructure glyphs from Tabler Icons (outline, MIT; the notice is in the icons block), in the page, so they work offline, in the plugin's MCP view and in the editor: user, users, server, database, stack (a cache), stack-push and list-details (queues), bucket, cloud, lambda, container, api, browser, lock, key, shield, mail, clock (a scheduler), broadcast (events), load-balancer, robot, brain and more (ARCH_ICONS.names()). database and tabler:database are the same icon.
  • Libraries: any Tabler icon (tabler:<name>, about 5,000, MIT) and any Simple Icons brand logo (si:<slug>, about 3,500, such as si:postgresql; the SVG data is CC0, the logos remain trademarks of their owners and are shown to identify the technology), at pinned versions (Tabler Icons 3.51.0, Simple Icons 16.37.0 on jsDelivr). build-explorer.mjs writes the ones a model names into the page's icon-data block (window.ARCH_ICON_DATA), so the built page needs no network. Vendor cloud icon sets (AWS, Azure, GCP) are not open source: they are neither bundled nor fetched; point icon at your own file instead.
  • Your own: a key of MODEL.icons ({ svg, title?, source?, license? }), a file next to model.js, an https URL or a data:image/svg+xml URI.
  • Lookup: MODEL.icons[ref], then ARCH_ICON_DATA[ref], then the built-in set; an icon that cannot be found is drawn as a dashed ? whose tooltip names it, and the console says so once. Files and URLs follow the images' policy (ARCH_IMAGE_POLICY = 'embedded' draws data URIs only).
  • Safe SVG: every SVG is cut down before it is drawn: only svg, g, path, circle, ellipse, rect, line, polyline and polygon, with their geometry and their fill, stroke and other presentation attributes (a style keeps only those properties). Scripts, event handlers, links and references (href, url(…)), images, text, foreignObject, defs and styles go, with what is inside them. The drawing is written anew from what was kept, never copied through. The validator warns about what an icon of MODEL.icons loses.
  • Where they show: closed boxes (before the tag, 16 px; 20 px on people and systems), open boxes (before the title, 22 px), arrow labels (at their start; the label is wider by it and placed as such), a round badge at an arrow's middle when labels are off, IN / OUT rows (before the label), the details panel's title, the Pinned board's cards, the Dynamic view's participants (collaboration boxes and sequence headers) and its scenario list and panel, the cards of the sequence inside a box, the Data view (a schema's frame title shows the schema's icon, else the icon of the box it lives in; an entity card shows the entity's), the search hits, and the connection panel. Exports (SVG, PNG, HTML) carry them as drawn. A merged arrow shows an icon when the relationships it carries that have one all name the same one.
  • Colour: iconColor decides for that icon: a tone (teal …) or brand. Without it, the page's setting decides: mono (the default) draws an icon in the colour of the text beside it (the box's ink; on a person's filled box its light text colour; on arrows and rows the label's colour); brand draws a logo in its brand colour (Simple Icons' hex, or a custom SVG's own colours), but only where every one of those colours keeps a contrast of at least 3:1 with what the icon stands on in the current theme (the box's fill, the label's pill, the row's section, the panel); otherwise mono. A theme change decides again. The setting: view.icons ('mono' or 'brand') and view.showIcons: false (none) in the model; the reader's Icons row in size ▾ (mono · brand · off, shown when the model has icons); #icons=brand (or mono, off) in the URL when it differs from the model's; ARCH_EXPLORER.api.icons() and setIcons(mode); get_view returns it.
  • Pages without icons look exactly as before: no room is kept, nothing is drawn, the Icons row is not offered.
  • For scripts: window.ARCH_ICONS (the icons block, DOM-free; the build and check scripts run it with vm): icons (name → inner SVG), words, names(), has(name), parse(ref), sanitize(svg) → { viewBox, root, body, colors, removed } or null, markup(S, 'mono' | 'own'), resolve(ref, MODEL.icons, ARCH_ICON_DATA, policy), search(q), searchIndex(lib, index, q), suggest(node, siIndex) (the same rules as suggest-icons.mjs: whole technology names only), contrast(a, b), LIB (the pinned URLs), and, in the page with the network, fetchIndex(lib) and fetchIcon(ref, hex).

Data view

A fourth tab, Data (A; ← Map at the start of its bar goes back to the map), present only when MODEL.entities is non-empty (schemas, entities, relations and the reads / writes of steps and edges: data-model.md, "Data"). It draws the data layer DB-diagram style:

  • Schemas are frames in the schema's colour (its color, else by kind: relational blue, ontology violet, JSON Schema and queue gold, document and API teal, object store brown, other neutral), titled with the kind, the format, the count (RELATIONAL · SQL · 6 TABLES), the name and where it lives (in PostgreSQL: the name of its in node).
  • Entities are cards: the kind (TABLE, CLASS, OBJECT, BUCKET, MESSAGE, ENUM…) and the name, then one row per field in declaration order: badges (PK identifier, FK reference, dashed when soft, UQ unique), the name, and the type in monospace ([] added for many, {5} when the field lists allowed values). An enum lists its values. A name or type too long for the card (340 px at most) is cut with "…"; the tooltip and the panel show it whole, and the validator warns.
  • Lines join rows: a field's ref runs from its row to the row it identifies (the target's identifier when only the entity is named, the header when the entity has none), a relations[] entry between the rows or headers it names. Ends: crow's foot for many, bar for one, circle for zero (cardinality of a ref: 0..*, or 0..1 when unique, at the field; 1 when required, else 0..1, at the target; card on a relation sets both), a hollow triangle at the class a subclass extends, a filled diamond at what contains, an open arrow for an assoc. Dashed: soft (not enforced by the store; a ref between two schemas is soft unless it says soft: false); dotted: maps (the same thing in another schema). Labels (refLabel, label) sit on the line, up to 22 characters.
  • Layout (the core script's archData, so check-model.mjs computes the same): inside a schema, cards stand in columns ranked by what they point at, a referenced table left of the tables that reference it (a part right of what contains it, a subclass right of its class), ordered to cross little, rows lined up with the rows they join; columns taller than about the frame's square side wrap; entities joined to nothing in their schema stack to the right. at: [column, row] on every entity of a schema places them by hand (some but not all: a warning, and automatic layout). Frames go in centred rows, the first declared first, then each time the schema with the most lines to those already placed, at the row width that lets the whole drawing fit largest in the view. Lines are right-angled, in the gutters, never across a card or a frame's title, on lanes of their own where they run side by side (lines that end at the same row may share one). Laying out 30 entities takes about 10 ms in a browser, 150 about 60 ms.
  • Pan, zoom, fit, minimap as on the map: drag, wheel or pinch, + − F and the buttons, a minimap (it folds with the map's, O). The first view fits everything, or zooms to what the URL selects, or to dzoom=.
  • Selection, the map's way: a click on a card keeps it, the cards it joins and the lines between them bright, with the rows those lines end at marked, and fades the rest; Ctrl / ⌘ / Shift + click (or + Enter on a focused card) adds a card or takes it out; a double-click zooms to a card and what it joins. A click on a field row keeps that field and the fields it references or that reference it. A click on a line selects the line (both ends bright), on a frame's title the schema. Esc or a click on empty canvas clears it.
  • The panel. An entity: its schema, kind, description and notes; Location (the schema, where it lives as buttons that open the map on that box, Defined in: its code boxes, its IRI); Source link; values; Fields (each with its badges, type, default, allowed values, reference and lifecycle; a click selects it); indexes; Points at and Pointed at by (every line, with its kind, label and cardinality); Used in: per scenario, in its flow colour, the steps that read or write it (step number as written in the model, label, reads / writes and which fields, from → to; a click opens the Dynamic view on that step) and the edges that do. A field: the same for one row, plus its Lifecycle when it has states (the state box and each state, as buttons to the map). A schema: its location, namespace, format, technology, source, its entities, and the schemas it is joined to with their lines. A line: its ends, kind, cardinality in words, soft or not. Nothing selected: the schemas, the notation, the keys.
  • Lines drawn always or on demand (the lines buttons, J, #lines=): refs (references and associations), contains · extends and maps. A kind that is pressed is drawn always; the others only where one of their ends is selected (or its schema, or the line itself), under the pointer, or read or written by a flow on. By default references, contains and extends are drawn always and maps lines on demand, which keeps the overview readable when many tables have a class or a JSON-LD term of their own. J draws every line, and again goes back to the default. The cards never move when this changes: the lines drawn always get their lanes and labels first, so the others take the outer lanes and leave no gap while hidden. Only lanes and labels are given out again (no new route search), so a toggle costs a few milliseconds.
  • Keys only (K, the keys only button): the cards keep identifiers, references, unique fields and every field a line ends at, and say how many others they hide; for large schemas.
  • Flows (W, the flows ▾ menu, #flows=): the scenarios on are painted over the data: a ring in the flow's colour around a card a step reads or writes whole, a tint and a bar on a field's row, and chips with the step numbers (3W step 3 writes it, 5R reads it; several flows side by side) at the right end of the row, the type moved left of them and shortened when there is not room for both (the tooltip and the panel keep it whole). With nothing selected what they touch stays bright. The Data view has its own legend (steps with data per flow, Dynamic ›, ×, folding like the map's).
  • Elsewhere on the page. A box that a schema lives in carries a small data badge with a table glyph and the number of entities, in the schema's colour (a click opens the Data view on that schema); its panel has a Data section with its schemas and their entities, and a box whose code defines entities lists them under Defines or maps. A Dynamic step that reads or writes data lists it as chips (W images.thumbnail_key) in the panel, the sequence-inside panel and a Data column of the step table; a chip opens the Data view on that field. Search (/) finds entities (name, id, kind, IRI) and fields (name, type, IRI, or entity.field); in the Data view they are listed first. export ▾ → This view saves the Data view whole as SVG, PNG or HTML.
  • Compare mode (with a history): the history script gives entities, fields, relations and schemas the classes it gives boxes and arrows (h-add, h-del, h-chg): added cards and rows green, changed amber, removed ones as red dashed ghosts (merged into the model by the history script), struck through.
  • For scripts: ARCH_EXPLORER.api.goTo({ entity, field }), goTo({ schema }), goTo({ relation: i }) (the i-th entry of MODEL.relations); dataSelection(), setKeysOnly(on), dataLayout() ({ schemas, entities, fields, lines, behind, crossings, ms }), dataCam(); counts.schemas and counts.entities.

Deployment view

A tab, Deployment (Y; ← Map at the start of its bar goes back to the map), present only when the model has a deployment (data-model.md, "Deployment"): one C4 deployment diagram (https://c4model.com/diagrams/deployment) per environment, picked in the view's bar.

  • What it draws. Deployment nodes as frames that nest, with a solid outline and a 3-D edge (UML's node; software system boundaries stay dashed), their technology in the header and ×N for several, drawn with copies stacked behind. Inside them the instances of the model's containers and software systems, drawn like their box on the map (its colour, its icon, a cylinder for a data store), the box's name with ×N and the instance's technology (the image, the port), and infrastructure nodes as plain boxes with a dotted outline. Arrows: the model's own relationships, lifted to the boxes the instances run (as the map lifts them to closed boxes) and merged per pair ("first label +N"), plus the environment's own relationships in the accent colour.
  • Layout. The page's core lays the environment out and routes its arrows exactly as it does the map: deployment nodes are open boxes, their contents in a grid, the arrow style, spacing and label size of the map. Nothing is laid out by hand.
  • Reading it. A click selects a node, an instance or an infrastructure node: what is inside it, the frames around it and the other ends of its arrows stay bright, the rest fades. The panel shows an instance's box (with Show on map), where it runs (its path of nodes, also as the breadcrumb), its technology, what it uses and what uses it in this environment, the other environments it runs in, and its source (the compose or manifest line); a node lists what is inside it. A double-click on an instance goes to its box on the map. A click on an arrow selects one end, again the other. With nothing selected the panel describes the environment (counts, its nodes, the other environments). Esc clears; F, +, − fit and zoom; drag pans, the wheel and pinch zoom.
  • From the map. A container's, data store's or software system's panel lists Deployed in: each environment and node path where it runs (×N), and a component's says where its container runs; each entry opens the Deployment view on that instance.
  • Mermaid. In this view the Mermaid panel (G, the bar's Mermaid button, or export ▾ → Mermaid) shows the environment as Mermaid C4Deployment (Deployment_Node, Node, Container, ContainerDb, ContainerQueue, System, Rel), with the preview and the downloads; it is read only (change the deployment in model.js or in edit mode). model-to-mermaid.mjs --deployment [env] writes the same text.
  • Exports. SVG, PNG and HTML of the view on screen draw the environment whole (<project>-deployment-<env>).
  • Edit mode. The drawer's Deployment section holds the deployment as JSON: Apply checks it with the validator and writes it as one undoable step (empty: no deployment). Deleting a box drops its instances; changing a box's id moves them.
  • URL: view=deploy&env=<id>&dsel=<item id>. Agents: get_deployment (environments, nodes, instances, relationships with the model edge each comes from) and show_deployment (an environment, and an item or a model box's instance to select); ARCH_EXPLORER.api.showDeployment(env, focus) and deployment().
  • Not drawn: a minimap of this view, and moving or arranging its boxes by hand (its layout is the core's).

Keyboard

Key Action
1–4 Open the map to that level
/ Search
F, +, − Fit, zoom in, zoom out (the map, or the Data view or the Dynamic view when it is shown; for the step table, its text size; beside the map, the sequence while the pointer is in its pane)
0 100 % (Dynamic view)
M, B, D, A, Y Map, Pinned board, Dynamic, Data (only with entities), Deployment (only with a deployment)
K Keys only (Data view): cards keep identifiers, references, unique and referenced fields
J Every line in the Data view, or back to the default (maps lines on demand)
P Pin or unpin the selected box (every selected box)
X, Shift+X Hide the selected boxes on the map (a view filter); show every hidden box again
R The arrange menu (Map): place the boxes so that fewer arrows cross (see "Arranging the boxes"); in edit mode it writes at
← →, Esc With the Issues area open (focus not in a field): previous, next finding; Esc in the area closes it (see "Coherence: the Issues area")
← → ↑ ↓ Map: move the selected box one place, when it is free to move (see "Moving boxes")
Ctrl / ⌘ / Shift + click, or + Enter on a focused box Add the box to the selection, or take it out
Click, or Enter, on an IN / OUT row Select that connection (see "Selecting connections"); with Ctrl / ⌘ / Shift, add it or take it out
Click a closed box, zoomed out (below 34 %) Collect it: its large copy stays beside it and it joins the selection; again, or its ✕, lets it go (see "Reading the map zoomed out")
Ctrl / ⌘ / Shift + click on an arrow, a row header or +K more Add that connection, or all of that box's inputs or outputs, to the selection (or take them out)
S Sequence inside the selected box, or its boxes again (Map) · all scenarios (Dynamic)
L, E, T Arrow labels (on the arrows, in the boxes, off), arrow style (right-angled / straight), next colour theme (the theme ▾ menu lists them all)
W The flows menu (Map and Data view): paint scenarios on the map, or what their steps read and write on the data
I Hide or show the details panel (fold or unfold the bottom sheet under 820 px)
O Minimize or restore the minimap
? How to explore: the keys, the legend and the variant filter, in a card over the map (Map)
G The Mermaid panel (Map): the map as Mermaid text, open or closed
V The flow's sequence beside the map, in step with it (Map: the flow playing, else a scenario over the whole map; Dynamic: this scenario on the map, on the same step); again: close it. See "The map and a sequence side by side"
Delete, Ctrl+Z, Ctrl+Y In edit mode: delete the selected box, undo, redo. F2, or Enter on the selected box, renames it on the map. A drag from a dot on a box's side to another box (or Alt+drag) connects them. I opens or folds the editor's drawer; the tool rail and the outline have their own keys (see "Edit mode")
Esc Clear the selection (boxes and connections), then leave a flow played on the map; with the version list open, close it first; with the lightbox open, close it
← → space Previous step, next step, play (Dynamic; on the map, a flow played inside a box, see "A flow played on the map")
[ ], C, H With a history embedded: previous / next version, compare mode on or off, the version list (drawer) open or closed
↑ ↓ Home End In the version list and in a list of changes: move between the entries (Enter / Space activates)
Tab, Enter, Space on a box Focus, select, open or close

Colour themes

The theme ▾ menu offers auto (light, or dark when the operating system is in dark mode) and six fixed themes:

Theme Look
light Cool grey canvas, navy accent. What auto shows by default.
dark Deep navy, soft colours. What auto shows when the OS is dark.
contrast High contrast, black on white. Every text pair is at least 5.8:1 (WCAG AA), arrows at least 8.7:1, box borders at least 5:1.
paper Warm cream with sepia ink; light enough to print.
blueprint Deep blue with pale line work and a visible grid.
graphite Neutral charcoal with a slate accent and muted tones.

A theme colours the whole page: map, minimap, pinned board, Dynamic tab, sequence inside a box, details panel, menus, scenario picker and the model-error screen.

Choosing. The menu shows a swatch for each theme drawn in that theme's own colours; inside it ↑ ↓ Home End move, Enter picks, Esc closes. T steps to the next theme in the same order without opening the menu.

Which theme the page opens in. The first of these that is set wins:

  1. #theme=<name> in the URL. Applies to this visit and is not saved.
  2. The reader's last pick from the menu or T, remembered per browser in localStorage. Without storage (private mode, blocked site data) the page still works; the pick then lasts for the visit.
  3. The model's view.theme (data-model.md).
  4. auto.

A pick is written to the URL as theme=<name> whenever it differs from the model's default (view.theme, else auto), so a copied link opens in the theme its sender saw.

Tokens. Each theme is one CSS block near the top of <style> that sets every colour token below; all other rules take their colours from these tokens only.

Token Used for
--bg Canvas, arrow-label backgrounds, and the text colour on accent and tone fills (people, badges, pressed buttons)
--surface Toolbar, panel, closed boxes, menus, dialog
--ink Main text
--muted Secondary text, tags, sub-lines, arrow labels, ordinary arrows
--line Borders, rules, lifelines, component and code box borders
--accent, --accent-soft People, system and container borders, selection, entry-point arrows, badges, links; system and highlight fill
--ext, --code-bg Border and fill of external systems and stores; source path background
--b1, --b2, --b3 Fill of open boxes by nesting depth
--teal, --orange, --green, --violet, --rose, --blue, --gold, --brown and each -soft The eight tones: kind colours (stroke and text, and fill), variant colours, and the flow colours of scenarios (.flow-<tone> sets --flow / --flow-soft from them). Compare mode takes --green, --rose and --orange (as --h-add, --h-del, --h-chg and their -soft). In every theme each tone is at least 4.4:1 on the canvas and the surfaces (the contrast theme at least 6.9:1), and --bg text on it at least 4.7:1
--grid, --shadow, --backdrop Canvas dots, box and menu shadows, the scenario dialog's backdrop
--dim-node, --dim-frame, --dim-edge Not colours: the opacity a selection gives unconnected boxes, the open boxes around connected ones, and unrelated arrows (contrast fades less)
--arrow-w, --arrow-w-hot, --arrow-hit Not colours: arrow width, width when highlighted or hovered, and the invisible hover target (contrast draws thicker arrows)

Adding a theme takes two edits:

  1. In <style>, copy a [data-theme="…"] block (paper for a light theme, blueprint for a dark one), rename it [data-theme="mytheme"] and change the values. Set every token in the table plus color-scheme: light or dark. Keep --bg readable on --accent and on each tone (it is the text drawn on those fills), and --muted and each tone readable on --bg, --surface, --code-bg, --accent-soft, --b1–--b3 and the -soft fills.
  2. In the validator script, add { id: 'mytheme', note: 'a few words for the menu' } to window.ARCH_THEMES. Its place in the list is its place in the menu and in the T cycle.

The menu, T, #theme=, the stored pick and the validation of view.theme all read that list, so nothing else changes. The block selector is [data-theme="…"] rather than :root[…] so that the swatches in the menu, which carry data-theme, draw in the theme's colours.

URL state

The URL hash mirrors what is on screen and is read at load, so any state can be linked, reloaded or screenshotted from the command line. Parameters are joined with &.

Parameter Meaning
level=3 Map opened to that level
open=api,orders Exactly these boxes open (their ancestors too). Written instead of level when the open set is not a whole level.
sel=place-order or sel=a,b,c Selected box, or several (the last one listed is the primary); their ancestors are opened
rel=3,7 Connections selected: relationship indexes of MODEL.edges (see "Selecting connections"). Written while the Map is shown
icons=brand / icons=mono / icons=off Icons in brand colours, in the colour of their text, or none. Written when it differs from the model's view.icons / view.showIcons
names=normal Zoomed out (below 34 %), every box keeps its own small text instead of its name drawn large (names=large, the default, is not written)
marquee=off / marquee=always Long text: cut texts stay cut, or every cut text in view slides by (marquee=hover, the default: under the pointer, is not written)
variant=cloud Variant filter, by variant id
hide=web,minio Boxes hidden on the map (with what is inside them and their arrows), by id
edit=1 Edit mode. Read at load: the editor opens, and edits kept in this browser come back at once (without the "restore" question)
labels=arrow / labels=0 Arrow labels on the arrows, or off (labels=off is read too); the default, in the boxes, is not written (labels=box is read)
io=out / io=in / io=none Labels in the boxes: the sections unfolded in every box. Written when it differs from the default, io=in,out (both unfolded)
iorder=label Labels in the boxes: each row reads label first (POST /orders → API service); the default, box first (→ API service · POST /orders), is not written
edges=straight / edges=orthogonal Arrow style, when different from the model's view.edges
around=0 Arrows may run through open boxes they have nothing in (see "Arrows and open boxes"); written only when off
beyond=0 The frame beyond the view off (see "Beyond the view"); written only when off
theme=paper Colour theme for this visit: auto or a theme name (see "Colour themes"). Written when it differs from the model's view.theme (else auto); a theme read from the URL is not saved.
view=pins / view=dynamic / view=data / view=deploy The other views (#pins, #dynamic and #data alone also work)
env=local · dsel=api Deployment view: the environment shown, and the node, infrastructure node or instance selected
entity=tasks or entity=a,b · field=tasks.status · schema=pg · line=f:images.uploaded_by Data view: the entities selected (the last listed is the primary), or one field (<entity id>.<field name>), or one schema, or one line (f:<entity>.<field> for a field's ref, r:<i> for relations[i]). Written only while the Data view is shown.
keys=1 Data view: keys only
lines=all, lines=refs,maps, lines=none Data view: the kinds of line drawn always (refs, struct for contains and extends, maps); the others on demand. Written when it differs from the default refs,struct.
dzoom=pg Read only: the Data view opens zoomed to that schema or entity instead of fitted (without it, to what entity / field / schema / line select)
scenario=checkout at=3 style=seq step=4 Dynamic view: scenario id, level (1–4, map, pins), style (collab, seq, list), step number from 1
dynzoom=2 Dynamic view: the zoom, × the fitted view (the step table: its text size), centred on the current step. Written while the Dynamic view is shown and zoomed; a new scenario, level or style fits again.
seq=api:checkout,worker Boxes showing the sequence inside, each with a scenario id (default: the first scenario through that box). Their ancestors open.
seqstep=api:3 Message picked in that box's sequence, numbered from 1
split=1 With collab=: the flow's sequence beside the map ("The map and a sequence side by side")
collab=api:upload cstep=3 cflow=lr Map: that scenario played inside that box ("A flow played on the map"; the box and its ancestors open; collab=*:upload on the whole map), its current step, from 1 (written when not the first), and cflow=lr with left to right on
zoom=api Read only: fit the camera to that box instead of the whole map
pins=a,b,c Read only: use these pins for this visit
flows=upload,review Map and Data view: those scenarios painted ("Flows on the map", "Data view"), by scenario id
legend=min The flows legend folded to one line (legend=full unfolds it, overriding the stored choice)
panel=closed The details panel folded away (the bottom sheet folded under 820 px). panel=open overrides the reader's stored choice.
mm=min The minimap minimized to its chip (mm=full overrides the stored choice)
mmd=flowchart / mmd=flowchart-lr / mmd=c4 The Mermaid panel open on the map, with that syntax (and direction)
ver=4d60afd / cmp=a889a40 Only with a history embedded (see "Versions and compare mode"): the version drawn, and the version it is compared with
hist=open / hx=4d60afd,f702ebd With a history: the version list (drawer) open, and the entries unfolded in it
hshow=milestones / hshow=last&hlast=50 / hkinds=merge,pr / hfrom=2026-01-01&hto=2026-03-31 / hby=Ana / hchips=20 With a history: the History settings (which versions the bar walks, how many chips it draws), when not the defaults

Example: index.html#open=api&zoom=api&theme=dark; with a history, index.html#ver=5ce40d3&cmp=4d60afd&hist=open&hx=5ce40d3.

Versions and compare mode

Only when the page was built with --history <history.json> (written by the architecture-history skill's arch-history.mjs timeline). A history bar runs along the bottom of the views (map, Pinned board, Dynamic), like a bottom navigation bar, with one dot per version. It has its own row, so it never covers the minimap, the zoom buttons, the hint line or the panel; with the panel folded it spans the whole width, and under 820 px it sits between the views and the bottom sheet, with shorter buttons. Clicking a dot, ‹ › or [ ] runs the page again on that version's model, keeping the camera and the open boxes; ▶ play steps through the versions. ⇄ compare (or C) draws the later version with added boxes and arrows in green, removed ones as red dashed ghosts brought back from the earlier version, changed ones in amber, each as an outline and a tint; the colours are each theme's --green, --rose and --orange, the very variables (--h-add, --h-del, --h-chg and their -soft) the panel's change list, its legend and the drawer use, so map and sidebar always match. Changes roll up: a box with changes anywhere inside it, at any depth, gets a badge on its top edge with the counts (+2 −1 ~3: boxes, states, and arrows with both ends inside it) and a beaded outline with a light tint, in the colour of the strongest change inside (removed, else added, else changed), heavier the more there are; so a change three levels down is visible at L1, and opening the box shows the same marks on its parts. A merged arrow says how many of the relationships it carries changed (JSON over HTTPS +4 · Δ +1 ~2), green or red when all of them were added or removed, amber when mixed. Selecting a box lists Changes inside, grouped by child (plus arrows between its parts and across its border), each a button that goes to the change. Click a dot to move the later end, Shift + click (or the "from" list) to move the earlier one (Shift + click also starts a comparison). The details panel lists the changes of the version or the comparison with the fields that changed and who changed them in which commit; a selected box shows its old and new text. While another version or a comparison is shown, pressing ✎ edit goes back to the page's own model first, then edits it (only that one is edited); the bar is disabled while editing.

A long history. The bar never draws a chip for every version once they do not fit: up to 24 versions it draws them all (the row scrolls), beyond that a window: the first version, the last one (two on a wide bar), the version shown (and the one compared from, and the page's own), and as many of the others around the version shown as the bar has room for, counted from its width (one width read: chips are 60 px wide there, labels cut with "…", the tooltip has them whole). The versions left out are folded into ⋯ n chips (a dashed rail; the tooltip gives the dates and the milestones inside); pressing one moves the window there, the version shown stays. ‹ ›, [ ] and play still walk every version, and the window follows the version shown; on a narrow bar (a phone) only that version is drawn. A window reads better than folding the runs between milestones: in a history of merges every version is a milestone.

History settings (⚙ on the bar; on a phone, in the version list's header): a dialog (modal: the focus stays in it, Esc closes it, Apply or Enter applies, Cancel leaves things as they were) that chooses which versions the bar walks (‹ ›, play, the chips): every version, milestones only (tags and releases, merges, pull requests, the first version and the page's own) or the last N; which kinds (commits, merges, pull requests, regenerated models, as the history has them); a date range; an author (part of a name); and how many chips the bar draws at most (auto: what fits, or 8 to 80). It counts what the choice leaves ("The bar walks 128 of 800 versions"). The version shown, the one compared from and the page's own are always in; the History button then reads 128/800 and the ⚙ is marked. The settings are kept per browser and project (localStorage key architecture-explorer-history:<project id>) and written to the URL when they are not the defaults (hshow=milestones|last, hlast, hkinds, hfrom, hto, hby, hchips; a link's settings win over the browser's). A version left out is still in the version list (marked "not in the bar"), and a link, compare and the agents reach any key. For scripts: ARCH_EXPLORER.history.settings() reads them, settings({ show: 'milestones' }) changes some.

The version list. ▴ History at the left of the bar (or H) opens a drawer upward over the views with every version, newest first, the one shown highlighted (in compare mode both ends, marked A and B). Each card shows the label (tag, pull request or short SHA) and the SHA, the kind (commit, merge, tag, pull request, squash, working tree), the date, the authors, the first line of the commit message, the pull request, whether the model was committed or regenerated, and what changed since the version before: + / − / ~ counts of boxes, states, arrows, transitions, scenarios and settings, the RDF triples added and removed, and where: the same counts rolled up to the containers (where API service +12 ~1 · Worker ~1). A changed scenario carries its flow colour as a swatch. Its actions: show it, ⇄ compare it with the version shown (or, in compare mode, set A / set B), copy SHA, and commit ↗ / PR #n ↗ on the forge when the history knows the repository (else the model's source.repoUrl). Unfolding a card (▶, or Enter on it) adds the full commit message, the SHA, parents, branches, tags, the pull request's branches and state, where the model came from, its size, and the list of its changes. The drawer scrolls, closes with Esc, ✕ or the button, keeps its place while the reader moves between versions, and is #hist=open (with #hx=<key>,… for the unfolded cards) in the URL. Past 12 versions it has a search (key, SHA, label, message, authors, tags, #PR, date: every word must match; "12 of 800 match"); past 80 cards (or answers) the list is drawn in pieces: the cards in view and a margin, two spacers for the rest, each card's height measured as it is drawn, so opening a list of 800 draws about ten cards. The arrow keys, Home and End still walk the whole list (the card asked for is drawn first), and a card unfolds as before. Finding the page's own version among them is bounded too: only versions with as many boxes, arrows and scenarios as the page are compared in full, newest first, at most 120 of them. Demonstration histories carry a "Demo data" banner in it and a demo data badge on the bar.

Going to a change. Every change listed, in the panel (the version's changes, or the comparison's) and in the drawer, is a button that goes to that element: a box is revealed as search does (its ancestors open, selected, centred); an arrow opens the boxes around both ends, selects both ends and highlights the arrow that carries it (a merged, lifted one if the ends are drawn inside closed boxes); a removed box or arrow is its red ghost in compare mode; a scenario opens the Dynamic view on it, at a level that draws the first changed step, on that step; a variant sets the filter. A change of another version (from the drawer) first shows that version, or compares it with the one before it when the page is in compare mode or the change is a removal; a removed scenario opens in the version before. The selection fades the rest exactly as a click on the box would. The engine's ARCH_EXPLORER.api.goTo({ box | edge | scenario, step | variant }) does the navigating.

The code is the history script of the template (the history bar and its drawer, the panel sections, going to a change, the restarts), the comparison code the build embeds with the versions (history-core.js of the architecture-history skill, between the /* BEGIN HISTORY */ and /* END HISTORY */ markers), and a few hooks in the engine (HU, goTo). Without a history the bar stays hidden and nothing else changes. Scripts can rely on these hooks: #histbar [data-hver] (a version dot), [data-hgo="play"], [data-hgo="cmp"], [data-hgo="drawer"]; the drawer's own buttons use data-hact and the change buttons data-hnav.

Sizes

size ▾ in the toolbar has three rows of − / +, remembered per browser:

  • Interface (80–120 %) scales the toolbars, the details panel and the map's text overlays, so more of the screen goes to the map.
  • Spacing between boxes (70–200 %) widens or narrows every gap; boxes keep their size, and the map is laid out again.
  • Labels and arrows (70–140 %) scales the arrow label font and the arrow widths; labels are placed again for the new size. With the labels in the boxes it scales their rows, and the map is laid out again.
  • Icons (only when the model has icons): mono (the colour of the text beside them), brand (logos in their brand colours, where they keep enough contrast) or off. Not remembered: the model's view.icons decides at load, #icons= overrides it. See "Icons".
  • Names zoomed out: large (the default) or normal: whether the boxes show their names large below 34 % zoom. Remembered per browser; #names=normal in the URL. See "Reading the map zoomed out".
  • Long text: cut, hover (the default) or always: what a text cut with "…" does. Remembered per browser; #marquee=off or #marquee=always in the URL (hover is not written). See "Long text".

Long text (a marquee for cut words)

Where a text does not fit, the map cuts it with "…": an IN / OUT row (label first or box first), a closed box's tag, name and second line, a name drawn large zoomed out, a chip of the frame beyond the view. The size menu's Long text row says what a cut text does:

  • hover (the default): under the pointer, or the keyboard's focus (a row or a box reached with Tab), its whole words slide sideways inside its place, clipped there and faded at both ends; they hold at the start and at the end and slide back, again and again while the pointer stays. Pointing at a box slides its own tag, name and second line; pointing at a row, that row's text. Nothing moves until the reader points at something, and only what they point at moves. Touch has no hover: a tap focuses a row, and it slides.
  • always: every cut text in view slides, at most 40 at once (the first ones from the top left), each at its own pace. The map holds them still while it pans, zooms, is dragged or is drawn again, and looks at what is in view a moment after it stops. The chips beyond the view slide too.
  • cut: as before; the arrow card, the magnifier zoomed out and the tooltips give the whole text.

The speed is about 34 px a second on screen at any zoom. With reduced motion (the system setting) nothing slides, whatever the choice; the menu says so. The status bar's ticker follows the same row: with cut it stays still (cut at its right edge, whole under the pointer), as with reduced motion. While a text slides, the cut one is hidden and a copy with the whole words runs in a small viewport in its place: no box is laid out again, and the copy is drawn with the same font, colour and weight. Screen readers keep reading the whole text from the row's and the box's labels, as before. Exports (SVG, PNG, HTML) and the magnifier's copies draw the cut text, still. For scripts: ARCH_EXPLORER.api.marquee() (the mode), marquee('off' | 'hover' | 'always'), marqueeInfo() (the mode, how many texts slide now, whether reduced motion holds them).

At 100 % the gaps are a little wider than box size would suggest, the arrow labels are 0.9 × 11 px and the arrows 0.85 × the theme's --arrow-w. The Dynamic diagrams follow the interface and arrow sizes, not the label size; the Pinned board follows all three, as the map does.

Export the diagram on screen

Icons go out as drawn (in their mono or brand colours). export ▾ → This view saves what is on screen as an SVG image, a PNG picture (twice the screen resolution, smaller for very large maps) or an HTML page with the diagram on its own. The map goes out whole, every box that is drawn and not only the part in the window, and so does the Data view (every cluster, card and line); the Pinned board and the Dynamic diagrams (collaboration or sequence) as drawn, whole whatever their zoom. The step table goes out as HTML only. The file carries the page's CSS with the current colour theme fixed and the reader sizes, so it looks like the screen. SVG and HTML load the web font when opened online; PNG uses the system font. On the map the menu also offers Mermaid, the map as Mermaid text (next section).

The whole explorer → Everything (.zip) saves it all in one ZIP (<project>-explorer.zip, a folder <project>-explorer/ inside): index.html (the page as Standalone HTML writes it, but with its images as files next to it), model.js, the RDF graph (.jsonld, .ttl), the map as shown as Mermaid text (map.mmd), the view on screen as SVG, the image and icon files the model names (under their own paths, img/…) and a README.md that lists them and says how to rebuild. Text files are deflated where the browser can (CompressionStream), else stored. From disk the page cannot read its folder, so the images it could not read are named in the README and the message, to copy next to index.html. The editor's Download menu has the same entry first, with the edits in it.

The whole explorer → Standalone HTML saves the interactive page itself as one file (<project>-explorer.html): every view, the history, the editor and the agent tools, with the model in effect written into its MODEL block (the editor's working copy, with your edits, else the model the page was built with) and relative images and icon files (img/…) put inside as data: URIs, so the file opens anywhere on its own. A page opened from disk cannot read its own folder (the browser refuses), so there those files stay links and the message says so; served over http(s) they go inside.

Mermaid

The map as a Mermaid diagram, to paste into a README, a pull request, an issue or a wiki (GitHub and GitLab draw ```mermaid blocks), and to edit there or in the page (in the Deployment view the panel shows the environment as C4Deployment instead, read only; see "Deployment view"). Map view only: export ▾ → Mermaid, or G, opens the Mermaid panel on the right of the map (a sheet over the lower part of it under 820 px, where the details sheet waits folded until it closes); G, ✕ or Esc (outside the text) closes it. Its left edge drags to make it wider (or ← → on it), remembered per browser.

  • What it shows. Exactly what the map draws: the boxes at the current level and the ones opened by hand, each arrow lifted to the boxes drawn and merged as the map merges it (first label +N, or the edges' summary). With a variant chosen, only that variant's boxes and relationships, merged among themselves (so a count can be lower than the map's, which merges before fading). A box that shows its sequence inside counts as closed. Boxes hidden on the map are left out, with what is inside them and their arrows (hidden=web,minio on the %% c4-explorer: line, and in view.hidden for scripts).
  • Two syntaxes. flowchart (default) renders anywhere Mermaid does: open boxes are nested subgraphs, people are rounded boxes, data stores cylinders, states stadiums; each type gets a classDef in the light theme's colours (externals grey, separate systems dashed, kind colours, dashed boxes, final states with a thick border), arrows --> or dashed -.-> with their labels; direction TB or LR. C4 uses Mermaid's C4 diagrams, C4Context, C4Container or C4Component after the deepest level drawn: Person, System, System_Ext, Container, ContainerDb (ContainerQueue for a store whose name, tag or technology says queue), Component (also for code boxes and states), nested System_Boundary, Container_Boundary and Boundary for open boxes, Rel for arrows; technology (tech, joined with commas), description (desc) and the box's own tag (as $tags) go along. Mermaid's C4 cannot attach an arrow to a boundary: arrows declared on an open box are left out of the C4 text, as commented-out Rel lines with a note (the flowchart draws them), and Mermaid's C4 layout is simple (shapes in rows, arrows may cross labels): the flowchart reads better beyond a dozen boxes.
  • Ids and the view. Mermaid ids are the box ids with every character other than letters, digits and _ turned into _, and a trailing _ on Mermaid words such as end or class. A %% c4-explorer: level=2 syntax=flowchart direction=TB line (or open=iat,api, variant=cloud) records the view and a %% c4-explorer ids: minio_init=minio-init line the ids that changed, so the text maps back to the model. Labels are escaped for Mermaid: in a flowchart " is #quot;, < > are #lt; #gt;, a # or & that would start an entity code is written as one, a newline is <br>; in C4 strings, which take no escapes, " is written " (U+FF02) and such a # # (U+FF03), read back as " and #.
  • The text. Monospace, with line numbers; Tab indents (the line or the selected lines; Shift+Tab outdents), Esc then Tab leaves it. Copy, download .mmd (the text), .md (a Markdown file: the title, one line naming the view, and the diagram in a mermaid block, ready for a README or an issue) and SVG (the preview as drawn, in the page's colour theme), and Reset (the text made again from the map). Switching the syntax makes the text again (an edited text asks first); switching the direction of an edited flowchart only changes its first line.
  • The preview is drawn by mermaid.js, fetched from jsDelivr (an exact version, archMermaid.URL) the first time the panel opens and redrawn a moment after each keystroke. An error (a line Mermaid cannot read) shows under the text with Mermaid's message; the last good drawing stays, faded, and the text is never touched. It takes the page's colour theme (the text's light-theme colours are swapped for the theme's own for the preview only; C4 boxes keep Mermaid's C4 colours); fit / 100% fits it in the panel or shows it at its own size. Offline, or where the page's security policy blocks the CDN, and always in the plugin's MCP view (ARCH_IMAGE_POLICY = 'embedded', which loads nothing), the preview says why it is missing; the text, Copy and the downloads work.
  • Following the map. While the panel is open, opening or closing boxes, a level, the variant filter or an edit to the model makes the text again, if the reader has not edited it. If they have, a bar offers make it again from the map or keep my text; nothing is overwritten without that.
  • Apply to the model… reads the edited text back and lists what it changes, compared with the text made for the view it was made for (its %% c4-explorer: line; the view the panel made it for when that line was deleted), and what it cannot apply, with the reason. Nothing changes until the reader clicks Apply N changes; the changes then go through the editor (edit mode opens if needed) as one step that undo (Ctrl+Z, ↶ undo) takes back, and the map and the text are made again from the changed model. It is refused while another version or a comparison is shown (history), and on a page without the editor.
  • Applied: a box renamed (its label); in C4 its description, technology and tag; a new box (its type from its shape or C4 function and the box it sits in: in a software system a container, a cylinder or ContainerDb / ContainerQueue a data store; in a container a component; in a component code; in code a state; at the top level a software system, a rounded box or Person a person, System_Ext an external system; a new subgraph or boundary is a new box that opens); a box moved into another subgraph or boundary (its at dropped, the box re-laid out); a box removed (with what is inside it, its arrows and the scenario steps that name them, as the editor's delete does); a new arrow (no label: uses, as the editor does); a 1:1 arrow (one relationship declared between exactly the two boxes drawn) relabelled, dashed or drawn solid, or removed.
  • Not applied, and listed with the reason: relabelling or removing an arrow that stands for several relationships (merged) or for one declared between boxes inside the ones drawn (lifted): change those in the editor, or open the boxes so each arrow is drawn on its own; a box moved or added where C4 does not put its type (a container at the top level); a box's shape or C4 function changed (the type is not changed from the text); a new box whose id is a box the view does not draw (inside a closed box); an arrow to an alias C4 does not declare, from a box to a box inside it, or from a box to itself (only states loop); a dashed arrow that is dashed because its relationship exists only in some variants; and any change the page's validator refuses. Colours (classDef, class, style, linkStyle), title, layout and style statements only style the diagram and are not read back.
  • For scripts. window.archMermaid (the mermaid script, no DOM): fromView(model, view, opts) → the text (view: { level }, { open: [ids] }, variant; opts: syntax, direction, core), build (the same with its boxes, arrows and notes), parse(text) (boxes with labels, parents and fields, arrows, errors, for both syntaxes), changes(model, view, text) → { changes, skipped, errors, open }, apply(model, changes), retheme(text, tokens), URL. ARCH_EXPLORER.api.mapView() ({ open, variant }), api.mermaid({ syntax, direction, view }) and api.showMermaid(open, syntax, direction). The agent tool get_mermaid returns the text, and scripts/model-to-mermaid.mjs writes it from model.js, a page or a graph (--all: one Markdown file with a diagram per level); scripts/check-mermaid.mjs checks the round trip, the edits and the rendering.

Edit mode

The ✎ edit handle on the left edge of the views (#btn-edit), the mirror of the details panel's handle on the right, is always there (while another version or a comparison is shown, pressing it goes back to the page's own model first): it turns the page into an editor of its own model, and while editing it reads ‹ done, beside the rail, and leaves edit mode. A tool rail (#edside) runs down the left of the views, and the details panel keeps its column on the right, showing what is selected as for readers (its handle still folds it). The rail is a toolbar (role="toolbar", one tab stop, the arrow keys, Home and End move along it), with, from the top: the drawer's button; the element types by C4 level (L1 person, software system, external system, separate system; L2 container, data store; L3 component; L4 code, state), each its box drawn with the map's own rules, so it follows the theme; the relationship tool; Outline and Properties, which open the drawer on that section; then undo, redo, download (a menu: model.js, the page, JSON-LD, Turtle, .rete), discard edits and ✓ done. Every button has a name (aria-label) and a tooltip with a line on what it does, shown on hover or on focus from the keyboard. A message chip in the map's status bar says what an edit did or why it was refused (✕ empties it).

The drawer opens beside the rail with the rail's first button, I (which folds the details panel when not editing) or its own fold button, and closes the same way; it is folded by default, and open or not, and its width, are remembered per browser. Its right edge drags to make it wider or narrower (or the arrow keys on it). Under 820 px the rail is a row along the bottom: its first button and the undo … done group stay put, the types between them scroll sideways (a swipe up from one onto the map drags it), the drawer is a sheet above the row (42 % of the height by default, its top edge drags), and the details panel waits until ✓ done.

The drawer has three sections, and groups inside them, that fold open and closed (buttons with aria-expanded); which ones are open is remembered per browser.

  • Add: the element types by C4 level, in groups that fold (people and systems: person, software system, external system, separate system; containers: container, data store; components; code and states: code, state). Each card shows the type's box drawn with the map's own rules, so it follows the theme, and one line on what it is for. The rail's type buttons do the same as these cards.
  • Drag a card (or a rail button) onto the map: onto a closed box that may hold it (it goes inside, and the box opens), else into the deepest open box under the pointer, else at the top level, at the cell under the pointer. While dragging, every box the type may go into has a dotted outline, the one it would land in a dashed accent outline, and a box it may not go into a red one; the label under the pointer says where it goes or why it cannot (✕ goes in a container or a data store). A drop where it may not go adds nothing and the status line says why. Esc cancels a drag.
  • Drag a card into the outline: onto a box's row adds it inside that box; onto the outline's empty space adds it at the top level.
  • Press a card (click, tap, Enter or Space): adds one inside the selected box, or the nearest box around it that may hold that type (or the only box in the model that may); people and systems go to the top level. Cards that need a selection first have a dashed border (on the rail, a paler box). The new box is selected; on the map its name is then edited in place (see "On the map"), else its Name field has the focus.
  • Where a type may go (C4, as the ontology's SHACL shapes have it): people, software systems, externals and separate systems at the top level; containers and data stores inside a software system (or an external or separate one); components inside a container or data store; code inside a component; states inside a container, data store, component or code box. The panel's Inside field and dragging a box on the map keep their old freedom (the validator only warns).
  • Relationship tool (on the rail and in Add): press it, pick the source box (on the map, or Enter on an outline item), then the target; the new connection's card opens on the map with its label selected. Esc cancels. Dragging from a box's dot, Alt+drag on the map and → pick on the map… (or the Add a connection to list) in a box's Relationships work too.
  • Outline: the whole model as a tree (role="tree", treeitem, aria-expanded, aria-selected, one tab stop), from people and systems down to code and states, with the type's box as the icon and the number of boxes inside; then Scenarios, each with its steps. Siblings are listed in the order the map reads them (row, then column). A filter box narrows it to the matching boxes (with the boxes around them) and steps; expand all and collapse open and close every branch, and the open branches are remembered per model.
  • Click or Enter / Space selects the box and shows it on the map (the engine's reveal: its ancestors open, centred); Ctrl / ⌘ / Shift adds it to the selection. A selection made on the map is marked in the outline, with the branches above it opened.
  • Drag a row (a mouse anywhere on it; a finger or pen by its ⠿ handle, so the outline still scrolls) onto the upper or lower edge of another row to put it before or after that one, or onto its middle to put it inside that box (right under an open box's row: its first place). A line or an outline marks where it goes, in red where it may not (the same rules as Add); resting on a closed branch opens it. Reordering gives the group the new reading order on the map: its boxes keep the cells they occupy and trade places, so the group keeps hand-set at positions as after a drag on the map. A box moved into a group laid out automatically stays automatic. Scenarios reorder among scenarios, and steps within their scenario.
  • Keys on an item: arrows, Home, End move and open or close branches; F2 renames it in place (also a double-click; Enter keeps, Esc does not); Delete deletes it; Alt+↑ / Alt+↓ move it among its siblings, Alt+← out of its box, Alt+→ into the box above it; Shift+F10, the context-menu key, a right click or its ⋯ button open its actions: rename, add each type it may hold inside it, duplicate, move, delete (for a scenario also + step and Show in Dynamic).
  • Delete asks first, in a bar at the top of the drawer (never a browser dialog): what goes with it (the boxes inside, connections, scenario steps). Cancel has the focus; Esc cancels. On the map, Delete / Backspace still deletes the selected boxes at once (undoable).
  • Properties: the forms for what is selected, in groups that fold.
  • A box: its breadcrumb, + … inside for each type it may hold, duplicate, delete…; then Identity (name, id (renaming updates every reference: parent, connections, scenario steps and actors, pins), type, second line, the box it is inside), Description and notes, Technology and tag, Source (path, line, link), Style (colour, dashed border, initial / final for states, variants), Relationships (uses and used by: each connection's label, colour, dashed style, direction, delete, the other end; add one from a list or by picking it on the map), Images and RDF (its IRI and triples). With several boxes selected the form edits the last one and delete… removes them all.
  • Images (the model's images list, see data-model.md): + image from a file… reads a PNG, JPEG, GIF, WebP, SVG or AVIF file with the page's archImages.fromFile and embeds it as a data: URI up to archImages.MAX_EMBED (400 KB); a larger PNG, JPEG or WebP is scaled down to fit. Or give a path next to model.js (img/screen.png) or an https URL. The picture then waits in a form until it has its alt text, which is required (Add image without it marks the field and says why); caption, credit, kind (screenshot, diagram, photo, illustration) and illustrative are optional. The entry is checked with validateArchImage before it is added. Each image's fields stay editable; ⤢ shows it in the page's viewer, ⠿ drags it (or ↑ ↓) to reorder, ✕ removes it. Images on connections and steps are shown (see them) and edited in model.js.
  • Icon (a box's Style, a connection's ◇ button in Relationships, a scenario's Identity): the icon, its reference and choose…, which opens the picker: the reference and its colour (page setting, brand, a tone) as fields; a search box over the built-in set (offline) and the model's own icons; suggestions from the box's type, name, tag and technologies (Suggest logos from its technology loads the Simple Icons list for that); More icons, which loads the Tabler and Simple Icons indexes from jsDelivr (pinned versions, about 330 KB in all, once per visit) and searches them too (logos previewed in their brand colours); Your own SVG, pasted or chosen as a file (at most 64 KB), cut down to shapes and kept in MODEL.icons under custom-<name>; no icon. A picked library icon is fetched and copied into MODEL.icons (with its source and licence; a logo keeps its brand colour as its fill), so the page, a downloaded model.js and the page download show it offline. Offline, or in the embedded MCP view, More icons says why and the built-in icons, your own SVG and a reference typed by hand still work. Every change is one undoable step. The whole model's form has an Icons section: the page's icon setting (mono, brand, hidden: view.icons, view.showIcons), how many boxes have one, and Suggest icons from technology…, which proposes an icon for every box without one (a logo from its technologies, else a built-in from its words, else from its type; only people and stores are checked by type alone), as a list to check and Apply as one step. The icons of schemas and entities are edited in model.js.
  • A scenario (picked in the outline): name, id, description, its colour on the map (a swatch for each flow tone, or auto, which shows the tone it gets now), its icon, the use case (primary actor, goal, trigger, preconditions one per line, outcome), every step (from, to, label, reply, moved up or down, deleted, added), its images, ▶ show in Dynamic, duplicate, delete scenario….
  • Nothing selected, the whole model: the project (name, subtitle, title, introduction, id), the source links, the RDF base and vocabulary IRIs, the opening view (start level, theme, arrow style), + buttons for the top level, the scenarios with their steps, and a short how-to.
  • On the map (the Map view), the selected box and the arrows are edited where they are:
  • The card: the selected box gets a card beside it (role="dialog"; right of the box, else left, else above or below; under 820 px along the map's bottom or top edge, away from the box, and not while the drawer is open), and it follows the box while the map pans and zooms. It holds the type and level, name, type, second line, technology and description (the Properties form's own fields, so a change is the same change), its colour (see "Colours" below), and + … inside (the first two types it may hold), → connect to…, ◇ icon… (the drawer's icon picker), duplicate and delete (at once, undoable). ⋯ opens the drawer on Properties for every field; ✕ or Esc closes the card until another box is selected, and the focus goes back to the box. Several boxes selected (Ctrl / ⌘ / Shift + click, or + Enter on a focused box): their own card, beside the selected one, with their names, Colour of all N and delete N boxes.
  • Rename in place: a double-click on a box's name (or anywhere on a box with nothing inside, which has nothing to open; elsewhere a double-click still opens the box), F2, or Enter on the selected, focused box (Enter on a box not yet selected selects it, as for readers) puts a field over the name. Enter or leaving the field keeps it, Esc does not; the focus goes back to the box. A box out of view is shown first. A new box added on the map (dropped, pressed on the rail, duplicated) is named this way.
  • Drawing a connection: the pointer on a box shows a dot on each side (on a touch screen, the selected box's dots). A drag from a dot to another box draws a dashed line that follows the pointer and outlines the box under it, in red where it cannot be connected (a box inside the other); releasing on it adds the relationship (labelled uses), selects it and opens its card with the label selected, to type over (Enter keeps it). Esc cancels the line. Alt+drag from a box still connects; a drag on a box itself still moves it, and the map's "free to move" buttons stay off.
  • An arrow's card: a click on an arrow selects the relationships it draws and opens their card where it was clicked: for each, its ends, label, colour (swatches), dashed, ⇄ reverse and ✕ delete. Ctrl / ⌘ / Shift + click still adds the arrow to the selection, and the details panel shows it as for readers; the card then has a row Colour of all N selected connections on top.
  • Colours: a row of round swatches, each drawn as the map draws that colour in the current theme (the map's own rules, so they follow every colour theme). For a box (its card, several boxes' card, the drawer's Style): default (the type's look), the eight tones (teal, orange, green, violet, rose, blue, gold, brown), highlight and plain, and under more the look of another type (person, system, container, store, code, external, separate system, state); the model's kind. For a relationship: default grey, accent and the eight tones. They are radio buttons in a labelled group: a click, or the arrow keys, picks one (each pick is one undoable step, and the focus stays on it), the current one is ringed, the name shows on hover. Several boxes, or all the selected connections, change together as one step and stay selected; their row marks a colour only when they all have it. What a colour means: when a tone is used, a field under the swatches (What teal means) writes legend.<tone> (cleared: removed), so the legend under ? explains it and the validator's warning about an unexplained colour goes away; its placeholder says when a variant already gives that tone a meaning. Ctrl+Z works with the focus on a swatch too.
  • Undo and redo: the rail, Ctrl+Z, Ctrl+Y (or Ctrl+Shift+Z), 200 steps, for every change above.
  • Every change goes through one path (the editor's commit): checked with the page's own validator first (a change it rejects is not made, and the status line says why), undoable, kept in this browser, and the engine runs again on the working copy (so the history's comparisons and the agent tools see it too).
  • Keep the result: the rail's download menu → Everything (.zip) (the page, model.js, the graph, the map as Mermaid and SVG and the image files in one ZIP; see "Export"), model.js (the source to rebuild from with build-explorer.mjs), page (this page as index.html with the edited MODEL block, ready to use as is), JSON-LD, .ttl or .rete (the edited graph). Until then the edits are kept in this browser: reopening the page offers to restore them. discard edits goes back to the model the page was built with, and can itself be undone. ✓ done (on the rail, or the ‹ done handle) leaves edit mode and keeps the edits on the page; the rail, the drawer and the card go away.

Things edit mode leaves to model.js: variants, level names, the legend's entries other than the tones' (see "Colours"), and the images of connections and steps.

Opening in edit mode. #edit=1 in the URL opens the editor at load, and the URL carries it while edit mode is on, so a reload stays in edit mode. Edits kept in this browser are then restored at once (the page was asked to edit); without #edit=1 the page asks first, as before.

An empty map

nodes: [] is a valid model for the page (the validator warns, nothing more; its RDF graph does not pass the ontology's SHACL shapes, which ask for at least one top-level element, until the first box is added): the map shows a card in its middle with three ways to start. ✎ Add a box turns edit mode on and puts the focus on the rail's software system button (Enter adds one, named in place; or drag any type onto the map). Let an agent build it says how an agent drives the page (next section). Open a model… reads a file into the page: model.js (read as data, so nothing in it runs: comments, quotes of either kind, bare keys and trailing commas are fine; any other code is refused), the MODEL as JSON, an explorer page (its MODEL block), or an RDF graph as N-Triples (.nt, through the page's own archRdf; convert Turtle or JSON-LD with model-from-rdf.mjs first). It is checked with the validator, and with the editor it becomes one undoable edit (so it is kept in this browser and the downloads give it back). The project's name and the rest of the project are edited in the editor's Properties with nothing selected. Edits are kept under the model's own project.id. Deleting every box of a model leaves this empty map. The documentation publishes one at /explorer/ (docs/playground/model.js).

Coherence: the Issues area

The coherence rules (coherence-rules.md next to this file: flows that no arrow carries, a step against its arrow or out of nowhere, data a step cannot reach, a queue with one side, two containers that call each other, a front end on a database, lifecycle states without a start, unreachable, stuck or leaving a final state) run as SPARQL over the model's RDF graph with rete-graph.

  • Where the findings come from. build-explorer.mjs runs the rules when rete-graph is installed (the plugin's mcp/ folder has it) and embeds the findings in the page (<script id="coherence-data">, window.ARCH_COHERENCE): the area works offline, from disk. ↻ Re-check runs them in the page on the model as it is now (edits included), with the rete builder from the CDN (the .rete export's): it needs the network. Without embedded findings and without the network, the area says how to get them.
  • The chip. The toolbar has a chip with the open findings by severity (✖ 1 ⚠ 5 i 6; issues ✓ when none is open, issues ? when the rules have not run). It opens and closes the area.
  • The area. It holds the details panel while open: every finding grouped by severity, then by rule, with filters (errors, warnings, notes; area: flows, data, infrastructure, states; rule; open, dismissed or both) and a search over the messages and names. A finding shows its message (naming the boxes), links to its boxes (selected on the map), its arrow (selected as a connection), its step (the Dynamic view on it), its entity (the Data view), and, opened (or current), why it matters and how to fix it. ‹ › (or ← → while the area is open and the focus is not in a field) step through the findings; ✕ or Esc in the area closes it.
  • On the map. While the area is open (and ◎ on the map is on): each box a finding is about is ringed in the severity's colour (rose for errors, orange for warnings, the accent for notes) with a badge (✖, ⚠, i, and the count when several findings land on it); an arrow is given a dashed halo; a step is marked with a chip with its number on the arrow that carries it at the current level, or a dashed line between its ends when no arrow does. Boxes that are not marked fade a little, like flows on the map. The current finding is drawn stronger and the others lighter; a click on a finding (or on a badge or a chip) makes it current: its boxes are selected and fitted (an arrow: the connection selected and centred). Boxes inside closed boxes are marked on the box that is drawn. In the Dynamic view, the steps a finding names are drawn in the severity's colour. Exports leave the marks out.
  • Dismiss and restore. dismiss… asks why the finding is right as it is and writes { rule, focus, reason, by, on } (by: reader, or agent from dismiss_issue; on: the day) into view.coherence.ignore through the editor (one undoable step; edit mode turns on); the finding stays listed, marked dismissed with the reason, and stays dismissed when the page is built again. restore takes it back. The validator checks the field (rule, focus, a reason); focus: "*" dismisses every finding of a rule.
  • Each finding, visual. The verdict in bold, the area as a tag, the boxes and the step as chips (the box's colour and icon; a click selects the box, opens the step in the Dynamic view, the arrow, the data), the plain sentence under them (for screen readers and copying), the severity as its icon and the colour band on the left. Opened: a small diagram of what the rule found (an SVG with the real names: the boxes in the map's colours, clickable and reachable with Tab and Enter; what is missing in the severity's colour, dashed; what is there instead in grey; the step or arrow in the accent colour), why it matters, how to fix it, and How this was found (a disclosure, closed by default): the rule and its logic in words with the names, what matched (each variable and its value, as links), what was checked and not found (the boxes on each line it walked), the facts (the pattern's triples) and the SPARQL (the where and unless ASKs with the values; copy). A dismissal says who and when (by, on in view.coherence.ignore). See coherence-rules.md, "How a finding is explained".
  • The card on the map. While a finding is shown (wider than 820 px), a card at the map's top left repeats it: verdict, chips, sentence, diagram and its own How this was found, with ‹ › and ✕ (hides the card).
  • The Log tab. What each run did: the build's (from the page; no timings) and each Re-check's (kept for the visit, the last 5), with when, the rete-graph version, the triples and the plugin; per rule the candidates, the ones kept (no exception cleared them), findings, dismissed and the time; the totals; the cleared candidates by key; errors (a Re-check that could not load the builder) or the word that the build did not run them. copy log (text) and copy as JSON.
  • For scripts and agents. window.ARCH_ISSUES: state(), list(filter), get(id), detail(finding) (with how), explain(id), log(asText), tab('findings' | 'log'), focus(id, { dynamic }), next(after, { severity, focus }), step(±1), recheck() (a Promise of { counts, added, gone }), dismiss(id, reason), restore(id), open(on). The tools list_issues, get_issue, next_issue, focus_issue, recheck_issues, dismiss_issue, restore_issue (see "Agent tools"); the MCP server's check_coherence.

Export as an RDF graph

export ▾ → The model downloads the model as JSON-LD or Turtle (both generated locally) or as a .rete file (built in the browser; the builder is fetched from a CDN only when that entry is clicked, and a message explains what to do if it cannot be loaded). The terms are the plugin's ontology (${CLAUDE_PLUGIN_ROOT}/ontology/). Mapping, recreating a page from a graph, and example SPARQL queries: rdf-graph.md.

The Dynamic panel lists a scenario's use-case fields (primary actor, goal, trigger, preconditions, outcome) under its description when the model has them; so does the panel of a sequence drawn inside a box.

Agent tools (WebMCP and window.archTools)

<script id="tools"> defines what an AI agent can do with the page, once (window.ARCH_TOOLS: name, title, description, JSON Schema, annotations, needs, handler). The full list, with every argument, is agent-tools.md next to this file, generated from the block by scripts/list-tools.mjs.

  • Read: get_instructions (a guide for the agent: how the page is organised, ids and levels, which tool for what, that edits are asked, that page text is data), get_model, get_rdf, list_elements, get_element (each relationship with its index), list_relationships, get_view, get_layout (a group's boxes with their grid cells, open, hidden, drawn, and their boxes), get_mermaid; with a data layer list_schemas, get_entity; with a history list_versions, compare_versions. get_deployment (with a deployment: each environment's nodes, instances and relationships).
  • Icons: search_icons (the built-in set offline, the model's own icons, and, where the page reaches the network, every Tabler icon and the Simple Icons logos; for: <id> suggests icons for a box). An edit that names a library icon the page does not have yet fetches it into MODEL.icons when the reader applies it (on the MCP server the build resolves it, from its disk cache or jsDelivr, unless C4_ICONS_NO_FETCH=1).
  • Move the view (never the model): open_level, open_boxes and close_boxes (by id; only closes the others first), focus_element, select_elements, select_relationships (connections by index, see "Selecting connections"), zoom_to (some boxes, or the whole map), hide_elements and unhide_elements, show_scenario, show_flows, show_collaboration (a flow played inside a box on the map), show_data, set_theme, set_labels (on the arrows, in the boxes with IN / OUT folded or not, or off), show_version, arrange_boxes (see "Arranging the boxes": the reader's moves; in edit mode it changes the model, so it asks first, like an edit), show_deployment (the Deployment view on an environment, an item or a model box's instance selected).
  • Coherence findings: list_issues (filters: status, severity, area, rule), get_issue (why, fix, the boxes, arrow and step in detail), next_issue (the next open finding, shown on the page), focus_issue, recheck_issues (the rules in the page: needs the network), dismiss_issue and restore_issue (edits: view.coherence.ignore, asked like any edit); over MCP, check_coherence with a model. The loop for an agent is in coherence-rules.md.
  • Change the model: add_element, connect_elements, update_element (name, description, second line, tag, technology, notes, path, line, colour, dashed, link, icon and its colour; null removes a field), rename_element, move_element (another parent and / or a cell at: [column, row]: within its group it swaps with the box on that cell; coming from another group it pushes that row's boxes from that column one column right; the group is then laid out by hand, every box keeping the cell it had), group_elements (a new box of the given type around boxes of one group; they keep their arrangement inside it and it takes the first one's cell), delete_element (refused for a box with boxes inside unless cascade: true; its relationships and the scenario steps through it go too, and the question lists them), update_relationship and delete_relationship (by index, or by from and to, plus label when several arrows join the same two boxes), apply_edits (any of these, in order, as one question and one undo step; later edits may name boxes earlier ones made), undo_edit, redo_edit. Each edit is checked first, by its own rules and then by the page's validator, so an edit that cannot be made is refused before anyone is asked. Where C4 does not put a box (a component in a component, say), the edit is still made, with a note in the question and the answer. The MCP server also has edit_model: the same operations on a model it is given, returning the edited model.
  • The reader's say. An edit waits in a bar at the bottom of the page: what the agent asks (a numbered list for a batch), notes (C4 placement, new validator warnings), Apply and Reject. Only a real click or key press answers it: a click made by a script (element.click()) is ignored. Nothing is applied after two minutes without an answer, or when the agent cancels the call. The first edit applied turns edit mode on (the bar says so), and from there it is an edit like any other: one undo step, kept in this browser, in the downloads. The bar's checkbox Let the agent apply edits without asking (this tab, until it reloads), off by default and never remembered, applies this edit and the following ones without a question; while it is on, a dashed bar on the views says so, counts the edits, names the last one, and has ↶ undo and stop.
  • Where the tools are offered. With WebMCP (document.modelContext, else navigator.modelContext; feature-detected) the page registers every tool it can run at load: the edit tools whenever the page has the editor, whether edit mode is on or not. Always, for agents that run JavaScript in the page but cannot see WebMCP (browser automation: Claude in Chrome, Playwright, DevTools): window.archTools.list() (the tools, as WebMCP would list them), window.archTools.call(name, args) (a Promise of { text }, with data when the text is JSON, or { error }; an edit waits for the reader exactly as through WebMCP) and window.archTools.help(). The plugin's MCP Apps view offers the page tools as app tools; the MCP server the ones that read a model, and edit_model. Without an agent nothing is drawn: the page looks exactly as without the block (a test compares them pixel for pixel). Delete the block to remove the tools.
  • How to add a tool. Add an object to TOOLS in the block: name (snake_case, a verb first), title, description written for an agent (what it returns or does, what the ids are, and + CAUTION when it returns page text), inputSchema (JSON Schema with additionalProperties: false, limits on strings and lists, a description on each argument), annotations (readOnlyHint; untrustedContentHint for page text), needs (model, view, edit, data, history, sparql; server: false or page: false to keep it off the MCP server or the page) and run(args, ctx), which returns ok(text or object) or err(message), or a Promise of one. ctx holds model, validate, rdf, view (ARCH_EXPLORER.api), edit (ARCH_EDIT), history, confirm(question) and page. A change to the model is an operation in OPS instead (title, description, required, properties, run(model, args) returning { q, done, select, open, notes }), with its name in OP_ORDER: it then becomes an edit tool and an apply_edits operation, asked, validated and undoable for free. Test it in mcp/test/agent-tools.test.mjs (a stubbed document.modelContext in headless Chrome), update the tool lists in mcp/test/webmcp.test.mjs (and server.test.mjs when the server offers it), and run node scripts/list-tools.mjs --write: mcp/test/tools-reference.test.mjs fails until agent-tools.md matches.

Model errors

A broken model never renders half a diagram. Schema errors replace the page with a list (unknown ids, duplicate ids, overlapping at cells, missing labels, …). A syntax error in the MODEL block shows "The MODEL block did not load". Warnings (truncated names, missing descriptions, crowded groups, undocumented colours) go to the console and to check-model.mjs.

For automated checks the page sets data-explorer="ready" or "error" on <html> and exposes window.ARCH_EXPLORER (ready, errors, warnings, counts, layout(), rdf, viewSvg() (the SVG that export saves), teardown(), and an api with setView, setLevel, setMode, reveal, toggle, setOpen(ids, open, only), fit(ids), hidden(), setHidden(ids, hide), moves(), setFree(id, on), resetMoves(), arrange(strategy, scope, opts), arrangeMenu(open, focus), undoArrange(), layoutOf(id), readModel(text, name), setScenario, setDynStyle, setDynLevel, sourceUrl, showSeq, showBoxes, pickSeqStep, select, selectedId, selectedIds, selectIds, selectRelationships, selectedRelationships, connections, icons, setIcons, setTheme, labels, setLabels, setFlows, flows, flowColors, openImages, closeImages, cam, geo, core, toWorld, goTo, and for the Data view dataSelection, setKeysOnly, dataLayout, dataCam, and for Mermaid mapView, mermaid, showMermaid), and history (with versions embedded: versions(), compare(a, b), show(key, from); else null). The engine is window.archEngine(prev): teardown() releases everything one run attached, and running it again on a changed window.MODEL redraws the page in place (prev may carry cam, open and select); edit mode works this way. window.ARCH_EDIT is the editor (active, model(), modelJs(), pageHtml(), apply(fn, opts), which changes the working copy the way the panel does (opts.label names the undo step), start() and canStart() (edit mode on, unless another version is shown), undo(), redo(), steps(), startAdd(), load(model) and toggleSide() (the drawer); the engine calls its panel, onDrop, onConnect, onClick and onArrow).

Command-line checks

Script What it does
check-model.mjs index.html Syntax of every script, the validator, and a LAYOUT report: for each group of boxes (that box open, the rest closed) the arrows that bend around a box (bend), the arrows that could not be routed and still run behind a box (BEHIND, a warning), crossings (cross), and the number of label collisions: labels that could not be placed clear of other labels, boxes and open-box headers and are drawn as markers (information, not a warning; --verbose lists each as label "…" on A → B would overlap …). The report is for the model's arrow style (view.edges, default orthogonal); with orthogonal arrows bend lines are replaced by OVERLAP (two unrelated arrows left on the same line because a gutter is full). --edges straight or --edges orthogonal reports on the other style, --verbose lists everything, --no-layout skips it. The report is made with the labels on the arrows; one more LAYOUT line reports the same groups with the labels in the boxes, as the page starts (IN and OUT unfolded): lines lying on another, crossings, lines left behind a box, and how many rows are cut with "…" (--verbose lists them). With entities, a DATA line: schemas, entities, fields, lines by kind, crossings, and lines of the Data view that still cross a card (BEHIND, a warning), with the time the layout took.
check-model.mjs index.html --arrange [tidy\|flow-x\|flow-y\|layers] After the LAYOUT report, for each group (laid out as there, with the labels as the page starts) that the page's arrange menu would improve: the crossings, bends, lines behind boxes and overlapping lines before and after, and at: [column, row] for every box of the group, with the cell it has now. Information only; each group is measured on its own, so set one, rebuild and check again. A layout by hand that tells the story better is worth more than a few crossings.
check-model.mjs index.html --root <repo> Also checks that every path exists in the repository (of nodes, schemas and entities), that directories end in /, and that each line is inside its file (a field's line in its entity's file). (Relative image paths are always checked: each must be a file next to the page.)
check-model.mjs index.html (HINTS) Modelling hints, from modelling.md: an ext or sibling drawn with its insides, code directly in a container, a generic name (Database, Backend), a library or a piece of infrastructure drawn as a container, a box with one child, a system or component past its "hard to read" size, a uses / calls label, an arrow back that looks like the reply to a call, a person on a data store, an edge that starts at a data store, a relationship declared again between the boxes around two ends that already have one, scenario steps that name a box with parts instead of its parts, and boxes with no edge and no step. Information only: never a warning, never fails a build (not with --strict either); each line names the section of modelling.md that explains it. --no-hints leaves them out; past 15, --verbose lists them all.
screenshot.mjs index.html [outDir] [state …] PNGs of the page in the given URL states with headless Chrome or Edge, after confirming the page booted. Finds the browser itself; --browser <path> or CHROME_PATH overrides.
build-explorer.mjs model.js index.html Template + model → page, runs the check, writes architecture.jsonld, architecture.ttl and, when rete is available, architecture.rete. Given a graph (.ttl, .jsonld, .nt, .rete) instead of model.js, it recreates the model from it first. Relative images must exist next to the model (or --images-from <dir>) and are copied next to the page; --embed-images puts them into the page as data URIs (up to 2 MB each) so index.html is one file.
model-from-rdf.mjs graph.ttl model.js An RDF graph back to an editable model.js.
check-roundtrip.mjs model.js Proves that the model's graph recreates the page: model → N-Triples, Turtle, JSON-LD → model, page rebuilt from the graph alone, screenshots compared.
model-to-mermaid.mjs model.js [--level N \| --open a,b] [--variant id] [--syntax flowchart\|c4] [--direction TB\|LR] [--all] [--out file] The map as Mermaid text (see "Mermaid"), the same the page's panel makes, from model.js, a page or a graph. Without --level / --open, the model's opening view. --all writes one Markdown file with the context, the containers and what is inside each container, each in a mermaid block. Exit 0 written, 1 model errors, 2 usage.
check-mermaid.mjs [model.js …] Checks the Mermaid export: every view in both syntaxes reads back to the same boxes, parents and arrows with nothing to change; scripted edits give exactly the expected changes and skips, and applied leave a valid model; with Chrome or Edge, mermaid.js draws every text without an error (--shots dir saves PNGs, --mermaid file.js uses a local mermaid.js, --no-render skips the browser). Without a model: the template and the plugin's example.
check-coherence.mjs <index.html \| model.js \| graph.ttl> [--json] [--rule id] [--strict] [--all] The coherence rules (coherence-rules.md) on the model's RDF graph, with rete-graph (the plugin's mcp/ folder has it): one ISSUE, WARN or INFO line per finding, naming the boxes and where they are (step review#5, edge 2 (web → db)), then a summary. --json the report (ids rule@key, focus, why, fix, dismissals), --all the dismissed findings too. Exit 1 on an error (or a warning with --strict), 2 without rete-graph. --write-shapes writes ontology/c4-coherence-shapes.ttl (the rules as SHACL-SPARQL), --check-shapes checks it is current. check-model.mjs --coherence adds a COHERENCE section to the usual report, and build-explorer.mjs embeds the findings in the page (--no-coherence to leave them out).
list-tools.mjs [--write] [--check] The reference of the agent tools (references/agent-tools.md: each tool's title, where it is offered, what it needs, its description and arguments), written from the template's tools block. Without options it prints it; --write writes the file, --check exits 1 when the file is out of date.

How layout is decided

  1. Each group of siblings sits on a grid. Cells come from at: [col, row] when every sibling has one; otherwise the engine assigns them (see data-model.md, "Layout").
  2. A closed box has a fixed size per type:
Type w × h (px)
system 300 × 124
code 272 × 84
component 264 × 96
container 260 × 108
person, sibling 250 × 104
store 240 × 108
ext 224 × 96
state 200 × 68

With the labels in the boxes, a box (closed, open or showing its sequence) is taller by its IN and OUT sections (see "Labels in the boxes"); widths stay.

  1. Column width is the widest box in the column, row height the tallest in the row. Gaps (gutters): 112 px between columns, 76 px between rows; at the top level 90 px between boxes and 110 px between rows. These are the sizes of quiet gutters; a busy gutter gets more room, each one on its own:
  2. Lanes. If n right-angled arrows run side by side along a gutter (the most at any point of it), it is at least 2 · 18 + (n − 1) · 9 px wide, so every arrow keeps its own lane.
  3. Labels. A label centred in a gutter that cannot be placed in full widens that gutter to fit the label across it, and each such label adds 22 px to a row gutter or 28 px to a column gutter per round.
  4. The layout is laid out, routed and labelled, the gutters that need it grow, and it is laid out again, until nothing changes (5 rounds at most; a gutter grows by 200 px at most). Growth that did not reduce the labels stuck in that gutter is taken back, and those labels become markers instead.
  5. Quiet gutters keep their size, so small diagrams do not spread out. Gutters are sized for the current arrow style and open boxes, so opening a box or switching the style can move boxes; it animates like any other layout change. Label visibility (labels, zoom) does not change the layout.

An open box is its children's grid plus an 84 px header and 30 px padding (60 px title strip, then room for one arrow lane above the first row). 4. Opening a box pushes its siblings apart rather than overlaying them. Sizes are computed bottom-up, positions top-down. 5. Top level: the row holding the system is centred; boxes in the other rows slide sideways to line up with what they talk to. 6. Arrows are drawn in one of two styles (next section). In both, routes are computed once per layout change, are stored relative to boxes rather than as coordinates, and so follow the boxes while the layout animates. If a box is completely walled in, the arrow falls back to a straight line and check-model.mjs reports it as BEHIND.

Beyond the view

When the map is larger than the view (zoomed in, or panned), arrows run off its edges, and the box at the other end is out of sight. The border of the map then names it, the way a game points at what is off screen:

  • Where. Each arrow is followed along its route on screen. Where it last leaves the view (its end, the box it points to, is off screen) a chip TO box sits on that side of the map; where it first comes in from an off-screen start, FROM box. An arrow that only crosses the view gets both. The side of the map that has chips gets a tinted band.
  • The chip is in the arrow's colour, as near the crossing as the other chips and the controls over the map (the status bar's chips, legends, minimap and its button, zoom buttons, the details panel's handle, the edit handle, ?) let it be, with a small pointer at the exact crossing. It shows the box's C4 level (L1 to L4, or L1·L2 for a merged chip whose boxes are at different levels), the box's name and the arrow's label; the tooltip says it in full. On the top and bottom sides a chip lies level; on the left and right sides it runs along the border, turned a quarter (reading down on the left, up on the right) so that its bottom and its pointer face out of the map. A chip is never longer than the longest free stretch of its side: it goes in the nearest stretch it fits in, its text cut with "…" if need be.
  • Groups. Chips that would overlap, or be pushed far from their crossings, merge: the two crossings nearest each other first, until they fit. A merged chip reads n arrows with the first names (or one box's name and its count, when they all go to it). A click on it lists its arrows; Escape or a click elsewhere closes the list.
  • The list of a merged chip gives each arrow's direction, its box's level, name and label.
  • Go there. A click on a chip (or a row of a list) moves the view to its box. The zoom stays, unless the box needs more room. The arrow's label stays shown until the next click on the map, and the box pulses once. Hovering a chip (or focusing it) lights its arrows, and a single arrow also shows its label. The wheel over a chip still zooms the map.
  • What counts. With a selection (or flows on the map), only the arrows that stay bright; with a variant picked, only that variant's. Labels in the boxes and labels off work the same: the chips follow the arrows, not their labels.
  • On and off. On by default. The edges ▾ menu's Name them in the frame turns it off (#beyond=0 in the URL). When the whole map fits, nothing crosses the border and nothing is drawn.
  • It is an HTML layer over the map, outside the SVG: exports (SVG, PNG, HTML), the minimap and the Mermaid text never include it. It is redrawn at most once a frame, after a camera move, a redraw or a new size.

Arrow styles: orthogonal and straight

Set the default with view.edges in the model ('orthogonal' if omitted). The reader picks one in the edges ▾ menu, or switches with E; the URL carries edges=straight or edges=orthogonal when it differs from the model's default. The style applies to the Map only: the pinned board, the dynamic diagrams and a sequence shown inside a box are drawn as before.

orthogonal (default, the button reads edges: square ▾). Right-angled arrows that do not lie on top of each other:

  • Each arrow leaves and enters a box perpendicular to a side. Sides come from the relative position of the two boxes: bottom → top when they are in different rows, right → left when they share a row.
  • Arrows that use the same side of a box get separate ports spread along it, ordered by where their other end is.
  • The path runs in the gutters: on lines 18 px outside the boxes, found as the shortest route with few bends. It never crosses a closed box, and it keeps off the 60 px title strip of open boxes.
  • Stretches of different arrows that fall on the same gutter line are moved onto parallel lanes 9 px apart, staying at least 6 px from any box. When a gutter is full, arrows that share an end box may share a lane (they read as one trunk); unrelated arrows are only stacked if nothing else is left, and check-model.mjs reports that as OVERLAP.
  • A label sits on a segment of its own arrow, the roomiest one first, and slides along it to avoid boxes, titles and other labels. If no spot is free it is folded into a marker (see "Arrow labels").

Arrows and open boxes (both styles). An arrow that has nothing inside an open box (neither of its ends is in it, nor is the box inside one of its ends) goes around it, not through it: for that arrow the open box is solid, like a closed one, with its own gutter lines to go round it, and the search for a route reaches 260 px past it. An open box is then crossed only by its own arrows. On by default; Around open boxes in the edges ▾ menu turns it off, and arrows take the shortest way through again (#around=0). ARCH_EXPLORER.layout().through lists the arrows that still cross an open box they have nothing in.

straight. Centre to centre, clipped at the box edge. If a closed box lies on the line, the arrow takes the shortest path around box corners (14 px clearance) with rounded bends. A pair of arrows running both ways is drawn as two parallel lines.

When to pick which:

orthogonal straight
Dense groups, hubs, many arrows between the same rows Clear: one lane per arrow, nothing coincides Arrows share nearly the same line and cut diagonally across boxes
Small diagrams, 3 to 6 boxes with few arrows Fine, slightly more formal Shortest and lightest
Following one arrow by eye Follow the lane; select a box to highlight its arrows Direct line, easy when few
Crossings Right-angle crossings in the gutters, usually no fewer in number Diagonal crossings anywhere

Limits of the orthogonal style: a gutter widens for its lanes and labels, but by 200 px at most, so a group with far more parallel arrows than that will stack some; boxes stacked exactly above each other with several arrows between them get small jogs where ports do not line up; where many arrows leave one side of a box, their ports are close together and some of their labels fold into markers; long-distance arrows take visible detours along the gutters. More room comes from fewer boxes per row (at), not from a setting.

What this means for placing boxes:

  • Adjacency rule. In both styles the shortest, cleanest arrows are between neighbouring cells. With straight, an arrow is straight when nothing sits between its two ends: same row with no box between them, same column with no box between them, or a diagonal that misses the other boxes. Neighbouring cells are always straight. Everything else bends, which is legible but busier.
  • Label room. The 112 px gap between two horizontal neighbours holds a label of 14 to 16 characters on a line; a longer one widens that gap (and the whole column gutter) to fit. Vertical neighbours have room for any label. Long labels on short horizontal arrows are still the usual cause of wide gutters and markers: shorten the label, or stack the two boxes vertically.
  • Entry on top, stores at the bottom. Automatic layout already pulls boxes reached from outside the group to the top row and boxes that only reach out to the bottom row.
  • Cross-cutting hubs (auth, ORM/session, logging, a shared client) are used by most siblings. Three ways to handle one, in order of preference:
  • Draw it and let the arrows route. Put the hub in the middle of the bottom row (or the middle column), so that most users are in the row above it and reach it with straight or one-bend arrows. Give the edges into it the same short label so the diagram reads as a fan.
  • If the fan drowns the rest, declare the dependency once at a higher level of the users (the routers/ component uses auth, instead of each of five route modules), when such a common parent exists.
  • Only as a last resort mention it in notes instead of drawing it, and say so in the hub's desc. Routing exists so that this is rarely needed.
  • Fix loop. Build, read the LAYOUT lines, move one end of a bent or crossing arrow into a neighbouring cell of the other with at on that whole group, rebuild. Zero bends is not the goal; a hub with five users will have some. BEHIND lines are the ones that must be fixed.

Extending and switching off

Model-only switches (no engine edits):

To Do
Remove the Dynamic tab Omit scenarios
Remove the Data tab Omit entities (and schemas, relations)
Remove the variant filter, dots and chips Omit variants
Remove levels 3 and 4 Do not add component / code nodes
Start with an empty Pinned board Omit defaultPins
Remove source links Omit source.repoUrl (paths still show) or omit path
Start on a different drill-down view.startLevel or view.open
Rename levels or legend entries levelNames, legend

Small edits outside the MODEL block (keep them minimal and say so in your report):

To Edit
Work fully offline, no font request Delete the three Google Fonts <link> lines in <head>; system fonts take over
Change brand colours The tokens in the theme blocks at the top of <style>: :root (light), the dark block under prefers-color-scheme and [data-theme="dark"] (keep those two identical), and one [data-theme] block per other theme. See "Colour themes".
Add a colour theme One [data-theme="name"] CSS block and one entry in ARCH_THEMES in the validator script. See "Colour themes".
Force a theme Set view.theme in the model and delete the <div class="themes"> element (button and menu). The page then ignores #theme=, stored picks and T.
Hide the minimap or hint Delete #minimap / .hint in the markup, or add display: none
Start with labels on the arrows, or off In the core, var LMODE = 'box' → 'arrow' or 'off' (IODEF holds which sections are unfolded, IOORD how a row reads); #labels= still wins, and the URL then names the boxes as labels=box
Change box sizes or spacing SIZE, HEAD, PAD and the gaps at 100 % spacing, GAP0 (GX, GY, RGX, RGY), in the core script; keep BOXW in the validator in step. How far busy gutters grow: GROW, GMAX, GROUNDS (set GROUNDS = 0 for fixed gaps)
Change the default label or arrow size Labels: LABEL_SCALE in the core (× the 11 px font and LBL0); arrows: the .85 fallback of --ink-scale in the .e rules and in applySizes(). The steps of the size menu: SIZE_STEPS in the engine
Remove the size menu Delete the <div class="sizes"> element; the defaults apply
Hide icons, or show logos in their brand colours view.showIcons: false or view.icons: 'brand' in the model (no edit outside the MODEL block). To drop icons from the page altogether, delete <script id="icons"> and <script id="icon-data">: nothing is drawn, nothing is fetched, and search_icons says the page has no icon set
Remove edit mode Delete the #btn-edit handle (the editor never opens); to drop the code too, also delete <script id="editor">, #ed-restore, #ed-msgw and the #edside aside
Add a colour tone Add --name / --name-soft to every theme block (light, both dark blocks, and each [data-theme] block), a .tone-name and a .flow-name rule, the name to both TONES arrays (validator and core) and, to offer it to flows, to ORDER in window.archFlowTones (core script); then to the sh:in lists of ontology/c4-shapes.ttl
Add a node type Add it to LEVEL and BOXW in the validator, to BASE_LEVEL, DEFAULT_KIND, DEFAULT_TAG, SIZE in the core, and to CLASS and BASE_LEVEL in the rdf script
Add a field to the details panel Carry it through the NODES = MODEL.nodes.map(...) normaliser in the core and print it in renderPanel(); escape with esc(). Add it to the rdf script if it should be exported.
Remove the export menu Delete the <div class="export"> element and the <aside id="mmd"> Mermaid panel; the page then never contacts a CDN
Remove the Mermaid panel Delete the <aside id="mmd"> element (G and the menu entry go with it); to drop the code too, also delete <script id="mermaid"> (the get_mermaid tool then answers that the page has no Mermaid export)
Turn arrow routing off In the core, make route() return agg immediately; arrows are straight again

All text from the model is HTML-escaped before it is inserted, and javascript: / data: URLs are rejected. Keep that property when extending.

Making a good architecture diagram with it

Decide what the levels mean for this project

The four levels are C4's: context, containers, components, code. Map them honestly:

  • System is the thing being documented. One box, unless the repository really ships several products.
  • Containers are things that run or are deployed separately, plus the stores they own: a service, a web app, a CLI, a worker, a scheduled job, a database, a queue. A library has few of these; then model the library as one container and put the weight on components.
  • Components are the modules a maintainer thinks in: usually top-level packages or directories, not every file.
  • Code is optional. Add it only for the elements someone will look for by name: public entry points, the orchestrating function, the central types, the one tricky algorithm.

Stop at the level where your knowledge stops. Two accurate levels beat four invented ones.

modelling.md has the full guide: a test for each type (person, system, external and neighbouring system, container, data store, component, code element), relationships and scenarios, the usual mistakes with their corrections, a worked example and a review checklist.

How many boxes

Group Aim for Hard to read beyond
Top level (people, system, externals) 4–8 10
Containers in a system 3–8 10
Components in a container 4–9 12
Code in a component 2–6 9

The validator warns above 12 children. Whole model: a few dozen nodes is typical, about 150 is a practical ceiling for comfortable navigation.

When a group is too big, split the level instead of shrinking the text:

  • Group by responsibility into intermediate boxes (five *_provider modules become one providers/ component with five code children).
  • Merge externals of the same role into one box (PyPI · npm as "Package registries") and list the members in desc.
  • Drop pure utilities (logging, config, helpers) unless they explain something. An element nothing points at and that points at nothing usually does not belong.
  • Only expand the containers that matter. It is normal for one container to have components and the others to stay leaves.

Naming

  • name: what the team calls it. Containers and components get role names (API service, Order service) or their real directory names (pipeline/stages/) when those are what people search for. Code gets its real identifier with call parentheses for functions (place_order()).
  • tag: what kind of thing it is, plus technology: CONTAINER · FASTAPI, DATA STORE · POSTGRES, CLASS, GET /v2/jobs/{id}.
  • sub: what it does in about five words, separated by ·. It is the only description visible without clicking.
  • Text is cut to the box: roughly 22 to 30 characters for name, a little more for tag and sub, depending on the type (table in data-model.md, "What fits on a box"). Do not repeat the parent's name in the child.

Edges and labels

  • Draw an edge when one element calls, reads, writes, sends to or depends at runtime on another. Skip pure import relationships that say nothing about behaviour.
  • Declare each edge at the lowest level you know. Never declare the same relationship twice at two levels; lifting does that for you.
  • Label with a verb phrase specific to this pair: reads stock + prices, POST /orders, publishes OrderPlaced. Avoid uses and calls when anything more precise is known. Use the protocol or function name when it is the thing a reader would grep for.
  • Length: 16 characters or fewer stays on one line and fits between neighbouring boxes; up to about 36 wraps to two lines; more is cut. Put the full call signature in a scenario step instead, where there is room.
  • Give code-level edges a summary wherever several of them collapse into one arrow at container level, so the container diagram shows JSON over HTTPS rather than whichever call was declared first.
  • Direction follows the call or the data push: caller → callee, producer → queue, consumer → queue it reads from. Be consistent.
  • kind: 'accent' for the few edges where the outside world enters the system. dashed: true for asynchronous or optional paths.
  • Aim for one to three outgoing edges per box at the level where it is drawn. A box with eight is either a real hub (fine, place it centrally) or a sign that the edges belong to its children.

What goes in the details panel

The box shows a name and five words; the panel is where the explanation lives.

  • desc: what it is responsible for and, if not obvious, why it exists. One to three sentences. State facts found in the code, not guesses.
  • notes: the things that bite. Configuration flags and their defaults, auth requirements, invariants, limits, "only runs when X", known caveats.
  • tech: language, framework, storage engine.
  • path and line: always, for anything that maps to code. This is what makes the explorer useful to a developer. Use a trailing / for directories.
  • url: documentation for externals.

Variants

Use them when a meaningful part of the architecture only exists in some mode: a runtime switch, cloud vs. self-hosted, a feature flag that swaps a subsystem. Tag the minority; leave everything shared untagged. If only two or three elements differ, a dashed border and a note are simpler than a filter.

Lifecycles

If an entity's status drives the domain (order, task, payment, job), model it as a state machine: a box for the lifecycle with state children and the transitions as edges, labelled with the event that causes them. Add an edge from the function that performs a transition to the state it produces. Five to nine states read well; fold rare error states into one.

Scenarios

  • Write every step in the direction the message travels (caller → callee; reply: true for an answer going back). The collaboration diagram derives its columns from that.
  • Two to four scenarios: the main happy path, then the flows that explain a design decision (cache hit, failure and retry, the alternative mode).
  • Write steps between the most specific nodes available, in real execution order, 8 to 40 steps. The reader chooses the level; the engine folds the rest.
  • Use reply: true for returned values worth showing, not for every call.
  • Labels are concrete: function call with key arguments, HTTP method and path, the message name, the status code.
  • Collaboration diagrams read best at L1–L2, which is why deeper levels open as sequence diagrams; the step table stays readable at any level.
  • The same steps drive "Sequence inside a box" on the map. A container only gets a useful inner sequence if steps name its components (or code), not the container itself. A step written as web → api shows nothing inside api.

Default pins

Choose the handful of elements, across levels, that you would draw on a whiteboard to explain the system in two minutes: the actor, the entry point, the orchestrator, the main store, the one or two externals that matter.


Source

This page is skills/architecture-explorer/references/features.md, the guide the skill reads while it works. Edit it there; the documentation includes it as is.