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
1900-2016 Olympic Data Analysis in Python by plotting different graphs

🔥 Olympics Data Analysis 🔥 In Data Science field, there is a big topic before creating a model for future prediction is Data Analysis. We can find o

Sayan Roy 1 Feb 06, 2022
哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看、waifu2x等功能。

picacomic-windows 哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看等功能。 功能介绍 登陆分流,还原安卓端的三个分流入口 分类,搜索,排行,收藏夹使用同一的逻辑,滚轮下滑自动加载下一页,双击打开 漫画详情,章节列表和评论列表 下载功能,目

1.8k Dec 31, 2022
A simple python tool for explore your object detection dataset

A simple tool for explore your object detection dataset. The goal of this library is to provide simple and intuitive visualizations from your dataset and automatically find the best parameters for ge

GRADIANT - Centro Tecnolóxico de Telecomunicacións de Galicia 142 Dec 25, 2022
Browse Dash docsets inside emacs

Helm Dash What's it This package uses Dash docsets inside emacs to browse documentation. Here's an article explaining the basic usage of it. It doesn'

504 Dec 15, 2022
Geospatial Data Visualization using PyGMT

Example script to visualize topographic data, earthquake data, and tomographic data on a map

Utpal Kumar 2 Jul 30, 2022
Interactive plotting for Pandas using Vega-Lite

pdvega: Vega-Lite plotting for Pandas Dataframes pdvega is a library that allows you to quickly create interactive Vega-Lite plots from Pandas datafra

Altair 342 Oct 26, 2022
Simulation du problème de Monty Hall avec Python et matplotlib

Le problème de Monty Hall C'est un jeu télévisé où il y a trois portes sur le plateau de jeu. Seule une de ces portes cache un trésor. Il n'y a rien d

ETCHART YANG 1 Jan 06, 2022
Cartopy - a cartographic python library with matplotlib support

Cartopy is a Python package designed to make drawing maps for data analysis and visualisation easy. Table of contents Overview Get in touch License an

1.2k Jan 01, 2023
HiPlot makes understanding high dimensional data easy

HiPlot - High dimensional Interactive Plotting HiPlot is a lightweight interactive visualization tool to help AI researchers discover correlations and

Facebook Research 2.4k Jan 04, 2023
A simple agent-based model used to teach the basics of OOP in my lectures

Pydemic A simple agent-based model of a pandemic. This is used to teach basic principles of object-oriented programming to master students. It is not

Fabien Maussion 2 Jun 08, 2022
web application for flight log analysis & review

Flight Review This is a web application for flight log analysis. It allows users to upload ULog flight logs, and analyze them through the browser. It

PX4 Drone Autopilot 145 Dec 20, 2022
A Python package that provides evaluation and visualization tools for the DexYCB dataset

DexYCB Toolkit DexYCB Toolkit is a Python package that provides evaluation and visualization tools for the DexYCB dataset. The dataset and results wer

NVIDIA Research Projects 107 Dec 26, 2022
The repository is my code for various types of data visualization cases based on the Matplotlib library.

ScienceGallery The repository is my code for various types of data visualization cases based on the Matplotlib library. It summarizes the code and cas

Warrick Xu 2 Apr 20, 2022
GitHub English Top Charts

Help you discover excellent English projects and get rid of the interference of other spoken language.

kon9chunkit 529 Jan 02, 2023
🧇 Make Waffle Charts in Python.

PyWaffle PyWaffle is an open source, MIT-licensed Python package for plotting waffle charts. It provides a Figure constructor class Waffle, which coul

Guangyang Li 528 Jan 02, 2023
Create charts with Python in a very similar way to creating charts using Chart.js

Create charts with Python in a very similar way to creating charts using Chart.js. The charts created are fully configurable, interactive and modular and are displayed directly in the output of the t

Nicolas H 68 Dec 08, 2022
Lightspin AWS IAM Vulnerability Scanner

Red-Shadow Lightspin AWS IAM Vulnerability Scanner Description Scan your AWS IAM Configuration for shadow admins in AWS IAM based on misconfigured den

Lightspin 90 Dec 14, 2022
Compute and visualise incidence (reworking of the original incidence package)

incidence2 incidence2 is an R package that implements functions and classes to compute, handle and visualise incidence from linelist data. It refocuss

15 Nov 22, 2022
This is a Web scraping project using BeautifulSoup and Python to scrape basic information of all the Test matches played till Jan 2022.

Scraping-test-matches-data This is a Web scraping project using BeautifulSoup and Python to scrape basic information of all the Test matches played ti

Souradeep Banerjee 4 Oct 10, 2022
Custom Plotly Dash components based on Mantine React Components library

Dash Mantine Components Dash Mantine Components is a Dash component library based on Mantine React Components Library. It makes it easier to create go

Snehil Vijay 239 Jan 08, 2023