From dc200af89c24ec1e1d506e79f7d79bca4640df19 Mon Sep 17 00:00:00 2001 From: Ali Abdalla Date: Wed, 21 Dec 2022 19:01:42 +0400 Subject: [PATCH] Remove footers and min-height the correct way (#2860) * fixes to readme * add css to demos and remove footer js from html * update changelog * fix weird notebook * fix weird notebook * fix weird notebook * fix weird notebook... * actually fixed the problem --- CHANGELOG.md | 1 + demo/audio_component/run.ipynb | 2 +- demo/audio_component/run.py | 4 +++- demo/button_component/run.ipynb | 2 +- demo/button_component/run.py | 4 +++- demo/chatbot_component/run.ipynb | 2 +- demo/chatbot_component/run.py | 4 +++- demo/checkbox_component/run.ipynb | 2 +- demo/checkbox_component/run.py | 4 +++- demo/checkboxgroup_component/run.ipynb | 2 +- demo/checkboxgroup_component/run.py | 4 +++- demo/colorpicker_component/run.ipynb | 2 +- demo/colorpicker_component/run.py | 4 +++- demo/dataframe_component/run.ipynb | 2 +- demo/dataframe_component/run.py | 4 +++- demo/dropdown_component/run.ipynb | 2 +- demo/dropdown_component/run.py | 4 +++- demo/file_component/run.ipynb | 2 +- demo/file_component/run.py | 4 +++- demo/gallery_component/run.ipynb | 2 +- demo/gallery_component/run.py | 4 +++- demo/highlightedtext_component/run.ipynb | 2 +- demo/highlightedtext_component/run.py | 4 +++- demo/html_component/run.ipynb | 2 +- demo/html_component/run.py | 4 +++- demo/image_component/run.ipynb | 2 +- demo/image_component/run.py | 4 +++- demo/json_component/run.ipynb | 2 +- demo/json_component/run.py | 4 +++- demo/label_component/run.ipynb | 2 +- demo/label_component/run.py | 4 +++- demo/markdown_component/run.ipynb | 2 +- demo/markdown_component/run.py | 4 +++- demo/model3d_component/run.ipynb | 2 +- demo/model3d_component/run.py | 4 +++- demo/number_component/run.ipynb | 2 +- demo/number_component/run.py | 4 +++- demo/plot_component/run.ipynb | 2 +- demo/plot_component/run.py | 4 +++- demo/radio_component/run.ipynb | 2 +- demo/radio_component/run.py | 4 +++- demo/scatterplot_component/run.ipynb | 2 +- demo/scatterplot_component/run.py | 4 +++- demo/slider_component/run.ipynb | 2 +- demo/slider_component/run.py | 4 +++- demo/state_component/run.ipynb | 2 +- demo/state_component/run.py | 4 +++- demo/textbox_component/run.ipynb | 2 +- demo/textbox_component/run.py | 4 +++- demo/timeseries_component/run.ipynb | 2 +- demo/timeseries_component/run.py | 4 +++- demo/video_component/run.ipynb | 2 +- demo/video_component/run.py | 4 +++- website/homepage/src/docs/template.html | 18 ------------------ 54 files changed, 105 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf55e48c7a..8182e5c94b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ No changes to highlight. ## Full Changelog: * Fixed importing gradio can cause PIL.Image.registered_extensions() to break by `[@aliencaocao](https://github.com/aliencaocao)` in `[PR 2846](https://github.com/gradio-app/gradio/pull/2846)` * Added the ability to set `x_lim`, `y_lim` and legend positions for `gr.ScatterPlot` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2807](https://github.com/gradio-app/gradio/pull/2807) +* Remove footers and min-height the correct way by [@aliabd](https://github.com/aliabd) in [PR 2860](https://github.com/gradio-app/gradio/pull/2860) ## Contributors Shoutout: No changes to highlight. diff --git a/demo/audio_component/run.ipynb b/demo/audio_component/run.ipynb index 521bae8a18..c2709434e0 100644 --- a/demo/audio_component/run.ipynb +++ b/demo/audio_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: audio_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "with gr.Blocks() as demo:\n", " gr.Audio()\n", "\n", "demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: audio_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Audio()\n", "\n", "demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/audio_component/run.py b/demo/audio_component/run.py index 17508a7af0..e6ea63ad9c 100644 --- a/demo/audio_component/run.py +++ b/demo/audio_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Audio() demo.launch() diff --git a/demo/button_component/run.ipynb b/demo/button_component/run.ipynb index 00e4c891c2..327c074a21 100644 --- a/demo/button_component/run.ipynb +++ b/demo/button_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: button_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "with gr.Blocks() as demo:\n", " gr.Button()\n", " \n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: button_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Button()\n", " \n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/button_component/run.py b/demo/button_component/run.py index 660d3ecc27..e27778fedf 100644 --- a/demo/button_component/run.py +++ b/demo/button_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Button() demo.launch() \ No newline at end of file diff --git a/demo/chatbot_component/run.ipynb b/demo/chatbot_component/run.ipynb index 82f59d809f..caa3b8470d 100644 --- a/demo/chatbot_component/run.ipynb +++ b/demo/chatbot_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: chatbot_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "with gr.Blocks() as demo:\n", " gr.Chatbot(value=[[\"Hello World\",\"Hey Gradio!\"],[\"\u2764\ufe0f\",\"\ud83d\ude0d\"],[\"\ud83d\udd25\",\"\ud83e\udd17\"]])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: chatbot_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Chatbot(value=[[\"Hello World\",\"Hey Gradio!\"],[\"\u2764\ufe0f\",\"\ud83d\ude0d\"],[\"\ud83d\udd25\",\"\ud83e\udd17\"]])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/chatbot_component/run.py b/demo/chatbot_component/run.py index c1b5d098fc..847cf7914f 100644 --- a/demo/chatbot_component/run.py +++ b/demo/chatbot_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Chatbot(value=[["Hello World","Hey Gradio!"],["❤️","😍"],["🔥","🤗"]]) demo.launch() \ No newline at end of file diff --git a/demo/checkbox_component/run.ipynb b/demo/checkbox_component/run.ipynb index 02a1469c26..2d2065c410 100644 --- a/demo/checkbox_component/run.ipynb +++ b/demo/checkbox_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: checkbox_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Checkbox()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: checkbox_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Checkbox()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/checkbox_component/run.py b/demo/checkbox_component/run.py index 3c588a0fac..74a4de96d1 100644 --- a/demo/checkbox_component/run.py +++ b/demo/checkbox_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Checkbox() demo.launch() \ No newline at end of file diff --git a/demo/checkboxgroup_component/run.ipynb b/demo/checkboxgroup_component/run.ipynb index 91e85fc2dc..256e93007f 100644 --- a/demo/checkboxgroup_component/run.ipynb +++ b/demo/checkboxgroup_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: checkboxgroup_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.CheckboxGroup(choices=[\"First Choice\", \"Second Choice\", \"Third Choice\"])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: checkboxgroup_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.CheckboxGroup(choices=[\"First Choice\", \"Second Choice\", \"Third Choice\"])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/checkboxgroup_component/run.py b/demo/checkboxgroup_component/run.py index 90530fd1f8..2cc1f8e63a 100644 --- a/demo/checkboxgroup_component/run.py +++ b/demo/checkboxgroup_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.CheckboxGroup(choices=["First Choice", "Second Choice", "Third Choice"]) demo.launch() \ No newline at end of file diff --git a/demo/colorpicker_component/run.ipynb b/demo/colorpicker_component/run.ipynb index 349861e937..3b2eb57d48 100644 --- a/demo/colorpicker_component/run.ipynb +++ b/demo/colorpicker_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: colorpicker_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.ColorPicker()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: colorpicker_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.ColorPicker()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/colorpicker_component/run.py b/demo/colorpicker_component/run.py index 98d5e9fb98..755083ddf4 100644 --- a/demo/colorpicker_component/run.py +++ b/demo/colorpicker_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.ColorPicker() demo.launch() \ No newline at end of file diff --git a/demo/dataframe_component/run.ipynb b/demo/dataframe_component/run.ipynb index f0a4d750f3..0bc8408168 100644 --- a/demo/dataframe_component/run.ipynb +++ b/demo/dataframe_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: dataframe_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Dataframe(interactive=True)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: dataframe_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Dataframe(interactive=True)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/dataframe_component/run.py b/demo/dataframe_component/run.py index 6e66fb510b..799baf800c 100644 --- a/demo/dataframe_component/run.py +++ b/demo/dataframe_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Dataframe(interactive=True) demo.launch() \ No newline at end of file diff --git a/demo/dropdown_component/run.ipynb b/demo/dropdown_component/run.ipynb index ba98c10620..9f988e7b5d 100644 --- a/demo/dropdown_component/run.ipynb +++ b/demo/dropdown_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: dropdown_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Dropdown(choices=[\"First Choice\", \"Second Choice\", \"Third Choice\"])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: dropdown_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Dropdown(choices=[\"First Choice\", \"Second Choice\", \"Third Choice\"])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/dropdown_component/run.py b/demo/dropdown_component/run.py index 8c6b929619..0ccf658898 100644 --- a/demo/dropdown_component/run.py +++ b/demo/dropdown_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Dropdown(choices=["First Choice", "Second Choice", "Third Choice"]) demo.launch() \ No newline at end of file diff --git a/demo/file_component/run.ipynb b/demo/file_component/run.ipynb index 02b6ef749b..50c53e7482 100644 --- a/demo/file_component/run.ipynb +++ b/demo/file_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: file_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.File()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: file_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.File()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/file_component/run.py b/demo/file_component/run.py index 518899d2e0..a16aef44ae 100644 --- a/demo/file_component/run.py +++ b/demo/file_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.File() demo.launch() \ No newline at end of file diff --git a/demo/gallery_component/run.ipynb b/demo/gallery_component/run.ipynb index d7bd8244ac..ca21881742 100644 --- a/demo/gallery_component/run.ipynb +++ b/demo/gallery_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: gallery_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " cheetahs = [\n", " \"https://upload.wikimedia.org/wikipedia/commons/0/09/TheCheethcat.jpg\",\n", " \"https://nationalzoo.si.edu/sites/default/files/animals/cheetah-003.jpg\",\n", " \"https://img.etimg.com/thumb/msid-50159822,width-650,imgsize-129520,,resizemode-4,quality-100/.jpg\",\n", " \"https://nationalzoo.si.edu/sites/default/files/animals/cheetah-002.jpg\",\n", " \"https://images.theconversation.com/files/375893/original/file-20201218-13-a8h8uq.jpg?ixlib=rb-1.1.0&rect=16%2C407%2C5515%2C2924&q=45&auto=format&w=496&fit=clip\",\n", " \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQeSdQE5kHykTdB970YGSW3AsF6MHHZzY4QiQ&usqp=CAU\",\n", " \"https://www.lifegate.com/app/uploads/ghepardo-primo-piano.jpg\",\n", " \"https://i.natgeofe.com/n/60004bcc-cd85-4401-8bfa-6f96551557db/cheetah-extinction-3_3x4.jpg\",\n", " \"https://qph.cf2.quoracdn.net/main-qimg-0bbf31c18a22178cb7a8dd53640a3d05-lq\"\n", " ]\n", " gr.Gallery(value=cheetahs)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: gallery_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " cheetahs = [\n", " \"https://upload.wikimedia.org/wikipedia/commons/0/09/TheCheethcat.jpg\",\n", " \"https://nationalzoo.si.edu/sites/default/files/animals/cheetah-003.jpg\",\n", " \"https://img.etimg.com/thumb/msid-50159822,width-650,imgsize-129520,,resizemode-4,quality-100/.jpg\",\n", " \"https://nationalzoo.si.edu/sites/default/files/animals/cheetah-002.jpg\",\n", " \"https://images.theconversation.com/files/375893/original/file-20201218-13-a8h8uq.jpg?ixlib=rb-1.1.0&rect=16%2C407%2C5515%2C2924&q=45&auto=format&w=496&fit=clip\",\n", " \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQeSdQE5kHykTdB970YGSW3AsF6MHHZzY4QiQ&usqp=CAU\",\n", " \"https://www.lifegate.com/app/uploads/ghepardo-primo-piano.jpg\",\n", " \"https://i.natgeofe.com/n/60004bcc-cd85-4401-8bfa-6f96551557db/cheetah-extinction-3_3x4.jpg\",\n", " \"https://qph.cf2.quoracdn.net/main-qimg-0bbf31c18a22178cb7a8dd53640a3d05-lq\"\n", " ]\n", " gr.Gallery(value=cheetahs)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/gallery_component/run.py b/demo/gallery_component/run.py index 205e9aae18..188c947258 100644 --- a/demo/gallery_component/run.py +++ b/demo/gallery_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: cheetahs = [ "https://upload.wikimedia.org/wikipedia/commons/0/09/TheCheethcat.jpg", "https://nationalzoo.si.edu/sites/default/files/animals/cheetah-003.jpg", diff --git a/demo/highlightedtext_component/run.ipynb b/demo/highlightedtext_component/run.ipynb index 0fdce05824..fb87ecbce0 100644 --- a/demo/highlightedtext_component/run.ipynb +++ b/demo/highlightedtext_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: highlightedtext_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.HighlightedText(value=[(\"Text\",\"Label 1\"),(\"to be\",\"Label 2\"),(\"highlighted\",\"Label 3\")])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: highlightedtext_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.HighlightedText(value=[(\"Text\",\"Label 1\"),(\"to be\",\"Label 2\"),(\"highlighted\",\"Label 3\")])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/highlightedtext_component/run.py b/demo/highlightedtext_component/run.py index 4bd90ef5f6..4abde8d506 100644 --- a/demo/highlightedtext_component/run.py +++ b/demo/highlightedtext_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.HighlightedText(value=[("Text","Label 1"),("to be","Label 2"),("highlighted","Label 3")]) demo.launch() \ No newline at end of file diff --git a/demo/html_component/run.ipynb b/demo/html_component/run.ipynb index 72b8759d00..26493e505c 100644 --- a/demo/html_component/run.ipynb +++ b/demo/html_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: html_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.HTML(value=\"

Gradio Docs Readers: visitor badge

\")\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: html_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.HTML(value=\"

Gradio Docs Readers: visitor badge

\")\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/html_component/run.py b/demo/html_component/run.py index 3b60e476cf..e667dd3249 100644 --- a/demo/html_component/run.py +++ b/demo/html_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.HTML(value="

Gradio Docs Readers: visitor badge

") demo.launch() \ No newline at end of file diff --git a/demo/image_component/run.ipynb b/demo/image_component/run.ipynb index f27b99ee10..8bda07d8a9 100644 --- a/demo/image_component/run.ipynb +++ b/demo/image_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: image_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Image()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: image_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Image()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/image_component/run.py b/demo/image_component/run.py index e18292d68e..9e60d184f2 100644 --- a/demo/image_component/run.py +++ b/demo/image_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Image() demo.launch() \ No newline at end of file diff --git a/demo/json_component/run.ipynb b/demo/json_component/run.ipynb index d465c76d31..9af2026efe 100644 --- a/demo/json_component/run.ipynb +++ b/demo/json_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: json_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.JSON(value={\"Key 1\": \"Value 1\", \"Key 2\": {\"Key 3\": \"Value 2\", \"Key 4\": \"Value 3\"}, \"Key 5\": [\"Item 1\", \"Item 2\", \"Item 3\"]})\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: json_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.JSON(value={\"Key 1\": \"Value 1\", \"Key 2\": {\"Key 3\": \"Value 2\", \"Key 4\": \"Value 3\"}, \"Key 5\": [\"Item 1\", \"Item 2\", \"Item 3\"]})\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/json_component/run.py b/demo/json_component/run.py index d3fcd5ea9b..9f2ef92750 100644 --- a/demo/json_component/run.py +++ b/demo/json_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.JSON(value={"Key 1": "Value 1", "Key 2": {"Key 3": "Value 2", "Key 4": "Value 3"}, "Key 5": ["Item 1", "Item 2", "Item 3"]}) demo.launch() \ No newline at end of file diff --git a/demo/label_component/run.ipynb b/demo/label_component/run.ipynb index 0cd6779e9a..bd9395a77f 100644 --- a/demo/label_component/run.ipynb +++ b/demo/label_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: label_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Label(value={\"First Label\": 0.7, \"Second Label\": 0.2, \"Third Label\": 0.1})\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: label_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Label(value={\"First Label\": 0.7, \"Second Label\": 0.2, \"Third Label\": 0.1})\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/label_component/run.py b/demo/label_component/run.py index b8e9f887c4..f9c57285e4 100644 --- a/demo/label_component/run.py +++ b/demo/label_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Label(value={"First Label": 0.7, "Second Label": 0.2, "Third Label": 0.1}) demo.launch() \ No newline at end of file diff --git a/demo/markdown_component/run.ipynb b/demo/markdown_component/run.ipynb index 63e5a75cf3..44a4f15758 100644 --- a/demo/markdown_component/run.ipynb +++ b/demo/markdown_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: markdown_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Markdown(value=\"This _example_ was **written** in [Markdown](https://en.wikipedia.org/wiki/Markdown)\\n\")\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: markdown_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Markdown(value=\"This _example_ was **written** in [Markdown](https://en.wikipedia.org/wiki/Markdown)\\n\")\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/markdown_component/run.py b/demo/markdown_component/run.py index 89e963a2ab..6dcb545b28 100644 --- a/demo/markdown_component/run.py +++ b/demo/markdown_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Markdown(value="This _example_ was **written** in [Markdown](https://en.wikipedia.org/wiki/Markdown)\n") demo.launch() \ No newline at end of file diff --git a/demo/model3d_component/run.ipynb b/demo/model3d_component/run.ipynb index 02e07d34f8..55c4e8b024 100644 --- a/demo/model3d_component/run.ipynb +++ b/demo/model3d_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: model3d_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Model3D()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: model3d_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Model3D()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/model3d_component/run.py b/demo/model3d_component/run.py index fc773fe511..c1d14b0c51 100644 --- a/demo/model3d_component/run.py +++ b/demo/model3d_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Model3D() demo.launch() \ No newline at end of file diff --git a/demo/number_component/run.ipynb b/demo/number_component/run.ipynb index a894d597d5..6485dbeb9f 100644 --- a/demo/number_component/run.ipynb +++ b/demo/number_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: number_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Number()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: number_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Number()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/number_component/run.py b/demo/number_component/run.py index 007339534f..d84367d8f3 100644 --- a/demo/number_component/run.py +++ b/demo/number_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Number() demo.launch() \ No newline at end of file diff --git a/demo/plot_component/run.ipynb b/demo/plot_component/run.ipynb index ef726a88f4..634b32bb69 100644 --- a/demo/plot_component/run.ipynb +++ b/demo/plot_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: plot_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio matplotlib numpy"]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "Fs = 8000\n", "f = 5\n", "sample = 8000\n", "x = np.arange(sample)\n", "y = np.sin(2 * np.pi * f * x / Fs)\n", "plt.plot(x, y)\n", "\n", "with gr.Blocks() as demo:\n", " gr.Plot(value=plt)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: plot_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio matplotlib numpy"]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "Fs = 8000\n", "f = 5\n", "sample = 8000\n", "x = np.arange(sample)\n", "y = np.sin(2 * np.pi * f * x / Fs)\n", "plt.plot(x, y)\n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Plot(value=plt)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/plot_component/run.py b/demo/plot_component/run.py index ae7ffd3ddd..10c6a0d1d9 100644 --- a/demo/plot_component/run.py +++ b/demo/plot_component/run.py @@ -9,7 +9,9 @@ x = np.arange(sample) y = np.sin(2 * np.pi * f * x / Fs) plt.plot(x, y) -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Plot(value=plt) demo.launch() \ No newline at end of file diff --git a/demo/radio_component/run.ipynb b/demo/radio_component/run.ipynb index 7306ddebeb..cbf06ec4f1 100644 --- a/demo/radio_component/run.ipynb +++ b/demo/radio_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: radio_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Radio(choices=[\"First Choice\", \"Second Choice\", \"Third Choice\"])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: radio_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Radio(choices=[\"First Choice\", \"Second Choice\", \"Third Choice\"])\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/radio_component/run.py b/demo/radio_component/run.py index 97396da00b..6278d6c3ae 100644 --- a/demo/radio_component/run.py +++ b/demo/radio_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Radio(choices=["First Choice", "Second Choice", "Third Choice"]) demo.launch() \ No newline at end of file diff --git a/demo/scatterplot_component/run.ipynb b/demo/scatterplot_component/run.ipynb index 75d7a60528..d9f9cbe311 100644 --- a/demo/scatterplot_component/run.ipynb +++ b/demo/scatterplot_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: scatterplot_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio vega_datasets"]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "from vega_datasets import data\n", "\n", "cars = data.cars()\n", "\n", "with gr.Blocks() as demo:\n", " gr.ScatterPlot(show_label=False,\n", " value=cars,\n", " x=\"Horsepower\",\n", " y=\"Miles_per_Gallon\",\n", " color=\"Origin\",\n", " tooltip=\"Name\",\n", " title=\"Car Data\",\n", " y_title=\"Miles per Gallon\",\n", " color_legend_title=\"Origin of Car\").style(container=False)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: scatterplot_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio vega_datasets"]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "from vega_datasets import data\n", "\n", "cars = data.cars()\n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.ScatterPlot(show_label=False,\n", " value=cars,\n", " x=\"Horsepower\",\n", " y=\"Miles_per_Gallon\",\n", " color=\"Origin\",\n", " tooltip=\"Name\",\n", " title=\"Car Data\",\n", " y_title=\"Miles per Gallon\",\n", " color_legend_title=\"Origin of Car\").style(container=False)\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/scatterplot_component/run.py b/demo/scatterplot_component/run.py index 4b005c6390..57f3241f89 100644 --- a/demo/scatterplot_component/run.py +++ b/demo/scatterplot_component/run.py @@ -3,7 +3,9 @@ from vega_datasets import data cars = data.cars() -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.ScatterPlot(show_label=False, value=cars, x="Horsepower", diff --git a/demo/slider_component/run.ipynb b/demo/slider_component/run.ipynb index ea8007b32a..3b14e253b3 100644 --- a/demo/slider_component/run.ipynb +++ b/demo/slider_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: slider_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Slider()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: slider_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Slider()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/slider_component/run.py b/demo/slider_component/run.py index 45b1bbfa76..8879db37c2 100644 --- a/demo/slider_component/run.py +++ b/demo/slider_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Slider() demo.launch() \ No newline at end of file diff --git a/demo/state_component/run.ipynb b/demo/state_component/run.ipynb index 83e1049d34..37517dca2e 100644 --- a/demo/state_component/run.ipynb +++ b/demo/state_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: state_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.State()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: state_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.State()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/state_component/run.py b/demo/state_component/run.py index b895b79c9e..db4cf52d96 100644 --- a/demo/state_component/run.py +++ b/demo/state_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.State() demo.launch() \ No newline at end of file diff --git a/demo/textbox_component/run.ipynb b/demo/textbox_component/run.ipynb index e0375502e3..b7128c65d9 100644 --- a/demo/textbox_component/run.ipynb +++ b/demo/textbox_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: textbox_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Textbox()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: textbox_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Textbox()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/textbox_component/run.py b/demo/textbox_component/run.py index 14c513b3f1..a46ca1cd51 100644 --- a/demo/textbox_component/run.py +++ b/demo/textbox_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Textbox() demo.launch() \ No newline at end of file diff --git a/demo/timeseries_component/run.ipynb b/demo/timeseries_component/run.ipynb index db959d32a7..6281a26331 100644 --- a/demo/timeseries_component/run.ipynb +++ b/demo/timeseries_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: timeseries_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Timeseries()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: timeseries_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Timeseries()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/timeseries_component/run.py b/demo/timeseries_component/run.py index 0e65d8907f..632bd15617 100644 --- a/demo/timeseries_component/run.py +++ b/demo/timeseries_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Timeseries() demo.launch() \ No newline at end of file diff --git a/demo/video_component/run.ipynb b/demo/video_component/run.ipynb index dea83cb799..7234777a11 100644 --- a/demo/video_component/run.ipynb +++ b/demo/video_component/run.ipynb @@ -1 +1 @@ -{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: video_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "with gr.Blocks() as demo:\n", " gr.Video()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file +{"cells": [{"cell_type": "markdown", "id": 302934307671667531413257853548643485645, "metadata": {}, "source": ["# Gradio Demo: video_component"]}, {"cell_type": "code", "execution_count": null, "id": 272996653310673477252411125948039410165, "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": 288918539441861185822528903084949547379, "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "\n", "css = \"footer {display: none !important;} .gradio-container {min-height: 0px !important;}\"\n", "\n", "with gr.Blocks(css=css) as demo:\n", " gr.Video()\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5} \ No newline at end of file diff --git a/demo/video_component/run.py b/demo/video_component/run.py index 995f8dafa4..44b6b42cdc 100644 --- a/demo/video_component/run.py +++ b/demo/video_component/run.py @@ -1,6 +1,8 @@ import gradio as gr -with gr.Blocks() as demo: +css = "footer {display: none !important;} .gradio-container {min-height: 0px !important;}" + +with gr.Blocks(css=css) as demo: gr.Video() demo.launch() \ No newline at end of file diff --git a/website/homepage/src/docs/template.html b/website/homepage/src/docs/template.html index 899b361357..24e10382d5 100644 --- a/website/homepage/src/docs/template.html +++ b/website/homepage/src/docs/template.html @@ -297,34 +297,16 @@ document.body.appendChild(scriptEle); } - function removeFooters() { - window.setTimeout(function() { - document.querySelectorAll('.embedded-component gradio-app').forEach(g => { - if ( g.shadowRoot ) { - let shadowroot = g.shadowRoot; - let f = shadowroot.querySelector('footer'); - if (f != null) { - f.classList.add('hidden'); - let c = shadowroot.querySelector('.gradio-container'); - c.style.removeProperty('min-height'); - } - }; - }); - }, 1000); - }; - {% if version=='main' %} if (!isMobile) { loadJS('/assets/index.js'); - window.addEventListener('load', removeFooters()); } {% else %} if (!isMobile) { loadJS('https://gradio.s3-us-west-2.amazonaws.com/{{ gradio_version }}/gradio.js'); - window.addEventListener('load', removeFooters()); } {% endif %}