output_file: using another template

Hey guys,

I’m producing some static html files for our volcano monitoring stuff, but I’d like to define some other template than file.html. How do I do that ?

Cheers,

Tom

Thomas,

Are you using 0.4.4? If so I will suggest trying a dev build (recently announced on the list, let me know if you more information on how to install) or waiting for 0.5 to be released in a few weeks at SciPy, if you can. (If this is not an option, let me know and I will help you with the old API.) Embedding bokeh plots has been made *much* simpler and easier and better documented. If you want to try out a dev build or wait for 0.5, there is a new bokeh.embed module, and it has a "file_html" function that will do what you want:

def file_html(plot_object, resources, title, template=FILE):
    ''' Return an HTML document that embeds a Bokeh plot.

    The data for the plot is stored directly in the returned HTML.

    Args:
        plot_object (PlotObject) : Bokeh object to render
            typically a Plot or PlotContext
        resources (Resources) : a resource configuration for BokehJS assets
        title (str) : a title for the HTML document ``<title>`` tags
        template (Template, optional) : HTML document template (default: FILE)
            A Jinja2 Template, see bokeh.templates.FILE for the required
            template parameters

    Returns:
        html : standalone HTML document with embedded plot

    '''

Additionally there are other ways to embed bokeh plots simply now:

  * embed.components: returns a script tag to load bokehjs and plot div you can put in your own templates however you want

  * embed.autoload_static: returns a single div you put in your doc/template wherever you want the plot to go, data is in sidecar js file, loads bokehjs automatically (from server, CDN, or filesystem) if necessary

  * embed.autoload_server: returns a single div you put in your doc/template wherever you want the plot to go, data is on bokeh-server, loads bokehjs automatically (from server, CDN, or filesystem) if necessary

There are some new examples that show how to use these in the latest GH, as well as sphinx documentation, and we will be adding even more examples and docs leading up to the release.

Let us know if we can help more!

Bryan

···

On Jun 22, 2014, at 2:23 AM, Thomas Lecocq <[email protected]> wrote:

Hey guys,

I'm producing some static html files for our volcano monitoring stuff, but I'd like to define some other template than file.html. How do I do that ?

Cheers,

Tom

--
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/113bd92a-d735-4a67-8e29-88306d329b36%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

About the new examples, you can see it here: https://github.com/ContinuumIO/bokeh/tree/master/examples/embed

Any questions, let us know…

Cheers.

···

On Sun, Jun 22, 2014 at 2:28 PM, Bryan Van de Ven [email protected] wrote:

Thomas,

Are you using 0.4.4? If so I will suggest trying a dev build (recently announced on the list, let me know if you more information on how to install) or waiting for 0.5 to be released in a few weeks at SciPy, if you can. (If this is not an option, let me know and I will help you with the old API.) Embedding bokeh plots has been made much simpler and easier and better documented. If you want to try out a dev build or wait for 0.5, there is a new bokeh.embed module, and it has a “file_html” function that will do what you want:

def file_html(plot_object, resources, title, template=FILE):

''' Return an HTML document that embeds a Bokeh plot.



The data for the plot is stored directly in the returned HTML.



Args:

    plot_object (PlotObject) : Bokeh object to render

        typically a Plot or PlotContext

    resources (Resources) : a resource configuration for BokehJS assets

    title (str) : a title for the HTML document ``<title>`` tags

    template (Template, optional) : HTML document template (default: FILE)

        A Jinja2 Template, see bokeh.templates.FILE for the required

        template parameters



Returns:

    html : standalone HTML document with embedded plot



'''

Additionally there are other ways to embed bokeh plots simply now:

    * embed.components: returns a script tag to load bokehjs and plot div you can put in your own templates however you want



    * embed.autoload_static: returns a single div you put in your doc/template wherever you want the plot to go, data is in sidecar js file, loads bokehjs automatically (from server, CDN, or filesystem) if necessary




    * embed.autoload_server: returns a single div you put in your doc/template wherever you want the plot to go, data is on bokeh-server, loads bokehjs automatically (from server, CDN, or filesystem) if necessary

There are some new examples that show how to use these in the latest GH, as well as sphinx documentation, and we will be adding even more examples and docs leading up to the release.

Let us know if we can help more!

Bryan

On Jun 22, 2014, at 2:23 AM, Thomas Lecocq [email protected] wrote:

Hey guys,

I’m producing some static html files for our volcano monitoring stuff, but I’d like to define some other template than file.html. How do I do that ?

Cheers,

Tom

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/113bd92a-d735-4a67-8e29-88306d329b36%40continuum.io.

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

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/AFFBD100-40E2-41F4-9101-A5C5D30C29E5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hey,

Thanks ! I’ll try to get the dev build and get the embed working !

Thanks

Tom

···

Le dimanche 22 juin 2014 23:52:54 UTC+2, Damian Avila a écrit :

About the new examples, you can see it here: https://github.com/ContinuumIO/bokeh/tree/master/examples/embed

Any questions, let us know…

Cheers.

On Sun, Jun 22, 2014 at 2:28 PM, Bryan Van de Ven [email protected] wrote:

Thomas,

Are you using 0.4.4? If so I will suggest trying a dev build (recently announced on the list, let me know if you more information on how to install) or waiting for 0.5 to be released in a few weeks at SciPy, if you can. (If this is not an option, let me know and I will help you with the old API.) Embedding bokeh plots has been made much simpler and easier and better documented. If you want to try out a dev build or wait for 0.5, there is a new bokeh.embed module, and it has a “file_html” function that will do what you want:

def file_html(plot_object, resources, title, template=FILE):

''' Return an HTML document that embeds a Bokeh plot.



The data for the plot is stored directly in the returned HTML.



Args:

    plot_object (PlotObject) : Bokeh object to render

        typically a Plot or PlotContext

    resources (Resources) : a resource configuration for BokehJS assets

    title (str) : a title for the HTML document ``<title>`` tags

    template (Template, optional) : HTML document template (default: FILE)

        A Jinja2 Template, see bokeh.templates.FILE for the required

        template parameters



Returns:

    html : standalone HTML document with embedded plot



'''

Additionally there are other ways to embed bokeh plots simply now:

    * embed.components: returns a script tag to load bokehjs and plot div you can put in your own templates however you want



    * embed.autoload_static: returns a single div you put in your doc/template wherever you want the plot to go, data is in sidecar js file, loads bokehjs automatically (from server, CDN, or filesystem) if necessary




    * embed.autoload_server: returns a single div you put in your doc/template wherever you want the plot to go, data is on bokeh-server, loads bokehjs automatically (from server, CDN, or filesystem) if necessary

There are some new examples that show how to use these in the latest GH, as well as sphinx documentation, and we will be adding even more examples and docs leading up to the release.

Let us know if we can help more!

Bryan

On Jun 22, 2014, at 2:23 AM, Thomas Lecocq [email protected] wrote:

Hey guys,

I’m producing some static html files for our volcano monitoring stuff, but I’d like to define some other template than file.html. How do I do that ?

Cheers,

Tom

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/113bd92a-d735-4a67-8e29-88306d329b36%40continuum.io.

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

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/AFFBD100-40E2-41F4-9101-A5C5D30C29E5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.