collab/mermaid/docs/ecosystem/tutorials.mdblame
View source
6dd74de1> **Warning**
6dd74de2>
6dd74de3> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
6dd74de4>
6dd74de5> ## Please edit the corresponding file in [/packages/mermaid/src/docs/ecosystem/tutorials.md](../../packages/mermaid/src/docs/ecosystem/tutorials.md).
6dd74de6
6dd74de7# Tutorials
6dd74de8
6dd74de9This is a list of publicly available Tutorials for using Mermaid.JS and is intended as a basic introduction for the use of the Live Editor for generating diagrams, and deploying Mermaid.JS through HTML.
6dd74de10
6dd74de11**Note that these tutorials might display an older interface, but the usage of the live-editor will largely be the same.**
6dd74de12
6dd74de13For most purposes, you can use the [Live Editor](https://mermaid.live), to quickly and easily render a diagram.
6dd74de14
6dd74de15## Live-Editor Tutorials
6dd74de16
6dd74de17The definitions that can be generated the Live-Editor are also backwards-compatible as of version 8.7.0.
6dd74de18
6dd74de19[Chris Chinchilla: Hands on - Text-based diagrams with Mermaid](https://www.youtube.com/watch?v=4_LdV1cs2sA)
6dd74de20
6dd74de21[GitLab Unfiltered: How to Create Mermaid Diagrams](https://www.youtube.com/watch?v=SQ9QmuTHuSI&t=438s)
6dd74de22
6dd74de23[GitLab Unfiltered: Emilie adds a mermaid diagram to the handbook](https://www.youtube.com/watch?v=5RQqht3NNSE)
6dd74de24
6dd74de25[World of Zero: I Learn How To Build Flowcharts and Signal Diagram's in Mermaid.JS](https://www.youtube.com/watch?v=7_2IroEs6Is&t=207s)
6dd74de26
6dd74de27[Eddie Jaoude: Can you code your diagrams?](https://www.youtube.com/watch?v=9HZzKkAqrX8)
6dd74de28
6dd74de29## Mermaid with OpenAI
6dd74de30
6dd74de31[Elle Neal: Mind Mapping with AI: An Accessible Approach for Neurodiverse Learners Tutorial:](https://medium.com/@elle.neal_71064/mind-mapping-with-ai-an-accessible-approach-for-neurodiverse-learners-1a74767359ff), [Demo:](https://databutton.com/v/jk9vrghc)
6dd74de32
6dd74de33## Mermaid with HTML
6dd74de34
6dd74de35Examples are provided in [Getting Started](../intro/getting-started.md)
6dd74de36
6dd74de37**CodePen Examples:**
6dd74de38
6dd74de39<https://codepen.io/CarlBoneri/pen/BQwZzq>
6dd74de40
6dd74de41<https://codepen.io/tdkn/pen/vZxQzd>
6dd74de42
6dd74de43<https://codepen.io/janzeteachesit/pen/OWWZKN>
6dd74de44
6dd74de45## Mermaid with Text Area
6dd74de46
6dd74de47<https://codepen.io/Ryuno-Ki/pen/LNxwgR>
6dd74de48
6dd74de49## Mermaid in open source docs
6dd74de50
6dd74de51[K8s.io Diagram Guide](https://kubernetes.io/docs/contribute/style/diagram-guide/)
6dd74de52
6dd74de53[K8s.dev blog: Improve your documentation with Mermaid.js diagrams](https://www.kubernetes.dev/blog/2021/12/01/improve-your-documentation-with-mermaid.js-diagrams/)
6dd74de54
6dd74de55## Jupyter / Python Integration with mermaid-js
6dd74de56
6dd74de57Here's an example of Python integration with mermaid-js which uses the mermaid.ink service, that displays the graph in a Jupyter notebook and save it as _.png_ image with the stated resolution (in this example, `dpi=1200`).
6dd74de58
6dd74de59```python
6dd74de60import base64
6dd74de61import io, requests
6dd74de62from IPython.display import Image, display
6dd74de63from PIL import Image as im
6dd74de64import matplotlib.pyplot as plt
6dd74de65
6dd74de66def mm(graph):
6dd74de67 graphbytes = graph.encode("utf8")
6dd74de68 base64_bytes = base64.urlsafe_b64encode(graphbytes)
6dd74de69 base64_string = base64_bytes.decode("ascii")
6dd74de70 img = im.open(io.BytesIO(requests.get('https://mermaid.ink/img/' + base64_string).content))
6dd74de71 plt.imshow(img)
6dd74de72 plt.axis('off') # allow to hide axis
6dd74de73 plt.savefig('image.png', dpi=1200)
6dd74de74
6dd74de75mm("""
6dd74de76graph LR;
6dd74de77 A--> B & C & D
6dd74de78 B--> A & E
6dd74de79 C--> A & E
6dd74de80 D--> A & E
6dd74de81 E--> B & C & D
6dd74de82""")
6dd74de83```
6dd74de84
6dd74de85**Output**
6dd74de86
6dd74de87![Example graph of the Python integration](img/python-mermaid-integration.png)
6dd74de88
6dd74de89<!--- cspell:ignore Elle Jaoude Neurodiverse graphbytes imshow savefig --->