Embedding layouts with Flask

In Flask: Is there a “simple” example on how to embed a WHOLE layout using script and div?

While I can easily embed single plots

script, div = components({
                            'plot_1': plot_1.figure,
                            'plot_2': plot_2.figure,
                            'plot_3': plot_3.figure,
                          })


html = html_template.render(js_resources=js_resources,
                       css_resources=css_resources,
                       plot_script=script,
                       plot_div=div)

I cannot do the same with a whole layout comprehending plot_1, plot_2 and plot_3.
Is this possible?

Hi,

"components" is not only limited to plots. You can pass in any layout-about model, e.g rows, columns, tabs, etc. the same as you have done with plots.

Please not that bokeh-widgets.js is a separately distributed JS file. You will need to remember to include it in your js resources.

Thanks,

Bryan

···

On Aug 11, 2017, at 04:38, Alessandro Pocaterra <[email protected]> wrote:

In Flask: Is there a "simple" example on how to embed a WHOLE layout using script and div?

While I can easily embed single plots

script, div = components({
                            'plot_1': plot_1.figure,
                            'plot_2': plot_2.figure,
                            'plot_3': plot_3.figure,
                          })

html = html_template.render(js_resources=js_resources,
                       css_resources=css_resources,
                       plot_script=script,
                       plot_div=div)

I cannot do the same with a whole layout comprehending plot_1, plot_2 and plot_3.
Is this possible?

--
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/7a4eb5c5-8055-45a1-bfa4-2ef63aa69b85%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

It works, Bryan. I don’t know what I did that it didn’t workbefore…
Thank you!

···

Il giorno venerdì 11 agosto 2017 15:06:10 UTC+2, Bryan Van de ven ha scritto:

Hi,

“components” is not only limited to plots. You can pass in any layout-about model, e.g rows, columns, tabs, etc. the same as you have done with plots.

Please not that bokeh-widgets.js is a separately distributed JS file. You will need to remember to include it in your js resources.

Thanks,

Bryan

On Aug 11, 2017, at 04:38, Alessandro Pocaterra [email protected] wrote:

In Flask: Is there a “simple” example on how to embed a WHOLE layout using script and div?

While I can easily embed single plots

script, div = components({

                        'plot_1': plot_1.figure,
                        'plot_2': plot_2.figure,
                        'plot_3': plot_3.figure,
                      })

html = html_template.render(js_resources=js_resources,

                   css_resources=css_resources,
                   plot_script=script,
                   plot_div=div)

I cannot do the same with a whole layout comprehending plot_1, plot_2 and plot_3.

Is this possible?


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/7a4eb5c5-8055-45a1-bfa4-2ef63aa69b85%40continuum.io.

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