Skip to content

Commit

Permalink
minifiy
Browse files Browse the repository at this point in the history
  • Loading branch information
jo committed Mar 17, 2014
1 parent 8a4652f commit 68b99cc
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
npm-debug.log
node_modules/
tmp/
dist/
.~lock*

.DS_Store
62 changes: 60 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,71 @@ module.exports = function(grunt) {
dest: 'json/migrations.json'
}
},
clean: ['tmp', 'json']
concat: {
js: {
options: {
separator: ';'
},
src: [
'javascripts/modernizr.js',
'javascripts/d3.v3.min.js',
'lib/countrymerge.js',
'lib/layout.js',
'lib/chord.js',
'lib/timeline.js',
'lib/chart.js'
],
dest: 'dist/app-v1.js'
},
css: {
options: {
separator: '\n'
},
src: [
'stylesheets/normalize.css',
'stylesheets/styles.css'
],
dest: 'dist/app-v1.css'
}
},
uglify: {
js: {
files: {
'dist/app-v1.min.js': ['dist/app-v1.js']
}
}
},
cssmin: {
css: {
src: 'dist/app-v1.css',
dest: 'dist/app-v1.min.css'
}
},
copy: {
fonts: {
files: [
{
expand: true,
cwd: 'stylesheets/fonts/',
src: ['*'],
dest: 'dist/fonts',
flatten: true
}
]
}
},
clean: ['tmp', 'json', 'dist']
});

grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');

grunt.registerTask('default', ['jshint', 'nodeunit', 'filter', 'compile']);
grunt.registerTask('build', ['concat', 'cssmin', 'uglify', 'copy']);
grunt.registerTask('default', ['jshint', 'nodeunit', 'filter', 'compile', 'build']);
};
22 changes: 6 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,10 @@
<meta name=description content="Global Migration Data Sheet 2013: Unique estimates of migration flows between the top 50 sending and receiving countries.">
<meta name=viewport content="width=device-width, initial-scale=1.0">
<link rel="icon" href="favicon.png" type="image/png">
<link href=stylesheets/normalize.css rel=stylesheet media=all>
<link href=stylesheets/styles.css rel=stylesheet media=all>
<link href="dist/app-v1.css" rel="stylesheet" media="all">

<!--[if lt IE 9]><script src=javascripts/html5shiv-printshiv.js></script><![endif]-->

<script src="javascripts/modernizr.js"></script>

<script src=javascripts/d3.v3.min.js></script>
<script src="lib/countrymerge.js"></script>
<script src="lib/layout.js"></script>
<script src="lib/chord.js"></script>
<script src="lib/timeline.js"></script>
<script src="lib/chart.js"></script>

<script>
</script>
<script src="dist/app-v1.js"></script>
</head>
<body>
<div id=container class="container">
Expand Down Expand Up @@ -119,7 +107,7 @@ <h2>About the Data</h2>
The bilateral flows between 196 countries are estimated from sequential stock tables. They are comparable across countries and capture the number of people who changed their country of residence over five-year periods. The estimates reflect migration transitions and thus cannot be compared to annual movements flow data published by United Nations and Eurostat.
</p>
<div class="center">
<a href="data/Flow%20Data%20for%20Online%20Viz.csv" class="button">
<a href="data/Flow%20Data%20for%20Online%20Viz%20Version2.csv" class="button">
Download the data
</a>
</div>
Expand Down Expand Up @@ -290,7 +278,9 @@ <h3>How to read the plot</h3>
}

loadScript(document, 'script', 'connect.facebook.net/en_US/all.js#xfbml=1', 'facebook-jssdk');
gapi.plusone.render("plusone-div", {size: 'medium', annotation: 'bubble', width: '250px'});
if (typeof gapi === 'object') {
gapi.plusone.render("plusone-div", {size: 'medium', annotation: 'bubble', width: '250px'});
}
loadScript(document, 'script', 'platform.twitter.com/widgets.js', 'twitter-wjs');
})();
</script>
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-jshint": "~0.6.0",
"csv": "~0.3.2",
"http-server": "~0.5.3"
"http-server": "~0.5.3",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-cssmin": "~0.9.0",
"grunt-contrib-copy": "~0.5.0"
},
"keywords": []
}

0 comments on commit 68b99cc

Please sign in to comment.