Access the "map" of mappers

Is there a way to access the range of values associated with each color of a color mapper?

For example with a LinearColorMapper, we give a palette and a high/low values. Can I retrieve the range of values associated with each color without having to do the mapping on the side myself?

Something like

mapper = LinearColorMapper(palette=[‘red’,‘blue’],high=100,low=0)
print mapper.map()
{“red”:[0,49],“blue”:[50,100]}

``

Hi,

No mapping like that exists. The linear mappers scale the data between high and low and use the result to index into the palette, and even that only on the JavaScript side. It would be possible to create a mapper that had more flexible binning via an explicitly defined mapping, but for now you'd have to make a custom extension to do it:

  https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

···

On Mar 6, 2018, at 12:35, Sébastien Roche <[email protected]> wrote:

Is there a way to access the range of values associated with each color of a color mapper?

For example with a LinearColorMapper, we give a palette and a high/low values. Can I retrieve the range of values associated with each color without having to do the mapping on the side myself?

Something like

> mapper = LinearColorMapper(palette=['red','blue'],high=100,low=0)
> print mapper.map()
{"red":[0,49],"blue":[50,100]}

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/0c593c56-a56f-43f7-bcde-d47a4726e2bb%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.