Error with bokeh.charts?

Using:
Fedora 20

Google Chrome

python 3.4

Bokeh 0.6.1

I recently upgraded to bokeh 0.6.1 to try out the bokeh.charts

Note, when I use my old plots they work fine (bokeh.plotting)

I went into bokeh.charts and found an example for Bar and used that example:

from collections import OrderedDict

import numpy as np

from bokeh.charts import Bar

from bokeh.sampledata.olympics2014 import data

data = {d[‘abbr’]: d[‘medals’] for d in data[‘data’] if d[‘medals’][‘total’] > 0}

countries = sorted(data.keys(), key=lambda x: data[‘total’], reverse=True)

gold = np.array([data[abbr][‘gold’] for abbr in countries], dtype=np.float)

silver = np.array([data[abbr][‘silver’] for abbr in countries], dtype=np.float)

bronze = np.array([data[abbr][‘bronze’] for abbr in countries], dtype=np.float)

medals = OrderedDict(bronze=bronze, silver=silver, gold=gold)

bar = Bar(medals, countries)

bar.title(“stacked, dict_input”).xlabel(“countries”).ylabel(“medals”).legend(True).width(600).height(400).stacked().notebook().show()

I get the below errors:

Javascript error adding output!

ReferenceError: Bokeh is not defined

See your browser Javascript console for more details.

When I open the Chrome javascript console here are the errors:

GET http://localhost:8888/static/components/backbone/backbone-min.map 404 (Not Found) :8888/static/components/backbone/backbone-min.map:1

GET http://localhost:8888/static/components/underscore/underscore-min.map 404 (Not Found) :8888/static/components/underscore/underscore-min.map:1

GET http://localhost:8888/static/components/jquery/jquery.min.map 404 (Not Found)

Hi,

I guess you are in the notebook, can you try cleaning your cache with the dev tools opened, restart the kernel and try running it again?

Damian

···

On Sun, Oct 12, 2014 at 8:10 PM, jared [email protected] wrote:

Using:
Fedora 20

Google Chrome

python 3.4

Bokeh 0.6.1

I recently upgraded to bokeh 0.6.1 to try out the bokeh.charts

Note, when I use my old plots they work fine (bokeh.plotting)

I went into bokeh.charts and found an example for Bar and used that example:

from collections import OrderedDict

import numpy as np

from bokeh.charts import Bar

from bokeh.sampledata.olympics2014 import data

data = {d[‘abbr’]: d[‘medals’] for d in data[‘data’] if d[‘medals’][‘total’] > 0}

countries = sorted(data.keys(), key=lambda x: data[‘total’], reverse=True)

gold = np.array([data[abbr][‘gold’] for abbr in countries], dtype=np.float)

silver = np.array([data[abbr][‘silver’] for abbr in countries], dtype=np.float)

bronze = np.array([data[abbr][‘bronze’] for abbr in countries], dtype=np.float)

medals = OrderedDict(bronze=bronze, silver=silver, gold=gold)

bar = Bar(medals, countries)

bar.title(“stacked, dict_input”).xlabel(“countries”).ylabel(“medals”).legend(True).width(600).height(400).stacked().notebook().show()

I get the below errors:

Javascript error adding output!

ReferenceError: Bokeh is not defined

See your browser Javascript console for more details.

When I open the Chrome javascript console here are the errors:

GET http://localhost:8888/static/components/backbone/backbone-min.map 404 (Not Found) :8888/static/components/backbone/backbone-min.map:1

GET http://localhost:8888/static/components/underscore/underscore-min.map 404 (Not Found) :8888/static/components/underscore/underscore-min.map:1

GET http://localhost:8888/static/components/jquery/jquery.min.map 404 (Not Found)

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/CADss3ASuTVCEGr5bSk6nRok0GSwqzRQPR6oYeWwHUMitqV2A9A%40mail.gmail.com.

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

Hello Damian,
by the cache, are you referring to (in chrome) tools > clear browser data?

That is where I did it.

then restarted the kernel and tried - I received the same error.

···

On Sun, Oct 12, 2014 at 7:14 PM, Damian Avila [email protected] wrote:

Hi,

I guess you are in the notebook, can you try cleaning your cache with the dev tools opened, restart the kernel and try running it again?

Damian

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/CAM9Ly3Fowx%3DxrM0vfweJ6FP%3DRe9s%2BuFOt9Vburyv3hy3sQ-h%3Dw%40mail.gmail.com.

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

On Sun, Oct 12, 2014 at 8:10 PM, jared [email protected] wrote:

Using:
Fedora 20

Google Chrome

python 3.4

Bokeh 0.6.1

I recently upgraded to bokeh 0.6.1 to try out the bokeh.charts

Note, when I use my old plots they work fine (bokeh.plotting)

I went into bokeh.charts and found an example for Bar and used that example:

from collections import OrderedDict

import numpy as np

from bokeh.charts import Bar

from bokeh.sampledata.olympics2014 import data

data = {d[‘abbr’]: d[‘medals’] for d in data[‘data’] if d[‘medals’][‘total’] > 0}

countries = sorted(data.keys(), key=lambda x: data[‘total’], reverse=True)

gold = np.array([data[abbr][‘gold’] for abbr in countries], dtype=np.float)

silver = np.array([data[abbr][‘silver’] for abbr in countries], dtype=np.float)

bronze = np.array([data[abbr][‘bronze’] for abbr in countries], dtype=np.float)

medals = OrderedDict(bronze=bronze, silver=silver, gold=gold)

bar = Bar(medals, countries)

