Skip to content

Commit 5d419f7

Browse files
committed
Merge branch 'fix-isinstance' of https://github.com/scverse/spatialdata-plot into fix-isinstance
2 parents 87d5792 + f28345d commit 5d419f7

13 files changed

+306
-115
lines changed

CHANGELOG.md

Lines changed: 65 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -8,172 +8,171 @@ and this project adheres to [Semantic Versioning][].
88
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
99
[semantic versioning]: https://semver.org/spec/v2.0.0.html
1010

11-
## incoming version
11+
## [0.2.9] - tbd
1212

1313
### Fixed
1414

15-
- Fix bug due to `sc.get.obs_df()` returning a different type (#393)
15+
- Transformations of Points and Shapes are now applied before rendering with datashader (#378)
16+
- Fix bug due to `sc.get.obs_df()` returning a different type (#393)
1617

1718
## [0.2.8] - 2024-11-26
1819

19-
- Support for `xarray.DataTree` (which moved from `datatree.DataTree`)
20+
### Changed
21+
22+
- Support for `xarray.DataTree` (which moved from `datatree.DataTree`) (#380)
2023

2124
## [0.2.7] - 2024-10-24
2225

2326
### Added
2427

25-
- The user can now specify `datashader_reduction` to control the rendering behaviour (#309)
26-
- Rendering outlines of shapes with datashader works now (#309)
28+
- The user can now specify `datashader_reduction` to control the rendering behaviour (#309)
29+
- Rendering outlines of shapes with datashader works now (#309)
2730

2831
### Fixed
2932

30-
- datashader now uses canvas size = image size which speeds up the rendering (#309)
31-
- datashader now uses the `linear` as interpolation method for colormaps instead of the default `eq_hist` to make it equivalent to matplotlib (#309)
32-
- point sizes of datashader now agree with matplotlib also when dpi != 100 (#309)
33-
- Giving a custom colormap when rendering a multiscale image now works (#586)
33+
- datashader now uses canvas size = image size which speeds up the rendering (#309)
34+
- datashader now uses the `linear` as interpolation method for colormaps instead of the default `eq_hist` to make it equivalent to matplotlib (#309)
35+
- point sizes of datashader now agree with matplotlib also when dpi != 100 (#309)
36+
- Giving a custom colormap when rendering a multiscale image now works (#586)
3437

3538
## [0.2.6] - 2024-09-04
3639

3740
### Changed
3841

39-
- Lowered RMSE-threshold for plot-based tests from 45 to 15 (#344)
40-
- When subsetting to `groups`, `NA` isn't automatically added to legend (#344)
41-
- When rendering a single image channel, a colorbar is now shown (#346)
42-
- Removed `percentiles_for_norm` parameter (#346)
43-
- Changed `norm` to no longer accept bools, only `mpl.colors.Normalise` or `None` (#346)
42+
- Lowered RMSE-threshold for plot-based tests from 45 to 15 (#344)
43+
- When subsetting to `groups`, `NA` isn't automatically added to legend (#344)
44+
- When rendering a single image channel, a colorbar is now shown (#346)
45+
- Removed `percentiles_for_norm` parameter (#346)
46+
- Changed `norm` to no longer accept bools, only `mpl.colors.Normalise` or `None` (#346)
4447

4548
### Fixed
4649

47-
- Filtering with `groups` now preserves original cmap (#344)
48-
- Non-selected `groups` are now not shown in `na_color` (#344)
49-
- Several issues associated with `norm` and `colorbar` (#346)
50+
- Filtering with `groups` now preserves original cmap (#344)
51+
- Non-selected `groups` are now not shown in `na_color` (#344)
52+
- Several issues associated with `norm` and `colorbar` (#346)
5053

5154
## [0.2.5] - 2024-08-23
5255

53-
### Added
54-
55-
-
56-
5756
### Changed
5857

59-
- Replaced `outline` parameter in `render_labels` with alpha-based logic (#323)
60-
- Lowered RMSE-threshold for plot-based tests from 60 to 45 (#323)
61-
- Removed `preprocessing` (.pp) accessor (#329)
58+
- Replaced `outline` parameter in `render_labels` with alpha-based logic (#323)
59+
- Lowered RMSE-threshold for plot-based tests from 60 to 45 (#323)
60+
- Removed `preprocessing` (.pp) accessor (#329)
6261

6362
### Fixed
6463

65-
- Minor fixes for several tests as a result of the threshold change (#323)
64+
- Minor fixes for several tests as a result of the threshold change (#323)
6665

6766
## [0.2.4] - 2024-08-07
6867

6968
### Added
7069

71-
- Added utils function for 0-transparent cmaps (#302)
70+
- Added utils function for 0-transparent cmaps (#302)
7271

7372
### Fixed
7473

75-
- Took RNG out of categorical label test (#306)
76-
- Performance bug when plotting shapes (#298)
77-
- scale parameter was ignored for single-scale images (#301)
78-
- Changes to support for dask-expr (#283)
79-
- Added error handling for non-existent elements (#305)
80-
- Specifying vmin and vmax properly clips image data (#307)
81-
- import bug `get_cmap()` (8fd969c)
74+
- Took RNG out of categorical label test (#306)
75+
- Performance bug when plotting shapes (#298)
76+
- scale parameter was ignored for single-scale images (#301)
77+
- Changes to support for dask-expr (#283)
78+
- Added error handling for non-existent elements (#305)
79+
- Specifying vmin and vmax properly clips image data (#307)
80+
- import bug `get_cmap()` (8fd969c)
8281

8382
## [0.2.3] - 2024-07-03
8483

8584
### Added
8685

87-
- Datashader support for points and shapes (#244)
86+
- Datashader support for points and shapes (#244)
8887

8988
### Changed
9089

91-
- All parameters are now provided for a single element (#272)
90+
- All parameters are now provided for a single element (#272)
9291

9392
### Fixed
9493

95-
- Fix color assignment for NaN values (#257)
96-
- Zorder of rendering now strictly follows the order of the render_x calls (#244)
94+
- Fix color assignment for NaN values (#257)
95+
- Zorder of rendering now strictly follows the order of the render_x calls (#244)
9796

9897
## [0.2.2] - 2024-05-02
9998

10099
### Fixed
101100

102-
- Fixed `fill_alpha` ignoring `alpha` channel from custom cmap (#236)
103-
- Fix channel str support (#221)
101+
- Fixed `fill_alpha` ignoring `alpha` channel from custom cmap (#236)
102+
- Fix channel str support (#221)
104103

105104
## [0.2.1] - 2024-03-26
106105

107106
### Minor
108107

109-
- Adjusted GitHub worklows
108+
- Adjusted GitHub worklows
110109

111110
## [0.2.0] - 2024-03-24
112111

113112
### Added
114113

115-
- Support for plotting multiple tables @melonora
114+
- Support for plotting multiple tables @melonora
116115

117116
### Fixed
118117

119-
- Several bugfixes, especially for colors and palettes @melonora
118+
- Several bugfixes, especially for colors and palettes @melonora
120119

121120
## [0.1.0] - 2024-01-17
122121

123122
### Added
124123

125-
- Multiscale image handling: user can specify a scale, else the best scale is selected automatically given the figure size and dpi (#164)
126-
- Large images are automatically rasterized to speed up performance (#164)
127-
- Added better error message for mismatch in cs and ax number (#185)
128-
- Beter test coverage for correct plotting of elements after transformation (#198)
129-
- Can now stack render commands (#190, #192)
130-
- The `color` argument in render_shapes/points now accepts actual colors as well (#199)
131-
- Input arguments are now evaulated for their types in basic.py (#199)
124+
- Multiscale image handling: user can specify a scale, else the best scale is selected automatically given the figure size and dpi (#164)
125+
- Large images are automatically rasterized to speed up performance (#164)
126+
- Added better error message for mismatch in cs and ax number (#185)
127+
- Beter test coverage for correct plotting of elements after transformation (#198)
128+
- Can now stack render commands (#190, #192)
129+
- The `color` argument in render_shapes/points now accepts actual colors as well (#199)
130+
- Input arguments are now evaulated for their types in basic.py (#199)
132131

133132
### Fixed
134133

135-
- Now dropping index when plotting shapes after spatial query (#177)
136-
- Points are now being correctly rotated (#198)
137-
- User can now pass Colormap objects to the cmap argument in render_images. When only one cmap is given for 3 channels, it is now applied to each channel (#188, #194)
134+
- Now dropping index when plotting shapes after spatial query (#177)
135+
- Points are now being correctly rotated (#198)
136+
- User can now pass Colormap objects to the cmap argument in render_images. When only one cmap is given for 3 channels, it is now applied to each channel (#188, #194)
138137

139138
## [0.0.6] - 2023-11-06
140139

141140
### Added
142141

143-
- Pushed `get_extent` functionality upstream to `spatialdata` (#162)
142+
- Pushed `get_extent` functionality upstream to `spatialdata` (#162)
144143

145144
## [0.0.5] - 2023-10-02
146145

147146
### Added
148147

149-
- Can now scale shapes (#152)
150-
- Can now plot columns from GeoDataFrame (#149)
148+
- Can now scale shapes (#152)
149+
- Can now plot columns from GeoDataFrame (#149)
151150

152151
### Fixed
153152

154-
- Multipolygons are now handled correctly (#93)
155-
- Legend order is now deterministic (#143)
156-
- Images no longer normalised by default (#150)
157-
- Filtering of shapes and points using the `groups` argument is now possible, coloring by palette and cmap arguments works for shapes and points (#153)
158-
- Colorbar no longer autoscales to [0, 1] (#155)
159-
- Plotting shapes after a spatial query is now possible (#163)
153+
- Multipolygons are now handled correctly (#93)
154+
- Legend order is now deterministic (#143)
155+
- Images no longer normalised by default (#150)
156+
- Filtering of shapes and points using the `groups` argument is now possible, coloring by palette and cmap arguments works for shapes and points (#153)
157+
- Colorbar no longer autoscales to [0, 1] (#155)
158+
- Plotting shapes after a spatial query is now possible (#163)
160159

161160
## [0.0.4] - 2023-08-11
162161

163162
### Fixed
164163

165-
- Multi-scale images/labels are now correctly substituted and the action is logged (#131).
166-
- Empty geometries among the shapes can be handeled (#133).
167-
- `outline_width` parameter in render_shapes is now a float that actually determines the line width (#139).
164+
- Multi-scale images/labels are now correctly substituted and the action is logged (#131).
165+
- Empty geometries among the shapes can be handeled (#133).
166+
- `outline_width` parameter in render_shapes is now a float that actually determines the line width (#139).
168167

169168
## [0.0.2] - 2023-06-25
170169

171170
### Fixed
172171

173-
- Multiple bugfixes of which I didn't keep track of.
172+
- Multiple bugfixes of which I didn't keep track of.
174173

175174
## [0.0.1] - 2023-04-04
176175

177176
### Added
178177

179-
- Initial release of `spatialdata-plot` with support for `images`, `labels`, `points` and `shapes`.
178+
- Initial release of `spatialdata-plot` with support for `images`, `labels`, `points` and `shapes`.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ SpatialData’s plotting capabilities allow to quickly visualise all contained m
2626

2727
For more information on the `spatialdata-plot` library, please refer to the [documentation](https://spatialdata.scverse.org/projects/plot/en/latest/index.html). In particular, the
2828

29-
- [API documentation][link-api].
30-
- [Example notebooks][link-notebooks] (section "Visiualizations")
29+
- [API documentation][link-api].
30+
- [Example notebooks][link-notebooks] (section "Visiualizations")
3131

3232
## Installation
3333

docs/contributing.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ Specify `vX.X.X` as a tag name and create a release. For more information, see [
9999

100100
Please write documentation for new or changed features and use-cases. This project uses [sphinx][] with the following features:
101101

102-
- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
103-
- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
104-
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
105-
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
106-
- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
102+
- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
103+
- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
104+
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
105+
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
106+
- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
107107

108108
See the [scanpy developer docs](https://scanpy.readthedocs.io/en/latest/dev/documentation.html) for more information
109109
on how to write documentation.
@@ -120,10 +120,10 @@ repository.
120120

121121
#### Hints
122122

123-
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
124-
if you do so can sphinx automatically create a link to the external documentation.
125-
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
126-
the `nitpick_ignore` list in `docs/conf.py`
123+
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
124+
if you do so can sphinx automatically create a link to the external documentation.
125+
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
126+
the `nitpick_ignore` list in `docs/conf.py`
127127

128128
#### Building the docs locally
129129

src/spatialdata_plot/pl/basic.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def render_shapes(
162162
palette: list[str] | str | None = None,
163163
na_color: ColorLike | None = "default",
164164
outline_width: float | int = 1.5,
165-
outline_color: str | list[float] = "#000000ff",
165+
outline_color: str | list[float] = "#000000",
166166
outline_alpha: float | int = 0.0,
167167
cmap: Colormap | str | None = None,
168168
norm: Normalize | None = None,
@@ -208,9 +208,11 @@ def render_shapes(
208208
won't be shown.
209209
outline_width : float | int, default 1.5
210210
Width of the border.
211-
outline_color : str | list[float], default "#000000ff"
212-
Color of the border. Can either be a named color ("red"), a hex representation ("#000000ff") or a list of
213-
floats that represent RGB/RGBA values (1.0, 0.0, 0.0, 1.0).
211+
outline_color : str | list[float], default "#000000"
212+
Color of the border. Can either be a named color ("red"), a hex representation ("#000000") or a list of
213+
floats that represent RGB/RGBA values (1.0, 0.0, 0.0, 1.0). If the hex representation includes alpha, e.g.
214+
"#000000ff", the last two positions are ignored, since the alpha of the outlines is solely controlled by
215+
`outline_alpha`.
214216
outline_alpha : float | int, default 0.0
215217
Alpha value for the outline of shapes. Invisible by default.
216218
cmap : Colormap | str | None, optional

0 commit comments

Comments
 (0)