text stringlengths 0 2k | heading1 stringlengths 3 79 | source_page_url stringclasses 190
values | source_page_title stringclasses 190
values |
|---|---|---|---|
[Progressive Web Apps (PWAs)](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps) are web applications that are regular web pages or websites, but can appear to the user like installable platform-specific applications.
Gradio apps can be easily served as PWAs by setting the `pwa=True` parameter in the `... | Progressive Web App (PWA) | https://gradio.app/guides/sharing-your-app | Additional Features - Sharing Your App Guide |
**API endpoint names**
When you create a Gradio application, the API endpoint names are automatically generated based on the function names. You can change this by using the `api_name` parameter in `gr.Interface` or `gr.ChatInterface`. If you are using Gradio `Blocks`, you can name each event listener, like this:
```... | Configuring the API Page | https://gradio.app/guides/view-api-page | Additional Features - View Api Page Guide |
**Adding API endpoints**
You can also add new API routes to your Gradio application that do not correspond to events in your UI.
For example, in this Gradio application, we add a new route that adds numbers and slices a list:
```py
import gradio as gr
with gr.Blocks() as demo:
with gr.Row():
input = gr... | Configuring the API Page | https://gradio.app/guides/view-api-page | Additional Features - View Api Page Guide |
This API page not only lists all of the endpoints that can be used to query the Gradio app, but also shows the usage of both [the Gradio Python client](https://gradio.app/guides/getting-started-with-the-python-client/), and [the Gradio JavaScript client](https://gradio.app/guides/getting-started-with-the-js-client/).
... | The Clients | https://gradio.app/guides/view-api-page | Additional Features - View Api Page Guide |
Instead of reading through the view API page, you can also use Gradio's built-in API recorder to generate the relevant code snippet. Simply click on the "API Recorder" button, use your Gradio app via the UI as you would normally, and then the API Recorder will generate the code using the Clients to recreate your all of... | The API Recorder 🪄 | https://gradio.app/guides/view-api-page | Additional Features - View Api Page Guide |
Next to the "Use via API" link, the footer has a **Runs** link, which opens a page at `<your-gradio-app-url>/gradio_api/runs` listing the runs made from this browser, grouped by endpoint. Each run shows its inputs, its outputs, how long the function took, and whether it succeeded. Clicking **Load run** puts a saved run... | Run History | https://gradio.app/guides/view-api-page | Additional Features - View Api Page Guide |
o want:
```py
demo.launch(footer_links=["api", "gradio", "settings"])
```
To turn the feature off completely, set `run_history=False`. Nothing is recorded, the run history page returns a 404, and any runs this app had already saved are cleared from the browser the next time someone opens it:
```py
demo.launch(run_hi... | Run History | https://gradio.app/guides/view-api-page | Additional Features - View Api Page Guide |
The API page also includes instructions on how to use the Gradio app as an Model Context Protocol (MCP) server, which is a standardized way to expose functions as tools so that they can be used by LLMs.

... | MCP Server | https://gradio.app/guides/view-api-page | Additional Features - View Api Page Guide |
You can access the complete OpenAPI (formerly Swagger) specification of your Gradio app's API at the endpoint `<your-gradio-app-url>/gradio_api/openapi.json`. The OpenAPI specification is a standardized, language-agnostic interface description for REST APIs that enables both humans and computers to discover and underst... | OpenAPI Specification | https://gradio.app/guides/view-api-page | Additional Features - View Api Page Guide |
You can initialize the `I18n` class with multiple language dictionaries to add custom translations:
```python
import gradio as gr
Create an I18n instance with translations for multiple languages
i18n = gr.I18n(
en={"greeting": "Hello, welcome to my app!", "submit": "Submit"},
es={"greeting": "¡Hola, bienvenid... | Setting Up Translations | https://gradio.app/guides/internationalization | Additional Features - Internationalization Guide |
When you use the `i18n` instance with a translation key, Gradio will show the corresponding translation to users based on their browser's language settings or the language they've selected in your app.
If a translation isn't available for the user's locale, the system will fall back to English (if available) or displa... | How It Works | https://gradio.app/guides/internationalization | Additional Features - Internationalization Guide |
Locale codes should follow the BCP 47 format (e.g., 'en', 'en-US', 'zh-CN'). The `I18n` class will warn you if you use an invalid locale code.
| Valid Locale Codes | https://gradio.app/guides/internationalization | Additional Features - Internationalization Guide |
The following component properties typically support internationalization:
- `description`
- `info`
- `title`
- `placeholder`
- `value`
- `label`
Note that support may vary depending on the component, and some properties might have exceptions where internationalization is not applicable. You can check this by referri... | Supported Component Properties | https://gradio.app/guides/internationalization | Additional Features - Internationalization Guide |
Gradio can stream audio and video directly from your generator function.
This lets your user hear your audio or see your video nearly as soon as it's `yielded` by your function.
All you have to do is
1. Set `streaming=True` in your `gr.Audio` or `gr.Video` output component.
2. Write a python generator that yields the... | Streaming Media | https://gradio.app/guides/streaming-outputs | Additional Features - Streaming Outputs Guide |
For an end-to-end example of streaming media, see the object detection from video [guide](/main/guides/object-detection-from-video) or the streaming AI-generated audio with [transformers](https://huggingface.co/docs/transformers/index) [guide](/main/guides/streaming-ai-generated-audio). | End-to-End Examples | https://gradio.app/guides/streaming-outputs | Additional Features - Streaming Outputs Guide |
- **1. Static files**. You can designate static files or directories using the `gr.set_static_paths` function. Static files are not be copied to the Gradio cache (see below) and will be served directly from your computer. This can help save disk space and reduce the time your app takes to launch but be mindful of poss... | Files Gradio allows users to access | https://gradio.app/guides/file-access | Additional Features - File Access Guide |
First, it's important to understand why Gradio has a cache at all. Gradio copies files to a cache directory before returning them to the frontend. This prevents files from being overwritten by one user while they are still needed by another user of your application. For example, if your prediction function returns a vi... | The Gradio cache | https://gradio.app/guides/file-access | Additional Features - File Access Guide |
d by a user to your Gradio app (e.g. through the `File` or `Image` input components).
Tip: If at any time Gradio blocks a file that you would like it to process, add its path to the `allowed_paths` parameter.
| The Gradio cache | https://gradio.app/guides/file-access | Additional Features - File Access Guide |
While running, Gradio apps will NOT ALLOW users to access:
- **Files that you explicitly block via the `blocked_paths` parameter in `launch()`**. You can pass in a list of additional directories or exact filepaths to the `blocked_paths` parameter in `launch()`. This parameter takes precedence over the files that Gradi... | The files Gradio will not allow others to access | https://gradio.app/guides/file-access | Additional Features - File Access Guide |
Sharing your Gradio application will also allow users to upload files to your computer or server. You can set a maximum file size for uploads to prevent abuse and to preserve disk space. You can do this with the `max_file_size` parameter of `.launch`. For example, the following two code snippets limit file uploads to 5... | Uploading Files | https://gradio.app/guides/file-access | Additional Features - File Access Guide |
* Set a `max_file_size` for your application.
* Do not return arbitrary user input from a function that is connected to a file-based output component (`gr.Image`, `gr.File`, etc.). For example, the following interface would allow anyone to move an arbitrary file in your local directory to the cache: `gr.Interface(lambd... | Best Practices | https://gradio.app/guides/file-access | Additional Features - File Access Guide |
Both `gr.set_static_paths` and the `allowed_paths` parameter in launch expect absolute paths. Below is a minimal example to display a local `.png` image file in an HTML block.
```txt
├── assets
│ └── logo.png
└── app.py
```
For the example directory structure, `logo.png` and any other files in the `assets` folder ca... | Example: Accessing local files | https://gradio.app/guides/file-access | Additional Features - File Access Guide |
When a user closes their browser tab, Gradio will automatically delete any `gr.State` variables associated with that user session after 60 minutes. If the user connects again within those 60 minutes, no state will be deleted.
You can control the deletion behavior further with the following two parameters of `gr.State`... | Automatic deletion of `gr.State` | https://gradio.app/guides/resource-cleanup | Additional Features - Resource Cleanup Guide |
Your Gradio application will save uploaded and generated files to a special directory called the cache directory. Gradio uses a hashing scheme to ensure that duplicate files are not saved to the cache but over time the size of the cache will grow (especially if your app goes viral 😉).
Gradio can periodically clean up... | Automatic cache cleanup via `delete_cache` | https://gradio.app/guides/resource-cleanup | Additional Features - Resource Cleanup Guide |
Additionally, Gradio now includes a `Blocks.unload()` event, allowing you to run arbitrary cleanup functions when users disconnect (this does not have a 60 minute delay).
Unlike other gradio events, this event does not accept inputs or outptus.
You can think of the `unload` event as the opposite of the `load` event.
| The `unload` event | https://gradio.app/guides/resource-cleanup | Additional Features - Resource Cleanup Guide |
The following demo uses all of these features. When a user visits the page, a special unique directory is created for that user.
As the user interacts with the app, images are saved to disk in that special directory.
When the user closes the page, the images created in that session are deleted via the `unload` event.
T... | Putting it all together | https://gradio.app/guides/resource-cleanup | Additional Features - Resource Cleanup Guide |
1. `GRADIO_SERVER_PORT`
- **Description**: Specifies the port on which the Gradio app will run.
- **Default**: `7860`
- **Example**:
```bash
export GRADIO_SERVER_PORT=8000
```
2. `GRADIO_SERVER_NAME`
- **Description**: Defines the host name for the Gradio server. To make Gradio accessible from any IP address, ... | Key Environment Variables | https://gradio.app/guides/environment-variables | Additional Features - Environment Variables Guide |
r the Gradio application. Useful if running Gradio [behind a reverse proxy](/guides/running-gradio-on-your-web-server-with-nginx).
- **Default**: `""`
- **Example**:
```sh
export GRADIO_ROOT_PATH="/myapp"
```
9. `GRADIO_SHARE`
- **Description**: Enables or disables sharing the Gradio app.
- **Default**: `"False... | Key Environment Variables | https://gradio.app/guides/environment-variables | Additional Features - Environment Variables Guide |
the application will trust the `X-Forwarded-For` header from these IP addresses to determine the original IP address of the user making the request. This means that if you use the `gr.Request` [object's](https://www.gradio.app/docs/gradio/request) `client.host` property, it will correctly get the user's IP address ins... | Key Environment Variables | https://gradio.app/guides/environment-variables | Additional Features - Environment Variables Guide |
e()`, `gr.ChatInterface()` or in `gr.Examples()`, Gradio will run your prediction function and save the results to disk. By default, this is in the `.gradio/cached_examples//` subdirectory within your app's working directory. You can customize the location of cached example files created by Gradio by setting the enviro... | Key Environment Variables | https://gradio.app/guides/environment-variables | Additional Features - Environment Variables Guide |
e"`
- **Options**: `"True"`, `"False"`
- **Example**:
```sh
export GRADIO_RESET_EXAMPLES_CACHE="True"
```
20. `GRADIO_CHAT_FLAGGING_MODE`
- **Description**: Controls whether users can flag messages in `gr.ChatInterface` applications. Similar to `GRADIO_FLAGGING_MODE` but specifically for chat interfaces.
- **De... | Key Environment Variables | https://gradio.app/guides/environment-variables | Additional Features - Environment Variables Guide |
*Options**: `"True"`, `"False"`
- **Example**:
```sh
export GRADIO_MCP_SERVER="True"
```
24. `GRADIO_NUM_WORKERS`
- **Description**: Number of multiple workers to launch in the background to offload traffic for file I/O and static assets from the main Gradio server. Only works when SSR mode is set.
- **Default... | Key Environment Variables | https://gradio.app/guides/environment-variables | Additional Features - Environment Variables Guide |
To set environment variables in your terminal, use the `export` command followed by the variable name and its value. For example:
```sh
export GRADIO_SERVER_PORT=8000
```
If you're using a `.env` file to manage your environment variables, you can add them like this:
```sh
GRADIO_SERVER_PORT=8000
GRADIO_SERVER_NAME="... | How to Set Environment Variables | https://gradio.app/guides/environment-variables | Additional Features - Environment Variables Guide |
To add custom buttons to a component, pass a list of `gr.Button()` instances to the `buttons` parameter:
```python
import gradio as gr
refresh_btn = gr.Button("Refresh", variant="secondary", size="sm")
clear_btn = gr.Button("Clear", variant="secondary", size="sm")
textbox = gr.Textbox(
value="Sample text",
l... | Basic Usage | https://gradio.app/guides/custom-buttons | Additional Features - Custom Buttons Guide |
Custom buttons work just like regular `gr.Button` components. You can connect them to Python functions or JavaScript functions using the `.click()` method:
Python Functions
```python
def refresh_data():
import random
return f"Refreshed: {random.randint(1000, 9999)}"
refresh_btn.click(refresh_data, outputs=te... | Connecting Button Events | https://gradio.app/guides/custom-buttons | Additional Features - Custom Buttons Guide |
Here's a complete example showing custom buttons with both Python and JavaScript functions:
$code_textbox_custom_buttons
| Complete Example | https://gradio.app/guides/custom-buttons | Additional Features - Custom Buttons Guide |
- Custom buttons appear in the component's toolbar, typically in the top-right corner
- Only the `value` of the Button is used, other attributes like `icon` are not used.
- Buttons are rendered in the order they appear in the `buttons` list
- Built-in buttons (like "copy", "download") can be hidden by omitting them fro... | Notes | https://gradio.app/guides/custom-buttons | Additional Features - Custom Buttons Guide |
Let's create a demo where a user can choose a filter to apply to their webcam stream. Users can choose from an edge-detection filter, a cartoon filter, or simply flipping the stream vertically.
$code_streaming_filter
$demo_streaming_filter
You will notice that if you change the filter value it will immediately take e... | A Realistic Image Demo | https://gradio.app/guides/streaming-inputs | Additional Features - Streaming Inputs Guide |
For some image streaming demos, like the one above, we don't need to display separate input and output components. Our app would look cleaner if we could just display the modified output stream.
We can do so by just specifying the input image component as the output of the stream event.
$code_streaming_filter_unified... | Unified Image Demos | https://gradio.app/guides/streaming-inputs | Additional Features - Streaming Inputs Guide |
Your streaming function should be stateless. It should take the current input and return its corresponding output. However, there are cases where you may want to keep track of past inputs or outputs. For example, you may want to keep a buffer of the previous `k` inputs to improve the accuracy of your transcription demo... | Keeping track of past inputs or outputs | https://gradio.app/guides/streaming-inputs | Additional Features - Streaming Inputs Guide |
For an end-to-end example of streaming from the webcam, see the object detection from webcam [guide](/main/guides/object-detection-from-webcam-with-webrtc). | End-to-End Examples | https://gradio.app/guides/streaming-inputs | Additional Features - Streaming Inputs Guide |
The simplest possible Workflow app:
```python
import gradio as gr
gr.Workflow().launch()
```
Open the app, drag Spaces, models, and datasets from the sidebar onto the canvas, connect their ports, and hit **Run**. As you add, remove, or change nodes and edges, a `workflow.json` file will automatically be created next... | Quickstart | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
Pass your own Python functions via `bind=` and they appear as callable nodes on the canvas. Gradio inspects the function signature to auto-generate input/output ports.
```python
import gradio as gr
def summarize(text: str) -> str:
return text[:200]
gr.Workflow(bind=[summarize]).launch()
```
Use a dict to give n... | Binding Python functions | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
For pipelines you want to ship with a fixed topology, declare edges programmatically:
```python
import gradio as gr
def clean(text: str) -> str:
return text.strip().lower()
def tag(text: str) -> str:
return f"[processed] {text}"
gr.Workflow(
bind=[clean, tag],
edges=[("clean", "tag")],
).launch()
``... | Defining edges in code | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
Pass a `graph=` path to load a saved workflow topology. The canvas reads from the file on each page load and autosaves back to it when you add, remove, or change nodes and edges.
```python
gr.Workflow(graph="workflow.json").launch()
```
If the file doesn't exist yet, it's created on the first authorized edit. `bind=`... | Loading from a JSON file | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
A workflow is a JSON file with three node collections:
```json
{
"schema_version": "2",
"name": "My Pipeline",
"references": [
{
"id": "ref_prompt", "label": "Prompt", "role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"... | Workflow JSON format | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
n the file, and `workflow.json` is never rewritten with it. `height` is measured from the rendered card. `width` is the default every viewer starts from — anyone can resize a card locally, and a writer's resize becomes the new default the next time an edit is saved.
| Collection | Role |
|---|---|
| `references` | Inp... | Workflow JSON format | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
Ports are typed so the canvas can validate connections. Supported types:
`image` · `audio` · `video` · `text` · `number` · `boolean` · `gallery` · `file` · `json` · `model3d` · `any`
`any` is a compatibility fallback that can connect to every port type. `file` and `any` usually come from API schema inference and are ... | Port types | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
One reference can feed multiple operators simultaneously. When you run the workflow in the interactive canvas, operators at the same dependency depth run in parallel:
```python
workflow.json excerpt — one product photo → 4 FLUX Kontext branches
"edges": [
{"from_node_id": "ref_product", ..., "to_node_id": "op_kontex... | Fan-out pipelines | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
A Workflow app is a standard Gradio app — deploy it to Hugging Face Spaces exactly like any other, by uploading the code to a Space, or by simply running in your terminal:
```
gradio deploy
```
Set `hf_oauth: true` [in your Space](https://huggingface.co/docs/hub/en/spaces-oauth) so the owner can authenticate for edit... | Deploying to Spaces | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
Two different things in a Workflow app can spend GPU time, and each is set up its own way:
- **Space, model, and dataset nodes** call out to someone else's hardware. The workflow app itself stays on CPU; what matters is *whose* quota each call is billed to.
- **`kind: "fn"` nodes** run inside the workflow app. If one ... | gr.Workflow on ZeroGPU | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
. | [Sizing `duration`](sizing-duration-on-bound-functions) |
| `ZeroGPU client warning` — "GPU device not used" | The decorated function never touched the GPU — usually the model was moved to `cuda` somewhere the decorator can't see. | [Load models at module scope](load-models-at-module-scope) |
| `RuntimeError: CUDA ... | gr.Workflow on ZeroGPU | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
one edit:
```yaml
README.md of your Space
hf_oauth: true
```
The workflow app itself does not need GPU hardware. It orchestrates calls to other Spaces, so CPU basic is the right choice unless a function you passed to `bind=` does its own GPU work.
Sizing `duration` on bound functions
The number you write in `@space... | gr.Workflow on ZeroGPU | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
t spaces must be imported before anything initializes CUDA
import torch
from diffusers import AutoPipelineForText2Image
pipe = AutoPipelineForText2Image.from_pretrained(
"stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16"
).to("cuda")
@spaces.GPU(duration=60)
def illustrate(prompt: str) -> dict:
... | gr.Workflow on ZeroGPU | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
as `{"path": ..., "url": ...}`, but one chained from an upstream node arrives as `{"url": "/gradio_api/file=<percent-encoded path>"}` with no `path` key at all. Normalize both before opening the file:
```python
from urllib.parse import unquote
def local_path(value):
if isinstance(value, str):
return valu... | gr.Workflow on ZeroGPU | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
Every Workflow app also renders as an ordinary Gradio app. Each independent pipeline is laid out like a `gr.Interface` — its unconnected inputs and a **Run** button on the left, its outputs on the right — and workflows with more than one pipeline get one tab each. Reference nodes that already hold a value show up as th... | App view | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
Every Workflow app is a Gradio app, meaning that it exposes its connected pipelines through the standard Gradio REST API. Each disconnected pipeline containing one or more output (subject) nodes gets one endpoint. Its name is derived from the first subject's label — for example, a pipeline whose first subject is labell... | API access | https://gradio.app/guides/workflows | Additional Features - Workflows Guide |
By default, each event listener has its own queue, which handles one request at a time. This can be configured via two arguments:
- `concurrency_limit`: This sets the maximum number of concurrent executions for an event listener. By default, the limit is 1 unless configured otherwise in `Blocks.queue()`. You can also ... | Configuring the Queue | https://gradio.app/guides/queuing | Additional Features - Queuing Guide |
identified by `"gpu_queue"`. The queue can handle up to 2 concurrent requests at a time, as defined by the `concurrency_limit`.
Notes
- To ensure unlimited concurrency for an event listener, set `concurrency_limit=None`. This is useful if your function is calling e.g. an external API which handles the rate limiting... | Configuring the Queue | https://gradio.app/guides/queuing | Additional Features - Queuing Guide |
Time plots need a datetime column on the x-axis. Here's a simple example with some flight data:
$code_plot_guide_temporal
$demo_plot_guide_temporal
| Creating a Plot with a pd.Dataframe | https://gradio.app/guides/time-plots | Data Science And Plots - Time Plots Guide |
You may wish to bin data by time buckets. Use `x_bin` to do so, using a string suffix with "s", "m", "h" or "d", such as "15m" or "1d".
$code_plot_guide_aggregate_temporal
$demo_plot_guide_aggregate_temporal
| Aggregating by Time | https://gradio.app/guides/time-plots | Data Science And Plots - Time Plots Guide |
You can use `gr.DateTime` to accept input datetime data. This works well with plots for defining the x-axis range for the data.
$code_plot_guide_datetime
$demo_plot_guide_datetime
Note how `gr.DateTime` can accept a full datetime string, or a shorthand using `now - [0-9]+[smhd]` format to refer to a past time.
You w... | DateTime Components | https://gradio.app/guides/time-plots | Data Science And Plots - Time Plots Guide |
In many cases, you're working with live, realtime date, not a static dataframe. In this case, you'd update the plot regularly with a `gr.Timer()`. Assuming there's a `get_data` method that gets the latest dataframe:
```python
with gr.Blocks() as demo:
timer = gr.Timer(5)
plot1 = gr.BarPlot(x="time", y="price")... | RealTime Data | https://gradio.app/guides/time-plots | Data Science And Plots - Time Plots Guide |
```python
from sqlalchemy import create_engine
import pandas as pd
engine = create_engine('sqlite:///your_database.db')
with gr.Blocks() as demo:
gr.LinePlot(pd.read_sql_query("SELECT time, price from flight_info;", engine), x="time", y="price")
```
Let's see a a more interactive plot involving filters that modi... | SQLite | https://gradio.app/guides/connecting-to-a-database | Data Science And Plots - Connecting To A Database Guide |
If you're using a different database format, all you have to do is swap out the engine, e.g.
```python
engine = create_engine('postgresql://username:password@host:port/database_name')
```
```python
engine = create_engine('mysql://username:password@host:port/database_name')
```
```python
engine = create_engine('oracl... | Postgres, mySQL, and other databases | https://gradio.app/guides/connecting-to-a-database | Data Science And Plots - Connecting To A Database Guide |
Plots accept a pandas Dataframe as their value. The plot also takes `x` and `y` which represent the names of the columns that represent the x and y axes respectively. Here's a simple example:
$code_plot_guide_line
$demo_plot_guide_line
All plots have the same API, so you could swap this out with a `gr.ScatterPlot`:
... | Creating a Plot with a pd.Dataframe | https://gradio.app/guides/creating-plots | Data Science And Plots - Creating Plots Guide |
You can break out your plot into series using the `color` argument.
$code_plot_guide_series_nominal
$demo_plot_guide_series_nominal
If you wish to assign series specific colors, use the `color_map` arg, e.g. `gr.ScatterPlot(..., color_map={'white': 'FF9988', 'asian': '88EEAA', 'black': '333388'})`
The color column c... | Breaking out Series by Color | https://gradio.app/guides/creating-plots | Data Science And Plots - Creating Plots Guide |
You can aggregate values into groups using the `x_bin` and `y_aggregate` arguments. If your x-axis is numeric, providing an `x_bin` will create a histogram-style binning:
$code_plot_guide_aggregate_quantitative
$demo_plot_guide_aggregate_quantitative
If your x-axis is a string type instead, they will act as the categ... | Aggregating Values | https://gradio.app/guides/creating-plots | Data Science And Plots - Creating Plots Guide |
You can use the `.select` listener to select regions of a plot. Click and drag on the plot below to select part of the plot.
$code_plot_guide_selection
$demo_plot_guide_selection
You can combine this and the `.double_click` listener to create some zoom in/out effects by changing `x_lim` which sets the bounds of the x... | Selecting Regions | https://gradio.app/guides/creating-plots | Data Science And Plots - Creating Plots Guide |
Take a look how you can have an interactive dashboard where the plots are functions of other Components.
$code_plot_guide_interactive
$demo_plot_guide_interactive
It's that simple to filter and control the data presented in your visualization! | Making an Interactive Dashboard | https://gradio.app/guides/creating-plots | Data Science And Plots - Creating Plots Guide |
Use any of the standard Gradio form components to filter your data. You can do this via event listeners or function-as-value syntax. Let's look at the event listener approach first:
$code_plot_guide_filters_events
$demo_plot_guide_filters_events
And this would be the function-as-value approach for the same demo.
$co... | Filters | https://gradio.app/guides/filters-tables-and-stats | Data Science And Plots - Filters Tables And Stats Guide |
Add `gr.DataFrame` and `gr.Label` to your dashboard for some hard numbers.
$code_plot_guide_tables_stats
$demo_plot_guide_tables_stats
| Tables and Stats | https://gradio.app/guides/filters-tables-and-stats | Data Science And Plots - Filters Tables And Stats Guide |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.