GithubHelp home page GithubHelp logo

jdfekete / ipyvega Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vega/ipyvega

0.0 1.0 0.0 82.02 MB

IPython/Jupyter notebook module for Vega and Vega-Lite

License: BSD 3-Clause "New" or "Revised" License

Python 0.11% Jupyter Notebook 99.41% JavaScript 0.02% TypeScript 0.06% HTML 0.41%

ipyvega's Introduction

IPython Vega

PyPI npm version Build Status

IPython/Jupyter notebook module for Vega 5, and Vega-Lite 4. Notebooks with embedded visualizations can be viewed on GitHub and nbviewer. If you use JupyterLab (not the notebook), you don't need to install this extension since JupyterLab comes with built-in support for Vega and Vega-Lite.

Available on pypi and Conda Forge as vega.

Install and run

Python Package Index

To install vega and its dependencies from the Python Package Index using pip, use the following commands:

pip install jupyter pandas vega
pip install --upgrade notebook  # need jupyter_client >= 4.2 for sys-prefix below
jupyter nbextension install --sys-prefix --py vega
jupyter nbextension enable --py --sys-prefix vega

Conda Forge

If you use Conda, you probably already have the latest versions of the notebook and pandas installed. To install vega extension run:

conda install vega

Usage

Once the package is installed, run

jupyter notebook

to launch the Jupyter notebook server, and use vega within the notebook. See the example notebooks for Vega-Lite and Vega.

To run the notebooks yourself, you need to get the file cars.json.

Developers

This project uses Poetry. If you prefer a local virtual environment, run poetry config virtualenvs.in-project true first. Install requirements: poetry install.

Then activate the virtual environment with poetry shell.

Symlink files instead of copying files:

jupyter nbextension install --py --symlink --sys-prefix vega
jupyter nbextension enable --py --sys-prefix vega

Run kernel with jupyter notebook. Run the tests with pytest vega.

To rebuild the JavaScript continuously, run yarn watch.

How to make a release

  • Update the JavaScript dependencies by changing package.json (e.g. with ncu).
  • Run yarn.
  • Update the version number in pyproject.toml (with poetry version [VERSION]), package.json, _frontend.py, and __init__.py
  • Rebuild the JavaScript with yarn build.
  • Make sure that everything still works (launch notebook and widgets and try the examples).
  • Add a git tag.
  • git push --tags.
  • Run npm publish to update https://www.npmjs.com/package/jupyter-vega.
  • Then run poetry publish --build to update https://pypi.python.org/pypi/vega.

The Conda feedstock for this package is at https://github.com/conda-forge/vega-feedstock. It should update automatically but we may need to merge a pull request with the updates.

Visual Regression Tests

ipyvega uses the same technical solution as ipywidgets for visual regression testing (i.e. Galata).

Therefore, the instructions provided for ipywidgets visual regression tests apply here.

Currently:

  • ipyvega uses ui-tests/tests/notebooks/vega.ipynb notebook for testing
  • reference images are in the ui-tests/tests/vega.test.ts-snapshots/ directory.

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.