Help:Diagrams: Difference between revisions

From RECESSIM, A Reverse Engineering Community
Jump to navigation Jump to search
How to create and embed diagrams (Flex Diagrams)
 
Document the one-BPMN-or-Gantt-per-page limit instead of triggering it
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This wiki can store '''diagrams as diagrams''' rather than as uploaded pictures. A
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.
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.
You need to be logged in and in the '''writer''' group to create or change a diagram. Anyone can view them.
Anyone can view them.


== The five formats ==
''Screenshots of the editing interfaces are still to be uploaded. Each section below already points at the image it expects, so uploading a file under exactly the name shown will make it appear here automatically — no further editing of this page needed:'' <code>FlexDiagrams Mermaid editor.png</code>, <code>FlexDiagrams DOT editor.png</code>, <code>FlexDiagrams Drawio editor.png</code>, <code>FlexDiagrams BPMN editor.png</code>, <code>FlexDiagrams Gantt editor.png</code>. ''Delete this paragraph once they are all up.''


Each format has its own namespace, and each has its own editor.
== Choosing a format ==


{| class="wikitable"
{| class="wikitable"
! Namespace !! Best for !! How you edit it
! Namespace !! Best for !! How you edit it
|-
|-
| '''Mermaid:''' || Flowcharts, sequence diagrams, state machines, ER diagrams, timelines || Text — you write a few lines of Mermaid syntax
| [[#Mermaid|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
| [[#DOT|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)
| [[#Drawio|Drawio:]] || Free-form drawings, block diagrams, anything you want to drag around || Full visual editor (draw.io / diagrams.net)
|-
|-
| '''BPMN:''' || Formal business-process diagrams || Visual editor
| [[#BPMN|BPMN:]] || Formal process diagrams, with elements that can link to wiki pages || Visual editor
|-
|-
| '''Gantt:''' || Project schedules with dependencies || Visual editor
| [[#Gantt|Gantt:]] || Project schedules with dependencies || Visual editor
|}
|}


'''Mermaid''' and '''DOT''' are the two most useful here for typical hardware, RF and
'''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.
reverse-engineering documentation, and they are the easiest to review in a diff because
the source is plain text.


== Creating a diagram ==
== Creating a diagram ==
Line 37: Line 31:
# The diagram editor opens directly. Fill it in and save.
# 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
You can also go straight to the editor for a page that does not exist yet by visiting its URL with <code>?action=editdiagram</code> on the end.
its URL with <code>?action=editdiagram</code> on the end.


On a diagram page that already exists, use the '''Edit diagram''' tab at the top.
On a diagram page that already exists, use the '''Edit diagram''' tab at the top.
Line 44: Line 37:
== Showing a diagram on another page ==
== Showing a diagram on another page ==


Diagram pages are not transcluded with the usual double braces. Use the
Diagram pages are '''not''' transcluded with the usual double braces. Use the <code>#display_diagram</code> parser function instead, naming the diagram page including its namespace:
<code>#display_diagram</code> parser function instead:


<pre>
<pre>
Line 51: Line 43:
</pre>
</pre>


That renders the diagram inline wherever you put it, so an article can show a diagram
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 is maintained on its own page.


== Mermaid example ==
'''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.


The source of [[Mermaid:Example diagram]] is simply:
== 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]] — [{{fullurl:Mermaid:Example diagram|action=editdiagram}} open it in the editor]
 
Its source is simply:


<pre>
<pre>
Line 65: Line 62:
     C -->|no| E[Adjust gain / freq]
     C -->|no| E[Adjust gain / freq]
     E --> B
     E --> B
</pre>
Embed it in a page with:
<pre>
{{#display_diagram:Mermaid:Example diagram}}
</pre>
</pre>


Line 71: Line 74:
{{#display_diagram:Mermaid:Example diagram}}
{{#display_diagram:Mermaid:Example diagram}}


Mermaid supports far more than flowcharts — sequence diagrams, state diagrams, class
See [https://mermaid.js.org/intro/ the Mermaid documentation] for the full syntax. Note that this wiki bundles '''Mermaid 10.9''', so diagram types added in Mermaid 11 will not render.
diagrams, ER diagrams, pie charts, timelines and Gantt charts are all available. See
 
[https://mermaid.js.org/intro/ the Mermaid documentation] for the full syntax. Note that
[[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.]]
this wiki bundles '''Mermaid 10.9''', so diagram types added in Mermaid 11 will not
 
render.
== DOT ==


== DOT example ==
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.


[[DOT:Example diagram]] contains:
'''Example page:''' [[DOT:Example diagram]] — [{{fullurl:DOT:Example diagram|action=editdiagram}} open it in the editor]
 
Its source:


<pre>
<pre>
Line 93: Line 98:
</pre>
</pre>


giving:
Embed it in a page with:
 
<pre>
{{#display_diagram:DOT:Example diagram}}
</pre>
 
which renders as:


{{#display_diagram:DOT:Example diagram}}
{{#display_diagram:DOT:Example diagram}}


DOT is good when you want the layout worked out for you — you describe what connects to
[[File:FlexDiagrams DOT editor.png|thumb|none|700px|The DOT editor: Graphviz source in the text box, with the rendered graph above it.]]
what, and Graphviz arranges 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 diagram]] — [{{fullurl:Drawio:Example diagram|action=editdiagram}} open it in the editor]
 
Embed it in a page with:
 
<pre>
{{#display_diagram:Drawio:Example diagram}}
</pre>
 
which renders as:
 
{{#display_diagram: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.
 
[[File:FlexDiagrams Drawio editor.png|thumb|none|700px|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 <code><nowiki>[[Some page]]</nowiki></code> becomes a link to that wiki page, so a process diagram can double as navigation.
 
'''Example page:''' [[BPMN:Example diagram]] — [{{fullurl:BPMN:Example diagram|action=editdiagram}} open it in the editor]
 
Embed it in a page with:
 
<pre>
{{#display_diagram:BPMN:Example diagram}}
</pre>
 
which renders as:
 
{{#display_diagram: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.
 
[[File:FlexDiagrams BPMN editor.png|thumb|none|700px|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 diagram]] — [{{fullurl:Gantt:Example diagram|action=editdiagram}} open it in the editor]
 
Embed it in a page with:
 
<pre>
{{#display_diagram:Gantt:Example diagram}}
</pre>


== A note on Drawio ==
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 [[#Showing a diagram on another page|above]]). To see it rendered, open [[Gantt:Example diagram]] itself.


The '''Drawio:''' editor is the full diagrams.net drawing tool, loaded from the external
[[File:FlexDiagrams Gantt editor.png|thumb|none|700px|The Gantt editor: task grid on the left, timeline on the right, with zoom controls for hours through years.]]
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 does need that external site to be reachable from your
browser. The other four formats are served entirely from this wiki.


== Tips ==
== Tips ==


* Diagrams are ordinary pages: <code>History</code>, <code>Talk</code>, watchlisting and
* Diagrams are ordinary pages: <code>History</code>, <code>Talk</code>, watchlisting and the normal backups all apply.
  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.
* Because Mermaid and DOT are text, their page histories produce readable diffs — prefer
* Give diagrams descriptive names, the same as files — <code>Mermaid:Landis Gyr Focus teardown steps</code> beats <code>Mermaid:Diagram 3</code>.
  them over an uploaded image when the diagram is likely to change.
* 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.
* In a '''BPMN''' diagram, an element named <code><nowiki>[[Some page]]</nowiki></code>
  becomes a link to that wiki page.
* Give diagrams descriptive names, the same as files —
  <code>Mermaid:Landis Gyr Focus teardown steps</code> beats
  <code>Mermaid:Diagram 3</code>.


== See also ==
== See also ==


* [[Help:Uploading files]] — for photographs, scans and CAD files
* [[Help:Uploading files]] — for photographs, scans and CAD files
* [https://www.mediawiki.org/wiki/Extension:Flex_Diagrams Extension:Flex Diagrams] — the
* [https://www.mediawiki.org/wiki/Extension:Flex_Diagrams Extension:Flex Diagrams] — the extension providing this
  extension providing this

Latest revision as of 01:52, 9 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.

Screenshots of the editing interfaces are still to be uploaded. Each section below already points at the image it expects, so uploading a file under exactly the name shown will make it appear here automatically — no further editing of this page needed: FlexDiagrams Mermaid editor.png, FlexDiagrams DOT editor.png, FlexDiagrams Drawio editor.png, FlexDiagrams BPMN editor.png, FlexDiagrams Gantt editor.png. Delete this paragraph once they are all up.

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 the #display_diagram parser function instead, naming the diagram page including its namespace:

{{#display_diagram: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.

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.

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:

{{#display_diagram: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. Note that this wiki bundles Mermaid 10.9, so diagram types added in Mermaid 11 will not render.

File:FlexDiagrams Mermaid editor.png
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:

{{#display_diagram: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"; }
File:FlexDiagrams DOT editor.png
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:

{{#display_diagram: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.

File:FlexDiagrams Drawio editor.png
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:

{{#display_diagram: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.

File:FlexDiagrams BPMN editor.png
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:

{{#display_diagram: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.

File:FlexDiagrams Gantt editor.png
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