Code Monkey home page Code Monkey logo

bokeh'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's People

Contributors

almarklein avatar birdsarah avatar brittainhard avatar bryevdv avatar canavandl avatar canavandl-test avatar clairetang6 avatar damianavila avatar fpliger avatar havocp avatar hhuuggoo avatar huntjsparra avatar ianthomas23 avatar jbcrail avatar jqmp avatar jsignell avatar justacec avatar kdodia avatar kevincolten avatar lilahickey avatar maggie-m avatar mattpap avatar mosc9575 avatar nroth-dealnews avatar paddymul avatar philippjfr avatar rothnic avatar shughes-uk avatar tcmetzger avatar tswicegood 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  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's Issues

HTMLFileSession should support output of multiple plots

Currently, the dumps() method (and its supporting templates, plots.html and plots.js) all rely on a single elementid, i.e. expecting a single plot. It would be nice to be able to have multiple plots output into a single HTML file, and it should be a pretty straightforward change.

not installable by pip

I checked out Bokeh from GH.

Then I did

pip install .
Unpacking d:\development\github\bokeh
  Running setup.py egg_info for package from file:///d%7C%5Cdevelopment%5Cgithub%5Cbokeh

Cleaning up...

The requirements were not verified or installed!

Explicitly calling these:

pip install requirements.txt
Downloading/unpacking requirements.txt
  Real name of requirement requirements.txt is requirements.txt
  Could not find any downloads that satisfy the requirement requirements.txt
No distributions at all found for requirements.txt

What is an easy why to install and test this software?

Installation problems

I am new to all of this so please let me know if you need more information, but I have all dependencies installed however I cannot get Bokeh to install:

Command python setup.py egg_info failed with error code 1 in /var/folders/Xs/Xs3BR-03GQGrXBHG6s-JSk+++TI/-Tmp-/pip-0yHevL-build

Any thoughts about why?

Thanks

HTMLFileSession Error following Quickstart.md instructions

Hi Team-Bokeh,

I'm a big fan of ggplot and follow you guys in the hope of one day being able to have most/all of ggplot from python. I saw you added a Quickstart.md but when I clone and install I get the following errors:

git clone https://github.com/ContinuumIO/Bokeh.git   
cd Bokeh
sudo python setup.py install  
cd examples/glyphs

» python glyph1.py                                                                                                                                                                                        
 Traceback (most recent call last):
   File "glyph1.py", line 55, in <module>
    sess.plotcontext.children.append(plot)
   AttributeError: 'HTMLFileSession' object has no attribute 'plotcontext'

» python line.py                                                                                                                                                                                          Traceback (most recent call last):
  File "line.py", line 46, in <module>
    sess.plotcontext.children.append(plot)
AttributeError: 'HTMLFileSession' object has no attribute 'plotcontext'

thanks,
zach cp

'module' object has no attribute 'serialize_msg'

Hi,

I'm following the Readme, and can get python glyph_example.py working, but pandas_example.py and webplot_example.py give a similar error

