ipyvizzu - Jupyter notebook integration of Vizzu

Overview

Vizzu

ipyvizzu - Jupyter notebook integration of Vizzu.

Tutorial · Examples · Repository

PyPI version CI check

About The Project

ipyvizzu is the Jupyter Notebook integration of Vizzu. ipyvizzu enables data scientists and analysts to utilize animation for storytelling with data using Python.

Similar to Vizzu, which is a free, open-source Javascript/C++ library, ipyvizzu also utilizes a generic dataviz engine that generates many types of charts and seamlessly animates between them. It is designed for building animated data stories as it enables showing different perspectives of the data that the viewers can easily follow.

Main features:

  • Designed with animation in focus;
  • Defaults based on data visualization guidelines;
  • Works with Pandas dataframe, also JSON and inline data input is available;
  • Auto scrolling to keep the actual chart in position while executing multiple cells.

Installation

ipyvizzu requires IPython and pandas packages. However you can use it only in Jupyter Notebook therefore notebook project has to be installed.

pip install ipyvizzu
pip install notebook

You can also use ipyvizzu by locally installing Vizzu, you can find more info about this in the documentation

Usage

ipyvizzu only works in Jupiter Notebook environment. A notebook cell may contain the following code snippet resulting in the animation below.

import pandas as pd
from ipyvizzu import Chart, Data, Config

data_frame = pd.read_csv('titanic.csv')
data = Data()
data.add_data_frame(data_frame)

chart = Chart(width="640px", height="360px")

chart.animate(data)

chart.animate(Config({"x": "Count", "y": "Sex", "label": "Count","title":"Passengers of the Titanic"}))
chart.animate(Config({"x": ["Count","Survived"], "label": ["Count","Survived"], "color": "Survived"}))
chart.animate(Config({"x": "Count", "y": ["Sex","Survived"]}))

ipyvizzu

Visit our documentation site for more details and a step-by-step tutorial into ipyvizzu, or check out the example gallery.

Tools Support

ipyvizzu can also be used within Google Colab, Deepnote and Kaggle Notebooks! Check out the demo links below 👇

  • Open in Collab

  • View in Deepnote

  • Open in Kaggle

  • Open in Mercury

Contributing

We welcome contributions to the project, visit our contributing guide for further info.

Contact

License

Copyright © 2022 Vizzu Kft..

Released under the Apache 2.0 License.

