File size: 1,386 Bytes
e841ba5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import gradio as gr
import modelscope_studio.components.antd as antd
import modelscope_studio.components.base as ms

with gr.Blocks() as demo:
    with ms.Application():
        with antd.ConfigProvider():
            antd.Slider(
                marks={
                    "0": '0°C',
                    "26": '26°C',
                    "37": '37°C',
                    "100": {
                        "style": {
                            "color": '#f50'
                        },
                        "label": "100°C",
                    },
                })
            with antd.Slider():
                with ms.Slot("marks"):
                    antd.Slider.Mark(
                        number=0,
                        label="0°C",
                    )
                    antd.Slider.Mark(
                        number=26,
                        label="26°C",
                    )
                    antd.Slider.Mark(
                        number=37,
                        label="37°C",
                    )
                    with antd.Slider.Mark(
                            number=100,
                            elem_style=dict(width=40),
                    ):
                        with ms.Slot("label"):
                            antd.Typography.Text("100°C", type="success")

if __name__ == "__main__":
    demo.queue().launch()