Skip to content

Archive Trac docs plot bokeh

madscatt edited this page Jun 20, 2026 · 1 revision

Docs Plot Bokeh

Legacy Trac archive page imported from docs_plot_bokeh. Source: https://genapp.rocks/wiki/wiki/docs_plot_bokeh. Review age, links, and examples before treating as current.

Bokeh plotting

  • standard plotting

  • Bokeh

    • Bokeh plotting available alpha revision 1353
    • Currently only targets html5 language
    • use standard plotting for cross target language support
    • Bokeh is python code
  • Generate plots using Bokeh 0.12.7, 0.12.10, 0.12.11, 0.12.16, 1.0.1, 1.0.2, 1.3.4, 1.4.0

    • other versions can be added upon request
    • N.B. Bokeh plotting is version dependent, so you will need to specify the version in directives.json
    • e.g. :
    ,"bokeh" : {
        "version" : "0.12.10"
    }
  • Bokeh embedding notes
  • In python, use {{{script, div = components(plot)}}}
  • return the value of script as the json value of the id associated with a "bokeh" field type
    • e.g. in the module json
    ,"fields"   : [
...
        {
            "role"       : "output"
            ,"id"        : "mybokehoutputid"
            ,"label"     : "my optional label"
            ,"type"      : "bokeh"
        }
...
  • and in your python code
from bokeh.plotting import figure
from bokeh.embed import components

plot = figure()
plot.circle([1,2], [3,4])

script, div = components(plot)
  • and finally return the script in the output json under the id of the bokeh field

  • Caveats

    • Bokeh multiple plotting generated structures will not show labels
    • workaround: use multiple module fields

Clone this wiki locally