Created
February 22, 2024 01:17
-
-
Save Layeska/0781ca855bf1cc5a390f138613006277 to your computer and use it in GitHub Desktop.
Código de integración de html & JS con Mermaid.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Ejemplo MermaidJS</title> | |
</head> | |
<body> | |
<h1>Integración Mermaid</h1> | |
<div class="mermaid"> | |
--- | |
title: Ejemplo Diagrama de Estado | |
--- | |
stateDiagram-v2 | |
[*] --> Ir_a_la_tienda | |
Salir --> [*] | |
Ir_a_la_tienda --> Buscar_producto | |
Buscar_producto --> Producto_encontrado | |
Buscar_producto --> Producto_no_encontrado | |
Producto_encontrado --> Pasar_a_caja | |
Producto_no_encontrado --> Salir | |
Pasar_a_caja --> Salir | |
[*] --> Ir_al_mercado | |
Ir_al_mercado --> comprar | |
comprar --> Comida: if dinero > 0 | |
comprar --> Nada : if dinero <= 0 | |
Comida --> Buscar_producto | |
Nada --> Salir | |
</div> | |
</body> | |
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.8.0/dist/mermaid.min.js"></script> | |
<script>mermaid.initialize({startOnLoad:true});</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment