Update app.py
Browse files
app.py
CHANGED
|
@@ -15,8 +15,17 @@ def plt_line():
|
|
| 15 |
demo=gr.Blocks()
|
| 16 |
with demo:
|
| 17 |
gr.Markdown("# <center>图表渲染测试")
|
| 18 |
-
|
| 19 |
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
with gr.TabItem("echarts"):
|
| 21 |
htmls='''
|
| 22 |
<html>
|
|
@@ -30,12 +39,4 @@ myChart.setOption(option);
|
|
| 30 |
</html>
|
| 31 |
'''
|
| 32 |
gr.HTML(htmls)
|
| 33 |
-
with gr.TabItem("pd_bar"):
|
| 34 |
-
pd_button=gr.Button("pd_bar>>")
|
| 35 |
-
pd_output=gr.Plot(label="pd_chart1")
|
| 36 |
-
pd_button.click(pd_bar, inputs=[], outputs=pd_output)
|
| 37 |
-
with gr.TabItem("plt_line"):
|
| 38 |
-
plt_button=gr.Button("plt_line>>")
|
| 39 |
-
plt_output=gr.Plot(label="plt_chart")
|
| 40 |
-
plt_button.click(plt_line, inputs=[], outputs=plt_output)
|
| 41 |
demo.launch()
|
|
|
|
| 15 |
demo=gr.Blocks()
|
| 16 |
with demo:
|
| 17 |
gr.Markdown("# <center>图表渲染测试")
|
|
|
|
| 18 |
with gr.Tabs():
|
| 19 |
+
with gr.TabItem("pd_bar"):
|
| 20 |
+
pd_button=gr.Button("pd_bar>>")
|
| 21 |
+
pd_output=gr.Plot(label="pd_chart1")
|
| 22 |
+
pd_button.click(pd_bar, inputs=[], outputs=pd_output)
|
| 23 |
+
with gr.TabItem("plt_line"):
|
| 24 |
+
plt_button=gr.Button("plt_line>>")
|
| 25 |
+
plt_output=gr.Plot(label="plt_chart")
|
| 26 |
+
plt_button.click(plt_line, inputs=[], outputs=plt_output)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
with gr.TabItem("echarts"):
|
| 30 |
htmls='''
|
| 31 |
<html>
|
|
|
|
| 39 |
</html>
|
| 40 |
'''
|
| 41 |
gr.HTML(htmls)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
demo.launch()
|