$ python pandas_example.py
no documents found, creating new document
got read write apikey
Traceback (most recent call last):
  File "pandas_example.py", line 15, in <module>
    p.pandastable(source)
  File "/Users/me/src/Bokeh/bokeh/mpl.py", line 583, in pandastable
    self.bbclient.create(table)
  File "/Users/me/src/Bokeh/bokeh/bbmodel.py", line 163, in create
    self.s.post(url, data=protocol.serialize_msg(
AttributeError: 'module' object has no attribute 'serialize_msg'

Based on errors up to now, it could be something I still need to install.

Ordering of updates

The experience with the selection tool on a low bandwidth connection has some problems.

Here is what I think is happening:

  1. The user starts a selection
  2. BokehJS sends model updates of "current_x", and "current_y" back to the plot_server over web sockets
  3. The client continues moving forward with the selection range, updating the client.
  4. The plot server responds with some modification of the selected data
  5. Their ends up being an ordering problem that causes flicker and poor user experience.

Is my understanding correct?

How would something like this work?
How about versioning model updates coming from the client and those coming from the server.

Have some type of decongestion protocol, so that the server only listens to the most recent data from the client, and the client only the most recent data from the server.
Further, only have the client respond to server events sent after the last client update sent. We would probably want to impose this ordering per topic.

What common terms are there for such ordering techniques? I would think that there might be different ordering techniques for different topic types.

Rationalize the functions in plotting.py

Right now there scatter(), plot(), and then functions for each of the glyphs. The latter is useful for constructing novel figures. scatter() is useful when the glyph/marker type needs to be chosen based on data grouping.

The plot() function exists because, well, people expect that in a plotting package.

So how do we simplify the user API? Should we eliminate scatter() and rely just on plot(), and let is "type" argument pick one of the schemas? (e.g. line, scatter, bar, etc.) Or should we get rid of plot() and only have functions for the schema?

Would like to hear others' input on this.

plotting.py needs to check for plotting.session being None

In this case I tried to call bokeh.plotting.line_plot prior to specifying an output mode (because I was trying to defer that as long as possible and e.g. don't know the filename until I actually want to save the plot).

This snippet below should check for None, and probably create a default/empty session or at least give a better error message about calling the API functions in proper sequence.

/home/jrh/anaconda/lib/python2.7/site-packages/bokeh/plotting.pyc in wrapper(*args, **kw)
    297 
    298         if plot is not None:
--> 299             session.add(plot)
    300             _config["curplot"] = plot
    301 

AttributeError: 'NoneType' object has no attribute 'add'

SyntaxError during installation

When installing Bokeh, I get the following error. It still installs successfully though, and I can run the example notebook without any problems.

$ sudo pip install ./Bokeh
Unpacking ./Bokeh
  Running setup.py egg_info for package from file:///home/jevans/clones/Bokeh

Installing collected packages: bokeh
  Running setup.py install for bokeh
    SyntaxError: ('invalid syntax', ('/usr/local/lib/python2.7/dist-packages/bokeh/bokeh.py', 2, 8, 'import .plot_expr_graph as peg\n'))


Successfully installed bokeh
Cleaning up...```

Make redis dependency of bokeh-server optional

The server should fall back to something in the Python standard library, when redis is not available, e.g. in memory, shelve module, or sqlite3. Getting redis to work in not trival for most users, and it seems in particular difficult on Windows.

It is hard to reason about model update relationships

For the selecttool it is hard to reason about how certain updates of client-side model attributes cascade into other modifications.

how does changing "start_x" or "current_x" on the model of the selecttool actually map to the data range changing? The data range seems to be on the renderers. how should I be able to look at the code and figure this out?

Should we have better documentation? or some type of tool that allows us to examine dependency graphs?

Python 2.7.5 required (on Windows)?

I'm struggling starting the runserver.py on my [Windows7 | Enthought Canopy Python 2.7.3 | 32-bit] machine.

The traceback shows:
Traceback (most recent call last): File "runserver.py", line 3, in <module> from bokeh.server import start File "C:\ETSgit\bokeh\bokeh\server\start.py", line 1, in <module> from geventwebsocket.handler import WebSocketHandler File "C:\Users\tlecocq\AppData\Local\Enthought\Canopy32\User\lib\site-packages\gevent_websocket-0.3.6-py2.7.egg\geventwebsocket\__init__.py", line 6, in <module> from geventwebsocket.handler import WebSocketHandler File "C:\Users\tlecocq\AppData\Local\Enthought\Canopy32\User\lib\site-packages\gevent_websocket-0.3.6-py2.7.egg\geventwebsocket\handler.py", line 8, in <module> from gevent.pywsgi import WSGIHandler File "C:\Users\tlecocq\AppData\Local\Enthought\Canopy32\User\lib\site-packages\gevent-0.13.8-py2.7-win32.egg\gevent\__init__.py", line 48, in <module> from gevent.greenlet import Greenlet, joinall, killall File "C:\Users\tlecocq\AppData\Local\Enthought\Canopy32\User\lib\site-packages\gevent-0.13.8-py2.7-win32.egg\gevent\greenlet.py", line 6, in <module> from gevent.hub import greenlet, getcurrent, get_hub, GreenletExit, Waiter File "C:\Users\tlecocq\AppData\Local\Enthought\Canopy32\User\lib\site-packages\gevent-0.13.8-py2.7-win32.egg\gevent\hub.py", line 30, in <module> greenlet = __import__('greenlet').greenlet ImportError: DLL load failed: The specified procedure could not be found.

According to this, greenlet might require 2.7.5 to work. Any ideas why? I'm not really willing to update python if it's not really required :(

Problem running examples on windows

Seems to be looking for css file in the wrong place on windows. This was with a fresh clone of Bokeh and the latest versions of conda and Anaconda.

C:\Users\Maggie\Bokeh\examples\glyphs>python glyph1.py
Traceback (most recent call last):
  File "glyph1.py", line 56, in <module>
    sess.save(js="relative", css="relative", rootdir=os.path.abspath("."))
  File "C:\Anaconda\lib\site-packages\bokeh\session.py", line 337, in save
    s = self.dumps(js, css, rootdir)
  File "C:\Anaconda\lib\site-packages\bokeh\session.py", line 308, in dumps
    rawcss = self._inline_css(self.css_paths()).decode("utf-8")
  File "C:\Anaconda\lib\site-packages\bokeh\session.py", line 143, in _inline_cs
s
    """ % f_name + open(f_name).read().decode("utf-8") + \
IOError: [Errno 2] No such file or directory: 'C:\\Anaconda\\lib\\site-packages\
\bokeh\\server\\static\\vendor/bokehjs\\css/bokeh.css

C:\Anaconda\lib\site-packages\ does not seem to exist on Windows (tested on Win 7 x64).

Docs: please explain how the coffescript based install works

The README.md file does not include many informations. And thus installation is not straightforward

Installation
============

After installing the dependencies (coffeescript, chaco, etc.), run the following:

git clone git://github.com/ContinuumIO/Bokeh.git
cd Bokeh
python coffeebuild.py
pip install .

Report from a first-time user

Hi,

Here's a list of blows received trying out bokeh for the first time.:

  1. installation suggests pip install .. but the webplot demo demands
    python setup.py develop. It's unclear why you would need to reinstall in
    develop mode, until you discover that js files are mysteriously absent.
    and figure out you've missed a step. better docs.
  2. gevent-websocket is a dependency for the server, undocumented.
    (there's an existing open issue)
  3. Once that's done, running python examples/webplot_example.py you hit
    an error in ./bokeh/mpl.py (there's an existing open issue).
    pypi currently holds Requests 1.1.0, in the version request.json is a function, not a property. It was a property in previous versions (I had 0.14.2 outside the virtualenv). Bokeh doesn't handle this, so all references to self.userinfo break because it
    gets assigned r.json rather then r.json(). same for apikey.
  4. IPython is a dependency of mpl.py, not documented.
  5. Once the local web server does start up, running examples/webplot_example.py
    throws you the following exception:
Traceback (most recent call last):
  File "examples/webplot_example.py", line 13, in <module>
    p.plot(x, y, 'orange')
  File "/home/user1/src/Bokeh/bokeh/mpl.py", line 565, in plot
    scatter=scatter
  File "/home/user1/src/Bokeh/bokeh/mpl.py", line 174, in plot
    if data_source.typename == 'PandasDataSource':
AttributeError: 'NoneType' object has no attribute 'typename'
  1. Is pandas another undocumented dependency?
  2. glyph_example.py or pandas_example.py seem to run without
    error and new entries are generated in the browser window, but no plots
    become visible nor does clicking produce any effect. I see
    no error in the console.
  3. Giving up on the plot server, I ran examples/local_example.py
    and got that exception again.
  4. Going back to the README, i tried the "static HTML dump" clause,
    and ran python tests/web/facetgrid.py, only to get an exception because
    the code tries to open a csv file using a relative path, expecting the user
    to be in the same dir.
  5. changed firectory, ran the script which generated a 1MB HTML file (?!?).
    I opened it in chrome (v25), which produced a syntax error at line 33064 and
    no visual output of any kind.

So I went to google and checked out "bokeh python", Found a tweet from 2 months ago by @pzwang pointing at
an HTML preview of Bokeh (Finally!)... The link was broken.

Add mpl style gallery to project page

Display a thumbnail gallery of sample plots, that takes users to live, interactive plots together with the python Code used to generate the plot.

readme should refer to redis, requests & jinja2 dependencies

Installation was a breeze (thankyou!) however it required me to install redis, requests and jinja2. These are well-known packages to me but conceivably the following could cause confusion to those who aren't familiar with them:

from bokeh import mpl
Traceback (most recent call last):
File "", line 1, in
File "bokeh/mpl.py", line 4, in
import requests
ImportError: No module named requests

from bokeh import mpl
Traceback (most recent call last):
File "", line 1, in
File "bokeh/mpl.py", line 6, in
import bbmodel
File "bokeh/bbmodel.py", line 9, in
import redis
ImportError: No module named redis

p.htmldump("foo.html")
Traceback (most recent call last):
File "", line 1, in
File "bokeh/mpl.py", line 576, in htmldump
html = self.make_html(self.models.values(), inline=inline)
File "bokeh/mpl.py", line 549, in make_html
import jinja2
ImportError: No module named jinja2

No file or directory bokeh.css

I have just installed Bokeh on win7 with

$ pip install -e git+https://github.com/ContinuumIO/Bokeh.git#egg=bokeh

When I tried to run the two examples

$ python glyph1.py in examples/glyphs/.
$ python rects.py in examples/plotting/.

I get the following traceback

PS C:\Users\bevanj\src\bokeh\examples\plotting> python .\rects.py
Traceback (most recent call last):
File ".\rects.py", line 13, in <module>
save()
File "c:\users\bevanj\src\bokeh\bokeh\plotting.py", line 265, in save
session.save()
File "c:\users\bevanj\src\bokeh\bokeh\session.py", line 337, in save
s = self.dumps(js, css, rootdir)
File "c:\users\bevanj\src\bokeh\bokeh\session.py", line 308, in dumps
rawcss = self._inline_css(self.css_paths()).decode("utf-8")
File "c:\users\bevanj\src\bokeh\bokeh\session.py", line 143, in _inline_css
""" % f_name + open(f_name).read().decode("utf-8") + \
IOError: [Errno 2] No such file or directory:        'c:\\users\\bevanj\\src\\bokeh\\bokeh\\server\\static\\vendor/bokehjs\\css/bokeh.css'

Any suggestions as to what I am doing wrong?

Installation successful, examples fail

Examples fail with:

Traceback (most recent call last):
  File "glyphs/glyph1.py", line 59, in <module>
    sess.save(js="relative", css="relative", rootdir=os.path.abspath("."))
  File "/usr/local/lib/python2.7/dist-packages/bokeh/session.py", line 344, in save
    s = self.dumps(js, css, rootdir)
  File "/usr/local/lib/python2.7/dist-packages/bokeh/session.py", line 314, in dumps
    rawcss = self._inline_css(self.css_paths()).decode("utf-8")
  File "/usr/local/lib/python2.7/dist-packages/bokeh/session.py", line 143, in _inline_css
    """ % f_name + open(f_name).read().decode("utf-8") + \
IOError: [Errno 20] Not a directory: '/usr/local/lib/python2.7/dist-packages/bokeh/server/static/vendor/bokehjs/vendor/bootstrap/css/bootstrap.css'

Revamp the tool UI (and possible the architecture for how tools/interactions are plugged in)

Key Goals

  • Create standard look-and-feel for Bokeh plots. I see the tool palette and status bar as being part of the definitive and distinguishing "chrome" for Bokeh plots.
  • Make tool palette look good on a variety of themes (dark and light background)
  • Have a place to display readouts from inspection tools
  • Have a place to provide usage hints to users (e.g. "Drag: pan Wheel: zoom R-Drag: box-select") that can dynamically change when user pressed modifier keys

Low-level details

  • Move resize to a corner widget/scrubber
  • Handle constrained pan & zoom, both limited in terms of dimension as well as bounded in terms of data range (e.g. max zoom in/out)
  • Design this to work well in both "concealed" mode that only pops up when the user mouses into a plot region, as well as in "show" mode that is always on
  • Keep touch events in mind, and think about how to present a possibly different set of interaction hints for touch-enabled browsers.
  • Add a lasso, polyline, and range mode to the selection tool
  • When designing the chrome, think about how to eventually add links to origin notebooks and sources, etc.

Zooming in on x axis but not y axis

I have some time series I want to drag around and zoom in on. Is it possible to zoom in on only the x axis and not the y axis?

If not, where's the right place to start looking to make this possible?

How does date plotting work?

enjoying playing with this so far.

I ran

from bokeh import mpl
import numpy as np
import pandas as pd
p = mpl.PlotClient()
p.notebooksources()
dates = pd.date_range('2012-01-02', '2012-01-05', freq='H')
values = np.arange(len(dates))
plot = p.plot(x=dates, y=values, color='orange',  width=700, is_x_date=True, )
plot.notebook()
p.figure()

and got an empty plot. Why?

WindowsError: [Error 2] The system cannot find the file specified

When I try to run

$ python runserver

I get the following traceback

PS C:\Users\bevanj> cd .\src\bokeh
PS C:\Users\bevanj\src\bokeh> python .\runserver.py
Traceback (most recent call last):
  File ".\runserver.py", line 46, in <module>
    main()
  File ".\runserver.py", line 43, in main
    start.start_app(verbose=args.verbose)
  File "C:\Users\bevanj\src\bokeh\bokeh\server\start.py", line 94, in start_app
    start_services()
  File "C:\Users\bevanj\src\bokeh\bokeh\server\start.py", line 82, in start_services
    bokeh_app.redis_port, os.getcwd())
  File "C:\Users\bevanj\src\bokeh\bokeh\server\services.py", line 19, in start_redis
    stderr=sys.stderr
  File "c:\users\bevanj\git_repositories\continuumweb\continuumweb\launch_process.py", line 29, in __init__
    stdin=stdin)
  File "C:\Python27\lib\subprocess.py", line 711, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 948, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Exception KeyError: KeyError(36739552,) in <module 'threading' from 'C:\Python27\lib\threading.pyc'> ignored
PS C:\Users\bevanj\src\bokeh> "C:\Users\bevanj\src\bokeh\bokeh\server\services.py",

setup.py script

I think Bokeh is a wonderful idea and have been looking forward to playing with it. It is possible to add an installation script? I have been playing with your tests but it would be easier if it could be installed via a script.

thanks,
zach cp

List of commands

I cannot find a list of commands to actually use Bokeh in the terminal. I read through your Readme file and I didn't find any instructions on how to actually use the program in the terminal or in a user interface now that I have Bokeh and all it's dependencies installed on Windows. Where can I find this information? Thank you,
Alexander Morgan

No such file or directory: '.../static/vendor/bokehjs/js/base.js' when running example notebook

I tried installing Bokeh and running the ipython notebook in examples, but got the following error:

IOError                                   Traceback (most recent call last)
<ipython-input-1-f68821c6493e> in <module>()
      2 import numpy as np
      3 p = mpl.PlotClient()
----> 4 p.notebooksources()

/usr/local/lib/python2.7/dist-packages/bokeh/mpl.pyc in notebooksources(self)
    311     def notebooksources(self):
    312         import IPython.core.displaypub as displaypub
--> 313         jsstr = inline_scripts(dump.notebook_script_paths)
    314         cssstr = inline_css(dump.css_paths)
    315         template = get_template('source_block.html')

/usr/local/lib/python2.7/dist-packages/bokeh/mpl.pyc in inline_scripts(script_paths)
    593 
    594 def inline_scripts(script_paths):
--> 595     js = dump.concat_scripts(script_paths)
    596     jsstr = """
    597 <script type=text/javascript>

/usr/local/lib/python2.7/dist-packages/bokeh/dump.pyc in concat_scripts(paths)
     57           """ % f_name
     58 
---> 59         output_str += open(f_name).read()
     60         output_str += """
     61           // END %s

IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/bokeh/server/static/vendor/bokehjs/js/base.js'

Plotting a pandas dataframe?

I see that there's a pandas dependency, and some mentions of pandas in the source -- is there a way right now to plot dataframes like df.plot() with matplotlib?

Installation problems

I am new to all of this so please let me know if you need more information, but I have all dependencies installed however I cannot get Bokeh to install:

Command python setup.py egg_info failed with error code 1 in /var/folders/Xs/Xs3BR-03GQGrXBHG6s-JSk+++TI/-Tmp-/pip-0yHevL-build

Any thoughts about why?

Thanks

ggplot example using ipython notebook?

Hi Guys,

Great to see Bokeh up and running. I am excited about this library. I am wondering if it is possible to plot ggplot objects in an ipython notebook. I am particularly interested in faceted charts like that in the facetgrid.py script.

The facetgrid.py script creates a ggplot object and then sends it to html using ggplot_object.to_html(). Alternatively the ipython notebook, bokehnotebook in the examples folder uses plot.notebook()to plot within the ipython notebook.

Is there currently a way to get ggplot object to plot in the ipython notebook? I've tried a few things like this to no avail:

import pandas as pd
auto = pd.read_csv('../tests/auto-mpg.csv')

g = ggplot(df, aes("displ", "mpg", color="green")) + facet_grid("cyl", "origin") + geom_point()
plot = p.plot(g)
plot.notebook()

thanks again for this exciting library,
zach cp

Bokeh in hung state...no known reset procedure

I was trying to understand the glyph_examples file and I have gotten Bokeh into a state that I don't know how to fix.

To reproduce the situation (now confirmed steps):

  1. Removed line 57 from examples/glyph_example.py (starts with "p.bbclient...")
  2. Executed "python examples/glyph_example.py"
  3. Went to localhost:5006/bokeh/ and there are no plots and the "close all plots" link has disappeared (so the page is white with the word "Plots" at the top).
  4. Executing any bokeh program and nothing shows up on the page.

I stopped the Bokeh-running python process and restarted it..still broken.
I stopped Bokeh and then the redis server, and restarted both…still broken.
I stopped everything again, re-ran "python setup.py develop"..still broken
I have shutdown and restarted just redis…still broken.
I pulled an updated copy of Bokeh and shutdown/restarted everything…still broken.

Any idea how to un-break my install?
Any idea why removing that line borks it so thoroughly?

Resolution of this bug could take two forms (not mutually exclusive):

  1. Instructions on how to reset Bokeh entirely probably need to be put somewhere. (Please...soon...so I can work on the Stencil emitters more...)
  2. Prevent the hung-state in some way

License

Hi guys,

I noticed there wasn't a license in the root Bokeh folder. I was wondering if you guys yet had a sense of the license type that you'd expect to release Bokeh under?

protovis is discontinued

Protovis library is discontinued for quite some time now. Are you planning on taking over development of protovis from the author, or will you move to D3

Grid plots currently have toolbars on every single subplot

See either the grid.py example in examples/glyphs/ or consult BokehJS grid_plot example. Ideally we'd move the toolbar outside of the entire grid, and tools will be written/refactored to not rely on the idea that they are bound to a single plot; they may have multiple plots they are awaiting events from.

setup.py fails for versions of requests prior to 0.10.0 & suggested fix

Running 'pip install .' on a Ubuntu server running 12.04 LTS with requests 0.8.2 (which comes via packages), using Response.content provides content in Unicode and then f.write() produces:

'''
downloading compiled javascript from github
Traceback (most recent call last):
File "", line 14, in
File "/tmp/pip-f2KEWv-build/setup.py", line 15, in
f.write(jssource)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u03bc' in position 18558: ordinal not in range(128)
Complete output from command python setup.py egg_info:
downloading compiled javascript from github
Traceback (most recent call last):
File "", line 14, in
File "/tmp/pip-f2KEWv-build/setup.py", line 15, in
f.write(jssource)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u03bc' in position 18558: ordinal not in range(128)
'''

It is specifically choking on the micro symbol that is contained in d3_formatPrefixes in d3.v2.js

Demoing this in the interpreter:
tim@cyclone:~/work/bokeh$ python
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import requests
requests.version
'0.8.2'
response = requests.get('http://raw.github.com/ContinuumIO/bokehjs-build/master/application.js')
response.headers['content-type']
'text/plain; charset=utf-8'
response.content[:5]
u'(func'
response.text[:5]
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'Response' object has no attribute 'text'
with open("foo.js","w+") as f:
... f.write(response.content)
...
Traceback (most recent call last):
File "", line 2, in
UnicodeEncodeError: 'ascii' codec can't encode character u'\u03bc' in position 18558: ordinal not in range(128)

As per the requests changelog, https://github.com/kennethreitz/requests/blob/master/HISTORY.rst
the Response object changed in 0.10.0 so that Response.content provides bytes and Response.text provides Unicode. Given that the source content from github is utf-8, using Response.text to pull the compiled javascript as Unicode and then writing the file as UTF-8 encoded seems valid. Thus:

  • any non-ASCII used by any vendor javascript would be catered for
  • anyone trying an install and producing a requests error of 'Response' object has no attribute 'text' could be easily identified as having an old requests package
  • requests minimum version requirement could be set to 0.10.0 (which is currently about a year old - seems fairly reasonable)

Tool that can re-normalize line plots (timeseries) relative to each other in various ways

Suppose you have 2 or more timeseries and want to plot them as separate lines in a multi-line plot. This works great if the dynamic ranges of each input are similar but can be visually dominated by a single line if that line has a much wider range.

Often a caller to a multi-line plotting API needs to normalize the inputs to make them "fit together". Fortunately, there is a very intuitive/canonical set of normalizations the user might try and several of them are "guaranteed to work" (at least visually).

It would be cool to provide a Bokeh tool (i.e. button like zoom/pan) that could select (or cycle thru?) the normalizations dynamically without the user/programmer needing an expensive break in the workflow. The operations are pretty cheap to compute so this can probably be done from javascript directly.

Here's a set of normalizations:

This first set uses a common y-axis.

  • default: do nothing, it will be dominated by the largest of the dynamic ranges
  • take logs (if both arrays are always positive)
  • subtract first value from each timeseries (so they all start at zero)
  • subtract the means (so they average to zero, but might not start together)
  • subtract the means AND divide by the stddev's (guaranteed to "work")

Alternatively, we can use a separate y-axis for each timeseries. This is similar in spirit to dividing by stddev but has the possible advantage that the user can still read off the raw values. Unfortunately it only works for a small set (2 or maybe 3).

So if there are only a few series you can use separate y-axes and:

  • make the min/max lineup visually
  • make the means lineup visually
  • make the starting value lineup visually

I think this would be pretty useful as a Bokeh tool that could be added to basically any multi-line plot.

ggplot gives error on Aesthetic Object

/usr/local/lib/python2.7/site-packages/bokeh/ggplot.pyc in init(self, x, y, *_kwtraits)
63 def init(self, x=None, y=None, *_kwtraits):
64 if x:
---> 65 self.x = x
66 if y:
67 self.y = y

/usr/local/lib/python2.7/site-packages/bokeh/properties.pyc in set(self, obj, value)
41 def set(self, obj, value):
42 old = self.get(obj)
---> 43 obj._changed_vars.add(self.name)
44 if self.matches(value, old):
45 return

AttributeError: 'Aesthetic' object has no attribute '_changed_vars'

Trouble with the examples

I think that I have all of the correct dependencies. I'm not sure what this means.

$ python webplot_example.py 
Traceback (most recent call last):
  File "webplot_example.py", line 2, in <module>
    p = mpl.PlotClient('defaultdoc', 'http://localhost:5006', 'nokey')
  File "/Users/sean/Documents/workspace/Bokeh/bokeh/mpl.py", line 302, in __init__
    typename='PlotContext')
  File "/Users/sean/Documents/workspace/Bokeh/bokeh/bbmodel.py", line 128, in fetch
    attrs = self.ph.deserialize_web(self.s.get(url).content)
  File "/usr/local/epd-64-722/lib/python2.7/site-packages/requests/sessions.py", line 310, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/epd-64-722/lib/python2.7/site-packages/requests/sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "/usr/local/epd-64-722/lib/python2.7/site-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/epd-64-722/lib/python2.7/site-packages/requests/adapters.py", line 209, in send
    raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=5006): Max retries exceeded with url: /bokeh/bb/defaultdoc/PlotContext (Caused by <class 'socket.error'>: [Errno 61] Connection refused)

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.