fix: let the explorer carry a categorical color key - #1752
Open
ghostiee-11 wants to merge 1 commit into
Open
Conversation
The explorer could not express a per-category color mapping. cmap is a Selector over colormap names, so the dict that hvPlot accepts everywhere else raised here. Explicit colors passed as cmap are now redirected to a new color_key control, which the converter takes directly; cmap is dropped from the emitted kwargs when it is set, since the converter accepts at most one of the two. Separately, coloring by a category left the linear default ramp in place, so datashaded by-plots rendered every category as a near identical shade of one hue. Select the categorical palette when a by column is being aggregated per pixel. That branch also never worked for a categorical color column, because DEFAULT_CMAPS['categorical'] is a bare list the cmap Selector cannot hold; it now uses the palette name.
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.
The explorer could not express a per-category color mapping, since cmap is a Selector over colormap names and rejects the dict that hvPlot accepts everywhere else. This adds a color_key control, redirects explicit colors passed as cmap to it, and selects the categorical palette when a by column is being datashaded, which previously left the linear ramp in place and rendered every category as a near identical shade of one hue.