how to create a bokeh colormapper in javascript?

Asked over in stackoverflow here:

I would like to do the equivalent of the following Python in stand-alone BokehJS


color_mapper = bokeh.models.mappers.LogColorMapper('Viridis256',low=vmin,high=vmax)

How do I do it? Where are the color mappers located in the javascript CDN files?
They don’t seem to be here, for example:


https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.7.js

and not here either:


https://cdn.pydata.org/bokeh/release/bokeh-api-0.12.7.js

I

am trying to follow examples like these:


https://bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html#minimal-complete-example

Thanks in advance – Aaron Watters

– Aaron Watters

Hi Aaron,

I’ve answered on SO, but I’ll copy the answer here as well.

Models are located inside the main JS file (at least, for Bokeh 0.12.9): https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.js

You can get LogColorMapper in your code by using:

Bokeh.require('models/mappers/log_color_mapper').LogColorMapper

Regards,

Eugene

···

On Friday, October 13, 2017 at 3:25:48 AM UTC+7, Aaron Watters wrote:

Asked over in stackoverflow here:

https://stackoverflow.com/questions/46717726/how-to-create-a-bokeh-colormapper-in-javascript

I would like to do the equivalent of the following Python in stand-alone BokehJS


color_mapper = bokeh.models.mappers.LogColorMapper('Viridis256',low=vmin,high=vmax)

How do I do it? Where are the color mappers located in the javascript CDN files?
They don’t seem to be here, for example:


https://[cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.7.js](http://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.7.js)

and not here either:


https://[cdn.pydata.org/bokeh/release/bokeh-api-0.12.7.js](http://cdn.pydata.org/bokeh/release/bokeh-api-0.12.7.js)

I

am trying to follow examples like these:


https://[bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html#minimal-complete-example](http://bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html#minimal-complete-example)

Thanks in advance – Aaron Watters

– Aaron Watters

Hi,

···

On Fri, Oct 13, 2017 at 9:50 AM, Eugene Pakhomov [email protected] wrote:

Hi Aaron,

I’ve answered on SO, but I’ll copy the answer here as well.

Models are located inside the main JS file (at least, for Bokeh 0.12.9): https://cdn.pydata.org/bokeh/release/bokeh-0.12.9.js

You can get LogColorMapper in your code by using:

Bokeh.require('models/mappers/log_color_mapper').LogColorMapper

or even better Bokeh.Models("LogColorMapper").

Mateusz

Regards,

Eugene

On Friday, October 13, 2017 at 3:25:48 AM UTC+7, Aaron Watters wrote:

Asked over in stackoverflow here:

https://stackoverflow.com/questions/46717726/how-to-create-a-bokeh-colormapper-in-javascript

I would like to do the equivalent of the following Python in stand-alone BokehJS


color_mapper = bokeh.models.mappers.LogColorMapper('Viridis256',low=vmin,high=vmax)

How do I do it? Where are the color mappers located in the javascript CDN files?
They don’t seem to be here, for example:


https://[cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.7.js](http://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.7.js)

and not here either:


https://[cdn.pydata.org/bokeh/release/bokeh-api-0.12.7.js](http://cdn.pydata.org/bokeh/release/bokeh-api-0.12.7.js)

I

am trying to follow examples like these:


https://[bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html#minimal-complete-example](http://bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html#minimal-complete-example)

Thanks in advance – Aaron Watters

– Aaron Watters

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/55b4f071-eba6-485a-901f-2abc7d990638%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.