Skip to content

Diagram Formats & Diff

A graph written out as Mermaid, Graphviz DOT, GraphML or Blow's own JSON, and Mermaid or GraphML read back in and laid out. A baseline marks the graph as it was; BlowGraphDiff lists every change since, and reverts them by applying the diff turned round.

Baseline marked.
yesno
Idea
Review
Build
Shelve
Ship
bit Blow
  • line 6: 'click' is not imported: nothing in a diagram may run code or open links.

Try it

  • Pick a Format: the text beside the canvas is the graph written out, updated as you edit. Paste the Mermaid into a Markdown file on GitHub and it renders as a picture.
  • Drag a node, connect two, or delete one: the footer lists each change since the baseline - "Changed Review: Position". Revert to baseline undoes them all at once; Mark baseline starts again from here.
  • Edit the Mermaid in the lower box - add C --> E[Ship] - and press Import: it is laid out, since Mermaid has no positions. Anything not imported (a click, a style) is listed, never run.
  • Paste the GraphML export into the lower box and import it: the graph comes back with its positions.

How it works

  • BlowMermaidFormat.Export(document), BlowDotFormat.Export and BlowGraphMLFormat.Export write a BlowDocument (here flow.ToDocument()); ids and labels are escaped so nothing in a label can break out of the text.
  • BlowMermaidFormat.Import(text) and BlowGraphMLFormat.Import(xml) return a BlowImportResult, as JSON import does: the document, plus issues with their line or element. Input is bounded by BlowImportLimits; GraphML never loads a DTD or an external entity.
  • BlowGraphDiff.Compare(before, after) matches nodes and edges by id and names the properties that changed. diff.Invert().ApplyTo(nodes, edges) turns the graph back.
An unhandled error has occurred. Reload 🗙