Skip to content

Commit

Permalink
[fix] merge
Browse files Browse the repository at this point in the history
  • Loading branch information
areski committed Apr 22, 2024
2 parents dc8e772 + 456c24f commit b2ee006
Show file tree
Hide file tree
Showing 66 changed files with 1,481 additions and 617 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Python Tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: false

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools
pip install -r requirements.txt
python setup.py install
pip install coveralls
- name: Run tests
run: coverage run --source=nvd3 setup.py test

- name: Finish coveralls
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ bower.json
bower_components

archive
env
myenv
nvd3_env

htmlcov
test_*.html
Expand Down
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

9 changes: 8 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ History
-------


0.15.0 - current
---------------------

* new settings show_controls & xAxis_rotateLabel
* add setting to add callback


0.14.0 - (2015-12-09)
---------------------

Expand Down Expand Up @@ -73,7 +80,7 @@ History


0.10.0 (2013-10-02)
------------------
-------------------

* Support new chart linePlusBarWithFocusChart

Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ If you are proposing a feature:
Get Started!
------------

Ready to contribute? Here's how to set up `python-msspeak` for local development.
Ready to contribute? Here's how to set up `python-nvd3` for local development.

1. Fork the `python-msspeak` repo on GitHub.
1. Fork the `python-nvd3` repo on GitHub.
2. Clone your fork locally::

$ git clone git@github.com:your_name_here/python-msspeak.git
$ git clone git@github.com:your_name_here/python-nvd3.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ mkvirtualenv python-msspeak
$ cd python-msspeak/
$ mkvirtualenv python-nvd3
$ cd python-nvd3/
$ python setup.py develop

4. Create a branch for local development::
Expand All @@ -76,7 +76,7 @@ Ready to contribute? Here's how to set up `python-msspeak` for local development

5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::

$ flake8 python-msspeak tests
$ flake8 python-nvd3 tests
$ python setup.py test
$ tox

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include CONTRIBUTING.rst
include HISTORY.rst
include CHANGELOG.rst
include LICENSE
include README.rst

Expand Down
28 changes: 13 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ Python Wrapper for NVD3 - It's time for beautiful charts
.. _Areski: https://github.com/areski/
.. _Oz: https://github.com/oz123/

.. image:: https://api.travis-ci.org/areski/python-nvd3.png?branch=develop
:target: https://travis-ci.org/areski/python-nvd3

.. image:: https://coveralls.io/repos/areski/python-nvd3/badge.png?branch=develop
:target: https://coveralls.io/r/areski/python-nvd3?branch=develop

Expand All @@ -32,10 +29,6 @@ Python Wrapper for NVD3 - It's time for beautiful charts
:target: https://pypi.python.org/pypi/python-nvd3/
:alt: License

.. image:: https://requires.io/github/areski/python-nvd3/requirements.svg?branch=develop
:target: https://requires.io/github/areski/python-nvd3/requirements/?branch=develop
:alt: Requirements Status

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

Expand All @@ -46,13 +39,11 @@ These graphs can be part of your web application:
.. image:: https://raw.githubusercontent.com/areski/python-nvd3/develop/docs/showcase/multiple-charts.png




Want to try it yourself? Install python-nvd3, enter your python shell and try this quick demo::

>>> from nvd3 import pieChart
>>> type = 'pieChart'
>>> chart = pieChart(name=type, color_category='category20c', height=450, width=450)
>>> chart_name = 'pieChart'
>>> chart = pieChart(name=chart_name, color_category='category20c', height=450, width=450)
>>> xdata = ["Orange", "Banana", "Pear", "Kiwi", "Apple", "Strawberry", "Pineapple"]
>>> ydata = [3, 4, 0, 1, 5, 7, 3]
>>> extra_serie = {"tooltip": {"y_start": "", "y_end": " cal"}}
Expand Down Expand Up @@ -109,6 +100,7 @@ Check out the documentation on `Read the Docs`_ for some live Chart examples!

.. _Read the Docs: http://python-nvd3.readthedocs.org


Installation
------------

Expand All @@ -119,8 +111,8 @@ Install, upgrade and uninstall python-nvd3 with these commands::
$ pip uninstall python-nvd3


