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
Create a table with row explanations, column headers, using matplotlib

Create a table with row explanations, column headers, using matplotlib. Intended usage was a small table containing a custom heatmap.

4 Aug 14, 2022
UNMAINTAINED! Renders beautiful SVG maps in Python.

Kartograph is not maintained anymore As you probably already guessed from the commit history in this repo, Kartograph.py is not maintained, which mean

1k Dec 09, 2022
Visualization of the World Religion Data dataset by Correlates of War Project.

World Religion Data Visualization Visualization of the World Religion Data dataset by Correlates of War Project. Mostly personal project to famirializ

Emile Bangma 1 Oct 15, 2022
Plotting library for IPython/Jupyter notebooks

bqplot 2-D plotting library for Project Jupyter Introduction bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar

3.4k Dec 29, 2022
China and India Population and GDP Visualization

China and India Population and GDP Visualization Historical Population Comparison between India and China This graph shows the population data of Indi

Nicolas De Mello 10 Oct 27, 2021
A napari plugin for visualising and interacting with electron cryotomograms.

napari-tomoslice A napari plugin for visualising and interacting with electron cryotomograms. Installation You can install napari-tomoslice via pip: p

3 Jan 03, 2023
Python package for hypergraph analysis and visualization.

The HyperNetX library provides classes and methods for the analysis and visualization of complex network data. HyperNetX uses data structures designed to represent set systems containing nested data

Pacific Northwest National Laboratory 304 Dec 27, 2022
Import, visualize, and analyze SpiderFoot OSINT data in Neo4j, a graph database

SpiderFoot Neo4j Tools Import, visualize, and analyze SpiderFoot OSINT data in Neo4j, a graph database Step 1: Installation NOTE: This installs the sf

Black Lantern Security 42 Dec 26, 2022
Decision Border Visualizer for Classification Algorithms

dbv Decision Border Visualizer for Classification Algorithms Project description A python package for Machine Learning Engineers who want to visualize

Sven Eschlbeck 1 Nov 01, 2021
A site that displays up to date COVID-19 stats, powered by fastpages.

https://covid19dashboards.com This project was built with fastpages Background This project showcases how you can use fastpages to create a static das

GitHub 1.6k Jan 07, 2023
A dashboard built using Plotly-Dash for interactive visualization of Dex-connected individuals across the country.

Dashboard For The DexConnect Platform of Dexterity Global Working prototype submission for internship at Dexterity Global Group. Dashboard for real ti

Yashasvi Misra 2 Jun 15, 2021
A gui application to visualize various sorting algorithms using pure python.

Sorting Algorithm Visualizer A gui application to visualize various sorting algorithms using pure python. Language : Python 3 Libraries required Tkint

Rajarshi Banerjee 19 Nov 30, 2022
Scientific Visualization: Python + Matplotlib

An open access book on scientific visualization using python and matplotlib

Nicolas P. Rougier 8.6k Dec 31, 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
Visualizing weather changes across the world using third party APIs and Python.

WEATHER FORECASTING ACROSS THE WORLD Overview Python scripts were created to visualize the weather for over 500 cities across the world at varying di

G Johnson 0 Jun 12, 2021
A simple Monte Carlo simulation using Python and matplotlib library

Monte Carlo python simulation Install linux dependencies sudo apt update sudo apt install build-essential \ software-properties-commo

Samuel Terra 2 Dec 13, 2021
:small_red_triangle: Ternary plotting library for python with matplotlib

python-ternary This is a plotting library for use with matplotlib to make ternary plots plots in the two dimensional simplex projected onto a two dime

Marc 611 Dec 29, 2022
Collection of data visualizing projects through Tableau, Data Wrapper, and Power BI

Data-Visualization-Projects Collection of data visualizing projects through Tableau, Data Wrapper, and Power BI Indigenous-Brands-Social-Movements Pyt

Jinwoo(Roy) Yoon 1 Feb 05, 2022
Mathematical learnings with Lean, for those of us who wish we knew more of both!

Lean for the Inept Mathematician This repository contains source files for a number of articles or posts aimed at explaining bite-sized mathematical c

Julian Berman 8 Feb 14, 2022
A curated list of awesome Dash (plotly) resources

Awesome Dash A curated list of awesome Dash (plotly) resources Dash is a productive Python framework for building web applications. Written on top of

Luke Singham 1.7k Dec 26, 2022