Create charts with Python in a very similar way to creating charts using Chart.js

Overview


The power of Chart.js in Jupyter Notebooks

GitHub GitHub release (latest by date) Binder Awesome Chart.js

Installation

You can install ipychart from your terminal using pip or conda:

# using pip
$ pip install ipychart

# using conda
$ conda install -c conda-forge ipychart

Documentation

Usage

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 the cells of your jupyter notebook environment:

You can also create charts directly from a pandas dataframe. See the Pandas Interface section of the documentation for more details.

Development Installation

For a development installation:

$ git clone https://github.com/nicohlr/ipychart.git
$ cd ipychart
$ conda install jupyterlab nodejs -c conda-forge
$ cd ipychart/js
$ npm install yarn
$ npm install 
$ cd .. 
$ pip install -e .
$ jupyter nbextension install --py --symlink --sys-prefix ipychart
$ jupyter nbextension enable --py --sys-prefix ipychart

References

License

Ipychart is available under the MIT license.

You might also like...
Movies-chart - A CLI app gets the top 250 movies of all time from imdb.com and the top 100 movies from rottentomatoes.com
Movies-chart - A CLI app gets the top 250 movies of all time from imdb.com and the top 100 movies from rottentomatoes.com

movies-chart This CLI app gets the top 250 movies of all time from imdb.com and

Simple plotting for Python. Python wrapper for D3xter - render charts in the browser with simple Python syntax.
Simple plotting for Python. Python wrapper for D3xter - render charts in the browser with simple Python syntax.

PyDexter Simple plotting for Python. Python wrapper for D3xter - render charts in the browser with simple Python syntax. Setup $ pip install PyDexter

🧇 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

🧇 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

Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js

pivottablejs: the Python module Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js Installation pip install pivot

Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js

pivottablejs: the Python module Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js Installation pip install pivot

Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner

streamlit-dashboards Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner Tutorial Video https://ww

mysql relation charts
mysql relation charts

sqlcharts 自动生成数据库关联关系图 复制settings.py.example 重命名为settings.py 将数据库配置信息填入settings.DATABASE,目前支持mysql和postgresql 执行 python build.py -b,-b是读取数据库表结构,如果只更新匹

Altair extension for saving charts in a variety of formats.

Altair Saver This packge provides extensions to Altair for saving charts to a variety of output types. Supported output formats are: .json/.vl.json: V

