Spaces:
Running
Running
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/aaecbe80da2e3aea6a78ea76e51089a2cbc77ecb/run.py
- Command line
-
hf download hf://spaces/gradio/plot_guide_datetime_main@aaecbe80da2e3aea6a78ea76e51089a2cbc77ecb/run.py
-
curl -L -o run.py https://huggingface.co/spaces/gradio/plot_guide_datetime_main/resolve/aaecbe80da2e3aea6a78ea76e51089a2cbc77ecb/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() |