`charts.css.py` brings `charts.css` to Python. Online documentation and samples is available at the link below.

Overview

charts.css.py

charts.css.py provides a python API to convert your 2-dimension data lists into html snippet, which will be rendered into charts by CSS, when serving inside a browser.

  • The output of charts.css.py is not images. Consequently, charts.css.py is a pure Python package without any image library dependency. You can use charts.css.py on any platform.
  • The output of charts.css.py is a normal HTML table. Search engines and screen readers will be able to consume your data even when CSS rendering is unavailable.
  • Once the html snippet is delivered into the browser window, the rendering is done by CSS, which is typically faster than JS-heavy chart libraries.
  • Since the output is normal HTML, you could customize its size and position, by defining your own CSS styles.

Installation

pip install charts.css.py

Usage

Just combine the output of charts.css.py functions and the predefined CSS style <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css"> into your html page.

For example, the following code snippet can convert a 2-dimension list into column chart:

from charts.css import column
STYLESHEET = '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css">'
chart = column(
    [
        ["Continent", "1st year", "2nd year", "3rd year", "4th year", "5th year"],
        ["Asia", 20.0, 30.0, 40.0, 50.0, 75.0],
        ["Euro", 40.0, 60.0, 75.0, 90.0, 100.0],
    ],
    headers_in_first_row=True,
    headers_in_first_column=True,
    )
# Now, variable chart contains html snippet of "<table>...</table>", and
# STYLESHEET is just a constant string of "<link href='https://.../charts.css'>".
# You can somehow insert them into the proper places of your full html page.
# Here in this sample, we take a shortcut by simply concatenating them.
open("output.html", "w").write(STYLESHEET + chart)

The output.html will be rendered in browser like this:

Sample output

Advanced Usage

There are currently 4 different charts implemented: bar, column, line, area. All those methods support many parameters to further customize the chart appearance. bar() and column() also support stacking by value or stacking by percentage. All those features are demonstrated in the different samples in this document.

Lastly, this package also provides a command-line tool csv2chart. You can use it to convert csv file into an html file. For example, csv2chart sample.csv output.html. You can also run csv2chart -h to know all the parameters it supports.

Versioning

charts.css.py uses Semantic Versioning.

You might also like...
🐞 📊 Ladybug extension to generate 2D charts

ladybug-charts Ladybug extension to generate 2D charts. Installation pip install ladybug-charts QuickStart import ladybug_charts API Documentation Loc

GitHub English Top Charts

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

Data-FX is an addon for Blender (2.9) that allows for the visualization of data with different charts
Data-FX is an addon for Blender (2.9) that allows for the visualization of data with different charts

Data-FX Data-FX is an addon for Blender (2.9) that allows for the visualization of data with different charts Currently, there are only 2 chart option

Glue is a python project to link visualizations of scientific datasets across many files.
Glue is a python project to link visualizations of scientific datasets across many files.

Glue Glue is a python project to link visualizations of scientific datasets across many files. Click on the image for a quick demo: Features Interacti

Flipper Zero documentation repo

Flipper Zero Docs Participation To fix a bug or add something new to this repository, you need to open a pull-request. Also, on every page of the site

A tool for automatically generating 3D printable STLs from freely available lidar scan data.
A tool for automatically generating 3D printable STLs from freely available lidar scan data.

mini-map-maker A tool for automatically generating 3D printable STLs from freely available lidar scan data. Screenshots Tutorial To use this script, g

A Python Binder that merge 2 files with any extension by creating a new python file and compiling it to exe which runs both payloads.
A Python Binder that merge 2 files with any extension by creating a new python file and compiling it to exe which runs both payloads.

Update ! ANONFILE MIGHT NOT WORK ! About A Python Binder that merge 2 files with any extension by creating a new python file and compiling it to exe w

Debugging, monitoring and visualization for Python Machine Learning and Data Science
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

Python module for drawing and rendering beautiful atoms and molecules using Blender.

