Skip to content

fix: let the explorer carry a categorical color key - #1752

Open
ghostiee-11 wants to merge 1 commit into
holoviz:mainfrom
ghostiee-11:fix/explorer-categorical-color-key
Open

fix: let the explorer carry a categorical color key#1752
ghostiee-11 wants to merge 1 commit into
holoviz:mainfrom
ghostiee-11:fix/explorer-categorical-color-key

Conversation

@ghostiee-11

Copy link
Copy Markdown

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.

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.
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.

1 participant