Embedding Atlas
Embedding Atlas explores large collections of text or image embeddings: a GPU-rendered map with cluster labels, charts, and a searchable table that all filter together. With @render_embedding_atlas, the user’s selection reaches your app through predicate() and selected_rows().

A GPU-rendered map with auto-generated cluster labels, built from 6,088 real GitHub issues in the Shiny ecosystem. Try the app.
Installation
pip install 'shinywidgets[embedding_atlas]'The package’s dependency tree is heavy – it pulls in torch, sentence-transformers, and umap-learn for its optional embedding and projection helpers – but EmbeddingAtlasWidget itself needs none of that; only embedding_atlas.projection.compute_projection() touches them, and only when you call it.
Quick start
# A minimal Embedding Atlas explorer over a real dataset: 6,088 GitHub issues
# from the Shiny ecosystem (R and Python Shiny, bslib, shinywidgets, ...), with
# a 2D projection already computed offline (see "Computing a projection").
# Data: docs/showcase/issues/embed.py built data/issues.parquet from public
# GitHub issues using embedding_atlas.projection.compute_projection().
from pathlib import Path
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "projection_x", "projection_y"]
ui.page_opts(title="Shiny issue atlas", fillable=True)
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
That’s the whole app: one data frame, four column names, and you get a GPU-rendered map with automatic cluster labels, auto-generated bar charts for every other column, and a searchable, paginated table. The dataset is real: 6,088 GitHub issues from the Shiny ecosystem, with a 2D projection computed once, offline, and the cluster labels generated automatically from issue text, with no configuration at all.
The embedding map itself needs a browser with WebGPU and the shader-f16 feature (recent desktop Chrome, Edge, or Firefox); elsewhere it’s replaced by a placeholder, but the charts, table, search, and SQL predicates keep working – enough to drive every accessor in this guide.
Overview
A look at what you can build. Click any of them to open the app, with its code, in Shinylive.
Average image of your selection
Digit thumbnails in the table
Auto-labeled issue clusters
Selection as linked cards
Crossfilter into a plotly chart
Filter to a detail table
Carry the view across a re-render
UMAP-projected topic clusters
Push a filter into your own query
Summarize a selection
A starter template to copy
Preparing the data
These are options on EmbeddingAtlasWidget itself, not on @render_embedding_atlas – nothing Shiny-specific yet.
Computing a projection
EmbeddingAtlasWidget only ever plots the x/y columns you give it – it doesn’t embed anything itself. Upstream’s embedding_atlas.projection.compute_projection() does that part: it embeds a text, image, or vector column (text and image need sentence-transformers; a column of precomputed vectors needs nothing but umap-learn) and runs UMAP to lay the result out in 2D. It can’t run inside a Shiny app’s own event loop, the same restriction that keeps it out of Jupyter – so treat it as an offline step: compute once, cache to Parquet, and have your app’s render function only read the cached columns.
# Turn embedding vectors into the x/y columns an atlas needs, with
# embedding_atlas.projection.compute_projection(). A real app embeds raw text
# or images (modality="text"/"image", needs sentence-transformers); here the
# vectors are already computed, so modality="vector" skips straight to UMAP.
#
# compute_projection() can't run inside a Shiny app's own event loop (it
# calls asyncio.run() internally, which raises once a loop is already
# running -- the same reason Jupyter can't call it directly either). Compute
# it once, offline, the way docs/showcase/issues/embed.py does for the real
# GitHub-issues dataset used elsewhere in this guide:
# uv run --with umap-learn python 02_compute_projection.py
# (UMAP's first call compiles its numba kernels, about a minute; reruns are
# fast.) Then view the cached result with `shiny run 02_compute_projection.py`.
from pathlib import Path
import numpy as np
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import ui
from shinywidgets import render_embedding_atlas
CACHE = Path(__file__).parent / "data" / "projected_topics.parquet"
def build_cache() -> None:
rng = np.random.default_rng(0)
topics = {"astronomy": 0, "cooking": 1, "sailing": 2, "chess": 3}
docs = pd.DataFrame(
{
"topic": [t for t in topics for _ in range(60)],
"text": [f"{t} note {i}" for t in topics for i in range(60)],
}
)
# 16-dim stand-ins for real text embeddings: one Gaussian cluster per topic
centers = rng.normal(scale=4, size=(len(topics), 16))
docs["vector"] = [
(centers[topics[t]] + rng.normal(size=16)).tolist() for t in docs["topic"]
]
# Imported here, not at module level: needs umap-learn, which only the
# cache-building path below requires -- `shiny run` never hits this branch
from embedding_atlas.projection import compute_projection
docs = compute_projection(docs, inputs="vector", modality="vector", neighbors=None)
docs.drop(columns=["vector"]).to_parquet(CACHE, index=False)
if __name__ == "__main__":
build_cache()
print(f"wrote {CACHE}")
else:
docs = pd.read_parquet(CACHE)
ui.page_opts(title="Projected from embedding vectors", fillable=True)
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(docs, x="projection_x", y="projection_y", text="text")
The four synthetic topics (astronomy, cooking, sailing, chess) land in four well-separated regions, confirming UMAP placed semantically similar vectors near each other. Swap modality="vector" for modality="text" and an embedder="sentence-transformers" to embed raw strings instead – the rest of the call is identical.
Auto-generated cluster labels
Cluster labels aren’t something you configure – they’re on by default whenever you give text=. The map clusters by 2D density and titles each cluster with keywords from that column, so you get a labeled map with no topic-modeling code of your own:
# Automatic cluster labels are the library's default whenever `text` is
# given -- you don't pass anything to get them (the quick start already has
# them; this is the same data, cropped in on the embedding view itself). The
# `labels=` option is for supplying your own list of label dicts instead, not
# a flag to toggle the automatic ones (see Gotchas: the documented
# "automatic"/"disabled" sentinel strings don't work as described).
from pathlib import Path
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "title", "text", "projection_x", "projection_y"]
ui.page_opts(title="Auto-labeled issue clusters", fillable=True)
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
Leave labels= unset to get automatic labels.
Images in the explorer
Put PNG or JPEG bytes (or a data:/http(s) URL) in a column and pass it as image=: the table and hover tooltips show the picture alongside every other column, and it participates in the same cross-filter as everything else.
# Put PNG bytes in a column and pass it as `image=`: the explorer shows the
# image in hover tooltips and the detail table, alongside the auto-generated
# charts for every other column. Needs scikit-learn for the bundled digits
# dataset: `uv run --with scikit-learn shiny run 04_images.py`
import io
import numpy as np
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from PIL import Image
from shiny.express import ui
from shinywidgets import render_embedding_atlas
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
digits = load_digits()
rng = np.random.default_rng(0)
idx = rng.choice(len(digits.images), size=600, replace=False)
def to_png(pixels: "np.ndarray") -> bytes:
img = Image.fromarray((pixels / 16 * 255).astype("uint8")).resize((64, 64))
buf = io.BytesIO()
img.save(buf, format="PNG")
return buf.getvalue()
xy = PCA(n_components=2).fit_transform(digits.data[idx])
docs = pd.DataFrame(
{
"digit": digits.target[idx].astype(str),
"image": [to_png(p) for p in digits.images[idx]],
"x": xy[:, 0],
"y": xy[:, 1],
}
)
ui.page_opts(title="Handwritten digits with image previews", fillable=True)
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(docs, x="x", y="y", image="image")
The digit thumbnails appear right in the table rows, resized and legible, with no client-side image-loading code of your own.
Reacting to interaction
Every chart click, shift-drag box, lasso, and typed SQL predicate the user builds in the explorer funnels into one place, a DuckDB WHERE expression. predicate() exposes that expression directly; selected_rows() re-runs it against the widget’s own DuckDB connection and hands you the matching rows. Both read from the same debounced, published value, so they always describe the same filter – even mid-debounce, before the widget’s own live trait has settled.
Push the filter upstream
predicate() is a SQL fragment over the exact column names the widget was built from, so you can run your own aggregate against it – useful when you want a number, not the rows themselves. This example applies it against a second DuckDB connection over the same data, kept separate from the widget’s own locked-down connection:
# predicate() is the cross-filter as a DuckDB WHERE expression, so you can
# push it into a query of your own instead of pulling the rows into Python
# first. Here it drives a server-side aggregate (average reactions) over a
# duckdb connection that's separate from the widget's own.
from pathlib import Path
import duckdb
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import render, ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "comments", "reactions", "projection_x", "projection_y"] # fmt: skip
# `.register()` returns the connection; keep that as an assignment, not a
# bare statement -- shiny.express would otherwise treat its non-None result
# as a UI child, like it would a bare module-level docstring
con = duckdb.connect().register("issues", ISSUES)
ui.page_opts(title="predicate() driving a server-side aggregate", fillable=True)
with ui.layout_columns(col_widths=[8, 4]):
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
with ui.card():
ui.card_header("Average engagement, selected rows")
@render.text
def stat():
where = atlas.predicate()
clause = f"WHERE {where}" if where else ""
n, reactions, comments = con.sql(
f"SELECT count(*), avg(reactions), avg(comments) FROM issues {clause}"
).fetchall()[0]
return f"{n:,} issues · {reactions:.2f} avg reactions · {comments:.2f} avg comments"

