Omnibus commited on
Commit
ae8f10f
·
verified ·
1 Parent(s): 058c62a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  import base64
 
3
  #import execjs
4
  # Define the Mermaid code for the flowchart
5
 
@@ -17,10 +18,11 @@ mermaid_code = """graph TD;
17
  #def call_chart(mermaidCode):
18
  def mm(graph):
19
  code_out=""
20
- for ea in mermaid_code.split("\n"):
21
  code=ea.strip().strip("\n")
22
  code_out+=code
23
- out_html=f'''<div><iframe src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}" height="500" width="500"></iframe></div>'''
 
24
  return out_html
25
 
26
  """
@@ -35,10 +37,10 @@ graph LR;
35
 
36
  css="""
37
  .flowchart-link{
38
- stroke:red;
39
  }
40
  .marker {
41
- fill: #ed0000;
42
  stroke: #ff0101;
43
  }
44
  """
 
1
  import gradio as gr
2
  import base64
3
+ import random
4
  #import execjs
5
  # Define the Mermaid code for the flowchart
6
 
 
18
  #def call_chart(mermaidCode):
19
  def mm(graph):
20
  code_out=""
21
+ for ea in graph.split("\n"):
22
  code=ea.strip().strip("\n")
23
  code_out+=code
24
+ #out_html=f'''<div><iframe src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}&rand={random.randint(1,1111111111)}" height="500" width="500"></iframe></div>'''
25
+ out_html=f'''<div><iframe src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}}" height="500" width="500"></iframe></div>'''
26
  return out_html
27
 
28
  """
 
37
 
38
  css="""
39
  .flowchart-link{
40
+ stroke:red!important;
41
  }
42
  .marker {
43
+ fill: #ed0000!important;
44
  stroke: #ff0101;
45
  }
46
  """