The EmbeddingAtlasWidget allows you to embed the Embedding Atlas UI directly into notebooks (Jupyter, Marimo, Colab, VSCode, etc.) using AnyWidget.
To display a widget with a pre-computed projection, pass the dataframe and the relevant column names for text, x-coordinates, y-coordinates, and neighbors to the constructor. You can retrieve user selections from the widget as a dataframe using the .selection() method.
from embedding_atlas.widget import EmbeddingAtlasWidget
# Create an Embedding Atlas widget with the pre-computed projection
widget = EmbeddingAtlasWidget(df, text="description",
x="projection_x", y="projection_y", neighbors="neighbors"
)
# Display the widget
widget
# Get selections back as a data frame
df_selection = widget.selection()