GithubHelp home page GithubHelp logo

bqplot / bqplot Goto Github PK

View Code? Open in Web Editor NEW
3.6K 3.6K 462.0 59.19 MB

Plotting library for IPython/Jupyter notebooks

Home Page: https://bqplot.github.io/bqplot

License: Apache License 2.0

Python 20.24% JavaScript 0.54% TypeScript 72.59% Less 1.00% Jupyter Notebook 5.58% HTML 0.05%
ipython jupyter visualizations

bqplot's Introduction

bqplot

bqplot.

Binder Chat

2-D plotting library for Project Jupyter

Introduction

bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar of Graphics.

Wealth of Nations

In bqplot, every component of a plot is an interactive widget. This allows the user to integrate visualizations with other Jupyter interactive widgets to create integrated GUIs with a few lines of Python code.

Documentation

You can follow the documentation on https://bqplot.github.io/bqplot

Trying it online

To try out bqplot interactively in your web browser, just click on the binder link:

Binder

Dependencies

This package depends on the following packages:

  • ipywidgets (version >=7.0.0, <8.0)
  • traitlets (version >=4.3.0, <5.0)
  • traittypes (Version >=0.2.1, <0.3)
  • numpy
  • pandas

Installation

Using pip:

$ pip install bqplot

Using conda

$ conda install -c conda-forge bqplot

If you are using JupyterLab <=2:

$ jupyter labextension install @jupyter-widgets/jupyterlab-manager bqplot
Development installation

For a development installation (requires JupyterLab (version >= 4) and yarn):

$ git clone https://github.com/bqplot/bqplot.git
$ cd bqplot
$ pip install -e .
$ jupyter nbextension install --py --overwrite --symlink --sys-prefix bqplot
$ jupyter nbextension enable --py --sys-prefix bqplot

Note for developers: the --symlink argument on Linux or OS X allows one to modify the JavaScript code in-place. This feature is not available with Windows.

For the experimental JupyterLab extension, install the Python package, make sure the Jupyter widgets extension is installed, and install the bqplot extension:

$ pip install "ipywidgets>=7.6"
$ jupyter labextension develop . --overwrite

Whenever you make a change of the JavaScript code, you will need to rebuild:

cd js
jlpm run build

Then refreshing the JupyterLab/Jupyter Notebook is enough to reload the changes.

Running tests

You can install the dependencies necessary to run the tests with:

    conda env update -f test-environment.yml

And run it with for Python tests:

    pytest

And cd js to run the JS tests with:

jlpm run test

Every time you make a change on your tests it's necessary to rebuild the JS side:

jlpm run build

Examples

Using the pyplot API

Pyplot Screenshot

Using the Object Model API

Bqplot Screenshot

Install a previous bqplot version (Only for JupyterLab <= 2)

In order to install a previous bqplot version, you need to know which front-end version (JavaScript) matches with the back-end version (Python).

For example, in order to install bqplot 0.11.9, you need the labextension version 0.4.9.

$ pip install bqplot==0.11.9
$ jupyter labextension install [email protected]

Versions lookup table:

back-end (Python) front-end (JavaScript)
0.12.14 0.5.14
0.12.13 0.5.13
0.12.12 0.5.12
0.12.11 0.5.11
0.12.10 0.5.10
0.12.9 0.5.9
0.12.8 0.5.8
0.12.7 0.5.7
0.12.6 0.5.6
0.12.4 0.5.4
0.12.3 0.5.3
0.12.2 0.5.2
0.12.1 0.5.1
0.12.0 0.5.0
0.11.9 0.4.9
0.11.8 0.4.8
0.11.7 0.4.7
0.11.6 0.4.6
0.11.5 0.4.5
0.11.4 0.4.5
0.11.3 0.4.4
0.11.2 0.4.3
0.11.1 0.4.1
0.11.0 0.4.0

Development

See our contributing guidelines to know how to contribute and set up a development environment.

License

This software is licensed under the Apache 2.0 license. See the LICENSE file for details.

bqplot's People

Contributors

agoose77 avatar astrofrog avatar blink1073 avatar cclauss avatar chakricherukuri avatar claytonpassmore avatar davidbrochart avatar dependabot[bot] avatar dmadeka avatar github-actions[bot] avatar havaldar avatar ibdafna avatar jasongrout avatar johanmabille avatar jtpio avatar kaiayoung avatar kpfleming avatar maartenbreddels avatar marimeireles avatar mariobuikhuizen avatar martinrenou avatar mbektas avatar meeseeksmachine avatar mheilman avatar mwcraig avatar rmenegaux avatar ssunkara1 avatar sylvaincorlay avatar timgates42 avatar vishalya 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

bqplot's Issues

Python 3 Support?

I ran into this error:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/Users/ssilvester/workspace/bqplot/bqplot/pyplot/pyplot.py in reset(_)
     96 
     97     def reset(_):
---> 98         pz.reset()
     99 
    100     def save(_):

/Users/ssilvester/workspace/bqplot/bqplot/interacts.py in reset(self)
    159     def reset(self):
    160         for k in self.scales:
--> 161             for i in xrange(len(self.scales[k])):
    162                 self.scales[k][i].set_state(self.scales_states[k][i])
    163                 self.scales[k][i].send_state()

