Skip to content

Commit

Permalink
Merge branch 'release/0.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
areski committed Apr 23, 2024
2 parents f9c45c7 + 8015dd1 commit 7576b60
Show file tree
Hide file tree
Showing 14 changed files with 183 additions and 118 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Django CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
django-version: ['3.2.*', '4.0.*', '4.1.*', '4.2.*', '5.0.*']
exclude:
- django-version: '3.2.*'
python-version: '3.11'
- django-version: '3.2.*'
python-version: '3.12'

- django-version: '4.0.*'
python-version: '3.11'
- django-version: '4.0.*'
python-version: '3.12'

- django-version: '4.1.*'
python-version: '3.12'

- django-version: '5.0.*'
python-version: '3.8'
- django-version: '5.0.*'
python-version: '3.9'

steps:
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
pip install setuptools
pip install Django==${{ matrix.django-version }}
python setup.py install
pip install -r test_requirements.txt
- name: Run tests
run: DJANGO_SETTINGS_MODULE=demoproject.demoproject.settings python setup.py test
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ Django Wrapper for NVD3 - It's time for beautiful charts
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.


.. image:: https://travis-ci.org/areski/django-nvd3.svg?branch=develop
:target: https://travis-ci.org/areski/django-nvd3

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

Expand Down
41 changes: 32 additions & 9 deletions demoproject/demoproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os

DEBUG = True
TEMPLATE_DEBUG = DEBUG

APPLICATION_DIR = os.path.dirname(globals()['__file__'])

Expand Down Expand Up @@ -97,11 +96,37 @@
SECRET_KEY = 'sq)9^f#mf444c(#om$zpo0v!%y=%pqem*9s_qav93fwr_&x40u'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader',
)
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [os.path.join(APPLICATION_DIR, "templates")],
"OPTIONS": {
"debug": DEBUG,
"loaders": [
(
"django.template.loaders.cached.Loader",
[
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
"admin_tools.template_loaders.Loader",
],
),
],
"context_processors": [
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.csrf",
"django.template.context_processors.tz",
"django.template.context_processors.request",
],
},
}
]


MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
Expand All @@ -118,8 +143,6 @@
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'demoproject.wsgi.application'

TEMPLATE_DIRS = (os.path.join(APPLICATION_DIR, 'templates'), )

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
Expand Down Expand Up @@ -183,7 +206,7 @@
BOWER_PATH = '/usr/local/bin/bower'

BOWER_INSTALLED_APPS = (
'd3#3.3.13',
'd3#3.5.5',
'nvd3#1.7.1',
)

Expand Down
32 changes: 16 additions & 16 deletions demoproject/demoproject/urls.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from django.conf.urls import url
from django.urls import path
from . import views


urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^piechart/', views.demo_piechart, name='demo_piechart'),
url(r'^linechart/', views.demo_linechart, name='demo_linechart'),
url(r'^linechart_without_date/', views.demo_linechart_without_date, name='demo_linechart_without_date'),
url(r'^linewithfocuschart/', views.demo_linewithfocuschart, name='demo_linewithfocuschart'),
url(r'^multibarchart/', views.demo_multibarchart, name='demo_multibarchart'),
url(r'^stackedareachart/', views.demo_stackedareachart, name='demo_stackedareachart'),
url(r'^multibarhorizontalchart/', views.demo_multibarhorizontalchart, name='demo_multibarhorizontalchart'),
url(r'^lineplusbarchart/', views.demo_lineplusbarchart, name='demo_lineplusbarchart'),
url(r'^cumulativelinechart/', views.demo_cumulativelinechart, name='demo_cumulativelinechart'),
url(r'^discretebarchart/', views.demo_discretebarchart, name='demo_discretebarchart'),
url(r'^discretebarchart_with_date/', views.demo_discretebarchart_with_date, name='demo_discretebarchart_date'),
url(r'^scatterchart/', views.demo_scatterchart, name='demo_scatterchart'),
url(r'^linechart_with_ampm/', views.demo_linechart_with_ampm, name='demo_linechart_with_ampm'),
# url(r'^demoproject/', include('demoproject.foo.urls')),
path('', views.home, name='home'),
path('piechart/', views.demo_piechart, name='demo_piechart'),
path('linechart/', views.demo_linechart, name='demo_linechart'),
path('linechart_without_date/', views.demo_linechart_without_date, name='demo_linechart_without_date'),
path('linewithfocuschart/', views.demo_linewithfocuschart, name='demo_linewithfocuschart'),
path('multibarchart/', views.demo_multibarchart, name='demo_multibarchart'),
path('stackedareachart/', views.demo_stackedareachart, name='demo_stackedareachart'),
path('multibarhorizontalchart/', views.demo_multibarhorizontalchart, name='demo_multibarhorizontalchart'),
path('lineplusbarchart/', views.demo_lineplusbarchart, name='demo_lineplusbarchart'),
path('cumulativelinechart/', views.demo_cumulativelinechart, name='demo_cumulativelinechart'),
path('discretebarchart/', views.demo_discretebarchart, name='demo_discretebarchart'),
path('discretebarchart_with_date/', views.demo_discretebarchart_with_date, name='demo_discretebarchart_date'),
path('scatterchart/', views.demo_scatterchart, name='demo_scatterchart'),
path('linechart_with_ampm/', views.demo_linechart_with_ampm, name='demo_linechart_with_ampm'),
# path('^demoproject/', include('demoproject.foo.urls')),
]
37 changes: 18 additions & 19 deletions demoproject/demoproject/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from django.shortcuts import render_to_response
from django.shortcuts import render
import random
import datetime
import time
Expand All @@ -10,7 +10,7 @@ def home(request):
"""
home page
"""
return render_to_response('home.html')
return render(request, 'home.html')


