Adding custom html divs and classes inside Bokeh application

Hi,

I have Bokeh application with multiple plots and live updates (add_periodic_callback).

Is it possible to generate custom html with multiple embedded plots (“components” function) for it? (I need to insert custom divs and classes).

All embedding examples I seen in Bokeh generate offline HTMLs. curdoc().add_root receives model and not explicite HTML.

How do I accomplish it?

Thanks!

Divs should be around plots, so using Div class is not an option

···

On Tuesday, November 15, 2016 at 6:07:03 PM UTC+2, Meir Tseitlin wrote:

Hi,

I have Bokeh application with multiple plots and live updates (add_periodic_callback).

Is it possible to generate custom html with multiple embedded plots (“components” function) for it? (I need to insert custom divs and classes).

All embedding examples I seen in Bokeh generate offline HTMLs. curdoc().add_root receives model and not explicite HTML.

How do I accomplish it?

Thanks!

Is it a good idea to use autoload_server multiple times for the same page?

Otherwise I don’t see any option to generate custom html with multiple plots

···

On Tuesday, November 15, 2016 at 6:08:00 PM UTC+2, Meir Tseitlin wrote:

Divs should be around plots, so using Div class is not an option

On Tuesday, November 15, 2016 at 6:07:03 PM UTC+2, Meir Tseitlin wrote:

Hi,

I have Bokeh application with multiple plots and live updates (add_periodic_callback).

Is it possible to generate custom html with multiple embedded plots (“components” function) for it? (I need to insert custom divs and classes).

All embedding examples I seen in Bokeh generate offline HTMLs. curdoc().add_root receives model and not explicite HTML.

How do I accomplish it?

Thanks!

Hi,

Bokeh applications can have jinja temples. See:

http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#directory-format

and

https://github.com/bokeh/bokeh/tree/master/examples/app/crossfilter

for an example.

Thanks,

Bryan

···

On Tue, Nov 15, 2016 at 12:24 PM, Meir Tseitlin [email protected] wrote:

Is it a good idea to use autoload_server multiple times for the same page?

Otherwise I don’t see any option to generate custom html with multiple plots

On Tuesday, November 15, 2016 at 6:08:00 PM UTC+2, Meir Tseitlin wrote:

Divs should be around plots, so using Div class is not an option

On Tuesday, November 15, 2016 at 6:07:03 PM UTC+2, Meir Tseitlin wrote:

Hi,

I have Bokeh application with multiple plots and live updates (add_periodic_callback).

Is it possible to generate custom html with multiple embedded plots (“components” function) for it? (I need to insert custom divs and classes).

All embedding examples I seen in Bokeh generate offline HTMLs. curdoc().add_root receives model and not explicite HTML.

How do I accomplish it?

Thanks!

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/5bab7300-dd59-4cb3-8d22-e9804d76f207%40continuum.io.

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

Yes we use Jinja templates, and we use CSS to customize dashboard created with gridplot. It is really hard and requires workarounds without custom classes (We did it with ugly JS hacks inserting missing classes)

One more problem is that we have multiple small panels, each one containing a plot with few associated buttons. It is currently not possible to wrap a plot with buttons into custom div (creating a reusable block), similar to what you do with widgetbox…

The workaround is to put plot and buttons into couple of row/column layouts, but this way gridplot stops unifying toolbars into single one…

(As far as I understood it is not possible to use server_autoload/components features together for creating multiple live update sub-plots)

The bottom line is that creating a complex dashboard containing multiple plots with Bokeh requires at least 2 missing features:

  1. Custom classes for ALL elements (including plots, widgets and etc.)
  2. Ability to wrap a group of plots with additional interactive controls into single Div, without compromising other functionality
···

On Wednesday, November 16, 2016 at 6:52:04 PM UTC+2, Bryan Van de ven wrote:

Hi,

Bokeh applications can have jinja temples. See:

http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#directory-format

and

https://github.com/bokeh/bokeh/tree/master/examples/app/crossfilter

for an example.

Thanks,

Bryan

On Tue, Nov 15, 2016 at 12:24 PM, Meir Tseitlin [email protected] wrote:

Is it a good idea to use autoload_server multiple times for the same page?

Otherwise I don’t see any option to generate custom html with multiple plots

On Tuesday, November 15, 2016 at 6:08:00 PM UTC+2, Meir Tseitlin wrote:

Divs should be around plots, so using Div class is not an option

On Tuesday, November 15, 2016 at 6:07:03 PM UTC+2, Meir Tseitlin wrote:

Hi,

I have Bokeh application with multiple plots and live updates (add_periodic_callback).

Is it possible to generate custom html with multiple embedded plots (“components” function) for it? (I need to insert custom divs and classes).

All embedding examples I seen in Bokeh generate offline HTMLs. curdoc().add_root receives model and not explicite HTML.

How do I accomplish it?

Thanks!

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/5bab7300-dd59-4cb3-8d22-e9804d76f207%40continuum.io.

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

2 tickets opened:

···

On Tuesday, November 15, 2016 at 6:07:03 PM UTC+2, Meir Tseitlin wrote:

Hi,

I have Bokeh application with multiple plots and live updates (add_periodic_callback).

Is it possible to generate custom html with multiple embedded plots (“components” function) for it? (I need to insert custom divs and classes).

All embedding examples I seen in Bokeh generate offline HTMLs. curdoc().add_root receives model and not explicite HTML.

How do I accomplish it?

Thanks!

Example demonstrating how to add custom classes: Adding custom HTML classes to Bokeh layouts by cloud-rocket · Pull Request #5481 · bokeh/bokeh · GitHub

Enjoy

···

On Tuesday, November 15, 2016 at 6:07:03 PM UTC+2, Meir Tseitlin wrote:

Hi,

I have Bokeh application with multiple plots and live updates (add_periodic_callback).

Is it possible to generate custom html with multiple embedded plots (“components” function) for it? (I need to insert custom divs and classes).

All embedding examples I seen in Bokeh generate offline HTMLs. curdoc().add_root receives model and not explicite HTML.

How do I accomplish it?

Thanks!