Skip to content
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

Merged
merged 4 commits into from Oct 10, 2018

Conversation

Projects
None yet
2 participants
@philippjfr
Copy link
Contributor

philippjfr commented Oct 10, 2018

This PR allows providing an explicit colormapping for non-categorical data.

  • Closes #3033
  • Adds unit test
@@ -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'

This comment has been minimized.

@jlstevens

jlstevens Oct 10, 2018

Contributor

Looks a little hackish?

This comment has been minimized.

@philippjfr

philippjfr Oct 10, 2018

Author Contributor

Does it? In what way? I've used this approach throughout.

This comment has been minimized.

@philippjfr

philippjfr Oct 10, 2018

Author Contributor

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?

This comment has been minimized.

@jlstevens

jlstevens Oct 10, 2018

Contributor

It might be worth coming up with a longer string to make clashes with user columns more unlikely.

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Oct 10, 2018

Looks good! I'll merge when the tests pass.

@philippjfr philippjfr force-pushed the explicit_categorical branch from 219e5be to 52cd6fa Oct 10, 2018

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Oct 10, 2018

Tests have passed now. Merging.

@jlstevens jlstevens merged commit d91c86f into master Oct 10, 2018

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.4%) to 88.92%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr added this to the v1.10.8 milestone Oct 25, 2018

@philippjfr philippjfr deleted the explicit_categorical branch Nov 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.