Skip to content

Fix datashader ignoring na_color transparency for continuous data#566

Merged
timtreis merged 2 commits intomainfrom
fix/issue-565-datashader-na-color
Mar 30, 2026
Merged

Fix datashader ignoring na_color transparency for continuous data#566
timtreis merged 2 commits intomainfrom
fix/issue-565-datashader-na-color

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented Mar 30, 2026

Summary

  • When na_color=None (fully transparent), the datashader continuous path for shapes and points now skips the NaN overlay entirely instead of rendering opaque grey shapes.
  • Root cause: _hex_no_alpha() stripped the alpha channel from na_color before passing to ds.tf.shade(), turning transparent "#d3d3d300" into opaque "#d3d3d3".

#565)

When na_color is fully transparent (alpha="00"), skip the NaN overlay
entirely in the datashader continuous path for both shapes and points.
Previously, _hex_no_alpha stripped the alpha channel before passing to
ds.tf.shade, turning transparent "#d3d3d300" into opaque "#d3d3d3".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.10%. Comparing base (6b2c484) to head (7d2af5a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #566      +/-   ##
==========================================
+ Coverage   74.06%   75.10%   +1.04%     
==========================================
  Files          10       10              
  Lines        2826     2876      +50     
  Branches      651      664      +13     
==========================================
+ Hits         2093     2160      +67     
+ Misses        457      431      -26     
- Partials      276      285       +9     
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/render.py 86.12% <100.00%> (+3.27%) ⬆️
src/spatialdata_plot/pl/render_params.py 86.36% <100.00%> (+0.06%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add is_fully_transparent() method to Color class and use it across all
5 call sites. Parametrize duplicate shapes tests and tighten docstrings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timtreis timtreis merged commit 55d59b7 into main Mar 30, 2026
8 checks passed
@timtreis timtreis deleted the fix/issue-565-datashader-na-color branch March 30, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants