Giter Club home page Giter Club logo

bokeh-notebooks's Introduction

Bokeh logo -- text is white in dark theme and black in light theme

Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics and affords high-performance interactivity across large or streaming datasets. Bokeh can help anyone who wants to create interactive plots, dashboards, and data applications quickly and easily.

Package Latest package version Supported Python versions Bokeh license (BSD 3-clause)
Project Github contributors Link to NumFOCUS Link to documentation
Downloads PyPI downloads per month Conda downloads per month NPM downloads per month
Build Current Bokeh-CI github actions build status Current BokehJS-CI github actions build status Codecov coverage percentage
Community Community support on discourse.bokeh.org Bokeh-tagged questions on Stack Overflow

Consider making a donation if you enjoy using Bokeh and want to support its development.

4x9 image grid of Bokeh plots

Installation

To install Bokeh and its required dependencies using pip, enter the following command at a Bash or Windows command prompt:

pip install bokeh

To install conda, enter the following command at a Bash or Windows command prompt:

conda install bokeh

Refer to the installation documentation for more details.

Resources

Once Bokeh is installed, check out the first steps guides.

Visit the full documentation site to view the User's Guide or launch the Bokeh tutorial to learn about Bokeh in live Jupyter Notebooks.

Community support is available on the Project Discourse.

If you would like to contribute to Bokeh, please review the Contributor Guide and request an invitation to the Bokeh Dev Slack workspace.

Note: Everyone who engages in the Bokeh project's discussion forums, codebases, and issue trackers is expected to follow the Code of Conduct.

Support

Fiscal Support

The Bokeh project is grateful for individual contributions, as well as for monetary support from the organizations and companies listed below:

NumFocus Logo CZI Logo Blackstone Logo
TideLift Logo Anaconda Logo NVidia Logo Rapids Logo

If your company uses Bokeh and is able to sponsor the project, please contact [email protected]

Bokeh is a Sponsored Project of NumFOCUS, a 501(c)(3) nonprofit charity in the United States. NumFOCUS provides Bokeh with fiscal, legal, and administrative support to help ensure the health and sustainability of the project. Visit numfocus.org for more information.

Donations to Bokeh are managed by NumFOCUS. For donors in the United States, your gift is tax-deductible to the extent provided by law. As with any donation, you should consult with your tax adviser about your particular tax situation.

In-kind Support

Non-monetary support can help with development, collaboration, infrastructure, security, and vulnerability management. The Bokeh project is grateful to the following companies for their donation of services:

bokeh-notebooks's People

Contributors

adrienpacifico avatar bingyao avatar birdsarah avatar bokeh-integrations avatar bryevdv avatar bsipocz avatar chdoig avatar damianavila avatar eldobbins avatar ghltshubh avatar gison93 avatar ianthomas23 avatar ivirshup avatar jbednar avatar jsignell avatar kozo2 avatar ltirrell avatar maggie-m avatar mattpap avatar miker985 avatar mutedpermit avatar nathanshammah avatar paddymul avatar pandres avatar philippjfr avatar siowyisheng avatar tidydata avatar timsnyder avatar wilcoln avatar yogabonito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bokeh-notebooks's Issues

Broken examples in the tutorials

I'm browsing around for some functionalities and looking at the tutorials always proved to be useful for this. However a I'm running into some issues that may be worth reporting/fixing.

My versions:

Python 3.4.5
IPython - 4.2.0
Pandas - 0.18.0
Bokeh - 0.12.1dev2
  • Hoover example in 03 - styling,ipynb is not working: The plot is static for me.
  • Jupyter interactors example in 04 - interactions.ipynb: the widget doesn't snow up, I got only this <function __main__.update> as output
  • WMTS Tile Source figures are broken as the tile access has been discontinued.
  • More recent releases of datashader are not uploaded to pypi? (I didn't check the notebook as still have some installing issues).
  • Second cell in A2 - Building gapminder.ipynb raises several deprecation warnings, and later cells raises TypeErrors, basically none of the cells produce a single plot.

bokeh-notebooks - gallery: Can not open the notebooks .ipynb in the gallery

bokeh-notebooks - gallery Can not open the notebooks .ipynb in the gallery
I am in windows 7 - bokeh version 0.8.1

2015-03-21 14:41:04.543 [NotebookApp] WARNING | Unreadable Notebook: C:\Users\Amit\Documents\IPython Notebooks\S00_Blaze_Bokeh\bokeh-notebooks\gallery
\bollinger.ipynb name 'NBFormatError' is not defined
WARNING:tornado.access:400 GET /api/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/gallery/bollinger.ipynb?=1426948863684 (127.0.0.1) 37.00ms referer=http
://localhost:8888/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/gallery/bollinger.ipynb
2015-03-21 14:41:15.954 [NotebookApp] WARNING | Unreadable Notebook: C:\Users\Amit\Documents\IPython Notebooks\S00_Blaze_Bokeh\bokeh-notebooks\gallery
\burtin.ipynb name 'NBFormatError' is not defined
WARNING:tornado.access:400 GET /api/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/gallery/burtin.ipynb?
=1426948875024 (127.0.0.1) 45.00ms referer=http://
localhost:8888/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/gallery/burtin.ipynb
2015-03-21 14:41:25.904 [NotebookApp] WARNING | Unreadable Notebook: C:\Users\Amit\Documents\IPython Notebooks\S00_Blaze_Bokeh\bokeh-notebooks\gallery
\linked_brushing.ipynb name 'NBFormatError' is not defined
WARNING:tornado.access:400 GET /api/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/gallery/linked_brushing.ipynb?_=1426948885363 (127.0.0.1) 43.50ms refere
r=http://localhost:8888/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/gallery/linked_brushing.ipynb
2015-03-21 14:41:52.151 [NotebookApp] WARNING | Notebook S00_Blaze_Bokeh/bokeh-notebooks/tutorial/exercises/advanced/01-les-miserables.ipynb is not tr
usted

2015-03-21 14:48:49.845 [NotebookApp] WARNING | Unreadable Notebook: C:\Users\Amit\Documents\IPython Notebooks\S00_Blaze_Bokeh\bokeh-notebooks\index.i
pynb name 'NBFormatError' is not defined
WARNING:tornado.access:400 GET /api/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/index.ipynb?=1426949329243 (127.0.0.1) 30.00ms referer=http://localhost
:8888/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/index.ipynb
2015-03-21 14:49:29.277 [NotebookApp] WARNING | Unreadable Notebook: C:\Users\Amit\Documents\IPython Notebooks\S00_Blaze_Bokeh\bokeh-notebooks\quickst
art\quickstart.ipynb name 'NBFormatError' is not defined
WARNING:tornado.access:400 GET /api/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/quickstart/quickstart.ipynb?
=1426949368564 (127.0.0.1) 56.00ms referer=
http://localhost:8888/notebooks/S00_Blaze_Bokeh/bokeh-notebooks/quickstart/quickstart.ipynb
2015-03-21 14:53:15.471 [NotebookApp] WARNING | Unreadable Notebook: C:\Users\Amit\Documents\IPython Notebooks\S00_Blaze_Bokeh\bkh00_quick-start.ipynb
Notebook does not appear to be JSON: '{\ncells: [\n{\ncell_type: "markdown",...
WARNING:tornado.access:400 GET /api/notebooks/S00_Blaze_Bokeh/bkh00_quick-start.ipynb?_=1426949594843 (127.0.0.1) 52.00ms referer=http://localhost:888
8/notebooks/S00_Blaze_Bokeh/bkh00_quick-start.ipynb

11. Running Bokeh applications

Hi Bryan, having issues with 11. Running Bokeh applications, only when embedding in Jupyter notebooks.
At show(modify_doc) I get the following exception:
AttributeError: 'function' object has no attribute 'references'
This also occurs when I pass notebook_url="http://localhost:8888".

My bokeh version is 0.12.10, iPython ver 6.1.0, Python 3.6.3
Any help is appreciated here.
Thank you.

ichart.yahoo.com discontinued by Yahoo

In section 07. Sharing and Embedding of the Bokeh Tutorial, the first code example pulls data from icharts.yahoo.com using the URL http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000&d=0&e=1&f=2015

Unfortunately, this service has been discontinued by the Yahoo finance team sometime around May, 2017, according to info in this thread: https://forums.yahoo.net/t5/Yahoo-Finance-help/Is-Yahoo-Finance-API-broken/m-p/251312#M3123

There are rumors that Google offers a similar service. Perhaps the code could be updated to use Google instead of Yahoo?

Spelling mistakes in the tutorials

Hey @ghltshubh ,I was going through the tutorials in bokeh...there are around 50 spelling mistakes(not including bad formatting,comma issues,phrasing..just plain spelling mistakes) @bryevdv pointed me to here to make the neccessary change request.. I am quite new to open source contribution or programming..but I can read:)...I read the guidelines for contributing...I created the environment and installed the requirements..

(bokeh-notebooks) ashwani@afj:~/bokeh-notebooks$ conda info

     active environment : bokeh-notebooks
    active env location : /home/ashwani/miniconda3/envs/bokeh-notebooks
            shell level : 2
       user config file : /home/ashwani/.condarc
 populated config files : 
          conda version : 4.8.2
    conda-build version : not installed
         python version : 3.7.6.final.0
       virtual packages : __glibc=2.27
       base environment : /home/ashwani/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/ashwani/miniconda3/pkgs
                          /home/ashwani/.conda/pkgs
       envs directories : /home/ashwani/miniconda3/envs
                          /home/ashwani/.conda/envs
               platform : linux-64
             user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.6 Linux/4.15.0-101-generic ubuntu/18.04.4 glibc/2.27
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

But I am stuck at this point when I run the 3) point on running the notebooks
I used the command for running

git ls-files -z \*.ipynb | xargs -0 jupyter nbconvert --to notebook --inplace --execute
------------------

--------------------------------------------------------------------------
KeyError                                 Traceback (most recent call last)
<ipython-input-2-f97db1205866> in <module>
      6 
      7 # Replace the value below with your personal API key:
----> 8 api_key = os.environ["GOOGLE_API_KEY"]
      9 
     10 p = gmap(api_key, map_options, title="Austin")

~/miniconda3/envs/bokeh-notebooks/lib/python3.7/os.py in __getitem__(self, key)
    677         except KeyError:
    678             # raise KeyError with the original key value
--> 679             raise KeyError(key) from None
    680         return self.decodevalue(value)
    681 

KeyError: 'GOOGLE_API_KEY'
KeyError: 'GOOGLE_API_KEY'

details about system:

(bokeh-notebooks) ashwani@afj:~/bokeh-notebooks$ screenfetch
                          ./+o+-       ashwani@afj
                  yyyyy- -yyyyyy+      OS: Ubuntu 18.04 bionic
               ://+//////-yyyyyyo      Kernel: x86_64 Linux 4.15.0-101-generic
           .++ .:/++++++/-.+sss/`      Uptime: 3h 3m
         .:++o:  /++++++++/:--:/-      Packages: 2798
        o:+o+:++.`..```.-/oo+++++/     Shell: bash 4.4.20
       .:+o:+o/.          `+sssoo+/    Resolution: 1920x1080
  .++/+:+oo+o:`             /sssooo.   DE: GNOME 
 /+++//+:`oo+o               /::--:.   WM: GNOME Shell
 \+/+o+++`o++o               ++////.   WM Theme: Adwaita
  .++.o+++oo+:`             /dddhhh.   GTK Theme: Ambiance [GTK2/3]
       .+.o+oo:.          `oddhhhh+    Icon Theme: ubuntu-mono-dark
        \+.++o+o``-````.:ohdhhhhh+     Font: Ubuntu 11
         `:o+++ `ohhhhhhhhyo++os:      CPU: Intel Core i5-8250U @ 8x 3.4GHz [0°C]
           .o:`.syhhhhhhh/.oo++o`      GPU: Mesa DRI Intel(R) UHD Graphics 620 (Kabylake GT2) 
               /osyyyyyyo++ooo+++/     RAM: 2040MiB / 7880MiB
                   ````` +oo+++o\:    
                          `oo++.      

What is the possible solution??I asked @bryevdv about giving more context on how to make the changes here but he is little busy :) with his work..can you give me more context :) on how to go about making changes here??

update tutorial/10 - Exporting and Embedding for CSS changes in 2.0

tutorial 10 explicitly links in the CSS from cdn.pydata.org. When we stop having the empty CSS files there, it will break.

Also, the version of the CSS and JS being linked in the tutorial is old. Probably need to search for 'bokeh-\d+.\d+.\d+' and replace it with the version set in envioronment.yml

Environment Dependencies

Hello,

I have a question about the dependencies listed in environment.yml :
What is the rationale behind the following dependencies:

  • firefox
  • selenium
  • geckodriver

Especially the firefox dependency is pretty heavy, and I was wondering what that is a requirement in the first place.
Thank you for your answers in advance.

Javascript Error on InteractiveImage

Hi,
I'm just starting to play around with datashader following one of your notebooks from the webinar and am getting the error below. My dataframe has about 10 mil points, floating point, no nans. This is run in a notebook as in the webinar. I'm running 2.7, datashader-0.1.0, bokeh-0.11.1, MacOSX. Many thanks! Evan

p = figure(
x_range=(0, 1),
y_range=(0, 1),
tools='pan,wheel_zoom,box_zoom,reset',
plot_width=500,
plot_height=500,
)
pipeline = ds.Pipeline(df, ds.Point("s3", "modscag"))
InteractiveImage(p, pipeline)

TypeError: Cannot read property '$' of undefined
at Array.inline_js (eval at (http://localhost:8889/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), :54:14)
at run_inline_js (eval at (http://localhost:8889/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), :67:21)
at eval (eval at (http://localhost:8889/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), :77:9)
at eval (eval at (http://localhost:8889/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), :11:67)
at Array.forEach (native)
at run_callbacks (eval at (http://localhost:8889/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), :11:38)
at load_libs (eval at (http://localhost:8889/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), :23:9)
at eval (eval at (http://localhost:8889/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), :77:7)
at eval (eval at (http://localhost:8889/static/notebook/js/main.min.js?v=40e10638fcf65fc1c057bff31d165e9d:89:4231), :82:4)
at eval (native)

Extra topics notebook

Maybe we should have an extra topics notebook to wrap things up and point people to other things

  • We don't cover the ajax source - something like the airports demo - I think we should at least demo it.
  • Other data sources
  • Annotations
  • Questions we get asked a lot & we should probably address:
  • How do you do x - point people to examples - maybe even get people to run one - find them on their machine
  • Legend - customizing & off canvas
  • Hover for a specific thing
  • All the server things - we should at least mention what it is and what's happening with it
  • Mapping / geo - we should at least mention current limitations & what's happening

Re-order lesson plan

  • I'd like to re-order the lesson plan to:
  • Intro (10 minutes)
  • Charts (message - quick & dirty for quick exploration) -
  • Plotting (control most things very easily)
  • Styling and Visual Appearance (based on plotting)
  • Adding Interactions (based on plotting)
  • Sharing and Embedding Bokeh Plots
  • Models (low level, control all the things)

quickstart has multiple errors

  • references apps/movies.html (404), should be apps/movies
  • ocean demo is down (do we even support downsampling?)
  • jsfiddle references bokeh 0.8.0 (!)

Add license

It's unclear under what terms these notebooks can be used, remixed or shared. Please add a license 🙏

error without message

I have a red error box showing up at the top of my notebook - which has now become unresponsive. This is on the navbar, I guess, to the right of "Widgets Help". But there is no message, no explanation, no pop up, no nothing. What am I supposed to do with that? How would I know if the issue is bokeh, binder, or some dependency? I've got nothing to go on here!!! https://notebooks.gesis.org/binder/jupyter/user/bokeh-bokeh-notebooks-lmhpedwb/notebooks/tutorial/01%20-%20Basic%20Plotting.ipynb#

New introduction

Should be the things that are possible with snippets / links to code - not such a deep dive.

@bryevdv - where are your euroscipy tutorial slides?

tutorial for a dynamic update of 2D image content

Hi!
Sorry for bothering and many thanks for bokeh!

I would greatly appreciate if anyone could help me recolving an issue.
It is clear how one can update contents of a 1D graph in a dynamic fashion - upon events, but updating 2D images content - is not clear. Here I am refering to the updates of 2D images shown with p.image(image=[np.array(..)],level="image").

I have tried to do the following without any success. Would it be possible to make an example notebook?
I am providing a simple code I tried.

`
from bokeh.layouts import column, row
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Select, TextInput

def simple_app(doc):

p = figure(tools="", toolbar_location=None)

p = figure(tooltips=[("x", "$x"), ("y", "$y"), ("value", "@image")])
p.x_range.range_padding = p.y_range.range_padding = 0