def demo_piechart(request):
Expand Down Expand Up @@ -42,7 +42,7 @@ def demo_piechart(request):
'jquery_on_ready': False,
}
}
return render_to_response('piechart.html', data)
return render(request, 'piechart.html', data)


def demo_linechart(request):
Expand All @@ -60,16 +60,15 @@ def demo_linechart(request):
extra_serie1 = {
"tooltip": {"y_start": "", "y_end": " cal"},
"date_format": tooltip_date,
'color': '#a4c639'
}
extra_serie2 = {
"tooltip": {"y_start": "", "y_end": " cal"},
"date_format": tooltip_date,
'color': '#FF8aF8'
}
chartdata = {'x': xdata,
'name1': 'series 1', 'y1': ydata, 'extra1': extra_serie1,
'name2': 'series 2', 'y2': ydata2, 'extra2': extra_serie2}
'name1': 'series 1', 'y1': ydata, 'extra1': extra_serie1, 'kwargs1': { 'color': '#a4c639' },
'name2': 'series 2', 'y2': ydata2, 'extra2': extra_serie2, 'kwargs2': { 'color': '#ff8af8' },
}

charttype = "lineChart"
chartcontainer = 'linechart_container' # container name
Expand All @@ -84,7 +83,7 @@ def demo_linechart(request):
'jquery_on_ready': False,
}
}
return render_to_response('linechart.html', data)
return render('linechart.html', data)


def demo_linechart_without_date(request):
Expand All @@ -111,7 +110,7 @@ def demo_linechart_without_date(request):
'jquery_on_ready': False,
}
}
return render_to_response('linechart.html', data)
return render(request, 'linechart.html', data)


def demo_linewithfocuschart(request):
Expand Down Expand Up @@ -152,7 +151,7 @@ def demo_linewithfocuschart(request):
'jquery_on_ready': True,
}
}
return render_to_response('linewithfocuschart.html', data)
return render(request, 'linewithfocuschart.html', data)


def demo_multibarchart(request):
Expand Down Expand Up @@ -216,7 +215,7 @@ def demo_multibarchart(request):
'jquery_on_ready': True,
},
}
return render_to_response('multibarchart.html', data)
return render(request, 'multibarchart.html', data)


def demo_stackedareachart(request):
Expand Down Expand Up @@ -250,7 +249,7 @@ def demo_stackedareachart(request):
'jquery_on_ready': True,
},
}
return render_to_response('stackedareachart.html', data)
return render(request, 'stackedareachart.html', data)


def demo_multibarhorizontalchart(request):
Expand Down Expand Up @@ -283,7 +282,7 @@ def demo_multibarhorizontalchart(request):
'jquery_on_ready': True,
},
}
return render_to_response('multibarhorizontalchart.html', data)
return render(request, 'multibarhorizontalchart.html', data)


def demo_lineplusbarchart(request):
Expand Down Expand Up @@ -325,7 +324,7 @@ def demo_lineplusbarchart(request):
'focus_enable': True,
},
}
return render_to_response('lineplusbarchart.html', data)
return render(request, 'lineplusbarchart.html', data)


def demo_cumulativelinechart(request):
Expand Down Expand Up @@ -364,7 +363,7 @@ def demo_cumulativelinechart(request):
'jquery_on_ready': True,
},
}
return render_to_response('cumulativelinechart.html', data)
return render(request, 'cumulativelinechart.html', data)


def demo_discretebarchart(request):
Expand All @@ -391,7 +390,7 @@ def demo_discretebarchart(request):
'jquery_on_ready': True,
},
}
return render_to_response('discretebarchart.html', data)
return render(request, 'discretebarchart.html', data)


def demo_discretebarchart_with_date(request):
Expand Down Expand Up @@ -422,7 +421,7 @@ def demo_discretebarchart_with_date(request):
'jquery_on_ready': True,
},
}
return render_to_response('discretebarchart_with_date.html', data)
return render(request, 'discretebarchart_with_date.html', data)


def demo_scatterchart(request):
Expand Down Expand Up @@ -460,7 +459,7 @@ def demo_scatterchart(request):
'jquery_on_ready': True,
},
}
return render_to_response('scatterchart.html', data)
return render(request, 'scatterchart.html', data)


def demo_linechart_with_ampm(request):
Expand Down Expand Up @@ -495,4 +494,4 @@ def demo_linechart_with_ampm(request):
'jquery_on_ready': True,
}
}
return render_to_response('linechart_with_ampm.html', data)
return render(request, 'linechart_with_ampm.html', data)
2 changes: 1 addition & 1 deletion django_nvd3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Project location : https://github.com/areski/django-nvd3
"""

__version__ = '0.9.7' # edit also docs/source/conf.py and update requirements.txt
__version__ = '0.10.0' # edit also docs/source/conf.py and update requirements.txt
__author__ = "Areski Belaid"
__contact__ = "[email protected]"
__homepage__ = "http://areskibelaid.com/"
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# built documents.
#
# The short X.Y version.
version = '0.9.7'
version = '0.10.0'
# The full version, including alpha/beta/rc tags.
#release = '0.6.1'
release = version
Expand Down
Loading

0 comments on commit 7576b60

Please sign in to comment.