> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Outputs and charts

> Tables, Datalooma charts, plots from your favorite library, images, Markdown, and interactive widgets.

A cell's output is whatever its last expression returns, plus anything it displays along the way.

## What renders

| Output | Examples |
| - | - |
| **Tables** | Polars and pandas dataframes, SQL results. Page, filter, sort, and copy as CSV. |
| **Datalooma charts** | `datalooma.chart(...)` |
| **Other charts** | Matplotlib, seaborn, Plotly, Altair, and Vega-Lite |
| **Images** | PNG, JPEG, GIF, WebP, SVG |
| **Text** | Markdown, HTML, JSON, plain text |
| **Widgets** | `datalooma.ui` widgets, ipywidgets, anywidget |
| **Errors** | A traceback, with notes on what went wrong |

Everything renders without loading anything from the internet.

## Datalooma charts

`datalooma.chart` is a declarative chart library. Pass it a dataframe, pick a mark, and map columns to channels.

```python theme={null}
datalooma.chart(weekly).line(x="week", y="revenue", color="region").title("Weekly revenue")
```

Marks include `line`, `bar`, `area`, `point`, `histogram`, `heatmap`, `pie`, and `boxplot`. Add `.tooltip()` and `.zoom()` for interaction. `datalooma.chart` also accepts Altair charts and Vega-Lite specs.

Prefer another library? Matplotlib, seaborn, Plotly, and Altair figures render natively. Return the figure as the cell's last expression.

## Layout and display

The `datalooma` module has helpers for richer outputs:

* `datalooma.md(...)` and `datalooma.html(...)` render Markdown and HTML.
* `datalooma.image(...)` shows an image.
* `datalooma.hstack(...)` and `datalooma.vstack(...)` arrange outputs side by side or stacked.
* `datalooma.callout(...)` highlights a note or warning.
* `datalooma.status.progress_bar(...)` and `datalooma.status.spinner(...)` show progress while a cell runs.

## Widgets

Widgets are inputs that drive [reactivity](/docs/notebooks/reactivity.md). Assign a widget to a variable in one cell, read its `.value` in another, and that cell re-runs whenever the widget changes.

```python theme={null}
region = datalooma.ui.dropdown(["EMEA", "AMER", "APAC"], value="AMER", label="Region")
region
```

```python theme={null}
datalooma.chart(weekly.filter(pl.col("region") == region.value)).line(x="week", y="revenue")
```

Available widgets: `slider`, `number`, `text`, `text_area`, `checkbox`, `switch`, `dropdown`, `radio`, `multiselect`, `date`, `button`, and `run_button`.

ipywidgets and anywidget work too. Wrap one in `datalooma.widget(...)` to make it reactive.

> [!NOTE]
>
> Use `datalooma.ui` rather than `mo.ui`. marimo's widgets are not available in Datalooma notebooks.

## Work with an output

A cell's **⋯** menu has **Clear output**, **Collapse output**, **Open output in a new tab**, **Download image**, and **Copy cell link**.

Outputs are saved with the notebook, so they show when you reopen it or preview it in Files. A saved output from an earlier session is marked **Not run in this kernel** until you run the cell again.

## Related

> [card] [Reactivity](/docs/notebooks/reactivity.md)
>
> How widgets and changes flow through the notebook.

> [card] [Dashboards](/docs/notebooks/dashboards.md)
>
> Coming soon: share outputs as an interactive dashboard.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.