From dbcadc1d0bc1c7ea8ff7b5bb96755ee1123b65f9 Mon Sep 17 00:00:00 2001 From: CNOCTAVE Date: Mon, 13 Oct 2025 13:56:04 +0800 Subject: [PATCH] add doc to use marmaid.js in GNU Octave --- docs/ecosystem/tutorials.md | 39 +++++++++++++++++++ .../mermaid/src/docs/ecosystem/tutorials.md | 39 +++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/docs/ecosystem/tutorials.md b/docs/ecosystem/tutorials.md index 8a6a9e8e2..207ea79f6 100644 --- a/docs/ecosystem/tutorials.md +++ b/docs/ecosystem/tutorials.md @@ -87,3 +87,42 @@ graph LR; ![Example graph of the Python integration](img/python-mermaid-integration.png) + +## GNU Octave Integration with mermaid-js + +Here's an example of GNU Octave integration with mermaid-js which uses the +octave_mermaid_js package to save graph image. + +```python +pkg load octave_mermaid_js +graph = { + "graph LR;" + " A--> B & C & D" + " B--> A & E" + " C--> A & E" + " D--> A & E" + " E--> B & C & D" +} +graph = strjoin(graph, "\n") +[ret, status] = mermaid_js_save(graph, "result.png") +``` + +Here's an example of GNU Octave integration with mermaid-js which uses the +octave_mermaid_js package to show graph image. + +```python +pkg load octave_mermaid_js +graph = { + "graph LR;" + " A--> B & C & D" + " B--> A & E" + " C--> A & E" + " D--> A & E" + " E--> B & C & D" +} +graph = strjoin(graph, "\n") +[ret, status] = mermaid_js_imshow(graph) +``` + +Here's a journal article about octave_mermaid_js. +[octave_mermaid_js: Integrating Mermaid.js Diagram Generation into GNU Octave](https://engrxiv.org/preprint/view/5547) diff --git a/packages/mermaid/src/docs/ecosystem/tutorials.md b/packages/mermaid/src/docs/ecosystem/tutorials.md index 9f0f351a2..d4b92fff5 100644 --- a/packages/mermaid/src/docs/ecosystem/tutorials.md +++ b/packages/mermaid/src/docs/ecosystem/tutorials.md @@ -81,3 +81,42 @@ graph LR; ![Example graph of the Python integration](img/python-mermaid-integration.png) + +## GNU Octave Integration with mermaid-js + +Here's an example of GNU Octave integration with mermaid-js which uses the +octave_mermaid_js package to save graph image. + +```python +pkg load octave_mermaid_js +graph = { + "graph LR;" + " A--> B & C & D" + " B--> A & E" + " C--> A & E" + " D--> A & E" + " E--> B & C & D" +} +graph = strjoin(graph, "\n") +[ret, status] = mermaid_js_save(graph, "result.png") +``` + +Here's an example of GNU Octave integration with mermaid-js which uses the +octave_mermaid_js package to show graph image. + +```python +pkg load octave_mermaid_js +graph = { + "graph LR;" + " A--> B & C & D" + " B--> A & E" + " C--> A & E" + " D--> A & E" + " E--> B & C & D" +} +graph = strjoin(graph, "\n") +[ret, status] = mermaid_js_imshow(graph) +``` + +Here's a journal article about octave_mermaid_js. +[octave_mermaid_js: Integrating Mermaid.js Diagram Generation into GNU Octave](https://engrxiv.org/preprint/view/5547)