Comments
  • change doc online version

    change doc online version

    I have a question about the online version of the documentation.

    If I change something in a ipynb file in doc/examples, after that I need to run make doc and commit changed htmls if I want to update the site too? (In that case I do not understand clearly what pages-build-deployment workflow do.)

    documentation 
    opened by veghdev 14
  • ipyvizzu.Chart.animation: allow distinct animations

    ipyvizzu.Chart.animation: allow distinct animations

    All Animation has a main key (Data => "data", Config => "config") therefore it is quite straightforward to merge different animation in one Chart.animate call. Therefore Chart.animate can allow multiple animations until they do not override any data.

    The *animations and **config can be merged with this strategy, too and the *args and **kwargs calls will lokk similar:

    Chart().animate(config={...}, data={...})

    Chart().animate(Config(...), Data(...))

    opened by nyirog 7
  • Refactor ipyvizzu.Chart.animate() to handle animoptions

    Refactor ipyvizzu.Chart.animate() to handle animoptions

    ipyvizzu.Chart.animate() can not handle animoptions (like delay, duration etc.).

    The JS API accepts the following arguments: animate({ data, config, style }, animoptions) animate(config, animoptions) animate({ data, config, style }) animate(config)

    ipyvizzu's behavior do not need to be the same like the JS API, so it can be pythonic, but the functions have to work. (animoptions is a js object like a python dict, or in js api it can be a single string if only want to change the duration so '500ms' instead of {duration: '500ms'})

    I think possible solutions in ipyvizzu are:

    I. kwargs only be animoptions style, data and config only be Style, Data, Config classes in args (it is a further problem with this, Style(None) needs to work to reset previous style modifications, but now it is working only in kwargs style=None)

    II. create az animOptions class, and handle it differently in _merge_animations()

    III. any other idea

    enhancement 
    opened by veghdev 6
  • docs: examples generator scripts

    docs: examples generator scripts

    Usage:

    cd tools/example-generator
    npm intall
    pip install -r requirements.txt
    ./run.sh
    

    Sparse clones/checks out the vizzu-lib repo to the current folder. Generates ipynb files for each example file found in the vizzu-lib repo test/integration/test_cases/web_content/sample_static/*.mjs, test/integration/test_cases/web_content/templates/*.mjs into docs/examples/static, docs/examples/animated folders

    opened by simzer 5
  • How to loop the animation? Add controls?

    How to loop the animation? Add controls?

    This is a great library! Exactly the lib that I was looking for! Thank you! :1st_place_medal:

    How to run the animation in the loop? Can I add controls for animation (stop, play)?

    I'm working on a framework for converting Jupyter Notebooks to interactive web apps. Would love to use vizzu in demos. I will let you know, thanks!

    enhancement 
    opened by pplonski 3
  • No scroll in case of user scroll

    No scroll in case of user scroll

    If the notebook is running and the user scrolls, then auto scrolling should switch off for that run. It is inconvenient for the user that they couldn't scroll during running.

    Something like this would be the solution:

    global scope:

    let inhibitScroll = false;
    document.addEventListener('scroll', function(e) {
      inhibitScroll = true;
    });
    

    cell:

    if (!inhibitScroll) myVizzu.scrollIntoView(...);
    

    I don't how to set inhibitScroll back to false after running, but next run should do autoscrolling again.

    enhancement 
    opened by simzer 3
  • ipyvizzu.Chart.animation: allow animoptions, kwargs can only be animo…

    ipyvizzu.Chart.animation: allow animoptions, kwargs can only be animo…

    …ptions

    • [x] refactor Chart.animate

    • [x] fix unit tests

    • [x] add unit tests to anim options

    • [x] fix examples

    • [x] add examples to anim options

    • [x] load data in the examples

    opened by veghdev 3
  • Generate ipynb from python and markdown assets

    Generate ipynb from python and markdown assets

    The notebooks (ipynb) inculdes the markdown and code cells as list of lines. Editing the notebook is error prone therefore we should read the cells from separate assets.

    A notebook

    {                                                                                                                                                                                                                      
      "cells": [                                                                                 
        {                                                                                         
           "cell_type": "markdown",                                                              
           "id": "e582c95b",                                                                     
           "metadata": {},                                                                       
           "source": [                                                                           
              "## Aggregate/drill-down\n",                                                         
              "\n",                                                                                
              "These features basically mean that you add or remove an additional dimension to/from an axis or another channel. As you can see below, there are some important things to keep in mind when you use them.\n",
              "\n",                                                                                
              "Let’s stack together the elements by putting the Genres dimension from the x-axis to the y-axis. At the end of this phase, there are chart elements with the same color stacked on top of each other, which is something you would want to avoid. "
          ]                                                                                     
        }
      ]
    }
    

    would be split into a json and markdown/python files

    {                                                                                                                                                                                                                      
      "cells": [                                                                                 
        {                                                                                         
          "cell_type": "markdown",                                                              
          "id": "e582c95b",                                                                     
          "metadata": {},                                                                       
          "source": {"@readlines": "aggregate.md"}
        }
      ]                                                                                     
    }
    
    ## Aggregate/drill-down
    
    These features basically mean that you add or remove an additional dimension to/from an axis or another channel. As you can see below, there are some important things to keep in mind when you use them.
    
    Let’s stack together the elements by putting the Genres dimension from the x-axis to the y-axis. At the end of this phase, there are chart elements with the same color stacked on top of each other, which is something you would want to avoid.
    

    The {"@readlines": "aggregate.md"} would be handle by a simple python script with the json.load object_hook. And the Makefile would genearte ipynb from the json template:

    #!/usr/bin/env python3
    """
    Replace `{"@readlines": "referred/file"}` object from the `json_file` with the
    list of lines read from the referred file. The path of the referred file is
    relative to the `json_file`.
    """
    
    import argparse
    import json
    import sys
    import pathlib
    
    
    def main():
        args = _parse_args()
        reader = Reader(args.json_file.parent)
    
        with args.json_file.open() as fp:
            obj = json.load(fp, object_hook=reader.object_hook)
    
        json.dump(obj, fp=sys.stdout, indent=4, sort_keys=True)
    
    
    def _parse_args():
        parser = argparse.ArgumentParser(
            description="Read files as list of lines into json", epilog=__doc__
        )
        parser.add_argument("json_file", type=pathlib.Path)
    
        return parser.parse_args()
    
    
    class Reader:
        def __init__(self, source_dir):
            self._source_dir = source_dir
    
        def object_hook(self, obj):
            if len(obj) != 1:
                return obj
    
            try:
                path = obj["@readlines"]
            except KeyError:
                return obj
    
            file_name = self._source_dir / path
    
            with file_name.open() as fp:
                return fp.readlines()
    
    
    if __name__ == "__main__":
        exit(main())
    
    documentation 
    opened by nyirog 3
  • question: does ipyvizzu work in PyCharm

    question: does ipyvizzu work in PyCharm

    PyCharm is a popular Python IDE, it would be great to see if ipyvizzu and ipyvizzu-story work in it. Pic: Kaggle State of Data Science and Machine Learning Survey 2022 image

    question 
    opened by petervidos 2
  • Add `conda` install option for `ipyvizzu`

    Add `conda` install option for `ipyvizzu`

    A conda install option could be very helpful. Adding ipyvizzu to conda-forge channel will be ideal.

    Note: I have started working on this already in the following PR.

    • https://github.com/conda-forge/staged-recipes/pull/19838

    Once merged you will be able to install the library with:

    conda install -c conda-forge ipyvizzu
    
    enhancement 
    opened by sugatoray 2
  • put readme into documentation and setup domains.

    put readme into documentation and setup domains.

    Please put all content from the readme to the github pages index page (https://vizzuhq.github.io/ipyvizzu/index.html). Including a link to the github repo. See vizzu-lib for reference, where the repo readme is the same as the lib.vizzuhq.com index page. 2. Please create an ipyvizzu.vizzuhq.com subdomain and direct it to the ipyvizzu project's github pages site. 3. We have the ipyvizzu.com domain now, please redirect it to ipyvizzu.vizzuhq.com

    documentation 
    opened by simzer 2
  • MkDocs - theme

    MkDocs - theme

    Change the mkdocs theme to resemble the vizzu lib doc site https://lib.vizzuhq.com/0.4/

    • [x] colors, font-sizes
    • [x] add vizzu logo, favicon
    • [x] syntax highlight
    • [ ] add social logos/links
    documentation 
    opened by simzer 4
  • Tutorial Notebook for setting Chart Styles

    Tutorial Notebook for setting Chart Styles

    Please let me know if I'm misunderstanding some of how this works!

    My current understanding is the documentation for updating Styles for charts is present in the JS Vizzu library, but not super clear for the ipyvizzu.

    My PR #200 adds a small Style tweak, but I think a full tutorial on Style properties and how to change them could help a lot, especially to explain a little of how python users can leverage the js documentation to customize plots. If this seems valuable, I would be happy to take a shot of making such a notebook. If so - feel free to tag me as the Assignee, but if not or if this documentation already exists feel free to close 👍

    documentation 
    opened by parkerkain-8451 1
  • Multi-tiered x-axes labels

    Multi-tiered x-axes labels

    This can be replicated by following the plots in the sorting tutorial notebook.

    As you follow along, the second to last plot looks like this:

    image

    and the final plot looks like:

    image

    Here - I think ideally, the final plot would have multi-tiered x axis labels, as by default it is impossible to know what each of the Genre bars within a Kind represent.

    question 
    opened by parkerkain-8451 0
  • Enable Makefile to run properly on OSX

    Enable Makefile to run properly on OSX

    Currently - Mac users cannot run any of the make commands for the repo - which forces repo maintainers to reformat code written by Mac users.

    This applies to both ipyvizzu and ipyvizzu-story

    enhancement 
    opened by parkerkain-8451 0
  • Enable the use of spark dataframes

    Enable the use of spark dataframes

    Enable users to use Spark dataframe next to the currently available pandas dataframe. More info: https://spark.apache.org/docs/3.1.1/api/python/reference/api/pyspark.sql.DataFrame.html

    enhancement 
    opened by petervidos 1
Releases(0.13.0)
Owner
Vizzu
Vizzu
A set of useful perceptually uniform colormaps for plotting scientific data

Colorcet: Collection of perceptually uniform colormaps Build Status Coverage Latest dev release Latest release Docs What is it? Colorcet is a collecti

HoloViz 590 Dec 31, 2022
Epagneul is a tool to visualize and investigate windows event logs

epagneul Epagneul is a tool to visualize and investigate windows event logs. Dep

jurelou 190 Dec 13, 2022
The plottify package is makes matplotlib plots more legible

plottify The plottify package is makes matplotlib plots more legible. It's a thin wrapper around matplotlib that automatically adjusts font sizes, sca

Andy Jones 97 Nov 04, 2022
Some examples with MatPlotLib library in Python

MatPlotLib Example Some examples with MatPlotLib library in Python Point: Run files only in project's directory About me Full name: Matin Ardestani Ag

Matin Ardestani 4 Mar 29, 2022
Tools for writing, submitting, debugging, and monitoring Storm topologies in pure Python

Petrel Tools for writing, submitting, debugging, and monitoring Storm topologies in pure Python. NOTE: The base Storm package provides storm.py, which

AirSage 247 Dec 18, 2021
MPL Plotter is a Matplotlib based Python plotting library built with the goal of delivering publication-quality plots concisely.

MPL Plotter is a Matplotlib based Python plotting library built with the goal of delivering publication-quality plots concisely.

Antonio López Rivera 162 Nov 11, 2022
A tool to plot and execute Rossmos's Formula, that helps to catch serial criminals using mathematics

Rossmo Plotter A tool to plot and execute Rossmos's Formula using python, that helps to catch serial criminals using mathematics Author: Amlan Saha Ku

Amlan Saha Kundu 3 Aug 29, 2022
coordinate to draw the nimbus logo on the graffitiwall

This is a community effort to draw the nimbus logo on beaconcha.in's graffitiwall. get started clone repo with git clone https://github.com/tennisbowl

4 Apr 04, 2022
Visualization ideas for data science

Nuance I use Nuance to curate varied visualization thoughts during my data scientist career. It is not yet a package but a list of small ideas. Welcom

Li Jiangchun 16 Nov 03, 2022
An intuitive library to add plotting functionality to scikit-learn objects.

Welcome to Scikit-plot Single line functions for detailed visualizations The quickest and easiest way to go from analysis... ...to this. Scikit-plot i

Reiichiro Nakano 2.3k Dec 31, 2022
阴阳师后台全平台(使用网易 MuMu 模拟器)辅助。支持御魂,觉醒,御灵,结界突破,秘闻副本,地域鬼王。

阴阳师后台全平台辅助 Python 版本:Python 3.8.3 模拟器:网易 MuMu | 雷电模拟器 模拟器分辨率:1024*576 显卡渲染模式:兼容(OpenGL) 兼容 Windows 系统和 MacOS 系统 思路: 利用 adb 截图后,使用 opencv 找图找色,模拟点击。使用

简讯 27 Jul 09, 2022
High performance, editable, stylable datagrids in jupyter and jupyterlab

An ipywidgets wrapper of regular-table for Jupyter. Examples Two Billion Rows Notebook Click Events Notebook Edit Events Notebook Styling Notebook Pan

J.P. Morgan Chase 75 Dec 15, 2022
Geocoding library for Python.

geopy geopy is a Python client for several popular geocoding web services. geopy makes it easy for Python developers to locate the coordinates of addr

geopy 3.8k Jan 02, 2023
Sky attention heatmap of submissions to astrometry.net

astroheat Installation Requires Python 3.6+, Tested with Python 3.9.5 Install library dependencies pip install -r requirements.txt The program require

4 Jun 20, 2022
GitHub Stats Visualizations : Transparent

GitHub Stats Visualizations : Transparent Generate visualizations of GitHub user and repository statistics using GitHub Actions. ⚠️ Disclaimer The pro

YuanYap 7 Apr 05, 2022
NumPy and Pandas interface to Big Data

Blaze translates a subset of modified NumPy and Pandas-like syntax to databases and other computing systems. Blaze allows Python users a familiar inte

Blaze 3.1k Jan 01, 2023
This is a small program that prints a user friendly, visual representation, of your current bsp tree

bspcq, q for query A bspc analyzer (utility for bspwm) This is a small program that prints a user friendly, visual representation, of your current bsp

nedia 9 Apr 24, 2022
A Scheil-Gulliver simulation tool using pycalphad.

scheil A Scheil-Gulliver simulation tool using pycalphad. import matplotlib.pyplot as plt from pycalphad import Database, variables as v from scheil i

pycalphad 6 Dec 10, 2021
Investment and risk technologies maintained by Fortitudo Technologies.

Fortitudo Technologies Open Source This package allows you to freely explore open-source implementations of some of our fundamental technologies under

Fortitudo Technologies 11 Dec 14, 2022
IPython/Jupyter notebook module for Vega and Vega-Lite

IPython Vega IPython/Jupyter notebook module for Vega 5, and Vega-Lite 4. Notebooks with embedded visualizations can be viewed on GitHub and nbviewer.

Vega 335 Nov 29, 2022