Batoms is a Python package for editing and rendering atoms and molecules objects using blender. A Python interface that allows for automating workflows.

Comments
  • charts.css.py 0.4.0

    charts.css.py 0.4.0

    This release adds some helper and parameters to help you fine tune the chart appearance. They are especially useful when you attempt to render some csv data input with many rows.

    • Feature: A transpose(...) helper to flip your input data diagonally so that it swaps its x-axis and y-axis.
    • Feature: New parameter hide_label. It is useful when primary axis contains too many rows.
    • Feature: New parameter tooltip_builder which has a shape of lambda value="...", label="...": "...".
    • Feature: New parameter value_converter which typically will be assigned with either int or float.
    • Change: By default, data axes will no longer be shown. You can turn it back on by the new show_data_axes parameter.

    The online documentation will be updated to demonstrate these new features.

    opened by rayluo 0
  • Release 0.3.0

    Release 0.3.0

    • Line chart should not accept non-zero data_spacing or datasets_spacing. Now it would rightfully reject such an input.
    • Provide an online document/sample
    • Backport to Brython 3.7 and 3.8. The recommended Brython version is still its latest version, currently 3.9.
    opened by rayluo 0
  • charts.css.py 0.1.0

    charts.css.py 0.1.0

    The first release contains:

    • Basic functionality including bar, column, line and area
    • An experimental helper wrapper
    • Barely enough documentation in README.md
    • Also comes with a command-line tool csv2chart. I use it for my ad-hoc test. Let me know if you find it useful.
    opened by rayluo 0
Releases(0.4.0)
  • 0.4.0(Jun 27, 2021)

    This release adds some helper and parameters to help you fine tune the chart appearance. They are especially useful when you attempt to render some csv data input with many rows.

    • Feature: A transpose(...) helper to flip your input data diagonally so that it swaps its x-axis and y-axis.
    • Feature: New parameter value_converter which typically will be assigned with either int or float. With its help, now you can consume data directly from csv by data = list(csv.reader(f)).
    • Feature: New parameter hide_label. It is useful when primary axis contains too many rows.
    • Feature: New parameter tooltip_builder which has a shape of lambda value="...", label="...": "...".
    • Change: By default, data axes will no longer be shown. You can turn it back on by the new show_data_axes parameter.

    The online documentation ~will be~ has been updated to demonstrate these new features.

    Source code(tar.gz)
    Source code(zip)
    charts.css.py-brython.js(8.11 KB)
  • 0.3.0(May 23, 2021)

    • Line chart should not accept non-zero data_spacing or datasets_spacing. Now it would rightfully reject such an input.
    • Provide an online document/sample
    • Backport to Brython 3.7 and 3.8. The recommended Brython version is still its latest version, currently 3.9.
    • Also hosted as a Brython package which can be used by <script src="https://github.com/rayluo/charts.css.py/releases/download/0.3.0/charts.css.py-brython.js"></script>. Requires Brython 3.7.5 or above.
    Source code(tar.gz)
    Source code(zip)
    charts.css.py-brython.js(7.20 KB)
  • 0.2.0(May 17, 2021)

  • 0.1.0(May 14, 2021)

    The first release contains:

    • Basic functionality including bar, column, line and area
    • An experimental helper wrapper
    • Barely enough documentation in README.md
    • Also comes with a command-line tool csv2chart. I use it for my ad-hoc test. Let me know if you find it useful.
    Source code(tar.gz)
    Source code(zip)
D-Analyst : High Performance Visualization Tool

D-Analyst : High Performance Visualization Tool D-Analyst is a high performance data visualization built with python and based on OpenGL. It allows to

4 Apr 14, 2022
Draw interactive NetworkX graphs with Altair

nx_altair Draw NetworkX graphs with Altair nx_altair offers a similar draw API to NetworkX but returns Altair Charts instead. If you'd like to contrib

