Skip to content

feat: add support for single-color colormaps with constant mapping behavior - #140

Merged
tlambert03 merged 3 commits into
pyapp-kit:mainfrom
tlambert03:single-color
Nov 5, 2026
Merged

tlambert03 merged 3 commits into
pyapp-kit:mainfrom
tlambert03:single-color

Conversation

@tlambert03

Copy link
Copy Markdown
Member

closes #139

hey @aafkegros, here's one possible fix to #139. Let me know how this would work for you. And again, still happy to iterate on this

@codecov

codecov Bot commented May 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.91%. Comparing base (57e3a13) to head (4da85b6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #140   +/-   ##
=======================================
  Coverage   95.90%   95.91%           
=======================================
  Files         168      168           
  Lines        2273     2278    +5     
=======================================
+ Hits         2180     2185    +5     
  Misses         93       93           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@aafkegros

Copy link
Copy Markdown
Contributor

I think this is a valid solution to solve that the single-valued colormap did not return a constant-valued map. However, l do think it's introducing more exceptions to the Colormap model than allowing single-valued colormaps would.

Given that the interpolation at calling behaviour would also work for a single valued color, and that would avoid inserting a new value and throwing away the color stop.

I can open a PR for my envisioned solution, but it will take a bit of time as I'm a bit busy in other tasks 😅

@tlambert03

Copy link
Copy Markdown
Member Author

Sure, I'd be happy to see it. No hurry (as long as you're not in a hurry for a fix! 😃)

@tlambert03

Copy link
Copy Markdown
Member Author

got @aafkegros's sign off on this :)

@tlambert03
tlambert03 merged commit 550c6c7 into pyapp-kit:main Nov 5, 2026
25 checks passed
@tlambert03
tlambert03 deleted the single-color branch November 5, 2026 10:52
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.

Single-color colormaps add an extra value

2 participants