bar.title(“stacked, dict_input”).xlabel(“countries”).ylabel(“medals”).legend(True).width(600).height(400).stacked().notebook().show()

I get the below errors:

Javascript error adding output!

ReferenceError: Bokeh is not defined

See your browser Javascript console for more details.

When I open the Chrome javascript console here are the errors:

GET http://localhost:8888/static/components/backbone/backbone-min.map 404 (Not Found) :8888/static/components/backbone/backbone-min.map:1

GET http://localhost:8888/static/components/underscore/underscore-min.map 404 (Not Found) :8888/static/components/underscore/underscore-min.map:1

GET http://localhost:8888/static/components/jquery/jquery.min.map 404 (Not Found)

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/CADss3ASuTVCEGr5bSk6nRok0GSwqzRQPR6oYeWwHUMitqV2A9A%40mail.gmail.com.

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

Yes, I forgot to mention… you have to actually load Bokeh into the notebook… at the top of your notebook run:

import bokeh

bokeh.load_notebook()

if you are using the IPython 2.x, but if you are using IPython master, add force=True in this way:

import bokeh

bokeh.load_notebook(force=True)

and the run the code with the chart.

···

On Sun, Oct 12, 2014 at 8:53 PM, jared [email protected] wrote:

Hello Damian,
by the cache, are you referring to (in chrome) tools > clear browser data?

That is where I did it.

then restarted the kernel and tried - I received the same error.

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/CADss3ARBepJtbPtU10-yCLBqVe%3DgJo6r0AewfJEqMwDWGK3Zqg%40mail.gmail.com.

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

On Sun, Oct 12, 2014 at 7:14 PM, Damian Avila [email protected] wrote:

Hi,

I guess you are in the notebook, can you try cleaning your cache with the dev tools opened, restart the kernel and try running it again?

Damian

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/CAM9Ly3Fowx%3DxrM0vfweJ6FP%3DRe9s%2BuFOt9Vburyv3hy3sQ-h%3Dw%40mail.gmail.com.

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

On Sun, Oct 12, 2014 at 8:10 PM, jared [email protected] wrote:

Using:
Fedora 20

Google Chrome

python 3.4

Bokeh 0.6.1

I recently upgraded to bokeh 0.6.1 to try out the bokeh.charts

Note, when I use my old plots they work fine (bokeh.plotting)

I went into bokeh.charts and found an example for Bar and used that example:

from collections import OrderedDict

import numpy as np

from bokeh.charts import Bar

from bokeh.sampledata.olympics2014 import data

data = {d[‘abbr’]: d[‘medals’] for d in data[‘data’] if d[‘medals’][‘total’] > 0}

countries = sorted(data.keys(), key=lambda x: data[‘total’], reverse=True)

gold = np.array([data[abbr][‘gold’] for abbr in countries], dtype=np.float)

silver = np.array([data[abbr][‘silver’] for abbr in countries], dtype=np.float)

bronze = np.array([data[abbr][‘bronze’] for abbr in countries], dtype=np.float)

medals = OrderedDict(bronze=bronze, silver=silver, gold=gold)

bar = Bar(medals, countries)

bar.title(“stacked, dict_input”).xlabel(“countries”).ylabel(“medals”).legend(True).width(600).height(400).stacked().notebook().show()

I get the below errors:

Javascript error adding output!

ReferenceError: Bokeh is not defined

See your browser Javascript console for more details.

When I open the Chrome javascript console here are the errors:

GET http://localhost:8888/static/components/backbone/backbone-min.map 404 (Not Found) :8888/static/components/backbone/backbone-min.map:1

GET http://localhost:8888/static/components/underscore/underscore-min.map 404 (Not Found) :8888/static/components/underscore/underscore-min.map:1

GET http://localhost:8888/static/components/jquery/jquery.min.map 404 (Not Found)

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/CADss3ASuTVCEGr5bSk6nRok0GSwqzRQPR6oYeWwHUMitqV2A9A%40mail.gmail.com.

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

Damian,

Ok, I suppose that is obvious now that I see it.
I apologize for the basic mistake.

I just toke the example as shown by doing:
import bokeh.charts as bc
bc.Bar?

and in that I thought the example that is shown was self contained - but
doing what you suggested makes sense now and works. Thanks for the
assistance Damian.

···

On Sun, Oct 12, 2014 at 7:58 PM, Damian Avila <[email protected]> wrote:

Yes, I forgot to mention... you have to actually load Bokeh into the
notebook... at the top of your notebook run:

import bokeh
bokeh.load_notebook()

It is noted here: http://bokeh.pydata.org/docs/user_guide/charts.html#interface-outputs, but we probably have to do a better job to communicate it.
Glad it is now working for you.
Have a good Sunday evening/night.

Damian

···

On Sun, Oct 12, 2014 at 9:03 PM, jared [email protected] wrote:

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/CADss3ATnyw9%3D-%2BKUDd9OiGq2c7MbMVfuKz3%3DiEBfFuUC%2BRv49w%40mail.gmail.com.

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

On Sun, Oct 12, 2014 at 7:58 PM, Damian Avila [email protected] wrote:

Yes, I forgot to mention… you have to actually load Bokeh into the notebook… at the top of your notebook run:

import bokeh

bokeh.load_notebook()

Damian,

Ok, I suppose that is obvious now that I see it.

I apologize for the basic mistake.

I just toke the example as shown by doing:

import bokeh.charts as bc

bc.Bar?

and in that I thought the example that is shown was self contained - but doing what you suggested makes sense now and works. Thanks for the assistance Damian.