[274] Implement new color_discrete_map param#348
Merged
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/