Help:Diagrams: Difference between revisions
Document the one-BPMN-or-Gantt-per-page limit instead of triggering it |
Add a Using the visual editor section: add, edit and repoint diagrams without wikitext, with screenshot slots to fill in later |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
You need to be logged in and in the '''writer''' group to create or change a diagram. Anyone can view them. | You need to be logged in and in the '''writer''' group to create or change a diagram. Anyone can view them. | ||
== Choosing a format == | == Choosing a format == | ||
| Line 37: | Line 35: | ||
== Showing a diagram on another page == | == Showing a diagram on another page == | ||
Diagram pages are '''not''' transcluded with the usual double braces. Use | Diagram pages are '''not''' transcluded with the usual double braces. Use [[Template:Diagram]], naming the diagram page including its namespace: | ||
<pre> | <pre> | ||
{{ | {{Diagram|page=Mermaid:Meter capture chain}} | ||
</pre> | </pre> | ||
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. | 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|Using the visual editor]] below. | |||
The older form <code><nowiki>{{#display_diagram:Mermaid:Meter capture chain}}</nowiki></code> still works and renders identically. Prefer the template: <code>#display_diagram</code> 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. | '''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 <code>FlexDiagrams VE insert template.png</code> — 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 <code>Diagram</code> and choose it. | |||
[[File:FlexDiagrams VE insert template.png|thumb|none|700px|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 — <code>Mermaid:</code>, <code>DOT:</code>, <code>Drawio:</code>, <code>BPMN:</code> or <code>Gantt:</code>. The field suggests existing pages as you type, so you rarely need to type the whole name. | |||
[[File:FlexDiagrams VE diagram field.png|thumb|none|700px|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|thumb|none|700px|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|thumb|none|700px|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 <code>Backspace</code> 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: | |||
<pre> | |||
{{Diagram|page=Mermaid:RE FlowChart Overview}} | |||
</pre> | |||
Both editors produce exactly the same thing, and you can move between them freely. | |||
== Mermaid == | == Mermaid == | ||
| Line 67: | Line 122: | ||
<pre> | <pre> | ||
{{ | {{Diagram|page=Mermaid:Example diagram}} | ||
</pre> | </pre> | ||
which renders as: | which renders as: | ||
{{ | {{Diagram|page=Mermaid:Example diagram}} | ||
See [https://mermaid.js.org/intro/ the Mermaid documentation] for the full syntax. | See [https://mermaid.js.org/intro/ 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 <code>layout: elk</code> is not available (it falls back to the default layout silently). The default look is <code>handDrawn</code>; override it per diagram with <code>%%{init: {'look': 'classic'}}%%</code>. | ||
[[File:FlexDiagrams Mermaid editor.png|thumb|none|700px|The Mermaid editor: type the diagram source in the text box and the preview above it redraws as you type.]] | [[File:FlexDiagrams Mermaid editor.png|thumb|none|700px|The Mermaid editor: type the diagram source in the text box and the preview above it redraws as you type.]] | ||
| Line 101: | Line 156: | ||
<pre> | <pre> | ||
{{ | {{Diagram|page=DOT:Example diagram}} | ||
</pre> | </pre> | ||
which renders as: | which renders as: | ||
{{ | {{Diagram|page=DOT:Example diagram}} | ||
[[File:FlexDiagrams DOT editor.png|thumb|none|700px|The DOT editor: Graphviz source in the text box, with the rendered graph above it.]] | [[File:FlexDiagrams DOT editor.png|thumb|none|700px|The DOT editor: Graphviz source in the text box, with the rendered graph above it.]] | ||
| Line 119: | Line 174: | ||
<pre> | <pre> | ||
{{ | {{Diagram|page=Drawio:Example diagram}} | ||
</pre> | </pre> | ||
which renders as: | which renders as: | ||
{{ | {{Diagram|page=Drawio:Example diagram}} | ||
'''One thing to know:''' the Drawio editor is loaded from the external site <code>embed.diagrams.net</code> 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. | '''One thing to know:''' the Drawio editor is loaded from the external site <code>embed.diagrams.net</code> 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. | ||
| Line 139: | Line 194: | ||
<pre> | <pre> | ||
{{ | {{Diagram|page=BPMN:Example diagram}} | ||
</pre> | </pre> | ||
which renders as: | which renders as: | ||
{{ | {{Diagram|page=BPMN:Example diagram}} | ||
That embed uses this page's one BPMN-or-Gantt slot; a second diagram of either type on the same page would be refused. | That embed uses this page's one BPMN-or-Gantt slot; a second diagram of either type on the same page would be refused. | ||
| Line 159: | Line 214: | ||
<pre> | <pre> | ||
{{ | {{Diagram|page=Gantt:Example diagram}} | ||
</pre> | </pre> | ||
Latest revision as of 05:40, 11 September 2026
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:
- On any page, add a link in a diagram namespace, for example
[[Mermaid:Meter capture chain]]. - Save, then click the new red link.
- 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.
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.
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
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.
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 diagram — open 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:
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'}}%%.

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 diagram — open 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:

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 diagram — open 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.

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 diagram — open 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.

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 diagram — open 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.

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 stepsbeatsMermaid: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
- Help:Uploading files — for photographs, scans and CAD files
- Extension:Flex Diagrams — the extension providing this