Dependecies
-----------
Dependencies
------------

D3 and NvD3 can be installed through bower (which itself can be installed through npm).
See http://bower.io/ and https://npmjs.org for further information.
Expand All @@ -132,8 +124,8 @@ Note : you might prefer to save your npm dependencies locally in a ``package.jso

Then in the directory where you will use python-nvd3, just execute the following commands::

$ bower install d3#3.3.8
$ bower install nvd3#1.1.12-beta
$ bower install d3#3.5.17
$ bower install nvd3#1.8.6

This will create a directory "bower_components" where d3 & nvd3 will be saved.

Expand Down Expand Up @@ -161,3 +153,9 @@ License
-------

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


Maintainers
-----------

If you want to help maintain this project, please get in touch.
6 changes: 3 additions & 3 deletions docs/source/_templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{% endblock %}

{% block extrahead %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.7.0/nv.d3.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.7.0/nv.d3.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.6/nv.d3.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.6/nv.d3.min.js"></script>
{% endblock %}

{%- block body %}
Expand Down
4 changes: 4 additions & 0 deletions docs/source/classes-doc/examples/NVD3Chart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
..
_Generated with generated_examples.sh script

.. raw:: html
4 changes: 4 additions & 0 deletions docs/source/classes-doc/examples/bulletChart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
..
_Generated with generated_examples.sh script

.. raw:: html
62 changes: 62 additions & 0 deletions docs/source/classes-doc/examples/cumulativeLineChart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
..
_Generated with generated_examples.sh script

.. raw:: html

<div id="cumulativelinechart"><svg style="height:450px;"></svg></div>


<script>



data_cumulativelinechart=[{"values": [{"x": 1365026400000, "y": 6}, {"x": 1365026500000, "y": 5}, {"x": 1365026600000, "y": 1}], "key": "Serie 1", "yAxis": "1"}, {"values": [{"x": 1365026400000, "y": 36}, {"x": 1365026500000, "y": 55}, {"x": 1365026600000, "y": 11}], "key": "Serie 2", "yAxis": "1"}];

nv.addGraph(function() {
var chart = nv.models.cumulativeLineChart();

chart.margin({top: 30, right: 60, bottom: 20, left: 60});
chart.xAxis.rotateLabels(0)
chart.xAxis.staggerLabels(false)
chart.xAxis.showMaxMin(true)
var datum = data_cumulativelinechart;







chart.xAxis
.tickFormat(function(d) { return d3.time.format('%d %b %Y')(new Date(parseInt(d))) }
);
chart.yAxis
.tickFormat(d3.format(',.1%'));

chart.tooltip.headerFormatter(function(d, i) {
return d3.time.format("%d %b %Y")(new Date(parseInt(d)));
});

chart.showLegend(true);







d3.select('#cumulativelinechart svg')
.datum(datum)
.transition().duration(500)
.attr('height', 450)
.call(chart);



});




</script>

58 changes: 58 additions & 0 deletions docs/source/classes-doc/examples/discreteBarChart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
..
_Generated with generated_examples.sh script

.. raw:: html

<div id="discretebarchart"><svg style="width:400px;height:400px;"></svg></div>


<script>



data_discretebarchart=[{"values": [{"x": "A", "y": 3}, {"x": "B", "y": 4}, {"x": "C", "y": 0}, {"x": "D", "y": -3}, {"x": "E", "y": 5}, {"x": "F", "y": 7}], "key": "Serie 1", "yAxis": "1"}];


nv.addGraph(function() {
var chart = nv.models.discreteBarChart();

chart.margin({top: 30, right: 60, bottom: 20, left: 60});
chart.xAxis.rotateLabels(0)
chart.xAxis.staggerLabels(false)
chart.xAxis.showMaxMin(true)
var datum = data_discretebarchart;







chart.yAxis
.tickFormat(d3.format(',.0f'));










d3.select('#discretebarchart svg')
.datum(datum)
.transition().duration(500)
.attr('width', '400')
.attr('height', 400)
.call(chart);




});



</script>

Loading

0 comments on commit b2ee006

Please sign in to comment.