r = p.image(image=[np.zeros((200,200))], x=0, y=0, dw=10, dh=10, palette="Spectral11", level="image")

select = Select(title="Select data", value="file2", options=['file1','file2'])

def update_data(attrname, old, new):
    tdata = {"file1": np.random.rand(200,200)*3,
             "file2": np.random.rand(200,200)*5.,
            }
    # reading files        
    cd = ColumnDataSource(data={'image': tdata[select.value]})
    print(f"Selected {select.value}")
    r.data_source = cd

select.on_change('value', update_data)

layout = column(row(select, width=200), row(p))

doc.add_root(layout)

show(simple_app)
`

2nd Interactive Exploration example in Ch 12 (Holoviews) gives Value Error

I do not understand what the call is trying to do, so cannot fix it myself.
Here is part of the Traceback:

ValueError Traceback (most recent call last)
in ()
2 keys = [(p,f) for p in phases for f in freqs]
3
----> 4 hv.HoloMap([(k, hv.Image(sine(grid, *k))) for k in keys], dims) + hv.HoloMap([(k, hv.Curve(zip(dist, sine(dist2, *k)),vdims=dims['vdims'])) for k in keys], **dims)
...
/Users/EDobbins/anaconda2/lib/python2.7/site-packages/param/init.pyc in _check_bounds(self, val)
1174 if min_length is not None and max_length is not None:
1175 if not (min_length <= l <= max_length):
-> 1176 raise ValueError("%s: list length must be between %s and %s (inclusive)"%(self._attrib_name,min_length,max_length))
1177 elif min_length is not None:
1178 if not min_length <= l:

ValueError: vdims: list length must be between 0 and 0 (inclusive)

Also, there are 2 examples which use deprecated options which can be changed when the bug is fixed.

The first code block refers to:
hv.notebook_extension('bokeh'=True)
which should be changed to:
hv.extension('bokeh')

The 2nd example in the External Data Sources give a warning that the mdims argument should be changed to groupby.

Tutorial 5 - Presentation and Layout

Tutorial number 5 (Presentation and Layout) has the following exercise:

In [4]: # EXERCISE: use column to arrange a few plots vertically

When doing this exercise it took me some time to realise that I had to import column.

I think the tutorial can be improved for new users if either the import is already in the code: from bokeh.layouts import row, column

or, probably even better because it makes the user take action, if the exercise remembers the user that he has to import column, for example:

In [4]: # EXERCISE: use column to arrange a few plots vertically. Don't forget to import column.

Widgets are not available. Please install widgetsnbextension or ipywidgets 4.0

Hi! I am new to Bokeh and wanted to try it out. I installed it with pip and cloned the bokeh-notebooks repository. I went to the 5 min Overview. The first three steps run through, the 4th step:

p = figure(width=500, height=500)
p.circle(x, y, size=7, color="firebrick", alpha=0.5)
show(p)

doesn't show a picture. Instead I get an error 404 in the browser console. And the following warning:

Failed to load resource: the server responded with a status of 404 (Not Found)
main.min.js:34110 Widgets are not available. Please install widgetsnbextension or ipywidgets 4.0
(anonymous) @ main.min.js:34110

Do I have to install one of the two packages? If yes, which one should I use?

Supplying a user-defined data source AND iterable values to glyph methods is deprecated.

Seen in notebook 03 - interactions: section Jupyter Interactions.

CELL:

import numpy as np
from bokeh.io import push_notebook

x = np.linspace(0, 2*np.pi, 2000)
y = np.sin(x)

source = ColumnDataSource(data=dict(x=x, y=y))

p = figure(title="simple line example", plot_height=300, plot_width=600, y_range=(-5, 5))
p.line(x, y, color="#2222aa", alpha=0.5, line_width=2, source=source, name="foo")

def update(f, w=1, A=1, phi=0):
    if   f == "sin": func = np.sin
    elif f == "cos": func = np.cos
    elif f == "tan": func = np.tan
    source.data['y'] = A * func(w * x + phi)
    push_notebook()
    
show(p, notebook_handle=True)

OUTPUT:

/home/adrsta/anaconda3/envs/tensorflow/lib/python3.5/site-packages/bokeh/util/deprecation.py:34: BokehDeprecationWarning: 
Supplying a user-defined data source AND iterable values to glyph methods is deprecated.

See https://github.com/bokeh/bokeh/issues/2056 for more information.

  warn(message)
/home/adrsta/anaconda3/envs/tensorflow/lib/python3.5/site-packages/bokeh/util/deprecation.py:34: BokehDeprecationWarning: 
Supplying a user-defined data source AND iterable values to glyph methods is deprecated.

See https://github.com/bokeh/bokeh/issues/2056 for more information.

  warn(message)

Mention `add_glyph`, `add_tools`, `add_layout`

I think it's good to mention the methods "add_glyph, add_tools, add_layout" which can be used on a chart, figure, or plot.

Mention in each briefly and then repetition will kick in? Or don't mention in charts as you're just getting going?

missing dependency

created environment file using the repo's environment.yml and was getting the below error quite frequently.

[E 22:54:05.375 NotebookApp] Notebook JSON is invalid: 'application/vnd.bokehjs_load.v0+json' does not match any of the regexes: '^(?!application/json$)[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$'
    
    Failed validating 'additionalProperties' in display_data['properties']['data']:
    
    On instance['cells'][5]['outputs'][1]['data']:
    {'application/javascript': '\n'
                               '(function(root) {\n'
                               '  function now() {\n'
                               '    return new Date();\n'
                               '  }...',
     'application/vnd.bokehjs_load.v0+json': '\n'
                                             '(function(root) {\n'
                                             '  function now() {\n'
                                             '    return new Date();\n'
                                             '  }...'}

some searching indicated to install conda install -n bokeh nbformat

and problem seems to have gone away

Error!! please help

from bokeh.io import output_notebook, show
from bokeh.plotting import figure
output_notebook()

from math import pi
import pandas as pd
from bokeh.palettes import Category20c
from bokeh.transform import cumsum

x = { 'United States': 157, 'United Kingdom': 93, 'Japan': 89, 'China': 63,
'Germany': 44, 'India': 42, 'Italy': 40, 'Australia': 35, 'Brazil': 32,
'France': 31, 'Taiwan': 31, 'Spain': 29 }

data = pd.Series(x).reset_index(name='value')
data = data.rename(columns={'index':'country'})
data['color'] = Category20c[len(x)]

represent each value as an angle = value / total * 2pi

data['angle'] = data['value']/data['value'].sum() * 2*pi
p = figure(plot_height=350, title="Pie Chart", toolbar_location=None,
tools="hover", tooltips="@Country: @value")

p.wedge(x=0, y=1, radius=0.4,start_angle=cumsum('angle', include_zero=True),
end_angle=cumsum('angle'), line_color="white", fill_color='color',
legend_field='country',
source=data)

p.axis.axis_label=None
p.axis.visible=False
p.grid.grid_line_color = None

show(p)


AttributeError Traceback (most recent call last)
in
29 end_angle=cumsum('angle'), line_color="white", fill_color='color',
30 legend_field='country',
---> 31 source=data)
32
33 p.axis.axis_label=None

fakesource in wedge(self, x, y, radius, start_angle, end_angle, direction, **kwargs)

~/anaconda3/lib/python3.7/site-packages/bokeh/plotting/helpers.py in func(self, **kwargs)
818 mglyph_ca = None
819
--> 820 glyph = _make_glyph(glyphclass, kwargs, glyph_ca)
821 nsglyph = _make_glyph(glyphclass, kwargs, nsglyph_ca)
822 sglyph = _make_glyph(glyphclass, kwargs, sglyph_ca)

~/anaconda3/lib/python3.7/site-packages/bokeh/plotting/helpers.py in _make_glyph(glyphclass, kws, extra)
359 kws = kws.copy()
360 kws.update(extra)
--> 361 return glyphclass(**kws)
362
363

~/anaconda3/lib/python3.7/site-packages/bokeh/model.py in init(self, **kwargs)
259 self._document = None
260 self._temp_document = None
--> 261 super(Model, self).init(**kwargs)
262 default_theme.apply_to_model(self)
263

~/anaconda3/lib/python3.7/site-packages/bokeh/core/has_props.py in init(self, **properties)
251
252 for name, value in properties.items():
--> 253 setattr(self, name, value)
254
255 def setattr(self, name, value):

~/anaconda3/lib/python3.7/site-packages/bokeh/core/has_props.py in setattr(self, name, value)
286
287 raise AttributeError("unexpected attribute '%s' to %s, %s attributes are %s" %
--> 288 (name, self.class.name, text, nice_join(matches)))
289
290 def str(self):

AttributeError: unexpected attribute 'legend_field' to Wedge, possible attributes are direction, end_angle, end_angle_units, fill_alpha, fill_color, js_event_callbacks, js_property_callbacks, line_alpha, line_cap, line_color, line_dash, line_dash_offset, line_join, line_width, name, radius, radius_units, start_angle, start_angle_units, subscribed_events, tags, x or y

Tutorial 10 is awkward now that bkcharts has spun off

Working my way through Tutorial 10, I got a warning message saying that bkcharts is a separate API now, and "from bokeh.charts import Scatter" will be deprecated in Bokeh 1.0. Also, all the documentation for Charts seems to have been removed from the current Users Guide and References, which makes the Exercises awkward. And 2 of the links at the bottom are broken.

If appropriate, I'm willing to make a PR to transition this to the new API. Should it wait till Bokeh 1.0 is released? Is there new documentation for bkcharts?

A minor point: in the Stacked Bar example, I expected the order of the bars (colors) to be the same for every year, but they were not, even after I sorted the Dataframe. Sometimes the red bar was at the bottom, sometimes in the middle, and once on the top (screenshot attached). Is this a longstanding issue with Bar charts?
screen shot 2017-07-26 at 9 33 56 am

[Binder] 02 - Styling and Theming: RuntimeError data directory does not exist

Problem

The 02 - Styling and Theming breaks at cell [10].

Full error

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-10-9b6655e825c9> in <module>()
      1 from bokeh.models.tools import HoverTool
----> 2 from bokeh.sampledata.glucose import data
      3 
      4 subset = data.loc['2010-10-06']
      5 

/srv/conda/lib/python3.6/site-packages/bokeh/sampledata/glucose.py in <module>()
     55 #-----------------------------------------------------------------------------
     56 
---> 57 data = external_csv('glucose', 'CGM.csv', sep=',', parse_dates=[1], index_col=1)

/srv/conda/lib/python3.6/site-packages/bokeh/util/api.py in wrapper(*args, **kw)
    188         @wraps(obj)
    189         def wrapper(*args, **kw):
--> 190             return obj(*args, **kw)
    191 
    192         wrapper.__bkversion__ = version

/srv/conda/lib/python3.6/site-packages/bokeh/util/sampledata.py in external_csv(module, name, **kw)
     93     '''
     94     pd = import_required('pandas', '%s sample data requires Pandas (http://pandas.pydata.org) to be installed' % module)
---> 95     return pd.read_csv(external_path(name), **kw)
     96 
     97 @dev((1,0,0))

/srv/conda/lib/python3.6/site-packages/bokeh/util/api.py in wrapper(*args, **kw)
    188         @wraps(obj)
    189         def wrapper(*args, **kw):
--> 190             return obj(*args, **kw)
    191 
    192         wrapper.__bkversion__ = version

/srv/conda/lib/python3.6/site-packages/bokeh/util/sampledata.py in external_path(filename)
    130 @dev((1,0,0))
    131 def external_path(filename):
--> 132     data_dir = external_data_dir()
    133     fn = join(data_dir, filename)
    134     if not exists(fn) and isfile(fn):

/srv/conda/lib/python3.6/site-packages/bokeh/util/api.py in wrapper(*args, **kw)
    188         @wraps(obj)
    189         def wrapper(*args, **kw):
--> 190             return obj(*args, **kw)
    191 
    192         wrapper.__bkversion__ = version

/srv/conda/lib/python3.6/site-packages/bokeh/util/sampledata.py in external_data_dir(create)
    116     if not exists(data_dir):
    117         if not create:
--> 118             raise RuntimeError('bokeh sample data directory does not exist, please execute bokeh.sampledata.download()')
    119         print("Creating %s directory" % data_dir)
    120         try:

RuntimeError: bokeh sample data directory does not exist, please execute bokeh.sampledata.download()

Bad fix

import bokeh
bokeh.sampledata.download()

Obviously solve the issue, but I guess it is a binder configuration file that would sort things out.

remote_ocean_slider example is missing

Hi,

I'm looking for how implement something very close to Downsampling example here https://github.com/bokeh/bokeh-notebooks/blob/master/quickstart/quickstart.ipynb
Is it right that Downsampling was replaced by Datashader?
Any comments gentlemen: @jbednar , @pzwang ?

If it's so - then obviously this example needs to be re-implemented using Datashader or something similar to it...

What I'm trying to do is to visualize a big cube of data sitting on remote machine. And I need to QC it in all directions (XY, XZ, YZ). Obviously number of points per slice are few billions, but resolution on the client will be quite small so all the data is not needed.
I thought that bokeh has a perfect solution and was very happy when I've found this example - but, unfortunately, I couldn't find it's implementation or any other details and Datashader module looks like more designed for scatter plots rather than images.

Please help.

Sincerely,
Thoth.

Use CDN resources when appropriate

This will reduce the overall size of notebooks, which currently is incredibly large (about 90 megs). This will also simplify updating to new versions of bokeh.

typo 2nd

In file “04 - Data Sources and Transformations.ipynb”, there is a typo between In[7] and In[8]. The "glhph methods" should be "glyph", I guess.

Jupyter notebooks do not work unless you install anaconda

Could not get the bokeh howto jupyter notebooks to work. I am not using Anaconda yet. Having too much trouble with Pycharm allowing things to work.

Installing anaconda as we speak. I hope this solves the problem.

I agree with the assessment that Anaconda is better than pip everything and virtualenv. I am new to python development but I will follow this recommendation.

Texas Unemployment Example

In https://github.com/bokeh/bokeh-notebooks/blob/master/tutorial/09%20-%20Geographic%20Plots.ipynb in cell 1

It is often useful to be able to relate datasets with their real-world context. You can plot geographic data just like any other type of data, as in the Texas Unemployment example, but Bokeh also Bokeh provides several specialized mechanisms for plotting data in geographic coordinates:

Texas Unemployment example is linked to http://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/gallery/texas.ipynb which no longer exists. I believe new link is https://bokeh.pydata.org/en/latest/docs/gallery/texas.html

#54

i 've Error help me

from math import pi
from bokeh.sampledata.glucose import data

week = data.loc['2010-10-01':'2010-10-08']

p = figure(x_axis_type="datetime", title="Glocose Range", plot_height=350, plot_width=800)
p.xaxis.formatter.days = '%m/%d/%Y'
p.xaxis.major_label_orientation = pi/3

p.line(week.index, week.glucose)

show(p)

this code have AttributeError: '_list_attr_splat' object has no attribute 'formatter'
I want solution please

typo

In file quickstart.ipynb, there is a typo at the first sentense of session "Bokeh Application". It should be "easily", not "eqsily", I guess.

In file “04 - Data Sources and Transformations.ipynb”, there is a typo between In[7] and In[8]. The "glhph methods" should be "glyph", I guess.

In file "05 - Presentation Layouts.ipynb", There is a typo in 3rd sentense "Boeh plots can be individually embedded in HTML documents". It should be "Bokeh", I guess.

five minute overview: linked brushing example throws error

In quickstart.ipynb, for the Linked Brushing example, when I run the following line:

source = ColumnDataSource(autompg)

I get the following error:


ValueError Traceback (most recent call last)
in
----> 1 source = ColumnDataSource(autompg)

~\Miniconda3\envs\ds\lib\site-packages\bokeh\models\sources.py in init(self, *args, **kw)
192 raw_data = self._data_from_groupby(raw_data)
193 else:
--> 194 raise ValueError("expected a dict or pandas.DataFrame, got %s" % raw_data)
195 super().init(**kw)
196 self.data.update(raw_data)

ValueError: expected a dict or pandas.DataFrame, got mpg cyl displ hp weight accel yr origin \

autompg is a dataframe that worked fine for the previous bar plot example. I am running Bokeh 2.1.0, in a Jupyter Notebook using conda (Python 3.7).

Setup Instructions Feedback

There were a few speedbumps when setting up students's environments:

  1. It was unclear to some students that they needed to cd into the bokeh-notebooks/tutorial directory before running the conda env create etc. commands. They would open up a terminal, run conda env create and get an error that environment.yml was missing
  2. Should source activate ... be activate ... for Windows users?
  3. Some people had jupyter notebooks already running and were confused why they needed to start another one

Mention webgl

We don't cover webgl - which is a pretty exciting addition - could add it into the plotting notebook

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.