BokehJS example

Hi all,
I am trying to run the first example for a standalone bokehjs application found here:

Developing with JavaScript — Bokeh 2.4.2 Documentation

I have saved this example code in a file called test.js

My HTML file looks like this:

*** ***

*** ***

*** Bokeh Plot***

*** ***

*** ***


*** ***

*** ***


*** ***


*** ***

*** ***

*** ***

I get the following error when I load the page:

Uncaught TypeError: Cannot read property ‘linspace’ of undefined

What am I doing wrong?

Thanks,

-Yonatan

Hi,

You are looking at "latest" docs, which are for 0.12.4, but in your HTML you are loading BokehJS 0.12.3 instead. My guess is that is your problem. The BokehJS API is still very new and evolving. It is important to always make sure the code you are looking at is matched by the corresponding version of BokehJS.

Thanks,

Bryan

···

On Jan 16, 2017, at 12:13 PM, [email protected] wrote:

Hi all,
I am trying to run the first example for a standalone bokehjs application found here:

    http://bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html

I have saved this example code in a file called test.js

My HTML file looks like this:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Bokeh Plot</title>

        <link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.css&quot; type="text/css" />
        <link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.css&quot; type="text/css" />
                
        <script type="text/javascript" src="https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.js&quot;&gt;&lt;/script&gt;
        <script type="text/javascript" src="https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.js&quot;&gt;&lt;/script&gt;
         
    </head>
    
    <body>
        <script type="text/javascript" src="test.js"></script>
    </body>
</html>

I get the following error when I load the page:

    Uncaught TypeError: Cannot read property 'linspace' of undefined

What am I doing wrong?

Thanks,

-Yonatan

--
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/6a756c5b-63df-49b9-a800-13e8ebea5ea4%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi,

···

On Mon, Jan 16, 2017 at 7:13 PM, [email protected] wrote:

Hi all,
I am trying to run the first example for a standalone bokehjs application found here:

http://bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html

I have saved this example code in a file called test.js

My HTML file looks like this:

*** ***

*** ***

*** Bokeh Plot***

*** ***

*** ***


*** ***

*** ***


*** ***


*** ***

*** ***

*** ***

I get the following error when I load the page:

Uncaught TypeError: Cannot read property ‘linspace’ of undefined

you need to add bokeh-api.min.js. You can also remove bokeh-widgets.min.{js,css}, as they aren’t needed for the referenced example.

Mateusz

What am I doing wrong?

Thanks,

-Yonatan

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/6a756c5b-63df-49b9-a800-13e8ebea5ea4%40continuum.io.

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

Thank you all for your quick reply!

Mateusz,
Adding bokeh-api.min.js did the trick, although this is not mentioned in the user guide.

Thanks,

-Yonatan

···

On Monday, January 16, 2017 at 1:14:53 PM UTC-5, [email protected] wrote:

Hi all,
I am trying to run the first example for a standalone bokehjs application found here:

http://bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html

I have saved this example code in a file called test.js

My HTML file looks like this:

*** ***

*** ***

*** Bokeh Plot***

*** ***

*** ***


*** ***

*** ***


*** ***


*** ***

*** ***

*** ***

I get the following error when I load the page:

Uncaught TypeError: Cannot read property ‘linspace’ of undefined

What am I doing wrong?

Thanks,

-Yonatan

Hi,

Please feel free to open an issue about the documentation, so that it is not forgotten, or better yet, a small PR to update this file:

  https://github.com/bokeh/bokeh/blob/master/sphinx/source/docs/user_guide/bokehjs.rst

Thanks,

Bryan

···

On Jan 16, 2017, at 1:41 PM, [email protected] wrote:

Thank you all for your quick reply!

Mateusz,
Adding bokeh-api.min.js did the trick, although this is not mentioned in the user guide.

Thanks,

-Yonatan

On Monday, January 16, 2017 at 1:14:53 PM UTC-5, yonatan...@gmail.com wrote:
Hi all,
I am trying to run the first example for a standalone bokehjs application found here:

    http://bokeh.pydata.org/en/latest/docs/user_guide/bokehjs.html

I have saved this example code in a file called test.js

My HTML file looks like this:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Bokeh Plot</title>

        <link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.css&quot; type="text/css" />
        <link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.css&quot; type="text/css" />
                
        <script type="text/javascript" src="https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.js&quot;&gt;&lt;/script&gt;
        <script type="text/javascript" src="https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.js&quot;&gt;&lt;/script&gt;
         
    </head>
    
    <body>
        <script type="text/javascript" src="test.js"></script>
    </body>
</html>

I get the following error when I load the page:

    Uncaught TypeError: Cannot read property 'linspace' of undefined

What am I doing wrong?

Thanks,

-Yonatan

--
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/27f2ed95-40a1-4f1f-be80-c6a2581120bb%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.