Zachary Sailer 206 Dec 12, 2022
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 Graph Learning library for Humans

A Graph Learning library for Humans These novel algorithms include but are not limited to: A graph construction and graph searching class can be found

Richard Tjörnhammar 1 Feb 08, 2022
Simple implementation of Self Organizing Maps (SOMs) with rectangular and hexagonal grid topologies

py-self-organizing-map Simple implementation of Self Organizing Maps (SOMs) with rectangular and hexagonal grid topologies. A SOM is a simple unsuperv

Jonas Grebe 1 Feb 10, 2022
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
YOPO is an interactive dashboard which generates various standard plots.

YOPO is an interactive dashboard which generates various standard plots.you can create various graphs and charts with a click of a button. This tool uses Dash and Flask in backend.

ADARSH C 38 Dec 20, 2022
Interactive Dashboard for Visualizing OSM Data Change

Dashboard and intuitive data downloader for more interactive experience with interpreting osm change data.

1 Feb 20, 2022
Squidpy is a tool for the analysis and visualization of spatial molecular data.

Squidpy is a tool for the analysis and visualization of spatial molecular data. It builds on top of scanpy and anndata, from which it inherits modularity and scalability. It provides analysis tools t

Theis Lab 251 Dec 19, 2022
3D-Lorenz-Attractor-simulation-with-python

3D-Lorenz-Attractor-simulation-with-python Animação 3D da trajetória do Atrator de Lorenz, implementada em Python usando o método de Runge-Kutta de 4ª

Hevenicio Silva 17 Dec 08, 2022
A command line tool for visualizing CSV/spreadsheet-like data

PerfPlotter Read data from CSV files using pandas and generate interactive plots using bokeh, which can then be embedded into HTML pages and served by

Gino Mempin 0 Jun 25, 2022
The Python ensemble sampling toolkit for affine-invariant MCMC

emcee The Python ensemble sampling toolkit for affine-invariant MCMC emcee is a stable, well tested Python implementation of the affine-invariant ense

Dan Foreman-Mackey 1.3k Jan 04, 2023
Plot toolbox based on Matplotlib, simple and elegant.

Elegant-Plot Plot toolbox based on Matplotlib, simple and elegant. 绘制效果 绘制过程 数据准备 每种图标类型的目录下有data.csv文件,依据样例数据填入自己的数据。

3 Jul 15, 2022
The interactive graphing library for Python (includes Plotly Express) :sparkles:

plotly.py Latest Release User forum PyPI Downloads License Data Science Workspaces Our recommended IDE for Plotly’s Python graphing library is Dash En

Plotly 12.7k Jan 05, 2023
Show Data: Show your dataset in web browser!

Show Data is to generate html tables for large scale image dataset, especially for the dataset in remote server. It provides some useful commond line tools and fully customizeble API reference to gen

Dechao Meng 83 Nov 26, 2022
Graphical visualizer for spectralyze by Lauchmelder23

spectralyze visualizer Graphical visualizer for spectralyze by Lauchmelder23 Install Install matplotlib and ffmpeg. Put ffmpeg.exe in same folder as v

Matthew 1 Dec 21, 2021
A Python toolbox for gaining geometric insights into high-dimensional data

"To deal with hyper-planes in a 14 dimensional space, visualize a 3D space and say 'fourteen' very loudly. Everyone does it." - Geoff Hinton Overview

Contextual Dynamics Laboratory 1.8k Dec 29, 2022
trade bot connected to binance API/ websocket.,, include dashboard in plotly dash to visualize trades and balances

Crypto trade bot 1. What it is Trading bot connected to Binance API. This project made for fun. So ... Do not use to trade live before you have backte

G 3 Oct 07, 2022
RockNext is an Open Source extending ERPNext built on top of Frappe bringing enterprise ready utilization.

RockNext is an Open Source extending ERPNext built on top of Frappe bringing enterprise ready utilization.

Matheus Breguêz 13 Oct 12, 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