Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import pandas_bokeh
|
| 4 |
import matplotlib.pyplot as plt,mpld3
|
|
@@ -48,7 +49,8 @@ def pyecharts1():
|
|
| 48 |
bar.add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
|
| 49 |
bar.add_yaxis("商家A", [5, 20, 36, 10, 75, 90])
|
| 50 |
bar.render('test.html')
|
| 51 |
-
|
|
|
|
| 52 |
def cff():
|
| 53 |
|
| 54 |
df=pd.DataFrame([[0.2,0.4,0.6],[0.4,0.3,0.4],[0.4,0.5,0.2],[0.5,0.4,0.4]],columns=['a','b','c'])
|
|
@@ -98,7 +100,7 @@ with demo:
|
|
| 98 |
bokeh_button.click(pd_bokeh, inputs=[], outputs=bokeh_output,api_name='pd_bokeh')
|
| 99 |
with gr.TabItem("pyecharts"):
|
| 100 |
ehc_button=gr.Button("pyecharts>>")
|
| 101 |
-
ehc_output=gr.File(label="pyecharts_chart")
|
| 102 |
ehc_button.click(pyecharts1, inputs=[], outputs=ehc_output,api_name='pyecharts')
|
| 103 |
with gr.TabItem("cufflinks"):
|
| 104 |
cff_button=gr.Button("cufflinks>>")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import requests
|
| 3 |
import pandas as pd
|
| 4 |
import pandas_bokeh
|
| 5 |
import matplotlib.pyplot as plt,mpld3
|
|
|
|
| 49 |
bar.add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
|
| 50 |
bar.add_yaxis("商家A", [5, 20, 36, 10, 75, 90])
|
| 51 |
bar.render('test.html')
|
| 52 |
+
aa=requests('test.html')
|
| 53 |
+
return 'test.html',aa.text
|
| 54 |
def cff():
|
| 55 |
|
| 56 |
df=pd.DataFrame([[0.2,0.4,0.6],[0.4,0.3,0.4],[0.4,0.5,0.2],[0.5,0.4,0.4]],columns=['a','b','c'])
|
|
|
|
| 100 |
bokeh_button.click(pd_bokeh, inputs=[], outputs=bokeh_output,api_name='pd_bokeh')
|
| 101 |
with gr.TabItem("pyecharts"):
|
| 102 |
ehc_button=gr.Button("pyecharts>>")
|
| 103 |
+
ehc_output=[gr.File(label="pyecharts_chart"),gr.Textbox(label="pyecharts_chart2",lines=18)]
|
| 104 |
ehc_button.click(pyecharts1, inputs=[], outputs=ehc_output,api_name='pyecharts')
|
| 105 |
with gr.TabItem("cufflinks"):
|
| 106 |
cff_button=gr.Button("cufflinks>>")
|