NameError: name 'xrange' is not defined

not able to figure out why bqplot stops working, and how to make it work again quickly

hi,

After having removed bqplot, it seems it doesn't want to plot anymore, Ipython stalls and nothing happens.

I don't see any error message, kernerl doesn't want to interrupt itself (remains in non-empty circle mode). Have you a wild guess ? (using current trunk in this try)

bqplot_blocking

!pip list

adodbapi (2.6.0.7)
alabaster (0.7.6)
astroid (1.3.6)
Babel (2.1.1)
backports-abc (0.4)
backports.ssl-match-hostname (3.4.0.2)
baresql (0.7.2)
bcolz (0.11.4)
beautifulsoup4 (4.4.1)
blaze (0.8.3)
blosc (1.2.8)
bloscpack (0.9.0)
bokeh (0.10.0)
Bottleneck (1.0.0)
bqplot (0.3.10.dev0)
brewer2mpl (1.4.1)
castra (0.1.6)
certifi (2015.9.6.1)
cffi (1.2.1)
click (5.0)
colorama (0.3.3)
configparser (3.5.0b2)
cvxopt (1.1.7)
cx-Freeze (4.3.4)
cycler (0.9.0)
cyordereddict (0.2.2)
Cython (0.23.4)
cytoolz (0.7.3)
dask (0.7.3)
datashape (0.4.7)
db.py (0.4.4)
decorator (4.0.4)
dill (0.2.4)
docopt (0.6.2)
docutils (0.12)
enum34 (1.0.4)
Flask (0.10.1)
formlayout (1.0.15)
funcsigs (0.4)
functools32 (3.2.3.post2)
greenlet (0.4.9)
guidata (1.7.0b5)
guiqwt (3.0.0b6)
h5py (2.5.0)
holoviews (1.3.2)
husl (4.0.3)
ipykernel (4.1.1)
ipyparallel (4.0.2)
ipython (4.0.0)
ipython-genutils (0.1.0)
ipython-sql (0.3.7.1)
ipywidgets (4.1.0)
itsdangerous (0.24)
jedi (0.8.1)
Jinja2 (2.8)
joblib (0.9.2)
jsonschema (2.5.1)
julia (0.1.1.8)
jupyter (1.0.0)
jupyter-client (4.1.1)
jupyter-console (4.0.3)
jupyter-core (4.0.6)
Keras (0.2.0)
llvmlite (0.6.0)
lmfit (0.9.1)
locket (0.2.0)
logilab-common (1.1.0)
lxml (3.4.4)
Markdown (2.6.2)
MarkupSafe (0.23)
matplotlib (1.5.0rc2)
mingwpy (0.1.0b3)
mistune (0.7.1)
mpld3 (0.2)
multipledispatch (0.4.8)
mysql-connector-python (2.0.4)
nbconvert (4.0.0)
nbformat (4.0.1)
netCDF4 (1.2.1)
networkx (1.10)
nltk (3.0.5)
nose (1.3.7)
notebook (4.0.6)
numba (0.20.0)
numexpr (2.4.4)
numpy (1.9.3)
numpydoc (0.5)
oct2py (3.3.3)
odo (0.3.4)
pandas (0.17.0)
pandas-datareader (0.2.0)
param (1.3.2)
partd (0.3.2)
path.py (8.1.2)
patsy (0.4.0)
pep8 (1.6.2)
pg8000 (1.10.2)
pickleshare (0.5)
Pillow (3.0.0)
pip (7.1.2)
pkginfo (1.2.1)
prettytable (0.7.2)
psutil (3.2.2)
PuLP (1.5.9)
py (1.4.30)
PyAudio (0.2.8)
pybars3 (0.9.1)
pycparser (2.14)
pyflakes (0.9.2)
Pygments (2.0.2)
pyhdf (0.8.3)
pylint (1.4.3)
PyMeta3 (0.5.1)
pymongo (3.0.3)
pyodbc (3.0.10)
PyOpenGL (3.1.0)
pyparsing (2.0.3)
PyQt4 (4.11.4)
PyQtdesignerplugins (1.1)
pyqtgraph (0.9.10)
PyQwt (5.2.1)
pyserial (2.7)
pystache (0.5.4)
pytest (2.8.2)
python-dateutil (2.4.2)
PythonQwt (0.3.0)
pytz (2015.6)
pywin32 (219)
PyYAML (3.11)
pyzmq (14.7.0)
qtconsole (4.1.0)
redis (2.10.3)
reportlab (3.2.0)
requests (2.8.1)
requests-toolbelt (0.4.0)
rope (0.10.2)
rpy2 (2.7.2)
Rx (1.2.3)
scikit-image (0.11.3)
scikit-learn (0.16.1)
scilab2py (0.6)
scipy (0.16.0)
seaborn (0.7.0.dev0)
setuptools (18.4)
simplegeneric (0.8.1)
simplejson (3.8.0)
singledispatch (3.4.0.3)
six (1.10.0)
snowballstemmer (1.2.0)
Sphinx (1.3.1)
sphinx-rtd-theme (0.1.9)
spyder (3.0.0.dev0)
SQLAlchemy (1.0.8)
sqlite-bro (0.8.10)
sqlparse (0.1.16)
statsmodels (0.6.1)
sympy (0.7.6.1)
tables (3.2.2)
Theano (0.7.0)
toolz (0.7.4)
tornado (4.2.1)
traitlets (4.0.0)
twine (1.6.3)
twitter (1.17.1)
ViTables (2.1)
Werkzeug (0.10.4)
wheel (0.26.0)
winpython (1.2)
xlrd (0.9.4)
XlsxWriter (0.7.6)
xray (0.6.0)

