add doc to use marmaid.js in GNU Octave

This commit is contained in:
CNOCTAVE
2025-10-13 13:56:04 +08:00
parent d80a638e55
commit dbcadc1d0b
2 changed files with 78 additions and 0 deletions

View File

@@ -87,3 +87,42 @@ graph LR;
![Example graph of the Python integration](img/python-mermaid-integration.png)
<!--- cspell:ignore Elle Jaoude Neurodiverse graphbytes imshow savefig --->
## 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)

View File

@@ -81,3 +81,42 @@ graph LR;
![Example graph of the Python integration](img/python-mermaid-integration.png)
<!--- cspell:ignore Elle Jaoude Neurodiverse graphbytes imshow savefig --->
## 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)