Help:Diagrams

From RECESSIM, A Reverse Engineering Community
Revision as of 05:40, 11 September 2026 by Hash (talk | contribs) (Add a Using the visual editor section: add, edit and repoint diagrams without wikitext, with screenshot slots to fill in later)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This wiki can store diagrams as diagrams rather than as uploaded pictures. A diagram lives on its own page, keeps a full edit history like any other page, and can be re-opened and changed by the next person — no hunting for the original file, and no re-uploading a flat image every time something moves.

You need to be logged in and in the writer group to create or change a diagram. Anyone can view them.

Choosing a format

Namespace Best for How you edit it
Mermaid: Flowcharts, sequence diagrams, state machines, ER diagrams, timelines Text — a few lines of Mermaid syntax
DOT: Graphs and trees: signal chains, network maps, workflows Text — Graphviz DOT syntax
Drawio: Free-form drawings, block diagrams, anything you want to drag around Full visual editor (draw.io / diagrams.net)
BPMN: Formal process diagrams, with elements that can link to wiki pages Visual editor
Gantt: Project schedules with dependencies Visual editor

Mermaid and DOT are the two most useful here for typical hardware, RF and reverse-engineering documentation, and they are the easiest to review in a diff because the source is plain text.

Creating a diagram

The easiest way is to write a red link and click it:

  1. On any page, add a link in a diagram namespace, for example [[Mermaid:Meter capture chain]].
  2. Save, then click the new red link.
  3. The diagram editor opens directly. Fill it in and save.

You can also go straight to the editor for a page that does not exist yet by visiting its URL with ?action=editdiagram on the end.

On a diagram page that already exists, use the Edit diagram tab at the top.

Showing a diagram on another page

Diagram pages are not transcluded with the usual double braces. Use Template:Diagram, naming the diagram page including its namespace:

{{Diagram|page=Mermaid:Meter capture chain}}

That renders the diagram inline wherever you put it, so an article can show a diagram that is maintained on its own page. Each section below gives the exact line for that format's example.

You do not have to type any of that. In the visual editor, diagrams can be added, repointed and opened for editing without touching wikitext — see Using the visual editor below.