"click" event in Scatter

I tried to enable both of hover and click interactions in Scatter by something like below:

scatter_chart = bq.Scatter(x=x_data, y=y_data, scales= {'x': x_sc, 'y': y_sc})
scatter_chart.interactions={'hover':'tooltip','click':'tooltip'}

def print_name(self, target):
    print("hover")
def print_figure(self, target):
    print ("clicked")

scatter_chart.on_hover(print_name)
scatter_chart.on_click(print_figure)

"hover" works fine. But "click" does not work. Did I do something wrong?

Lines ignore values after infinite values

Linechart seems to ignore subsequent valid numerical values after first non
finite number. E.g. in example below y values of 4 & 5 are not displayed.

import numpy as np
from IPython.display import display
from bqplot import *

sc_x = LinearScale()
sc_y = LinearScale()

line = Lines(x=[1,2,3,4,5], y=[1,2,np.inf,4, 5],
             scales={'x': sc_x, 'y': sc_y})
ax_x = Axis(scale=sc_x, label='index')
ax_y = Axis(scale=sc_y, orientation='vertical')

fig = Figure(marks=[line], axes=[ax_x, ax_y])
display(fig)

Reported by @Arun-Verma

bqplot stalls ipython(2/3) sessions

When I try any example in a jupyter notebook session either with python2 (2.7.10) or python3 (3.5.0) on either firefox or chromium, the session stalls --- the circle on the upper right side (menu strip) next to the python 2 (or python 3) label becomes filled and the session becomes unresponsive. This happened after an execution of any bqplot function.

System: Archlinux on a sandy bridge processor PC.
bqplot versions: 0.3.9, 0.4.1, and 0.4.2

how to use from client side browser if bqplot is only installed on server side?

it looks like the javascript and maybe even python code need to be installed on client side when using jupyter notebook server from remote machine?

right now if the javascript code is not installed, the code execution of bqplot just freezes.

this is very confusing for the user.

also when multiple users access the same remote jupyter notebook, then plots seem to break.

bqplot not working on macbook

I followed the installation directions, but the example notebooks either stall or they don't create the
javascript-based figure.

GridHeatMap strokes

The GridHeatMap does not use multiple layers ala the Map Mark, as a result, strokes on individual cells do not show correctly.

Map widget's `selected` attribute is overloaded to not allow None.

At the moment, the Map widget overloads the selected attribute in order to disallow None.

Other marks make a distinction between an empty selection and the absence of a selection. It would be nice to unify Map with the other marks in this regard.

Note for self: this will require changing the js-side default value after #88.

cc @dmadeka

Use of deprecated: from IPython import display

Examples and source use:

from IPython.display import display

Jupyter 4.0.3 warning: You should import from ipykernel or jupyter_client instead

I don't yet know the equivalent to the deprecated IPython.display, but as I am having no success yet displaying bqplot inline images, executed cell index remains at [*] with no other information), it seemed worth mentioning.

bqplot doesn't work with probplot when emulating matplotlib

Thanks for bqplot! It would be really great if it worked with libraries designed for matplotlib too like scipy.stats.probplot. I get

# ax1 = plt.subplot(111) -- doesn't make sense apparently.
p = probplot(n, plot=plt)
---------------------------------------------------------------------------
TraitError                                Traceback (most recent call last)
<ipython-input-7-f0fe6c3a8d01> in <module>()
      1 # ax1 = plt.subplot(111) -- doesn't make sense apparently.
----> 2 p = probplot(n, plot=plt)

//anaconda/lib/python2.7/site-packages/scipy/stats/morestats.pyc in probplot(x, sparams, dist, fit, plot)
    424 
    425     if plot is not None:
--> 426         plot.plot(osm, osr, 'bo', osm, slope*osm + intercept, 'r-')
    427         try:
    428             if hasattr(plot, 'set_title'):

/Users/awatters/repos/bqplot/bqplot/pyplot/pyplot.pyc in plot(*args, **kwargs)
    460         length = len(args[0])
    461         kwargs['x'] = np.linspace(0.0, length - 1, length)
--> 462     return _draw_mark(Lines, **kwargs)
    463 
    464 

/Users/awatters/repos/bqplot/bqplot/pyplot/pyplot.pyc in _draw_mark(mark_type, options, axes_options, **kwargs)
    420             scales[name] = _context['scales'][dimension]
    421 
--> 422     mark = mark_type(scales=scales, **kwargs)
    423     _context['last_mark'] = mark
    424     fig.marks = [m for m in fig.marks] + [mark]

/Users/awatters/repos/bqplot/bqplot/marks.pyc in __init__(self, **kwargs)
    191 
    192     def __init__(self, **kwargs):