Selection as a detail table
# selected_rows() returns the rows passing the current cross-filter, as the same
# frame type (here pandas) the widget was built from -- a detail table for
# exactly what the user selected, with no SQL of your own to write.
from pathlib import Path
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import render, ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "projection_x", "projection_y"] # fmt: skip
ui.page_opts(title="selected_rows() as a detail table", fillable=True)
with ui.layout_columns(col_widths=[7, 5]):
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
with ui.card(full_screen=True):
ui.card_header("Selected rows")
@render.data_frame
def table():
sel = atlas.selected_rows()
return sel[["repo", "state", "title"]].reset_index(drop=True)

selected_rows() runs a DuckDB query every time it’s read, so read it once into a @reactive.calc if several outputs need the same selection.
Select from the map
Every example so far clicks a chart bar, since that’s the gesture a browser without WebGPU can still make. The same two accessors answer to the embedding canvas’s own gestures too – shift-drag for a box, shift+⌘-drag (Ctrl on non-Mac) for a lasso – because both drive the same underlying filter:


Linked detail cards
selected_rows() feeding ui.a() links instead of a plain table, for a richer linked panel:
# Pattern: lasso/filter -> a linked detail list, built from selected_rows()
# instead of a plain data_frame so each row can carry a live link.
from pathlib import Path
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import render, ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "url", "projection_x", "projection_y"] # fmt: skip
ui.page_opts(title="Selection as linked detail cards", fillable=True)
with ui.layout_columns(col_widths=[7, 5]):
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
with ui.card(full_screen=True):
ui.card_header("Selected issues")
@render.ui
def cards():
sel = atlas.selected_rows()
if len(sel) == len(ISSUES):
return ui.p("Select a region or click a bar to see issues here.")
rows = sel.sort_values("state").head(15)
return ui.div(
*[
ui.p(
ui.a(f"{r.repo} ({r.state})", href=r.url, target="_blank"),
": ",
r.title,
class_="mb-2",
)
for r in rows.itertuples()
]
)

