Skip to content

Commit

Permalink
created examples build in prep for new chart wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdrowell committed Jun 20, 2014
1 parent b12fb3d commit b0d6ac1
Show file tree
Hide file tree
Showing 25 changed files with 195 additions and 177 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
*.sublime-project
*.sublime-workspace
/dist
/examples/dist
/node_modules
/docs
45 changes: 30 additions & 15 deletions Gruntfile.js
Expand Up @@ -83,7 +83,8 @@ module.exports = function(grunt) {
}
},
clean: {
build: ['dist/*']
dist: ['dist/*'],
examples: ['examples/dist/*']
},
jshint: {
options: {
Expand All @@ -106,6 +107,22 @@ module.exports = function(grunt) {
dest: 'dist/meteorcharts-dev.js'
}]
},
examples: {
options: {
variables: {
LINE_SERIES_DATA: grunt.file.read('examples/data/line-series-data.json'),
BAR_SERIES_DATA: grunt.file.read('examples/data/bar-series-data.json'),
BAR_SERIES_DUAL_DATA: grunt.file.read('examples/data/bar-series-dual-data.json')
},
prefix: '@@'
},

files: [{
expand: true, flatten: true,
src: ['examples/src/*.js'],
dest: 'examples/dist/'
}]
},
prodSrcLicense: {
options: {
variables: {
Expand Down Expand Up @@ -154,19 +171,15 @@ module.exports = function(grunt) {
spawn: false,
},
}
}
/*
shell: {
test: {
command: 'mocha -u tdd -d -v -R spec test/build/meteorcharts-test.js',
options: {
callback: function(err, stdout, stderr, cb) {
console.log(stdout);
cb();
}
}
},
copy: {
examples: {
flatten: true,
expand: true,
src: ['examples/src/*'],
dest: 'examples/dist/',
}
}*/
}
};

grunt.initConfig(config);
Expand All @@ -179,10 +192,12 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');

// Tasks
grunt.registerTask('dev', ['clean', 'concat:dev', 'concat:dev2', 'replace:dev']);
grunt.registerTask('full', ['clean', 'concat:prodSrc', 'uglify', 'concat:prodSrcLicense', 'concat:prodMinLicense', 'replace:prodSrcLicense', 'replace:prodMinLicense']);
grunt.registerTask('dev', ['clean:dist', 'concat:dev', 'concat:dev2', 'replace:dev']);
grunt.registerTask('examples', ['clean:examples', 'copy:examples:', 'replace:examples']);
grunt.registerTask('full', ['clean:dist', 'concat:prodSrc', 'uglify', 'concat:prodSrcLicense', 'concat:prodMinLicense', 'replace:prodSrcLicense', 'replace:prodMinLicense']);
grunt.registerTask('test', ['simplemocha']);
grunt.registerTask('devtest', ['dev', 'test']);

Expand Down
9 changes: 5 additions & 4 deletions examples/chart.html
Expand Up @@ -16,9 +16,10 @@
<script src="../../../lib/three.min.js"></script>
<script src="../../../lib/moment.min.js"></script>
<script src="../../../dist/meteorcharts-dev.js"></script>
<script src="data/line-series-data.js"></script>
<script src="data/bar-series-data.js"></script>
<script src="data/bar-series-dual-data.js"></script>

<script>
var CHARTS = [];
</script>

<script type="text/javascript">
var QUERY_STRING = function () {
Expand Down Expand Up @@ -47,7 +48,7 @@

var js = document.createElement('script');
js.type = 'text/javascript';
js.src = 'charts/' + QUERY_STRING.chart + '.js';
js.src = 'dist/' + QUERY_STRING.chart + '.js';
document.body.appendChild(js);
</script>
</body>
Expand Down
47 changes: 0 additions & 47 deletions examples/data/bar-series-data.js

This file was deleted.

47 changes: 47 additions & 0 deletions examples/data/bar-series-data.json
@@ -0,0 +1,47 @@
[
{
title: 'Califonia',
bars: [
{
title: 'Republicans',
value: 10
}
]
},
{
title: 'New York',
bars: [
{
title: 'Republicans',
value: 15
}
]
},
{
title: 'Colorado',
bars: [
{
title: 'Republicans',
value: 25
}
]
},
{
title: 'Florida',
bars: [
{
title: 'Republicans',
value: 45
}
]
},
{
title: 'Texas',
bars: [
{
title: 'Republicans',
value: 85
}
]
}
]
67 changes: 0 additions & 67 deletions examples/data/bar-series-dual-data.js

This file was deleted.

67 changes: 67 additions & 0 deletions examples/data/bar-series-dual-data.json
@@ -0,0 +1,67 @@
[
{
title: 'Califonia',
bars: [
{
title: 'Republicans',
value: 5
},
{
title: 'Democrats',
value: 95
}
]
},
{
title: 'New York',
bars: [
{
title: 'Republicans',
value: 15
},
{
title: 'Democrats',
value: 85
}
]
},
{
title: 'Colorado',
bars: [
{
title: 'Republicans',
value: 25
},
{
title: 'Democrats',
value: 75
}
]
},
{
title: 'Florida',
bars: [
{
title: 'Republicans',
value: 45
},
{
title: 'Democrats',
value: 55
}
]
},
{
title: 'Texas',
bars: [
{
title: 'Republicans',
value: 85
},
{
title: 'Democrats',
value: 15
}
]
}
]
19 changes: 0 additions & 19 deletions examples/data/line-series-data.js

This file was deleted.

19 changes: 19 additions & 0 deletions examples/data/line-series-data.json
@@ -0,0 +1,19 @@
[
{
title: 'Series 1',
points: [
-100, -100,
100, 100,
200, 50
]
},
{
title: 'Series 2',
points: [
0, 100,
100, 200,
200, 150,
300, 200
]
}
]
Expand Up @@ -40,10 +40,10 @@ var chart = new MeteorChart({
min: 0,
max: 100
},
data: BAR_SERIES_DUAL_DATA,
data: @@BAR_SERIES_DUAL_DATA,
style: function() {
return {
barWidth: (this.get('width') / 10) - 10
barWidth: (this.get('width') / 12)
};
}
},
Expand Down

0 comments on commit b0d6ac1

Please sign in to comment.