Skip to content

Commit 9990c02

Browse files
committed
Added test
1 parent 3097825 commit 9990c02

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/spatialdata_plot/pl/basic.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -661,15 +661,6 @@ def show(
661661
# extent=extent[cs],
662662
)
663663
elif cmd == "render_shapes" and cs_contents.query(f"cs == '{cs}'")["has_shapes"][0]:
664-
# if sdata.table is not None and isinstance(params.color, str):
665-
# colors = sc.get.obs_df(sdata.table, params.color)
666-
# if is_categorical_dtype(colors):
667-
# _maybe_set_colors(
668-
# source=sdata.table,
669-
# target=sdata.table,
670-
# key=params.color,
671-
# palette=params.palette,
672-
# )
673664
_render_shapes(
674665
sdata=sdata,
675666
render_params=params,
Loading

tests/pl/test_render_shapes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,12 @@ def _make_multi():
8989
table = TableModel.parse(adata, region="p", region_key="region", instance_key="val")
9090
sdata.table = table
9191
sdata.pl.render_shapes(color="val", outline=True, fill_alpha=0.3).pl.show()
92+
93+
def test_plot_can_color_from_geodataframe(self, sdata_blobs: SpatialData):
94+
95+
blob = sdata_blobs
96+
blob.shapes["blobs_polygons"]["value"] = [1, 10, 1, 20, 1]
97+
blob.pl.render_shapes(
98+
elements="blobs_polygons",
99+
color="value",
100+
).pl.show()

0 commit comments

Comments
 (0)