Selection summary
The release showcase wires a real selection into Claude: it reads selected_rows()’s titles, sends them to an LLM, and shows what the issues have in common in a couple of sentences. This example keeps the same shape – selected_rows() in, a one-line text summary out – with a keyword-frequency stand-in in place of the model call:
# Pattern: selected_rows() -> a one-line summary of what the user circled. This
# guide can't call a real LLM (no API keys), so `stub_summary()` below ranks
# keywords by frequency as a stand-in. The release showcase
# (docs/showcase/issues/summarize.py) wires the same selection into a real
# call: `await ChatAnthropic(model=..., system_prompt=...).chat_async(prompt)`
# with the selected titles in the prompt -- swap `stub_summary` for that.
import re
from collections import Counter
from pathlib import Path
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import render, ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "projection_x", "projection_y"] # fmt: skip
STOP_WORDS = {"the", "a", "an", "to", "in", "on", "for", "and", "is", "of", "with"}
def stub_summary(titles: list[str]) -> str:
words = [w for t in titles for w in re.findall(r"[a-z]+", t.lower())]
top = Counter(w for w in words if w not in STOP_WORDS).most_common(3)
return f"{len(titles)} issues, mostly about: {', '.join(w for w, _ in top)}"
ui.page_opts(title="Selection summary (stand-in for an LLM call)", fillable=True)
with ui.layout_columns(col_widths=[8, 4]):
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
with ui.card():
ui.card_header("Summary of the selection")
@render.text
def summary():
sel = atlas.selected_rows()
if len(sel) == len(ISSUES):
return "Select a region to summarize it."
return stub_summary(sel["title"].tolist())

