Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
import execjs
|
3 |
# Define the Mermaid code for the flowchart
|
4 |
mermaid_code = """
|
5 |
graph TD;
|
@@ -11,7 +11,7 @@ graph TD;
|
|
11 |
E[End] --> F[End]
|
12 |
"""
|
13 |
# Create an ExecJS context
|
14 |
-
|
15 |
var mermaid = require('mermaid');
|
16 |
mermaid.initialize({startOnLoad:true});
|
17 |
function renderMermaid(mermaidCode) {
|
@@ -28,5 +28,5 @@ def call_chart():
|
|
28 |
|
29 |
with gr.Blocks() as app:
|
30 |
gr.HTML("""<div id='diagram'></div>""")
|
31 |
-
app.load(call_chart,None,None)
|
32 |
app.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
#import execjs
|
3 |
# Define the Mermaid code for the flowchart
|
4 |
mermaid_code = """
|
5 |
graph TD;
|
|
|
11 |
E[End] --> F[End]
|
12 |
"""
|
13 |
# Create an ExecJS context
|
14 |
+
js_c=("""
|
15 |
var mermaid = require('mermaid');
|
16 |
mermaid.initialize({startOnLoad:true});
|
17 |
function renderMermaid(mermaidCode) {
|
|
|
28 |
|
29 |
with gr.Blocks() as app:
|
30 |
gr.HTML("""<div id='diagram'></div>""")
|
31 |
+
app.load(call_chart,None,None,js=js_c)
|
32 |
app.launch()
|