--> 193         super(Mark, self).__init__(**kwargs)
    194         self._hover_handlers = CallbackDispatcher()
    195         self._click_handlers = CallbackDispatcher()

//anaconda/lib/python2.7/site-packages/ipywidgets/widgets/widget.pyc in __init__(self, **kwargs)
    170         """Public constructor"""
    171         self._model_id = kwargs.pop('model_id', None)
--> 172         super(Widget, self).__init__(**kwargs)
    173 
    174         Widget._call_widget_constructed(self)

//anaconda/lib/python2.7/site-packages/traitlets/config/configurable.pyc in __init__(self, **kwargs)
     72 
     73         # load kwarg traits, other than config
---> 74         super(Configurable, self).__init__(**kwargs)
     75 
     76         # load config

//anaconda/lib/python2.7/site-packages/traitlets/traitlets.pyc in __init__(self, *args, **kw)
    586         with self.hold_trait_notifications():
    587             for key, value in iteritems(kw):
--> 588                 setattr(self, key, value)
    589 
    590     @contextlib.contextmanager

//anaconda/lib/python2.7/contextlib.pyc in __exit__(self, type, value, traceback)
     22         if type is None:
     23             try:
---> 24                 self.gen.next()
     25             except StopIteration:
     26                 return

//anaconda/lib/python2.7/site-packages/traitlets/traitlets.pyc in hold_trait_notifications(self)
    630                         self._trait_values.pop(name)
    631                 cache = {}
--> 632                 raise e
    633             finally:
    634                 self._notify_trait = _notify_trait

TraitError: Missing scale for data attribute y.

