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

Bokeh colorbars #861

Merged
merged 21 commits into from Sep 14, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+13 −10
Diff settings

Always

Just for now

Handled updating of colormapping ranges

  • Loading branch information...
Philipp Rudiger Philipp Rudiger
Philipp Rudiger authored and Philipp Rudiger committed Sep 14, 2016
commit f2884e1f103c609370954d437ac6c3f90c36d6e7
@@ -710,6 +710,19 @@ def _init_glyph(self, plot, mapping, properties):
return ret


def _update_glyph(self, glyph, properties, mapping):
allowed_properties = glyph.properties()
cmappers = [v.get('transform') for v in mapping.values()
if isinstance(v, dict)]
cmappers.append(properties.pop('color_mapper', None))
for cm in cmappers:
if cm:
self.handles['color_mapper'].low = cm.low
self.handles['color_mapper'].high = cm.high
merged = dict(properties, **mapping)
glyph.set(**{k: v for k, v in merged.items()
if k in allowed_properties})


class LegendPlot(ElementPlot):

@@ -53,16 +53,6 @@ def _glyph_properties(self, plot, element, source, ranges):
return properties

This comment has been minimized.

Copy link
@jlstevens

jlstevens Sep 14, 2016

Contributor

I'm just wondering why in this case self._get_colormapper is used to add the color mapper to the properties (in _glyph_properties) but is added to the data in get_data everywhere else...

This comment has been minimized.

Copy link
@philippjfr

philippjfr Sep 14, 2016

Author Contributor

The image glyph accepts a colormapper directly while in other cases it is used as a transform that maps color to a particular column.

This comment has been minimized.

Copy link
@jlstevens

jlstevens Sep 14, 2016

Contributor

Thanks for the explanation!



def _update_glyph(self, glyph, properties, mapping):
allowed_properties = glyph.properties()
cmap = properties.pop('color_mapper', None)
if cmap:
glyph.color_mapper.low = cmap.low
glyph.color_mapper.high = cmap.high
merged = dict(properties, **mapping)
glyph.set(**{k: v for k, v in merged.items()
if k in allowed_properties})


class ImagePlot(RasterPlot):

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.