Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -404,14 +404,14 @@ css="""
|
|
| 404 |
"""
|
| 405 |
|
| 406 |
|
| 407 |
-
def mm(graph):
|
| 408 |
code_out=""
|
| 409 |
for ea in graph.split("\n"):
|
| 410 |
code=ea.strip().strip("\n")
|
| 411 |
code_out+=code
|
| 412 |
#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>'''
|
| 413 |
out_html=f'''<div id="wrap"><iframe id="frame" src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}" height="500" width="500"></iframe></div>'''
|
| 414 |
-
return gr.update(out_html,css=css.replace("$ZOOM",
|
| 415 |
|
| 416 |
def summarize(inp,history,data=None,files=None,directory=None,url=None,pdf_url=None,pdf_batch=None):
|
| 417 |
json_box=[]
|
|
@@ -505,7 +505,7 @@ def summarize(inp,history,data=None,files=None,directory=None,url=None,pdf_url=N
|
|
| 505 |
break
|
| 506 |
|
| 507 |
|
| 508 |
-
chart_html=mm(line_out)
|
| 509 |
#print(chart_out)
|
| 510 |
else:
|
| 511 |
rawp = "Provide a valid data source"
|
|
@@ -558,8 +558,8 @@ with gr.Blocks() as app:
|
|
| 558 |
json_out=gr.JSON()
|
| 559 |
#text=gr.JSON()
|
| 560 |
|
| 561 |
-
zoom_btn.change(zoom_update,zoom_btn,None)
|
| 562 |
-
upd_button.click(mm,e_box,m_box)
|
| 563 |
#inp_query.change(search_models,inp_query,models_dd)
|
| 564 |
clear_btn.click(clear_fn,None,[prompt,chatbot])
|
| 565 |
|
|
|
|
| 404 |
"""
|
| 405 |
|
| 406 |
|
| 407 |
+
def mm(graph,zoom):
|
| 408 |
code_out=""
|
| 409 |
for ea in graph.split("\n"):
|
| 410 |
code=ea.strip().strip("\n")
|
| 411 |
code_out+=code
|
| 412 |
#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>'''
|
| 413 |
out_html=f'''<div id="wrap"><iframe id="frame" src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}" height="500" width="500"></iframe></div>'''
|
| 414 |
+
return gr.update(out_html,css=css.replace("$ZOOM",str(zoom)))
|
| 415 |
|
| 416 |
def summarize(inp,history,data=None,files=None,directory=None,url=None,pdf_url=None,pdf_batch=None):
|
| 417 |
json_box=[]
|
|
|
|
| 505 |
break
|
| 506 |
|
| 507 |
|
| 508 |
+
chart_html=mm(line_out,1)
|
| 509 |
#print(chart_out)
|
| 510 |
else:
|
| 511 |
rawp = "Provide a valid data source"
|
|
|
|
| 558 |
json_out=gr.JSON()
|
| 559 |
#text=gr.JSON()
|
| 560 |
|
| 561 |
+
#zoom_btn.change(zoom_update,zoom_btn,None)
|
| 562 |
+
upd_button.click(mm,[e_box,zoom_btn],m_box)
|
| 563 |
#inp_query.change(search_models,inp_query,models_dd)
|
| 564 |
clear_btn.click(clear_fn,None,[prompt,chatbot])
|
| 565 |
|