The older form {{#display_diagram:Mermaid:Meter capture chain}} still works and renders identically. Prefer the template: #display_diagram is a parser function, and the visual editor can edit a template's parameters but not a parser function's target, so bare calls can only be changed by editing the page source.

One limit to know about: a single page can contain at most one BPMN or Gantt diagram — the extension gives both of them the same internal element name, so a second one on the same page is refused with an error message. Mermaid, DOT and Drawio can be embedded as many times as you like.

Using the visual editor

Screenshots for this section have not been uploaded yet. Each caption below names the file to upload — for example FlexDiagrams VE insert template.png — so uploading under that exact name fills the slot with no further edit to this page.

Everything here works in the ordinary visual editor. Nothing below requires editing wikitext.

Adding a diagram to a page

Put the cursor where the diagram should go, then Insert → Template. Type Diagram and choose it.

File:FlexDiagrams VE insert template.png
The Insert → Template dialog with "Diagram" typed into the search box.

Fill in the Diagram page field with the diagram's full page name, including its namespace prefix — Mermaid:, DOT:, Drawio:, BPMN: or Gantt:. The field suggests existing pages as you type, so you rarely need to type the whole name.

File:FlexDiagrams VE diagram field.png
The Diagram page field, suggesting existing diagram pages as you type.

Insert, and save the page as usual.

What a diagram looks like while editing

An embedded diagram does not appear as a picture in the visual editor. It shows as a single labelled line naming the diagram, like:

◈ Mermaid:RE FlowChart Overview — diagram, edit it on its own page
File:FlexDiagrams VE placeholder.png
An embedded diagram as it appears while editing: one labelled line rather than the rendered picture.

That is deliberate. The visual editor cannot run the diagram renderer, so without it you would see the diagram's raw source — dozens of lines of flowchart code — sitting in the middle of the article. The line above is shown instead. Save or preview the page to see the diagram itself.

Editing the diagram

Double-click the line. The diagram's own editor opens in a new tab, leaving your article edit untouched in the original tab. Edit the diagram, save it there, then return to your article.

Changing which diagram is shown

Single-click the line to select it. A small box appears with two choices:

  • Edit "…" ↗ — opens that diagram's editor in a new tab, the same as double-clicking.
  • Change which diagram is shown — opens the template's settings so you can point this embed at a different diagram page.
File:FlexDiagrams VE context menu.png
Selecting an embedded diagram: edit the diagram itself, or change which diagram the page shows.

Single-clicking also selects the diagram as a block, so Backspace removes the embed from the article — which deletes only the embed, never the diagram page itself.

If you edit the source instead

The visual editor is not required. In the source editor the same embed is one line:

{{Diagram|page=Mermaid:RE FlowChart Overview}}

Both editors produce exactly the same thing, and you can move between them freely.

Mermaid

Flowcharts, sequence diagrams, state machines, class and ER diagrams, pie charts and timelines, all written as text. Served entirely from this wiki.

Example page: Mermaid:Example diagramopen it in the editor

Its source is simply:

flowchart LR
    A[Smart meter] -->|900 MHz| B(SDR capture)
    B --> C{Decodes?}
    C -->|yes| D[rtlamr output]
    C -->|no| E[Adjust gain / freq]
    E --> B

Embed it in a page with:

{{Diagram|page=Mermaid:Example diagram}}

which renders as:

flowchart LR A[Smart meter] -->|900 MHz| B(SDR capture) B --> C{Decodes?} C -->|yes| D[data output] C -->|no| E[Adjust gain / freq] E --> B

See the Mermaid documentation for the full syntax. This wiki bundles Mermaid 11.17.2, so the Mermaid 11 diagram types — architecture, packet, kanban, treemap and radar — all work. Diagram types added in Mermaid 12 will not render, and layout: elk is not available (it falls back to the default layout silently). The default look is handDrawn; override it per diagram with %%{init: {'look': 'classic'}}%%.

The Mermaid editor: type the diagram source in the text box and the preview above it redraws as you type.

DOT

Graphviz DOT source, rendered in your browser by the bundled Viz.js. You describe what connects to what and Graphviz works out the layout. Served entirely from this wiki.

Example page: DOT:Example diagramopen it in the editor

Its source:

digraph FlashExtraction {
    rankdir=LR;
    node [shape=box];
    "Target PCB" -> "Desolder chip";
    "Desolder chip" -> "Socket adapter";
    "Socket adapter" -> "Programmer";
    "Programmer" -> "Binary dump";
    "Binary dump" -> "Analysis";
}

Embed it in a page with:

{{Diagram|page=DOT:Example diagram}}

which renders as:

digraph FlashExtraction { rankdir=LR; node [shape=box]; "Target PCB" -> "Desolder chip"; "Desolder chip" -> "Socket adapter"; "Socket adapter" -> "Programmer"; "Programmer" -> "Binary dump"; "Binary dump" -> "Analysis"; }
The DOT editor: Graphviz source in the text box, with the rendered graph above it.

Drawio

The full draw.io drawing tool, for free-form diagrams you build by dragging shapes around. Good when the layout itself carries meaning — panel layouts, wiring sketches, block diagrams.

Example page: Drawio:Example diagramopen it in the editor

Embed it in a page with:

{{Diagram|page=Drawio:Example diagram}}

which renders as:

One thing to know: the Drawio editor is loaded from the external site embed.diagrams.net while you are editing. Your diagram is saved here on the wiki, not on their servers, and viewing a saved Drawio diagram does not contact them at all — but editing one needs that external site reachable from your browser. The other four formats are served entirely from this wiki.

The Drawio editor: the full draw.io canvas, shape palette and format panel, embedded in the wiki page.

BPMN

Formal business-process diagrams, drawn with bpmn-js. Worth knowing: an element named [[Some page]] becomes a link to that wiki page, so a process diagram can double as navigation.

Example page: BPMN:Example diagramopen it in the editor

Embed it in a page with:

{{Diagram|page=BPMN:Example diagram}}

which renders as:

That embed uses this page's one BPMN-or-Gantt slot; a second diagram of either type on the same page would be refused.

The BPMN editor: the shape palette down the left, canvas in the middle, zoom controls on the right.

Gantt

Project schedules with tasks, durations and dependencies, drawn with dhtmlxGantt. Useful for planning a long teardown or a multi-stage project on its own page.

Example page: Gantt:Example diagramopen it in the editor

Embed it in a page with:

{{Diagram|page=Gantt:Example diagram}}

This help page cannot show that live: it already embeds a BPMN diagram above, and only one BPMN-or-Gantt diagram is allowed per page (see above). To see it rendered, open Gantt:Example diagram itself.

The Gantt editor: task grid on the left, timeline on the right, with zoom controls for hours through years.

Tips

  • Diagrams are ordinary pages: History, Talk, watchlisting and the normal backups all apply.
  • Because Mermaid and DOT are text, their page histories produce readable diffs — prefer them over an uploaded image when the diagram is likely to change.
  • Give diagrams descriptive names, the same as files — Mermaid:Landis Gyr Focus teardown steps beats Mermaid:Diagram 3.
  • The five example pages above are meant to be edited and experimented with. If you want a scratch diagram of your own, make a new page rather than overwriting an example.

See also