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.
Press Tab to move between the nodes and edges of the diagram.
Press Enter or Space to select it, Shift with Enter to add it to the selection, the arrow keys to move the selected nodes, Delete to remove them and Escape to clear the selection. Press C to start a connection from it.
Press Enter or Space to select it, Delete to remove it and Escape to clear the selection. Press C to move its end to another node.
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 (aclick, astyle) 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.ExportandBlowGraphMLFormat.Exportwrite aBlowDocument(hereflow.ToDocument()); ids and labels are escaped so nothing in a label can break out of the text.BlowMermaidFormat.Import(text)andBlowGraphMLFormat.Import(xml)return aBlowImportResult, as JSON import does: the document, plus issues with their line or element. Input is bounded byBlowImportLimits; 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.