bokeh html (or json) generates empty plot

Hi,

I followed the “bokeh html foo.py” example in user guide, but the generated html is displayed as a blank page.

foo.py:

from bokeh.plotting import figure

p = figure()
p.line(x=[1, 2, 3], y=[4,6,2])

If I tried bokeh json foo.py, the generated json is: {“roots”:{“references”:,“root_ids”:},“title”:“Bokeh Application”,“version”:“0.12.3”} which is an empty plot.

I was wondering if I’m missing some steps, or is this behavior expected?

Regards,

Verdi

The example seems to be missing a couple of lines, that I would expect. Can you open a Github issue regarding this? For reference, the full code should be something like:

  from bokeh.io import curdoc
  from bokeh.plotting import figure

  p = figure()
  p.line(x=[1, 2, 3], y=[4,6,2])

  curdoc().add_root(p)

IIRC we originally had some "automagic" in mind, but ultimately decided to go down a slightly more explicit route. Those docs apparently did not get updated.

Thanks,

Bryan

···

On Dec 29, 2016, at 12:23 PM, [email protected] wrote:

Hi,

I followed the "bokeh html foo.py" example in user guide, but the generated html is displayed as a blank page.

foo.py:
from bokeh.plotting import figure

p = figure()
p.line(x=[1, 2, 3], y=[4,6,2])

If I tried bokeh json foo.py, the generated json is: {"roots":{"references":,"root_ids":},"title":"Bokeh Application","version":"0.12.3"} which is an empty plot.

I was wondering if I'm missing some steps, or is this behavior expected?

Regards,
Verdi

--
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/9db3cdad-e05d-4f5f-9a7b-555876bf1625%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks Bryan! Adding those two lines make the example works. Will also open a github request.

Regards,

Verdi

···

On Friday, December 30, 2016 at 2:34:26 AM UTC+8, Bryan Van de ven wrote:

The example seems to be missing a couple of lines, that I would expect. Can you open a Github issue regarding this? For reference, the full code should be something like:

    from [bokeh.io](http://bokeh.io) import curdoc

    from bokeh.plotting import figure



    p = figure()

    p.line(x=[1, 2, 3], y=[4,6,2])



    curdoc().add_root(p)

IIRC we originally had some “automagic” in mind, but ultimately decided to go down a slightly more explicit route. Those docs apparently did not get updated.

Thanks,

Bryan

On Dec 29, 2016, at 12:23 PM, [email protected] wrote:

Hi,

I followed the “bokeh html foo.py” example in user guide, but the generated html is displayed as a blank page.

foo.py:

from bokeh.plotting import figure

p = figure()

p.line(x=[1, 2, 3], y=[4,6,2])

If I tried bokeh json foo.py, the generated json is: {“roots”:{“references”:,“root_ids”:},“title”:“Bokeh Application”,“version”:“0.12.3”} which is an empty plot.

I was wondering if I’m missing some steps, or is this behavior expected?

Regards,

Verdi


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/9db3cdad-e05d-4f5f-9a7b-555876bf1625%40continuum.io.

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