Comments
  • Running the formatter with a function?

    Running the formatter with a function?

    Hey guys,

    Firstly, thank you for this! What a great implementation. I really appreciate your efforts.

    So I inherited a code base that I'm trying to streamline data while using JavaScript and Python. I'm running into an issue where I can't seem to get the formatter to work on data labels. I'll post the working JS version below and what I've tried to do in Jupyter/Python.

    setChartPercentages() { for (const set of this.chart.data.datasets) set.datalabels = { labels: { value: { formatter: function(value, ctx) { //ctx not needed, but including it as that's typically what the chart.js docs do. return value + '%' } } } } } This function is called when creating or updating charts. I simplified it a bit, but basically it shows total percent instead of the numbers.

    I tried to replicate this in ipychart. I've tried to use the callback function as stated in the documentation as well as just using the formatter. I even tried to combine them. All of them did not register the formatter.

    dataset = { 'labels': ['Data 1', 'Data 2', 'Data 3', 'Data 4', 'Data 5', 'Data 6', 'Data 7', 'Data 8'], 'datasets': [{'data': [14, 22, 36, 48, 60, 90, 28, 12], "datalabels": {"display": True, "labels": { "value": { 'formatter': { 'callback': '''function(value, ctx) {return '$' + value.toString()}''' } } } } }] }

    I also tried

    '''function(value, index, values) {return '$' + value}'''

    Any idea on how to get the formatter to register? Thank you a ton for any help.

    opened by timmyjl12 3
  • Animation with ipywidget

    Animation with ipywidget

    Thanks for this amazing library, I'm surprised it's not already super hyped as the plots are looking great, and at the moment there are zero good equivalents for Jupyter notebooks.

    It is stated in the doc that a plot could be animated with ipywidget. I tried, but there seems to be no equivalent to the Figure attribute of bqplot, or FigureWidget of plotly, which would be used in e.g. a widgets.VBox object. Here is what I currently have, which doesn't work:

    # Modules import
    from ipychart import Chart
    import ipywidgets as widgets
    import time
    import numpy as np
    
    # Define data and chart
    data = {'datasets': [{'data': [{'x': 0, 'y': 0}, {'x': 1, 'y': 1}]}]}
    mychart = Chart(data, 'line')
    
    # Define a button for animation
    btn = widgets.Button(description="Start", icon="play")
    
    # Callback to update the chart
    def update_chart(btn):
        for i in range(10):
            y = np.random.rand(2)
            with mychart.hold_sync():
                mychart.data = {'datasets': [{'data': [{'x': 0, 'y': y[0]}, {'x': 1, 'y': y[1]}]}]}
            time.sleep(0.1)
            
    btn.on_click(update_chart)
    
    # UI Combining Button & Chart
    widgets.VBox([btn, mychart])
    
    

    I believe I should provide something like mychart.fig instead of mychart to widgets.VBox, but I couldn't find any similar attribute in the Chart class. Any idea how to solve that? If yes, that would be a great addendum to the documentation. Thank you :)

    opened by ColasDroin 3
  • Running on jupyter-lab

    Running on jupyter-lab

    Hi,

    Nice project you've got here, just what I wanted.

    Could you add a warning in the "Installing" docs saying that this only works with jupyter-notebook and not with jupyter-labs?

    I don't know if it was a problem only for me, but I couldn't make it work on Jupyter-lab, I kept getting errors when the front-end tried to depend on jupyter.extensions.jupyterWidgetRegistry. Unfortunately I'm not that used with this whole notebook thing and lost a couple hours trying to make it work. 😅

    BR, Gabriel

    opened by Psidium 2
  • Chartjs graphs are not respecting the width and height of the container.

    Chartjs graphs are not respecting the width and height of the container.

    It seems ChartJS might be trying to maintain the aspect ratio in the Voila dashboard web app. I need to turn that option off by setting the "maintainAspectRatio: false" option. Could you add this to the IPYCharts package to correctly render the charts in Voila?

    opened by ndgayan 2
Releases(v0.4.0)
  • v0.4.0(Mar 17, 2022)

    New features in this version:

    • Chart.js backend was updated to 3.x.x. This is a major update, all changes can be seen here: https://www.chartjs.org/docs/latest/getting-started/v3-migration.html. This implies large performance improvements, easier customization, a rewritten animation system, bug fixes etc.
    • Doc: Move from GitLab pages to GitHub pages. Replace algolia search by flexsearch. Re-writing of some sections to match the new syntax of Chart.js 3.x.x. Better handling of components, which are now isolated in separates HTML files called by Vue scripts.
    • Convert all JS code to ES6 Javascript standard. Use ESLint and Prettier to clean the JS codebase.
    • Integration and adaptation of the colorscheme plugin into the codebase because original implementation is not compatible with Chart.js 3.x.x.
    • Start TDD on Python side.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.3(Jan 21, 2022)

  • v0.3.2(Dec 18, 2021)

    New features in this version:

    • Pandas Interface : Complete refactoring of the API. Charts are now created using functions.
    • Added support of Jupyter Lab.
    • Added dynamic update of charts when an agument of the chart is modified. This bring a lots of possibilities to dynamically modify a chart, for example by using ipywidgets (sliders, buttons ...).
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Nov 7, 2020)

    New features in this version:

    • Full cleaning of Python code
    • Reduce fontsize in tooltips (back to default size) for charts made using the Pandas Interface
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Sep 15, 2020)

    New features in this version:

    • Add zoom feature (using https://github.com/chartjs/chartjs-plugin-zoom), allowing the user to zoom in the chart using his mouse. Double click on the chart will reset the zoom.

    Bug Fixes:

    • Fix tooltips for doughnut, pie, polarArea charts when using pandas interface (tooltips wasn't formatted in the same way as other charts).
    • Fix typing in methods of ChartDataFrame class in pandas interface.
    • Fix docstrings: removing excess arguments and adding missing arguments.
    • Various fixes and minor modifications in the documentation
    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Sep 4, 2020)

    New features in this version:

    • Pandas Interface : Tooltips are automatically generated to use the column names of the dataframe used to draw the chart. Therefore, the information displayed when hovering the Chart is more relevant and more complete!
    • Code optimization in both Chart & ChartDataFrame classes

    Bug Fixes:

    • Add missing requirements
    • Requirements & LICENSE are now packaged in the source distribution
    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Aug 2, 2020)

    New features in this version:

    • Pandas Interface : add aggregator in the y scale label for clarity purpose.

    Bug Fixes:

    • ChartDataFrame can now handle dataset_options as list (for 2 datasets when hue is activated) or as dict (for 1 dataset when hue is deactivated)
    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Jul 24, 2020)

    New features in this version:

    • Pandas Interface : draw charts from your pandas dataframe. More details in documentation.
    • Better handling of callback functions in Javascript side. Using loops & Lodash Javascript package instead of listing all possible callbacks.

    Bug Fixes:

    • Dalalabels automatic coloring didn't work when a colorscheme was selected.
    • Default point colors and border colors didn't work on mixed type charts.
    • Callback functions didn't work on axes options.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Jun 18, 2020)

    Second version of ipychart. Some new features are available:

    • Datalabels (using https://github.com/chartjs/chartjs-plugin-datalabels)
    • Colorschemes (using https://github.com/nagix/chartjs-plugin-colorschemes)
    • New default style
    • Export chart to html

    ... And several bug fixes.

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Apr 29, 2020)

This repository contains a streaming Dataflow pipeline written in Python with Apache Beam, reading data from PubSub.

Sample streaming Dataflow pipeline written in Python This repository contains a streaming Dataflow pipeline written in Python with Apache Beam, readin

Israel Herraiz 9 Mar 18, 2022
Generating interfaces(CLI, Qt GUI, Dash web app) from a Python function.

oneFace is a Python library for automatically generating multiple interfaces(CLI, GUI, WebGUI) from a callable Python object. oneFace is an easy way t

NaNg 31 Oct 21, 2022
Small project demonstrating the use of Grafana and InfluxDB for monitoring the speed of an internet connection

Speedtest monitor for Grafana A small project that allows internet speed monitoring using Grafana, InfluxDB 2 and Speedtest. Demo Requirements Docker

Joshua Ghali 3 Aug 06, 2021
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
Create artistic visualisations with your exercise data (Python version)

strava_py Create artistic visualisations with your exercise data (Python version). This is a port of the R strava package to Python. Examples Facets A

Marcus Volz 53 Dec 28, 2022
Debugging, monitoring and visualization for Python Machine Learning and Data Science

Welcome to TensorWatch TensorWatch is a debugging and visualization tool designed for data science, deep learning and reinforcement learning from Micr

Microsoft 3.3k Dec 27, 2022
The official colors of the FAU as matplotlib/seaborn colormaps

FAU - Colors The official colors of Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU) as matplotlib / seaborn colormaps. We support the old colo

Machine Learning and Data Analytics Lab FAU 9 Sep 05, 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
HM02: Visualizing Interesting Datasets

HM02: Visualizing Interesting Datasets This is a homework assignment for CSCI 40 class at Claremont McKenna College. Go to the project page to learn m

Qiaoling Chen 11 Oct 26, 2021
A Jupyter - Leaflet.js bridge

ipyleaflet A Jupyter / Leaflet bridge enabling interactive maps in the Jupyter notebook. Usage Selecting a basemap for a leaflet map: Loading a geojso

Jupyter Widgets 1.3k Dec 27, 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
Fast data visualization and GUI tools for scientific / engineering applications

PyQtGraph A pure-Python graphics library for PyQt5/PyQt6/PySide2/PySide6 Copyright 2020 Luke Campagnola, University of North Carolina at Chapel Hill h

pyqtgraph 3.1k Jan 08, 2023
A filler visualizer built using python

filler-visualizer 42 filler のログをビジュアライズしてスポーツさながら楽しむことができます! Usage (標準入力でvisualizer.pyに渡せばALL OK) 1. 既にあるログをビジュアライズする $ ./filler_vm -t 3 -p1 john_fill

Takumi Hara 1 Nov 04, 2021
Matplotlib JOTA style for making figures

Matplotlib JOTA style for making figures This repo has Matplotlib JOTA style to format plots and figures for publications and presentation.

JOTA JORNALISMO 2 May 05, 2022
Draw datasets from within Jupyter.

drawdata This small python app allows you to draw a dataset in a jupyter notebook. This should be very useful when teaching machine learning algorithm

vincent d warmerdam 505 Nov 27, 2022
Small project to recursively calculate and plot each successive order of the Hilbert Curve

hilbert-curve Small project to recursively calculate and plot each successive order of the Hilbert Curve. After watching 3Blue1Brown's video on Hilber

Stefan Mejlgaard 2 Nov 15, 2021
An interactive GUI for WhiteboxTools in a Jupyter-based environment

whiteboxgui An interactive GUI for WhiteboxTools in a Jupyter-based environment GitHub repo: https://github.com/giswqs/whiteboxgui Documentation: http

Qiusheng Wu 105 Dec 15, 2022
Visualize your pandas data with one-line code

PandasEcharts 简介 基于pandas和pyecharts的可视化工具 安装 pip 安装 $ pip install pandasecharts 源码安装 $ git clone https://github.com/gamersover/pandasecharts $ cd pand

陈华杰 2 Apr 13, 2022
Comparing USD and GBP Exchange Rates

Currency Data Visualization Comparing USD and GBP Exchange Rates This is a bar graph comparing GBP and USD exchange rates. I chose blue for the UK bec

5 Oct 28, 2021
Process dataframe in a easily way.

Popanda Written by Shengxuan Wang at OSU. Used for processing dataframe, especially for machine learning. The name is from "Po" in the movie Kung Fu P

ShawnWang 1 Dec 24, 2021