-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Allow using explicit colormapping on non-categorical data #3071
Conversation
holoviews/plotting/bokeh/element.py
Outdated
@@ -1189,6 +1192,11 @@ def _get_color_data(self, element, ranges, style, name='color', factors=None, co | |||
|
|||
mapper = self._get_colormapper(cdim, element, ranges, style, | |||
factors, colors) | |||
if not factors and isinstance(mapper, CategoricalColorMapper): | |||
field += '_str' |
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.
Looks a little hackish?
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.
Does it? In what way? I've used this approach throughout.
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.
To be clearer, what's your suggestion for not overriding the original column and making it clear the column has been "categorized" by casting values to strings?
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.
It might be worth coming up with a longer string to make clashes with user columns more unlikely.
Looks good! I'll merge when the tests pass. |
219e5be
to
52cd6fa
Compare
Tests have passed now. Merging. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR allows providing an explicit colormapping for non-categorical data.