Spaces:
Sleeping
Sleeping
fruitpicker01
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,42 +1,9 @@
|
|
1 |
-
import plotly.graph_objects as go
|
2 |
import gradio as gr
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
mode="gauge+number",
|
7 |
-
value=76,
|
8 |
-
gauge={
|
9 |
-
'axis': {'range': [0, 100]},
|
10 |
-
'bar': {'color': "black"}, # Цвет стрелки
|
11 |
-
'steps': [
|
12 |
-
{'range': [0, 40], 'color': "#55efc4"}, # Мягкий зеленый
|
13 |
-
{'range': [40, 70], 'color': "#ffeaa7"}, # Желтый
|
14 |
-
{'range': [70, 100], 'color': "#ff7675"} # Мягкий красный
|
15 |
-
],
|
16 |
-
'threshold': {
|
17 |
-
'line': {'color': "black", 'width': 4},
|
18 |
-
'thickness': 0.75,
|
19 |
-
'value': 76
|
20 |
-
}
|
21 |
-
},
|
22 |
-
number={'font': {'size': 48}} # Размер шрифта числа
|
23 |
-
))
|
24 |
-
fig.update_layout(paper_bgcolor="#f8f9fa", # Цвет фона
|
25 |
-
font={'color': "#2d3436", 'family': "Arial"}) # Цвет текста
|
26 |
-
return fig
|
27 |
|
28 |
-
|
29 |
-
return create_gauge()
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
with gr.Row():
|
35 |
-
plot = gr.Plot(label="Success Rate Gauge")
|
36 |
-
|
37 |
-
with gr.Row():
|
38 |
-
update_button = gr.Button("Показать спидометр")
|
39 |
-
|
40 |
-
update_button.click(fn=update_plot, inputs=[], outputs=plot)
|
41 |
-
|
42 |
-
demo.launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
hello_world = gr.Interface(lambda name: "Hello " + name, "text", "text")
|
4 |
+
bye_world = gr.Interface(lambda name: "Bye " + name, "text", "text")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
demo = gr.TabbedInterface([hello_world, bye_world], ["Hello World", "Bye World"])
|
|
|
7 |
|
8 |
+
if __name__ == "__main__":
|
9 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|