Updating in place
The explorer ignores trait changes made from Python: setting atlas.widget._predicate or atlas.widget._props from a @reactive.effect has no visible effect, because the frontend only listens for browser-driven changes, not Python-driven ones. Re-rendering is the only way to change what the explorer shows.
A plain re-render throws away the user’s pan, zoom, coloring, and filter, though. _state round-trips that whole view as JSON, so capturing it in a reactive.value and passing it back as initial_state on the next render carries it forward:
# The explorer ignores trait changes made from Python (setting
# `atlas.widget._predicate` or `._props` has no visible effect; there's no
# `change:_props` listener wired up for it on the frontend), so the only way
# to change what it shows is a re-render. A plain re-render would reset the
# user's pan/zoom/filter/coloring, though -- `_state` round-trips that view as
# JSON, so capturing it and passing it back as `initial_state` carries it
# across the data change below.
import json
from pathlib import Path
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny import reactive
from shiny.express import input, render, ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "projection_x", "projection_y"] # fmt: skip
REPOS = ["All repos", *sorted(ISSUES["repo"].unique())]
ui.page_opts(title="Re-render while carrying the view forward", fillable=True)
ui.input_select("repo", "Repo", REPOS)
last_state = reactive.value(None)
@reactive.effect
def _capture_state():
s = atlas.read("_state")
if s is not None:
last_state.set(s)
@reactive.calc
def filtered():
repo = input.repo()
return ISSUES if repo == "All repos" else ISSUES[ISSUES["repo"] == repo]
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
df = filtered()
with reactive.isolate():
# NOT atlas.widget here: reading a renderer's own accessor/widget
# inside its own render function cancels the render (see the
# Gotchas section)
prev = last_state.get()
opts = {"initial_state": json.loads(prev)} if prev else {}
return EmbeddingAtlasWidget(
df[COLUMNS], x="projection_x", y="projection_y", text="text", **opts
)
@render.text
def note():
return f"{len(filtered()):,} rows loaded"

The comment in atlas() reads the previous state from the reactive.value, not from atlas.widget itself.
Linking widgets
The explorer can only be changed by a re-render (previous section), so linking means flowing data out of the atlas into another widget; there’s no way to drive the atlas’s own filter or viewport from another widget’s selection in place.
Feed a plotly chart
The same predicate() string, applied to a second connection over the same data, drives a live plotly bar chart of whatever categorical breakdown you want for just the selected rows:
# Pattern: atlas crossfilter -> a plotly chart of exactly the selected rows.
# predicate() is a DuckDB WHERE expression over the *same* column names the
# widget was built from, so it applies directly to a pandas boolean mask via
# a second DuckDB connection registered on the same frame -- no need to
# touch the widget's own (locked-down) connection. Pairs with the plotly guide.
from pathlib import Path
import duckdb
import pandas as pd
import plotly.express as px
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import render, ui
from shinywidgets import render_embedding_atlas, render_plotly
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "projection_x", "projection_y"] # fmt: skip
# Chained as an assignment, not a bare statement: shiny.express would
# otherwise capture .register()'s non-None return as a UI child
con = duckdb.connect().register("issues", ISSUES)
ui.page_opts(title="Crossfilter driving a plotly breakdown", fillable=True)
with ui.layout_columns(col_widths=[7, 5]):
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
with ui.card():
ui.card_header("Language mix of the current selection")
@render_plotly
def breakdown():
where = atlas.predicate()
clause = f"WHERE {where}" if where else ""
counts = con.sql(
f"SELECT language, count(*) AS n FROM issues {clause} GROUP BY language"
).df()
return px.bar(counts, x="language", y="n", text="n")

Accessor reference
| accessor | returns | before any interaction | across re-render | default rate policy |
|---|---|---|---|---|
predicate() |
str \| None (a DuckDB boolean expression) |
seeded None: nothing is filtered |
re-seeded from the new explorer | debounce, 250 ms |
selected_rows() |
the same frame type (pandas/polars/pyarrow) the widget was built from, plus a __row_index__ column |
seeded; all rows while nothing is filtered | re-seeded, following predicate() |
debounce, 250 ms (shares predicate()’s window) |
Both behave like reactive_read()-backed values outside their own render function: reading one before the explorer has ever rendered cancels the current reactive context (req(False)), the way .widget does. Both describe the explorer’s current cross-filter, not a memory of past interaction, so a re-render always re-seeds them from the new explorer’s own (unfiltered) state.
Tuning accessors
Reading on demand
Every pattern above reads selected_rows() continuously, re-rendering as the user filters. A download handler instead reads it on demand: it’s live from the moment the explorer renders, so the handler needs no earlier read to “arm” it.
# Read on demand: export the explorer's current selection as a CSV, read
# only when the user clicks Download -- no warm-up needed, since
# selected_rows() is live from the moment the explorer renders.
from pathlib import Path
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny import render
from shiny.express import ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "projection_x", "projection_y"] # fmt: skip
ui.page_opts(title="Export the current selection, read on demand", fillable=True)
with ui.layout_columns(col_widths=[9, 3]):
with ui.card(full_screen=True):
@render_embedding_atlas
def atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
with ui.card():
ui.card_header("Export")
"Download exactly the issues currently selected (chart click, box, or lasso)."
@render.download_button(filename="issues_selected.csv", label="Download CSV")
def download():
sel = atlas.selected_rows()
yield sel[["repo", "state", "title"]].to_csv(index=False)

