Skip to main content

Python NVD3

Project description

Description:

Python-nvd3 is a wrapper for NVD3 graph library

nvd3:

NVD3 http://nvd3.org/

d3:

Data-Driven Documents http://d3js.org/

NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you.

https://www.travis-ci.org/areski/python-nvd3.png?branch=master

endorse

Installation

Install, upgrade and uninstall python-nvd3 with these commands:

$ pip install python-nvd3
$ pip install --upgrade python-nvd3
$ pip uninstall python-nvd3

Dependecies

You will “bower” installed in order to install D3 and NvD3, see bower website for futher info : http://bower.io/

Bower depends on Node and npm. It’s installed globally using npm:

npm install -g bower

Then in your directory where you will use python-nvd3, just type the following:

$ bower install d3
$ bower install nvd3

This will create a directory “bower_components” where d3 & nvd3 will be installed.

Usage

After installation use python-nvd3 as follows

from nvd3 import pieChart

#Open File to write the D3 Graph
output_file = open('test-nvd3.html', 'w')

type = 'pieChart'
chart = pieChart(name=type, color_category='category20c', height=450, width=450)
chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n")

#Create the keys
xdata = ["Orange", "Banana", "Pear", "Kiwi", "Apple", "Strawberry", "Pineapple"]
ydata = [3, 4, 0, 1, 5, 7, 3]

#Add the serie
extra_serie = {"tooltip": {"y_start": "", "y_end": " cal"}}
chart.add_serie(y=ydata, x=xdata, extra=extra_serie)
chart.buildhtml()
output_file.write(chart.htmlcontent)

#close Html file
output_file.close()

See the file examples.py for more samples.

Live demo of NVD3

See a live demo on jsfiddle : http://jsfiddle.net/areski/z4zuH/3/

Supported nvd3 charts

Charts list:

https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/lineWithFocusChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/lineChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/multiBarChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/pieChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/stackedAreaChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/multiBarHorizontalChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/linePlusBarChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/cumulativeLineChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/discreteBarChart.png https://raw.github.com/areski/python-nvd3/master/docs/source/_static/screenshot/scatterChart.png

Documentation

Documentation is available on ‘Read the Docs’: http://python-nvd3.readthedocs.org

Changelog

Changelog summary : https://github.com/areski/python-nvd3/blob/master/CHANGELOG.rst

Like Django ?

We love Django too and we made available a django wrapper for nvd3: https://github.com/areski/django-nvd3

License

Python-nvd3 is licensed under MIT, see MIT-LICENSE.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-nvd3-0.9.0.tar.gz (26.0 kB view details)

Uploaded Source

File details

Details for the file python-nvd3-0.9.0.tar.gz.

File metadata

  • Download URL: python-nvd3-0.9.0.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-nvd3-0.9.0.tar.gz
Algorithm Hash digest
SHA256 70f3d0f1c48f75bdd8d1b2504907337b9dfaea8417d2f3f9c4078f6cb8fb1ec0
MD5 cd226eb0dc2e6f603972391b98162065
BLAKE2b-256 7b37763af3f1f7b4222c9c2db5220d67e01e27f6477e9341d63a7142832162dc

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page