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)

Python code for solving 3D structural problems using the finite element method

3DFEM Python 3D finite element code This python code allows for solving 3D structural problems using the finite element method. New features will be a

Rémi Capillon 6 Sep 29, 2022
Pyan3 - Offline call graph generator for Python 3

Pyan takes one or more Python source files, performs a (rather superficial) static analysis, and constructs a directed graph of the objects in the combined source, and how they define or use each oth

Juha Jeronen 235 Jan 02, 2023
Implementation of SOMs (Self-Organizing Maps) with neighborhood-based map topologies.

py-self-organizing-maps Simple implementation of self-organizing maps (SOMs) A SOM is an unsupervised method for learning a mapping from a discrete ne

Jonas Grebe 6 Nov 22, 2022
This project is created to visualize the system statistics such as memory usage, CPU usage, memory accessible by process and much more using Kibana Dashboard with Elasticsearch.

System Stats Visualizer This project is created to visualize the system statistics such as memory usage, CPU usage, memory accessible by process and m

Vishal Teotia 5 Feb 06, 2022
Python package to visualize and cluster partial dependence.

partial_dependence A python library for plotting partial dependence patterns of machine learning classifiers. The technique is a black box approach to

NYU Visualization Lab 25 Nov 14, 2022
Analytical Web Apps for Python, R, Julia, and Jupyter. No JavaScript Required.

Dash Dash is the most downloaded, trusted Python framework for building ML & data science web apps. Built on top of Plotly.js, React and Flask, Dash t

Plotly 17.9k Dec 31, 2022
metedraw is a project mainly for data visualization projects of Atmospheric Science, Marine Science, Environmental Science or other majors

It is mainly for data visualization projects of Atmospheric Science, Marine Science, Environmental Science or other majors.

Nephele 11 Jul 05, 2022
A Simple Flask-Plotly Example for NTU 110-1 DSSI Class

A Simple Flask-Plotly Example for NTU 110-1 DSSI Class Live Demo Prerequisites We will use Flask and Ploty to build a Flask application. If you haven'

Ting Ni Wu 1 Dec 11, 2021
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
Data parsing and validation using Python type hints

pydantic Data validation and settings management using Python type hinting. Fast and extensible, pydantic plays nicely with your linters/IDE/brain. De

Samuel Colvin 12.1k Jan 06, 2023
Massively parallel self-organizing maps: accelerate training on multicore CPUs, GPUs, and clusters

Somoclu Somoclu is a massively parallel implementation of self-organizing maps. It exploits multicore CPUs, it is able to rely on MPI for distributing

Peter Wittek 239 Nov 10, 2022
flask extension for integration with the awesome pydantic package

Flask-Pydantic Flask extension for integration of the awesome pydantic package with Flask. Installation python3 -m pip install Flask-Pydantic Basics v

249 Jan 06, 2023
Print matplotlib colors

mplcolors Tired of searching "matplotlib colors" every week/day/hour? This simple script displays them all conveniently right in your terminal emulato

Brandon Barker 32 Dec 13, 2022
Movie recommendation using RASA, TigerGraph

Demo run: The below video will highlight the runtime of this setup and some sample real-time conversations using the power of RASA + TigerGraph, Steps

Sudha Vijayakumar 3 Sep 10, 2022
Python script for writing text on github contribution chart.

Github Contribution Drawer Python script for writing text on github contribution chart. Requirements Python 3.X Getting Started Create repository Put

Steven 0 May 27, 2022
LabGraph is a a Python-first framework used to build sophisticated research systems with real-time streaming, graph API, and parallelism.

LabGraph is a a Python-first framework used to build sophisticated research systems with real-time streaming, graph API, and parallelism.

MLH Fellowship 7 Oct 05, 2022
demir.ai Dataset Operations

demir.ai Dataset Operations With this application, you can have the empty values (nan/null) deleted or filled before giving your dataset to machine le

Ahmet Furkan DEMIR 8 Nov 01, 2022
This is a learning tool and exploration app made using the Dash interactive Python framework developed by Plotly

Support Vector Machine (SVM) Explorer This app has been moved here. This repo is likely outdated and will not be updated. This is a learning tool and

Plotly 150 Nov 03, 2022
Simple python implementation with matplotlib to manually fit MIST isochrones to Gaia DR2 color-magnitude diagrams

Simple python implementation with matplotlib to manually fit MIST isochrones to Gaia DR2 color-magnitude diagrams

Karl Jaehnig 7 Oct 22, 2022
Create animated and pretty Pandas Dataframe or Pandas Series

Rich DataFrame Create animated and pretty Pandas Dataframe or Pandas Series, as shown below: Installation pip install rich-dataframe Usage Minimal exa

Khuyen Tran 92 Dec 26, 2022