Skip to content

Conversation

Sonja-Stockhaus
Copy link
Collaborator

Another feature from squidpy that we want to support here: the new shape argument in render_shapes() can be set to "circle", "hex" or "square" so that the shapes are converted to and redered as circles/hexagons/squares. If the argument is set to None (default), the shapes are rendered as they are.

First version of the conversion method (@timtreis up to discussion):

  • from circle to square/hex: the new shape lies exactly within the original circle
  • from (multi)polygon to circle: the convex hull is computed, then we take the center as the mean of the resulting points and choose the radius as the maximum of the distances between the center and every point on the convex hull
  • from (multi)polygon to square/hex: chain of (multi)polygon -> circle -> square/hex

@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2025

Codecov Report

❌ Patch coverage is 76.41509% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.40%. Comparing base (ce5a103) to head (e6e1ae2).

Files with missing lines Patch % Lines
src/spatialdata_plot/pl/utils.py 73.95% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #474      +/-   ##
==========================================
- Coverage   83.80%   83.40%   -0.41%     
==========================================
  Files           8        8              
  Lines        1976     2079     +103     
==========================================
+ Hits         1656     1734      +78     
- Misses        320      345      +25     
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/basic.py 89.32% <100.00%> (ø)
src/spatialdata_plot/pl/render.py 92.61% <100.00%> (+0.10%) ⬆️
src/spatialdata_plot/pl/render_params.py 89.20% <100.00%> (+0.06%) ⬆️
src/spatialdata_plot/pl/utils.py 77.97% <73.95%> (-0.35%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sonja-Stockhaus Sonja-Stockhaus marked this pull request as ready for review July 3, 2025 15:10
@Sonja-Stockhaus Sonja-Stockhaus requested a review from timtreis July 3, 2025 15:11
@timtreis timtreis merged commit a9cf363 into main Oct 20, 2025
3 of 4 checks passed
@timtreis timtreis added shapes 🫧 Anything related to Shapes release-added labels Oct 20, 2025
@timtreis timtreis deleted the feature/render_shapes_add_shape_arg branch October 20, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-added shapes 🫧 Anything related to Shapes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants