Skip to content

Commit b3f7725

Browse files
committed
Initial commit
0 parents  commit b3f7725

36 files changed

+1680
-0
lines changed

.bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory" : "vendor"
3+
}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor
2+
vendor/*
3+
node_modules

.jshintrc

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
/*
3+
* ENVIRONMENTS
4+
* =================
5+
*/
6+
7+
// Define globals exposed by modern browsers.
8+
"browser": true,
9+
10+
// Define globals exposed by jQuery.
11+
"jquery": true,
12+
13+
// Define globals exposed by Node.js.
14+
"node": true,
15+
16+
/*
17+
* ENFORCING OPTIONS
18+
* =================
19+
*/
20+
21+
// Force all variable names to use either camelCase style or UPPER_CASE
22+
// with underscores.
23+
"camelcase": true,
24+
25+
// Prohibit use of == and != in favor of === and !==.
26+
"eqeqeq": true,
27+
28+
// Enforce tab width of 2 spaces.
29+
"indent": 2,
30+
31+
// Prohibit use of a variable before it is defined.
32+
"latedef": true,
33+
34+
// Require capitalized names for constructor functions.
35+
"newcap": true,
36+
37+
// Enforce use of single quotation marks for strings.
38+
"quotmark": "single",
39+
40+
// Enforce placing 'use strict' at the top function scope
41+
"strict": true,
42+
43+
// Prohibit use of explicitly undeclared variables.
44+
"undef": true,
45+
46+
// Warn when variables are defined but never used.
47+
"unused": true,
48+
49+
// Prohibits overwriting prototypes of native objects such as Array, Date and so on.
50+
"freeze": true,
51+
52+
// Prohibits the use of immediate function invocations without wrapping them in parentheses.
53+
"immed": true,
54+
55+
// Prohibits the use of arguments.caller and arguments.callee
56+
"noarg": true,
57+
58+
/*
59+
* RELAXING OPTIONS
60+
* =================
61+
*/
62+
63+
// Suppress warnings about globals.
64+
"globals": {
65+
"$": false,
66+
"Mustache": false,
67+
"nv": false,
68+
"recline": false,
69+
"jQuery": false,
70+
"_": false,
71+
"d3": false,
72+
"Backbone": false,
73+
"LoadDataView": false,
74+
"DataOptionsView": false,
75+
"ChooseChartView": false,
76+
"ChartOptionsView": false,
77+
"PublishView": false,
78+
"MultiStageView": false
79+
},
80+
// Suppress warnings about == null comparisons.
81+
"eqnull": true
82+
}

.travis.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: node_js
2+
node_js:
3+
- 0.10.28
4+
before_install:
5+
- "export DISPLAY=:99.0"
6+
- "sh -e /etc/init.d/xvfb start"
7+
before_script:
8+
- npm install -g bower
9+
- bower install
10+
script:
11+
- node_modules/karma/bin/karma start --single-run --browsers PhantomJS

Gruntfile.js

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
module.exports = function(grunt) {
2+
'use strict';
3+
// Project configuration.
4+
grunt.initConfig({
5+
pkg: grunt.file.readJSON('package.json'),
6+
concat: {
7+
options: {
8+
separator: ';'
9+
},
10+
dist: {
11+
src: ['src/**/*.js'],
12+
dest: 'dist/<%= pkg.name %>.min.js'
13+
}
14+
},
15+
uglify: {
16+
options: {
17+
banner: '/*! <%= pkg.name %> v0.1 */\n'
18+
},
19+
build: {
20+
src: ['src/**/*.js'],
21+
dest: 'dist/<%= pkg.name %>.min.js'
22+
}
23+
},
24+
livereload: {
25+
26+
},
27+
express: {
28+
all: {
29+
options: {
30+
bases: ['./'],
31+
port: 8080,
32+
hostname: '0.0.0.0',
33+
livereload: true
34+
}
35+
}
36+
},
37+
watch: {
38+
all: {
39+
files: '**/*.html',
40+
options: {
41+
livereload: true
42+
}
43+
}
44+
},
45+
open: {
46+
all: {
47+
path: 'http://localhost:8080/examples/index.html'
48+
}
49+
},
50+
jshint: {
51+
all: ['Gruntfile.js', 'src/**/*.js', 'examples/*.js' ],
52+
options: {
53+
jshintrc: true
54+
}
55+
}
56+
});
57+
58+
grunt.loadNpmTasks('grunt-contrib-jshint');
59+
grunt.loadNpmTasks('grunt-open');
60+
grunt.loadNpmTasks('grunt-express');
61+
grunt.loadNpmTasks('grunt-livereload');
62+
grunt.loadNpmTasks('grunt-contrib-uglify');
63+
grunt.loadNpmTasks('grunt-contrib-concat');
64+
// Default task(s).
65+
grunt.registerTask('default', [
66+
'express',
67+
'jshint',
68+
'concat',
69+
'uglify',
70+
'open',
71+
'watch'
72+
]);
73+
74+
grunt.registerTask('build', [
75+
'jshint',
76+
'concat',
77+
'uglify'
78+
]);
79+
80+
grunt.registerTask('lint', ['jshint']);
81+
};

Makefile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
build-page:
2+
git branch -D gh-pages
3+
git checkout --orphan gh-pages
4+
cp examples/* .
5+
mkdir public
6+
cp -R vendor/* public
7+
sed -i.bak 's/\.\.\/vendor/public/g' index.html
8+
sed -i.bak 's/\.\.\///g' index.html
9+
rm *.bak
10+
git add . -A
11+
git commit -m 'Building gh-pages branch'
12+
git push origin gh-pages --force
13+
rm -rf public
14+
git checkout master

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## Recline NVD3 View
2+
3+
### Usage
4+
5+
```
6+
// Create the demo dataset.
7+
var dataset = new recline.Model.Dataset({
8+
records: [
9+
{id: 0, date: '2011-01-01', x: 1, y: 2, z: 3, country: 'DE', title: 'first', lat:52.56, lon:13.40},
10+
{id: 1, date: '2011-02-02', x: 2, y: 4, z: 24, country: 'UK', title: 'second', lat:54.97, lon:-1.60},
11+
{id: 2, date: '2011-03-03', x: 3, y: 6, z: 9, country: 'US', title: 'third', lat:40.00, lon:-75.5},
12+
{id: 3, date: '2011-04-04', x: 4, y: 8, z: 6, country: 'UK', title: 'fourth', lat:57.27, lon:-6.20},
13+
{id: 4, date: '2011-05-04', x: 5, y: 10, z: 15, country: 'UK', title: 'fifth', lat:51.58, lon:0},
14+
{id: 5, date: '2011-06-02', x: 6, y: 12, z: 18, country: 'DE', title: 'sixth', lat:51.04, lon:7.9}
15+
],
16+
fields: [
17+
{id: 'id'},
18+
{id: 'date', type: 'date'},
19+
{id: 'x', type: 'number'},
20+
{id: 'y', type: 'number'},
21+
{id: 'z', type: 'number'},
22+
{id: 'country', 'label': 'Country'},
23+
{id: 'title', 'label': 'Title'},
24+
{id: 'lat'},
25+
{id: 'lon'}
26+
]
27+
});
28+
29+
var $graphEl = $('#graph');
30+
var graph = new recline.View.nvd3({
31+
model: dataset,
32+
el: $graphEl,
33+
state: {
34+
height: 400,
35+
width: 400,
36+
graphType: "pieChart",
37+
// Label field.
38+
xfield: "country",
39+
// Value field.
40+
yfield: "z",
41+
// Group label field values.
42+
group: true
43+
}
44+
});
45+
graph.render();
46+
```
47+
48+

bower.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "recline.views.nvd3.js",
3+
"version": "0.0.1",
4+
"keywords": [
5+
"recline",
6+
"nvd3"
7+
],
8+
"license": "MIT",
9+
"ignore": [
10+
"**/.*",
11+
"node_modules",
12+
"vendor",
13+
"test",
14+
"tests"
15+
],
16+
"dependencies": {
17+
"lodash.data": "[email protected]:NuCivic/lodash.data.git",
18+
"backbone": "1.0.0",
19+
"jquery": "2.0.3",
20+
"json": "*",
21+
"moment": "2.0.0",
22+
"mustache": "0.5.2",
23+
"showdown": "~0.3.1",
24+
"slickgrid": "2.0.1",
25+
"timeline": "2.29.1",
26+
"underscore.deferred": "*",
27+
"bootstrap-css": "2.3.2",
28+
"nvd3": "*",
29+
"chosen-bootstrap": "*",
30+
"lodash": "*",
31+
"recline.backend.gdocs": "https://github.com/okfn/recline.backend.gdocs.git#e81bb237759353932834a38a0ec810441e0ada10",
32+
"csv.js": "https://github.com/okfn/csv.js.git#976b61384a1808eb464aca5876e5ea46c98deaee",
33+
"recline.view.nvd3.js": "https://github.com/NuCivic/recline.view.nvd3.js.git#removing_steps"
34+
}
35+
}

0 commit comments

Comments
 (0)