sphinxcontrib.nvd3¶
Sphinx chart extension using NVD3.
Feature¶
- provide some kinds of
nvd3-
prefixed directives to generate SVG chart from source.
Installation¶
Install with pip:
$ pip install sphinxcontrib.nvd3
setup conf.py with:
extensions = ["sphinxcontrib.nvd3"]
This package is NOT includes Javascript and CSS files (e.g. d3.js, nvd3.js and nvd3.css).
You need to add setup function into conf.py, as below:
def setup(app):
app.add_javascript("/path/to/d3.v3.js")
app.add_javascript("/path/to/nv.d3.js")
app.add_stylesheet("/path/to/nv.d3.css")
And then:
$ make html
Requirement¶
- python-nvd3 >= 0.3.16
- D3.js >= 3.x
- Sphinx >= 1.3
License¶
Licensed under the Apache Software License . See the LICENSE file for specific terms.
Authors¶
Sphinx Directive and packaging¶
- Shoji KUMAGAI <take.this.2.your.grave@gmail.com> Sphinx-users.jp
COntributors¶
- m-vdb
Changes¶
0.1.5 (18 Feb, 2017)¶
- add parallel doc build option
0.1.4 (25 Oct, 2015)¶
- add new option ‘window_onload’
0.1.3 (19 Apr, 2015)¶
- enable to accept dataset from directive content
0.1.2 (16 Apr, 2015)¶
- fix packaging failure
0.1.1 (08 Apr, 2015)¶
- add new option
0.1.0 (08 Apr, 2015)¶
- first release
Sample Charts¶
Options¶
The following keywords from python-nvd3 are acceptable. Please refer to nvd3docs for details:
- jquery_on_ready
- charttooltip_dateformat
- name
- color_category
- color_list
- margin_top
- margin_right
- margin_bottom
- margin_left
- width
- height
- stacked
- resize
- show_legend
- show_labels
- tag_script_js
- use_interactive_guideline
- chart_attr
- chart_kwargs
- extras
- x_is_date
- x_axis_format
- style
Additionaly, following keywords are acceptable:
encoding: | specify a character encoding for input file. default value depends on ‘source_encoding’. |
---|---|
delimiter: | specify a line delimiter for input file. ‘,’ as default. |
window_onload: | enable to execute js codes for chart on ‘onload’ event |