Spaces:
Sleeping
Sleeping
Download run.py from gradio/plot_guide_datetime_main: direct link, hf CLI and curl.
- Browser
- Download file 404 Bytes
-
https://huggingface.co/spaces/gradio/plot_guide_datetime_main/resolve/41ee4dee4f930e06e21d2e5a9727a1e29ee3b3df/run.py
- Command line
-
hf download hf://spaces/gradio/plot_guide_datetime_main@41ee4dee4f930e06e21d2e5a9727a1e29ee3b3df/run.py
-
curl -L -o run.py https://huggingface.co/spaces/gradio/plot_guide_datetime_main/resolve/41ee4dee4f930e06e21d2e5a9727a1e29ee3b3df/run.py
404 Bytes
| import gradio as gr | |
| from data import df # type: ignore | |
| with gr.Blocks() as demo: | |
| with gr.Row(): | |
| start = gr.DateTime("now - 24h") | |
| end = gr.DateTime("now") | |
| apply_btn = gr.Button("Apply") | |
| plot = gr.LinePlot(df, x="time", y="price") | |
| apply_btn.click(lambda start, end: gr.BarPlot(x_lim=[start, end]), [start, end], plot) | |
| if __name__ == "__main__": | |
| demo.launch() |