Maybe adding a default scale would fix it? (I tried attaching a complete notebook, but github didn't accept it).

If this sort of backwards compatibility is not a priority for the project, please delete this issue.

trying to adapt to bqplot 0.6.1

bqplot06
hi,

I have a few issues trying to adapt to bqplot 0.6.1. at instalaltion time, I get a:

jupyter.exe nbextension enable --py bqplot
Enabling notebook extension bqplot/extension...
      - Validating: ok

at run time I get;

[NotebookApp] server_extensions is deprecated, use nbserver_extensions
D:\WinPython\basedir34\buildQt5\winpython-64bit-3.4.x.3\python-3.4.4.amd64\lib\site-packages\widgetsnbextension\__init__.py:30: UserWarning: To use the jupyter-js-widgets nbextension, you'll need to update
    the Jupyter notebook to version 4.2 or later.
  the Jupyter notebook to version 4.2 or later.""")
[INotebookApp] Loading IPython parallel extension
[NotebookApp] Serving notebooks from local directory: D:\WinPython\basedir34\buildQt5\winpython-64bit-3.4.x.3\notebooks
...
...

[NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20160426170626 (::1) 33.00ms referer=http://localhost:8888/notebooks/Untitled.ipynb?kernel_name=python3
[IPKernelApp] WARNING | Widget Javascript not detected.  It may not be installed properly.

I have Jupyter Notebook 4.2.0. What did I miss ?

widgetsnbextension is supposed there. maybe there is an additional step ?

pip list: adodbapi (2.6.0.7)
alabaster (0.7.7)
astroid (1.4.5)
astroML (0.3)
Babel (2.3.2)
backports-abc (0.4)
backports.shutil-get-terminal-size (1.0.0)
baresql (0.7.3)
bcolz (1.0.0)
beautifulsoup4 (4.4.1)
blaze (0.10.0)
blosc (1.3.2)
bloscpack (0.9.0)
bokeh (0.11.1)
Bottleneck (1.0.0)
bqplot (0.6.1)
brewer2mpl (1.4.1)
castra (0.1.7)
certifi (2016.2.28)
cffi (1.6.0)
click (6.6)
cloudpickle (0.2.1)
colorama (0.3.7)
cvxopt (1.1.7)
cx-Freeze (4.3.4)
cycler (0.10.0)
cyordereddict (1.0.0)
Cython (0.24)
cytoolz (0.7.5)
dask (0.8.2)
datashape (0.5.2)
db.py (0.4.4)
decorator (4.0.7)
dill (0.2.5)
docopt (0.6.2)
docrepr (0.1.0)
docutils (0.12)
emcee (2.1.0)
entrypoints (0.2.1)
Flask (0.10.1)
Flask-Cors (2.1.2)
formlayout (1.1.0)
geopy (1.11.0)
greenlet (0.4.9)
guidata (1.7.5)
guiqwt (3.0.2)
h5py (2.6.0)
holoviews (1.4.3)
html5lib (0.9999999)
husl (4.0.3)
idlex (1.13)
imagesize (0.7.1)
ipykernel (4.3.1)
ipyparallel (5.0.1)
ipython (4.2.0)
ipython-genutils (0.1.0)
ipython-sql (0.3.7.1)
ipywidgets (5.0.0)
itsdangerous (0.24)
jedi (0.9.0)
Jinja2 (2.8)
joblib (0.9.4)
jsonschema (2.5.1)
julia (0.1.1.8)
jupyter (1.0.0)
jupyter-client (4.2.2)
jupyter-console (4.1.1)
jupyter-core (4.1.0)
Keras (1.0.1)
Lasagne (0.2.dev1)
lazy-object-proxy (1.2.2)
llvmlite (0.10.0)
lmfit (0.9.3)
locket (0.2.0)
lxml (3.6.0)
Markdown (2.6.6)
MarkupSafe (0.23)
matplotlib (1.5.1)
mingwpy (0.1.0b3)
mistune (0.7.2)
mkl-service (1.1.2)
mpld3 (0.2)
mpmath (0.19)
multipledispatch (0.4.8)
mysql-connector-python (2.0.4)
nbconvert (4.2.0)
nbformat (4.0.1)
netCDF4 (1.2.4)
networkx (1.11)
nltk (3.2.1)
nose (1.3.7)
notebook (4.2.0)
numba (0.25.0)
numexpr (2.5.2)
numpy (1.10.4)
numpydoc (0.6.0)
oct2py (3.5.3)
odo (0.5.0)
pandas (0.18.0)
pandas-datareader (0.2.0)
param (1.3.2)
partd (0.3.2)
patsy (0.4.1)
pep8 (1.7.0)
pg8000 (1.10.5)
pickleshare (0.7.2)
Pillow (3.2.0)
pip (8.1.1)
pkginfo (1.2.1)
prettytable (0.7.2)
prompt-toolkit (0.60)
psutil (4.1.0)
ptpython (0.32)
PuLP (1.6.1)
py (1.4.31)
PyAudio (0.2.9)
pybars3 (0.9.1)
pycparser (2.14)
pyflakes (1.1.0)
Pygments (2.1.3)
pylint (1.5.5)
pymc (2.3.6)
pymc3 (3.0)
PyMeta3 (0.5.1)
pymongo (3.2.2)
pyodbc (3.0.10)
PyOpenGL (3.1.1)
pyparsing (2.1.0)
pyqtgraph (0.9.10)
pyreadline (2.1)
pyserial (3.0.1)
pystache (0.5.4)
pytest (2.9.1)
python-dateutil (2.5.3)
python-hdf4 (0.9)
pythonnet (2.1.0)
PythonQwt (0.5.5)
pytz (2016.4)
pywin32 (220)
PyYAML (3.11)
pyzmq (15.2.0)
QtAwesome (0.3.3)
qtconsole (4.2.1)
QtPy (1.0.1)
redis (2.10.5)
reportlab (3.3.0)
requests (2.9.1)
requests-toolbelt (0.6.0)
rope-py3k (0.9.4.post1)
rpy2 (2.7.8)
Rx (1.2.6)
scikit-image (0.12.3)
scikit-learn (0.17.1)
scikit-neuralnetwork (0.7)
scilab2py (0.6)
scipy (0.17.0)
seaborn (0.7.0)
setuptools (20.9.0)
simplegeneric (0.8.1)
simplejson (3.8.2)
six (1.10.0)
snowballstemmer (1.2.1)
Sphinx (1.4.1)
sphinx-rtd-theme (0.1.9)
spyder (3.0.0.dev0)
SQLAlchemy (1.0.12)
sqlite-bro (0.8.11)
sqlparse (0.1.19)
statsmodels (0.6.1)
sympy (1.0)
tables (3.2.2)
Theano (0.8.2)
toolz (0.7.4)
tornado (4.3)
traitlets (4.2.1)
twine (1.6.5)
twitter (1.17.1)
wcwidth (0.1.6)
Werkzeug (0.11.9)
wheel (0.29.0)
widgetsnbextension (1.0.0)
winpython (1.5.20160402)
wordcloud (1.2.1)
wrapt (1.10.8)
xarray (0.7.2)
xlrd (0.9.4)
XlsxWriter (0.8.5)

observe, method inherited from traitlets

I am playing with the example. After running,

intsel.on_trait_change(interval_change_callback, name='selected')

it says

/home/cloud-user/anaconda3/lib/python3.5/site-packages/ipykernel/__main__.py:8:
 DeprecationWarning: on_trait_change is deprecated: use observe instead

So I tried to use,

intsel.observe(interval_change_callback, names='selected')

The error goes,

TypeError: interval_change_callback() missing 1 required positional argument: 'value'

What arguments should be put in the handler interval_change_callback()?

Interaction Layer example notebook

After hitting "Run All" in the Interaction Layer example notebook, the Line Chart interactions in the different examples are inconsistent. The FastIntervalSelector example is actually an IndexSelector, and the IndexSelector example is a BrushSelector.
This is because the notebook was designed to run sequentially, cell by cell, so the same figure and interaction are used throughout all the examples.

This might be confusing for a new user.

Installation from bdist, wheel, or sdist requires Bower

Installing this without bower globally installed on the system makes installation fail

$ pip install bqplot
...
  ----------------------------------------
  Failed building wheel for bqplot
Failed to build bqplot
Installing collected packages: bqplot
  Running setup.py install for bqplot
    Complete output from command /usr/local/opt/python3/bin/python3.5 -c "import setuptools, tokenize;__file__='/private/var/folders/ps/1dvr90bd6p3blnyrnpyxnryhv45qg1/T/pip-build-guwwr43h/bqplot/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/ps/1dvr90bd6p3blnyrnpyxnryhv45qg1/T/pip-ydoisomt-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    running js
    /usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'License'
      warnings.warn(msg)
    Failed to run bower: [Errno 2] No such file or directory: 'bower'
    error: [Errno 2] No such file or directory: 'bower'

The assets should be packaged up within the release on PyPI within the sdist, bdist, and wheel and the setup.py should not rely on bower when not in development mode.

Installation will work if bower is installed globally.

GridHeatMap Default Colors

Currently GridHeatMap only takes color as a Data Attribute, it would be nice to pass it a list of colors

Matplotlib colormaps

Currently we only support colorbrewer ColorMaps, when matplotlib has many more that have been updated very recently.

Although there are JS libraries that mimic this:

https://github.com/politiken-journalism/scale-color-perceptual

I guess the best way to do it would be to import matplotlib and do it on the Python side. Maybe we can have utils that generate the colors and feed that to a ColorScale.

What do you think @SylvainCorlay @ssunkara1 @jasongrout @ChakriCherukuri @rmenegaux ?

Plot networks

Currently, there is no good library to plot graphs with jupyter/python and I wonder if it would be possible to use the bqplot machinery to do just that (at least when there are not many points).

I did a quick prototype to plot networkx graphs ( https://github.com/albop/backtothetrees/blob/master/bqgraphs.ipynb ) using bqplot and found it very easy. Now I can respond to node click events which makes me very happy ;-)

Things I didn't figured out how to do were:

  • implement a way to let the user move the nodes (and keep the edges in sync)
  • add arrows to the segments (matplotlib has problems there too)
  • label the nodes

Edit: replaced in the issue name networks by graphs. Otherwise it may sound confusing.

`Future warning trying candles.ipynb on ipython4 / pandas 0.17rc2

# Split up the data into x and y points

from bqplot.traits import convert_to_date

​

dates_all = []

prices = []

for item in price_data:

    dates_all.append(item[0])

    prices.append(item[1])

dates_all = convert_to_date(dates_all)

​

prices2 = []

dates_all2 = []

for item in price_data2:

    dates_all2.append(item[0])

    prices2.append(item[1])



dates_all2 = convert_to_date(dates_all2)

D:\result_tests\winpython-3.4.3.6Qt5_build3.amd64\python-3.4.3.amd64\lib\site-packages\bqplot\traits.py:184: FutureWarning: the coerce=True keyword is deprecated, use errors='coerce' instead
  temp_val = pd.to_datetime(array, coerce=True, box=False, infer_datetime_format=True)

GridHeatMap

I am experimenting this GridHeatMap. I wonder there is a way of changing the colorscale through ColorScale(scheme='something') so that the heat map gives red to large values and blue to small values. The default one gives green to large values and red to small values. What's more, how to display the heat map legend so that it's easier for people to tell approximately the numbers from the colors.

Pie Chart Labels don't show up

The following code snippet doesn't print labels on the pie slices
"from bqplot import *
from IPython.display import display
pie = Pie(sizes=[], select_slices=True, opacities=[0.2])
pie_fig = Figure(marks=[pie])
pie.sizes=[1,2,3]
pie.labels = ['A','B','C']

display(pie_fig)"

However, if next I change sizes via pie.sizes=[1,2,4], labels show up!

Missing a file on install

I followed the install instructions for Linux (I'm on a Mac) and tried to run the example code in the notebook, but I'm getting this error:

[W 15:54:49.951 NotebookApp] 404 GET /nbextensions/bqplot/components/d3/d3.js (::1) 5.70ms referer=http://localhost:8888/notebooks/Untitled1.ipynb?kernel_name=python3

python 2 only?

the code seems breaking in python 3 on 'Reset View' command:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
C:\Users\denis\Anaconda3\lib\site-packages\bqplot\pyplot\pyplot.py in reset(_)
     96 
     97     def reset(_):
---> 98         pz.reset()
     99 
    100     def save(_):

C:\Users\denis\Anaconda3\lib\site-packages\bqplot\interacts.py in reset(self)
    159     def reset(self):
    160         for k in self.scales:
--> 161             for i in xrange(len(self.scales[k])):
    162                 self.scales[k][i].set_state(self.scales_states[k][i])
    163                 self.scales[k][i].send_state()

NameError: name 'xrange' is not defined

licensing of notebooks

I think it would be helpful to note the license of the notebooks in the notebooks themselves.

Install Issue

I am running Ubuntu 14.04 and tried to both pip install and build bqplot from source following the instructions in the README file but am receiving the following error message (both dependencies ipywidgets==4.0.3 and numpy==1.9.3 are installed):

What is causing these errors; am I missing some JS dependencies?

Thanks for the help,
Steve Taylor

steve98654@Riemann:~/LocRepos$ pip install bqplot
Collecting bqplot
  Using cached bqplot-0.3.8.tar.gz
Requirement already satisfied (use --upgrade to upgrade): ipywidgets in /home/steve98654/anaconda/lib/python2.7/site-packages (from bqplot)
Requirement already satisfied (use --upgrade to upgrade): numpy in /home/steve98654/anaconda/lib/python2.7/site-packages (from bqplot)
Requirement already satisfied (use --upgrade to upgrade): pandas in /home/steve98654/anaconda/lib/python2.7/site-packages (from bqplot)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /home/steve98654/anaconda/lib/python2.7/site-packages (from pandas->bqplot)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /home/steve98654/anaconda/lib/python2.7/site-packages (from pandas->bqplot)
Building wheels for collected packages: bqplot
  Running setup.py bdist_wheel for bqplot
  Complete output from command /home/steve98654/anaconda/bin/python -c "import setuptools;__file__='/tmp/pip-build-Vfqxcs/bqplot/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmptfN2aypip-wheel-:
  /home/steve98654/anaconda/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'License'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  running js

  Error: Unknown encoding
      at Buffer.write (buffer.js:382:13)
      at new Buffer (buffer.js:261:26)
      at Object.fs.writeFileSync (fs.js:758:12)
      at Function.writeFileSync [as sync] (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/write-file-atomic/index.js:37:12)
      at Object.create.all.set (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/index.js:55:21)
      at Object.Configstore (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/index.js:20:11)
      at new Insight (/usr/local/lib/node_modules/bower/node_modules/insight/lib/index.js:37:34)
      at ensureInsight (/usr/local/lib/node_modules/bower/lib/util/analytics.js:25:19)
      at Object.setup (/usr/local/lib/node_modules/bower/lib/util/analytics.js:41:9)
      at Object.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:72:11)
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-Vfqxcs/bqplot/setup.py", line 204, in <module>
      setup(**setup_args)
    File "/home/steve98654/anaconda/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/home/steve98654/anaconda/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 176, in run
      self.run_command('build')
    File "/home/steve98654/anaconda/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/home/steve98654/anaconda/lib/python2.7/distutils/command/build.py", line 127, in run
      self.run_command(cmd_name)
    File "/home/steve98654/anaconda/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-Vfqxcs/bqplot/setup.py", line 154, in run
      self.run_command('js')
    File "/home/steve98654/anaconda/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-Vfqxcs/bqplot/setup.py", line 143, in run
      env=os.environ.copy(),
    File "/home/steve98654/anaconda/lib/python2.7/subprocess.py", line 540, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['bower', 'install', '--allow-root', '--config.interactive=false']' returned non-zero exit status 1

  ----------------------------------------
  Failed building wheel for bqplot
Failed to build bqplot
Installing collected packages: bqplot
  Running setup.py install for bqplot
    Complete output from command /home/steve98654/anaconda/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Vfqxcs/bqplot/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-n3L33O-record/install-record.txt --single-version-externally-managed --compile:
    /home/steve98654/anaconda/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'License'
      warnings.warn(msg)
    running install
    running build
    running build_py
    running js

    Error: Unknown encoding
        at Buffer.write (buffer.js:382:13)
        at new Buffer (buffer.js:261:26)
        at Object.fs.writeFileSync (fs.js:758:12)
        at Function.writeFileSync [as sync] (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/write-file-atomic/index.js:37:12)
        at Object.create.all.set (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/index.js:55:21)
        at Object.Configstore (/usr/local/lib/node_modules/bower/node_modules/insight/node_modules/configstore/index.js:20:11)
        at new Insight (/usr/local/lib/node_modules/bower/node_modules/insight/lib/index.js:37:34)
        at ensureInsight (/usr/local/lib/node_modules/bower/lib/util/analytics.js:25:19)
        at Object.setup (/usr/local/lib/node_modules/bower/lib/util/analytics.js:41:9)
        at Object.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:72:11)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-Vfqxcs/bqplot/setup.py", line 204, in <module>
        setup(**setup_args)
      File "/home/steve98654/anaconda/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/home/steve98654/anaconda/lib/python2.7/site-packages/setuptools-18.3.2-py2.7.egg/setuptools/command/install.py", line 61, in run
      File "/home/steve98654/anaconda/lib/python2.7/distutils/command/install.py", line 563, in run
        self.run_command('build')
      File "/home/steve98654/anaconda/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/home/steve98654/anaconda/lib/python2.7/distutils/command/build.py", line 127, in run
        self.run_command(cmd_name)
      File "/home/steve98654/anaconda/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-Vfqxcs/bqplot/setup.py", line 154, in run
        self.run_command('js')
      File "/home/steve98654/anaconda/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/home/steve98654/anaconda/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-Vfqxcs/bqplot/setup.py", line 143, in run
        env=os.environ.copy(),
      File "/home/steve98654/anaconda/lib/python2.7/subprocess.py", line 540, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['bower', 'install', '--allow-root', '--config.interactive=false']' returned non-zero exit status 1

    ----------------------------------------
Command "/home/steve98654/anaconda/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Vfqxcs/bqplot/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-n3L33O-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Vfqxcs/bqplot
steve98654@Riemann:~/LocRepos$ 

Multi Selector

I have a question regarding the Multi Selector elaborated here.

What do you do to multi-select? I use mouse to select an interval but when I select again, only the first the interval is updated. How can I select a new interval?

Thanks

PanZoom

When you use PanZoom as interaction, by rolling the scroll wheel in your mouse, you can zoom in or out from your plot. Is there a way to zoom in or out along only one direction instead of along both x and y at the same time? Thanks.

wheel package format

It would be wonderfull to have this:

  • available as a wheel package,
  • with the python -m bqplot.install --user functionality triggered automatically when you detect the ".js" stuff is not in the right place.

HTTP 404 on nbextension installed as per readme

After following install instructions in readme (using pip -e /path/to/bgplot), I get HTTP 404 on attempts to create inline plots in jupyter-1.0.0:

Successfully installed bqplot-0.3.5
(test-bqplot) myuser /software/test-bqplot  % python -m bqplot.install --symlink --user --force
symlink /home/myuser/.local/share/jupyter/nbextensions/bqplot -> /software/bqplot/bqplot/nbextension

The symlink exists and points to the correct location:

% ls -al ~/.local/share/jupyter/nbextensions/bqplot 
lrwxrwxrwx 1 myuser myuser 35 Sep 29 14:39 /home/myuser/.local/share/jupyter/nbextensions/bqplot -> /software/bqplot/bqplot/nbextension

Error output is:

[W 15:03:40.123 NotebookApp] 404 GET /nbextensions/bqplot/components/d3/d3.js?v=20150929150214 (::1) 2.72ms referer=http://localhost:8888/notebooks/test1.ipynb

Installed versions are:

% pip freeze
backports.ssl-match-hostname==3.4.0.2
-e git+https://github.com/bloomberg/bqplot.git@fe21b42c5a2c8f520bd4a95e2dd39637cb3c1e8c#egg=bqplot-master
certifi==2015.9.6.2
decorator==4.0.4
funcsigs==0.4
functools32==3.2.3.post2
ipykernel==4.0.3
ipython==4.0.0
ipython-genutils==0.1.0
ipywidgets==4.0.3
Jinja2==2.8
jsonschema==2.5.1
jupyter==1.0.0
jupyter-client==4.0.0
jupyter-console==4.0.2
jupyter-core==4.0.6
MarkupSafe==0.23
matplotlib==1.4.3
mistune==0.7.1
mock==1.3.0
nbconvert==4.0.0
nbformat==4.0.0
nose==1.3.7
notebook==4.0.5
numpy==1.9.3
pandas==0.16.2
path.py==8.1.1
pbr==1.8.0
pexpect==3.3
pickleshare==0.5
ptyprocess==0.5
Pygments==2.0.2
pyparsing==2.0.3
python-dateutil==2.4.2
pytz==2015.6
pyzmq==14.7.0
qtconsole==4.0.1
simplegeneric==0.8.1
six==1.9.0
terminado==0.5
tornado==4.2.1
traitlets==4.0.0
wheel==0.26.0

Browser is Google Chrome 47.0.2516.0 dev (64-bit)

pyplot clear issues

on call of clear() in pyplot, the scales are retained from the previous state. Consequently, axes are not drawn when next mark is plotted.

Won't install on top of "docker-demo-image" (jupyter/demo on DockerHub) UnicodeDecodeError

I've tried installing this on the Jupyter/demo image, but I get the following error.

The following is the end of the output log of a build built on top of the jupyter/demo image:

Any idea how to fix this?

If you need to test, my Dockerfile is at
https://github.com/mjbright/jupyter_trusted_builds/blob/master/demo/Dockerfile

Step 31 : RUN pip install bqplot
Collecting bqplot
Downloading bqplot-0.3.8.tar.gz (451kB)
Requirement already satisfied (use --upgrade to upgrade): ipywidgets in /opt/conda/lib/python3.4/site-packages (from bqplot)
Requirement already satisfied (use --upgrade to upgrade): numpy in /opt/conda/lib/python3.4/site-packages (from bqplot)
Requirement already satisfied (use --upgrade to upgrade): pandas in /opt/conda/lib/python3.4/site-packages (from bqplot)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=2 in /opt/conda/lib/python3.4/site-packages (from pandas->bqplot)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /opt/conda/lib/python3.4/site-packages (from pandas->bqplot)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /opt/conda/lib/python3.4/site-packages (from python-dateutil>=2->pandas->bqplot)
Building wheels for collected packages: bqplot
Running setup.py bdist_wheel for bqplot
Stored in directory: /home/jovyan/.cache/pip/wheels/e4/f9/62/512546616698b2ac0b48bf9042ce807cb914987993d592b453
Successfully built bqplot
Installing collected packages: bqplot
Successfully installed bqplot-0.3.8
---> 5c92ffed1fbe
Step 32 : RUN python -m bqplot.install --symlink --user --force
�[91m/opt/conda/bin/python: Error while finding spec for 'bqplot.install' (<class 'UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xc3 in position 98318: ordinal not in range(128))
�```

Labeled data plotting

An interesting feature of matplotlib which was added recently is the use of labeled data in the plotting function.

i.e. one can do

some_dict = {
    'elephant': [1, 3, 4],
    'cat': [8, 0, 7],
    'mouse': [3, 3, 3],
}
plt.scatter(data=some_dict, x="elephant", y="mouse")

this also works with anything that accepts indexing with "elephant" and "mouse" such as a data frame having such columns. I think this is an interesting feature worth implementing in bqplot.pyplot.

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.