-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
2,669 additions
and
1,973 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Slider | ||
|
||
A Slider component for displaying current value and intervals in range. See [Ant Design](https://ant.design/components/slider/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="marks" title="With Marks"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Slider | ||
|
||
A Slider component for displaying current value and intervals in range. See [Ant Design](https://ant.design/components/slider/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="marks" title="With Marks"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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(value=50) | ||
antd.Slider(range=True, value=[20, 50]) | ||
antd.Divider("Vertical") | ||
antd.Slider(range=True, | ||
value=[20, 50], | ||
step=5, | ||
vertical=True, | ||
elem_style=dict(height=200)) | ||
antd.Divider("Customize tooltip") | ||
antd.Slider(tooltip=dict(formatter="(value) => `${value}%`")) | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Switch | ||
|
||
Used to toggle between two states. See [Ant Design](https://ant.design/components/switch/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Switch | ||
|
||
Used to toggle between two states. See [Ant Design](https://ant.design/components/switch/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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(): | ||
with antd.Space(): | ||
antd.Switch(value=True) | ||
antd.Switch(checked_children="Open", | ||
un_checked_children="Close") | ||
with antd.Switch(value=True): | ||
with ms.Slot("checkedChildren"): | ||
antd.Icon("CheckOutlined") | ||
with ms.Slot("unCheckedChildren"): | ||
antd.Icon("CloseOutlined") | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# TimePicker | ||
|
||
To select/input a time. See [Ant Design](https://ant.design/components/time-picker/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="ranger_picker" title="Range Picker"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# TimePicker | ||
|
||
To select/input a time. See [Ant Design](https://ant.design/components/time-picker/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="ranger_picker" title="Range Picker"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import time | ||
|
||
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(): | ||
with antd.Space(direction='vertical'): | ||
antd.TimePicker() | ||
antd.TimePicker(format="HH:mm") | ||
antd.TimePicker(minute_step=15, | ||
second_step=10, | ||
hour_step=1, | ||
need_confirm=True) | ||
antd.Divider("12 hours") | ||
with antd.Space(direction='vertical'): | ||
antd.TimePicker(use_12_hours=True) | ||
antd.TimePicker(use_12_hours=True, format="h:mm:ss A") | ||
antd.TimePicker(use_12_hours=True, format="h:mm a") | ||
antd.Divider("Prefix and Suffix") | ||
with antd.Space(direction='vertical'): | ||
with antd.TimePicker(): | ||
with ms.Slot("suffixIcon"): | ||
antd.Icon("SmileOutlined") | ||
with antd.TimePicker(): | ||
with ms.Slot("prefix"): | ||
antd.Icon("SmileOutlined") | ||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import time | ||
|
||
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.TimePicker.RangePicker( | ||
value=lambda: [time.time(), time.time()], format="HH:mm:ss") | ||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Transfer | ||
|
||
Double column transfer choice box. See [Ant Design](https://ant.design/components/transfer/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
Oops, something went wrong.