Skip to content

Commit 71d4f3e

Browse files
melonorapre-commit-ci[bot]LucaMarconato
authored
allow for plotting using specific table (#217) (#220)
* allow for plotting using specific table (#217) * allow for plotting using specific table * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Change into get with default return * fix issues with pp * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * ensure instance key coercable to int dtype * add table keys import * allow feature branches tests * remove table key getters * extract into function * add docstring * don't create unnecessary anndata * allow for label color without specified table * refactor show param validations * refactor show param validations * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * big refactor * remove unused render_params.layer * remove redundant code * refactor to mapping * allow later creation of mapping * reimplement color label * fix unused arguments * change points shapes logic * unfixed full implementation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix tests * fix tests * remove duplicate checks * implement nested list groups palette * fix tests * fix or mistake * add dummy test * Change to warning * partial fix mypy * add function type hints --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * silence table deprecation warning * fix tests * silence deprecations and other warnings * Fix incorrect conditional * refactor wanted_elements * remove unwanted extend * further refactor * using getattr * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * change palette * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove color if no table * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed! (#222) * fixed! * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Partial fixes mypy (#224) * fix mypy * shut more mypy up * some mypy --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: LucaMarconato <[email protected]>
1 parent 602c27a commit 71d4f3e

File tree

10 files changed

+1068
-788
lines changed

10 files changed

+1068
-788
lines changed

src/spatialdata_plot/pl/basic.py

Lines changed: 192 additions & 514 deletions
Large diffs are not rendered by default.

src/spatialdata_plot/pl/render.py

Lines changed: 144 additions & 155 deletions
Large diffs are not rendered by default.

src/spatialdata_plot/pl/render_params.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ class ShapesRenderParams:
7575
col_for_color: str | None = None
7676
groups: str | Sequence[str] | None = None
7777
contour_px: int | None = None
78-
layer: str | None = None
7978
palette: ListedColormap | str | None = None
8079
outline_alpha: float = 1.0
8180
fill_alpha: float = 0.3
8281
scale: float = 1.0
8382
transfunc: Callable[[float], float] | None = None
83+
element_table_mapping: dict[str, set[str] | str] | str | list[str] | None = None
8484

8585

8686
@dataclass
@@ -96,6 +96,7 @@ class PointsRenderParams:
9696
alpha: float = 1.0
9797
size: float = 1.0
9898
transfunc: Callable[[float], float] | None = None
99+
element_table_mapping: dict[str, set[str] | str] | str | list[str] | None = None
99100

100101

101102
@dataclass
@@ -117,13 +118,13 @@ class LabelsRenderParams:
117118

118119
cmap_params: CmapParams
119120
elements: str | Sequence[str] | None = None
120-
color: str | None = None
121+
color: list[str | None] | str | None = None
121122
groups: str | Sequence[str] | None = None
122123
contour_px: int | None = None
123124
outline: bool = False
124-
layer: str | None = None
125125
palette: ListedColormap | str | None = None
126126
outline_alpha: float = 1.0
127127
fill_alpha: float = 0.4
128128
transfunc: Callable[[float], float] | None = None
129129
scale: str | list[str] | None = None
130+
element_table_mapping: dict[str, set[str] | str] | str | list[str] | None = None

0 commit comments

Comments
 (0)