new components method

I’ve seen some talk on this group and on Github about a new “components” method coming out in 0.9.1 that will make layout less dependent upon HBox/VBox. I’d like to learn more - is there any documentation/explanation/example of what that will look like yet?

An example of it in action is in this PR: https://github.com/bokeh/bokeh/pull/2468

Each of the dictionary values is an actual plot object and then we pass them into a template for rendering

spectrogram_plots = {
    'freq_slider': freq_slider,  # slider
    'gain_slider': gain_slider,  # slider
    'spec': spec,  # image
    'spectrum': spectrum,  # line
    'signal': signal,  # line
    'equalizer': eq  # radial
}

script, divs = components(spectrogram_plots)

     html = flask.render_template("spectrogram.html", bokeh=bokeh, script=script, divs=divs)

We use the divs throughout the html template like this: {{ divs.freq_slider|safe }} etc.

You can see the full template here: https://github.com/birdsarah/bokeh/blob/spectrogram/examples/embed/spectrogram/templates/spectrogram.html

···

On Wed, Jul 1, 2015 at 3:24 PM, Schaun Wheeler [email protected] wrote:

I’ve seen some talk on this group and on Github about a new “components” method coming out in 0.9.1 that will make layout less dependent upon HBox/VBox. I’d like to learn more - is there any documentation/explanation/example of what that will look like yet?


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/d809d125-4386-467f-b63c-789b9dd358a8%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.