The downloaded CSV has exactly 139 rows, every one with repo equal to py-shinywidgets, matching the explorer’s own count.
Rate limiting
Both accessors debounce at 250 ms by default, because a dragging box or lasso streams many intermediate filter values, and each one costs a DuckDB query if you’re reading selected_rows(). Pass rate_policy="throttle" to @render_embedding_atlas(...) for a steady trickle of updates during a long drag instead of one at the end, or rate_delay=0 to react to every intermediate value. Both keyword arguments also apply to atlas.read()/reactive_read() on the widget’s own traits, including _state.
.read()
The only other trait worth reading directly is _state – the explorer’s full UI state (coloring, active charts, viewport, and the current filter) as a JSON string. It’s not wrapped in an accessor because on its own it’s not something you’d react to; its job is letting you carry the view across a re-render. Prefer atlas.read("_state") over calling reactive_read(atlas.widget, "_state") directly.
Large data
Embedding Atlas combines two large-data approaches at once: the embedding map is a GPU-rendered scatter, and every chart, table, and cross-filter runs as a DuckDB query in-process, so only the matching rows or a predicate cross the wire – not the underlying table. This guide’s own examples use a real but modest 6,088-row dataset, so there’s no dedicated scale example here; for how each piece scales at the high end, see jupyter-scatter (bare GPU scatter at scale) and quak or mosaic (DuckDB-backed views).
Layout and sizing
# Fill behavior: with no explicit height, the output grows to fill its card
# (left, `full_screen=True` card). An explicit height (right) always wins --
# the explorer fits itself to it, growing or shrinking from its own 650px
# default. Outside a fillable container, give it at least 600px.
from pathlib import Path
import pandas as pd
from embedding_atlas.widget import EmbeddingAtlasWidget
from shiny.express import ui
from shinywidgets import render_embedding_atlas
ISSUES = pd.read_parquet(Path(__file__).parent / "data" / "issues.parquet")
COLUMNS = ["repo", "language", "state", "title", "text", "projection_x", "projection_y"] # fmt: skip
def small_atlas():
return EmbeddingAtlasWidget(
ISSUES[COLUMNS], x="projection_x", y="projection_y", text="text"
)
ui.page_opts(title="Fillable card vs. a fixed-height output", fillable=True)
with ui.layout_columns(col_widths=[8, 4]):
with ui.card(full_screen=True):
ui.card_header("Fills the card (no explicit height)")
@render_embedding_atlas
def atlas_fill():
return small_atlas()
with ui.card():
ui.card_header('height="650px"')
@render_embedding_atlas(height="650px")
def atlas_fixed():
return small_atlas()
With no explicit height, the output fills its parent (full_screen=True works well for an explorer this dense). In a non-fillable layout, give @render_embedding_atlas an explicit height of at least 600px – the library’s own default is 650px, and a smaller explicit height can clip the chart panel.
The narrower card above (about 590px) shows the library’s own responsive behavior: below a certain width, the explorer collapses its chart/table side panel behind a toggle icon. That’s upstream’s layout, not something shinywidgets controls.
Gotchas
Security defaults
The explorer runs SQL that the visitor’s browser sends, in your Python process. @render_embedding_atlas restricts it to the explorer’s data, so a query that tries to read or write server files is refused. Pass allow_unrestricted_connection=True to lift the restriction for a local, single-user app.
Nothing limits how expensive a query is, and a slow one blocks the Python process while it runs.
Other gotchas
- Inside
atlas’s own render function,.widgetis the previous render’s widget (orNoneon the first render). Keep state you need in areactive.valuewritten by a separate effect. - Two widgets can’t share one DuckDB connection: a second
EmbeddingAtlasWidget(df, connection=con)on an already-used connection raises aCatalogException. Create the connection inside the render function, or let the widget make its own, rather than sharing one at module scope. - Construction options such as
point_sizecan’t be changed on a live explorer; re-render to change them.
In the gallery
Complete apps in the gallery that use Embedding Atlas:
Learn more
- Embedding Atlas documentation
embedding_atlas.projectionreference forcompute_projection()- Related guides: jupyter-scatter for a bare GPU scatter at scale, mosaic for grammar-based crossfilter dashboards, itables and perspective for tabular search without a map