Commit 892d8451 authored by Kjetil Thuen's avatar Kjetil Thuen
Browse files

Project setup complete.

parent d7a60daf
......@@ -4,15 +4,13 @@ module.exports = function(grunt) {
// Load libs
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-coffeelint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-connect-proxy');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-extend');
grunt.loadNpmTasks('grunt-browserify');
// Setup
grunt.initConfig({
......@@ -38,79 +36,47 @@ module.exports = function(grunt) {
},
files: {
'tmp/config/settings.json': ['.settings-overrides.json']
}
}
},
development: {
files: {
'tmp/config/settings.json': ['.settings-overrides.json']
}
}
}
},
copy: {
settings: {
cwd: 'tmp/config/',
expand: true,
src: ['**/*.json'],
dest: 'www/js/config/'
},
},
sass: {
dist: {
options: {
includePaths: ['src/styles/']
includePaths: ['src/style/']
},
files: {
'www/css/main.css': 'src/styles/main.scss'
'www/css/timebars.css': 'src/style/timebars.scss'
}
}
},
jshint: {
files: [
'gruntfile.js',
'src/**/*.js',
'test/**/*.js'
],
options: {
globals: {
console: true
},
undef: true,
//unused: true
}
},
jslint: {
coffeelint: {
default: {
src: [
'src/**/*.js',
'test/**/*.js'
'src/**/*.coffee',
'test/**/*.coffee'
]
},
ci: {
src: [
'src/**/*.js',
'test/**/*.js'
'src/**/*.coffee',
'test/**/*.coffee'
],
options: {
failOnError: false,
checkstyle: 'jslint.xml',
checkstyle: 'coffeelint.xml',
}
}
},
clean: {
build: ['buildtmp', 'tmp', 'www/css', 'www/js', 'www/images', 'jslint.xml', 'xunit.xml']
},
bump: {
options: {
files: ['package.json', 'bower.json'],
pushTo: 'origin',
commitFiles: ['package.json', 'bower.json']
}
build: ['buildtmp', 'tmp', 'www/css', 'www/js', 'www/images', 'coffeelint.xml']
},
watch: {
......@@ -120,14 +86,14 @@ module.exports = function(grunt) {
livereload: true
},
scripts: {
files: ['src/**/*.js', 'bower.json'],
files: ['src/**/*.js', 'src/**/*.coffee'],
tasks: ['default'],
options: {
atBegin: true
}
},
stylesheets: {
files: ['src/styles/**'],
files: ['src/style/**'],
tasks: ['sass']
},
tests: {
......@@ -176,16 +142,27 @@ module.exports = function(grunt) {
xforward: false
}
]
},
browserify: {
dist: {
files: {
'www/js/timebars.js': ['src/app/**/*.coffee'],
},
options: {
transform: ['coffeeify']
}
}
}
});
grunt.registerTask('lint', [
'jslint:default'
'coffeelint:default'
]);
grunt.registerTask('build', [
'sass',
'copy'
'browserify'
]);
grunt.registerTask('server', [
......@@ -197,6 +174,6 @@ module.exports = function(grunt) {
grunt.registerTask('default', [
'extend:development',
'build',
'lint'
'coffeelint'
]);
};
TimeBars
========
Introduction
------------
This project is a quick test to see how viable it would be to create animated
barcharts on top of the [Nesstar Rest
API](https://prosjekt.nsd.uib.no/gitlab/nesstar/nesstar-rest-api/wikis/home)
Running
-------
To run this code you will need npm and grunt installed. Once those are in place, run the commands
```
> npm install
> grunt server
```
Then point your (modern) webbrowser to http://localhost:9001
......@@ -2,19 +2,24 @@
"name": "Timebars",
"version": "0.0.1",
"description": "Animated barcharts",
"dependencies": {
"d3-browserify": "3.3.x",
"lodash": "2.4.x"
},
"devDependencies": {
"browserify": "~3.28.1",
"coffeelint": "~1.0.7",
"grunt": "0.4.x",
"grunt-contrib-copy": "0.4.x",
"grunt-bower-task": "0.3.x",
"grunt-contrib-jshint": "0.6.x",
"grunt-jslint": "1.0.x",
"grunt-contrib-clean": "0.5.x",
"grunt-bump": "~0.0.0",
"grunt-contrib-watch": "0.5.x",
"grunt-contrib-connect": "0.3.x",
"grunt-notify": "0.2.x",
"grunt-sass": "0.6.0",
"grunt-connect-proxy": "~0.1.6",
"grunt-extend": "~0.4.2"
"grunt-extend": "~0.4.2",
"grunt-browserify": "~1.3.0",
"grunt-coffeelint": "0.0.8",
"coffeeify": "~0.6.0"
}
}
d3 = require 'd3-browserify'
lodash = require 'lodash'
.timebars {
color: black;
}
......@@ -5,9 +5,9 @@
<meta name="viewport" content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/timebars.css" rel="stylesheet">
<script data-main="js/app/index.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.8/require.min.js"></script>
<script src="js/timebars.js"></script>
</head>
<body>
<nav id="header" class="navbar navbar-default navbar-fixed-top" role="navigation"></nav>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment