deepspatial.vis_utils.interactive_spatial_range_widget#
- deepspatial.vis_utils.interactive_spatial_range_widget(adata: AnnData, color_col: str = 'cell_class', palette: Dict[str, str] | None = None, spatial_key: str = 'spatial', z_key: str = 'z_coord', point_size: float = 2.0, opacity: float = 0.8, bg_color: str = 'black', width: int | None = None, height: int | None = 800, show: bool = True) VBox | None[source]#
Generate a Jupyter widget for dynamically slicing and projecting 3D data onto a 2D plane.
- Parameters:
adata (ad.AnnData) – Annotated data matrix.
color_col (str) – Column in adata.obs for coloring points.
palette (dict, optional) – Mapping of categories to colors.
spatial_key (str) – Key in adata.obsm for XY coordinates.
z_key (str) – Key in adata.obs for Z coordinate.
point_size (float) – Marker size.
opacity (float) – Marker opacity.
bg_color (str) – Canvas background color.
width (int, optional) – Dimensions of the widget rendering area.
height (int, optional) – Dimensions of the widget rendering area.
show (bool) – If True, renders the widget inline via IPython.display.
- Returns:
Container widget if show=False, else None.
- Return type:
ipywidgets.VBox or None