-
-
Notifications
You must be signed in to change notification settings - Fork 9
[274] Implement new color_discrete_map param
#348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Tomas Pereira de Vasconcelos <tomasvasconcelos1@gmail.com>
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #348 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 648 659 +11
Branches 82 85 +3
=========================================
+ Hits 648 659 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 17 out of 19 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Closes #274
Relates to #315
This pull request introduces a new
color_discrete_mapparameter to theridgeplotAPI, allowing users to directly map trace labels to specific colors for more precise control over ridgeline coloring. The changes include updates to documentation and examples to demonstrate this feature, internal refactoring to support the new parameter, and improvements to type utilities for better collection handling.New Feature: Discrete Color Mapping
color_discrete_mapparameter to theridgeplotfunction, enabling users to specify exact colors for traces by label. This is now documented and demonstrated in both the API and usage examples. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Documentation and Example Updates
color_discrete_mapparameter for customizing trace colors, replacing older approaches usingcolorscaleandcolormode. [1] [2] [3] [4] [5] [6] [7]Internal Refactoring for Coloring Logic
_figure_factory.pyand trace classes to use a booleanfillgradientin the coloring context, and to applycolor_discrete_mapwhen provided, bypassing the default colorscale logic. [1] [2] [3] [4] [5] [6]Type Utilities and Validation Improvements
is_collection_l2andis_densitiesin_types.py, and refactorednormalise_row_attrsin_utils.pyto accept both shallow and deep collections, improving robustness and flexibility in input validation. [1] [2] [3] [4] [5] [6] [7]Miscellaneous Improvements
test_helpers.pyand layout changes in documentation examples for consistency. [1] [2] [3]These changes collectively make the ridgeplot API more flexible and user-friendly, especially for users who want exact control over trace coloring.
📚 Documentation preview 📚: https://ridgeplot--348.org.readthedocs.build/en/348/