Skip to content

Commit 32575fc

Browse files
committed
NuCivic/nucivic-internal#554 New configuration system
1 parent 87d1191 commit 32575fc

9 files changed

+35
-25
lines changed

Gruntfile.js

+23-16
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,38 @@ module.exports = function(grunt) {
44
grunt.initConfig({
55
pkg: grunt.file.readJSON('package.json'),
66
livereload: {
7-
7+
port: 9999
88
},
99
express: {
1010
all: {
1111
options: {
1212
bases: ['./'],
13-
port: 8080,
13+
port: 8888,
1414
hostname: '0.0.0.0',
15-
livereload: true
15+
livereload: {
16+
port: 9999
17+
}
1618
}
1719
}
1820
},
21+
jshint: {
22+
files: ['Gruntfile.js', 'src/**/*.js', 'examples/*.js' ],
23+
options: {
24+
jshintrc: true
25+
}
26+
},
1927
watch: {
20-
all: {
21-
files: '**/*.html',
22-
options: {
23-
livereload: true
24-
}
28+
files: ['<%= jshint.files %>'],
29+
tasks: ['jshint', 'concat', 'uglify'],
30+
options: {
31+
interval: 5007,
32+
livereload: true
2533
}
2634
},
2735
open: {
2836
all: {
2937
path: 'http://localhost:8080/examples/index.html'
3038
}
31-
},
32-
jshint: {
33-
all: ['Gruntfile.js', 'src/**/*.js', 'examples/*.js' ],
34-
options: {
35-
jshintrc: true
36-
}
3739
}
3840
});
3941

@@ -43,13 +45,18 @@ module.exports = function(grunt) {
4345
grunt.loadNpmTasks('grunt-livereload');
4446
grunt.loadNpmTasks('grunt-contrib-uglify');
4547
grunt.loadNpmTasks('grunt-contrib-concat');
48+
4649
// Default task(s).
4750
grunt.registerTask('default', [
4851
'express',
49-
'jshint',
5052
'open',
51-
'watch'
53+
'watch',
5254
]);
5355

56+
grunt.registerTask('build', [
57+
'jshint',
58+
'concat',
59+
'uglify'
60+
]);
5461
grunt.registerTask('lint', ['jshint']);
5562
};

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"timeline": "2.29.1",
2626
"underscore.deferred": "*",
2727
"bootstrap-css": "2.3.2",
28-
"nvd3": "*",
28+
"nvd3": "https://github.com/novus/nvd3.git#development",
2929
"chosen-bootstrap": "*",
3030
"lodash": "*",
3131
"recline.backend.gdocs": "https://github.com/okfn/recline.backend.gdocs.git#e81bb237759353932834a38a0ec810441e0ada10",

css/img/cumulativeline.png

99.1 KB
Loading

css/style.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@
106106
background-image: url('img/scatter.png');
107107
}
108108

109-
#chart-selector .linePlusBarChart {
110-
background-image: url('img/lineplusbar.png');
109+
#chart-selector .cumulativeLineChart {
110+
background-image: url('img/cumulativeline.png');
111111
}

examples/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<script src="../vendor/chosen/chosen.jquery.js"></script>
2121
<script src="../vendor/csv.js/csv.js"></script>
2222
<script src="../vendor/recline.backend.gdocs/backend.gdocs.js"></script>
23-
<script src="../vendor/lodash/dist/lodash.compat.min.js"></script>
23+
<script src="../vendor/lodash/lodash.min.js"></script>
2424
<script src="../vendor/lodash.data/dist/lodash.data.min.js"></script>
2525
<script src="../vendor/backbone/backbone.js"></script>
2626
<script src="../vendor/mustache/mustache.js"></script>
@@ -49,7 +49,7 @@
4949
</div>
5050
</div>
5151
</div>
52-
<footer style="position:absolute;bottom:10px;height:25px;text-align:center;width: 100%; font-size:12px;">
52+
<footer style="text-align:center;width: 100%; font-size:12px;">
5353
<strong>Disclaimer:</strong> Early alpha phase, use at your own risk. Embed urls could change in the near future.
5454
</footer>
5555
<script type="text/javascript" src="../vendor/recline.view.nvd3.js/dist/recline.view.nvd3.min.js"></script>

examples/view.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<script src="../vendor/chosen/chosen.jquery.js"></script>
2121
<script src="../vendor/csv.js/csv.js"></script>
2222
<script src="../vendor/recline.backend.gdocs/backend.gdocs.js"></script>
23-
<script src="../vendor/lodash/dist/lodash.compat.min.js"></script>
23+
<script src="../vendor/lodash/lodash.min.js"></script>
2424
<script src="../vendor/lodash.data/dist/lodash.data.min.js"></script>
2525
<script src="../vendor/backbone/backbone.js"></script>
2626
<script src="../vendor/mustache/mustache.js"></script>

src/ChartOptionsView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'</div>' +
1818
'<div class="form-group">' +
1919
'<label>X Field</label>' +
20-
'<div>{{xfield}}</div>'+
20+
'<div>{{options.x}}</div>'+
2121
'</div>' +
2222
'<div class="form-group">' +
2323
'<label>Series fields</label>' +

src/ChooseChartView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
render: function(){
5151
var self = this;
5252
var graphTypes = ['discreteBarChart', 'multiBarChart', 'stackedAreaChart', 'pieChart',
53-
'lineChart', 'lineWithFocusChart', 'scatterChart', 'linePlusBarChart'
53+
'lineChart', 'lineWithFocusChart', 'scatterChart', 'cumulativeLineChart'
5454
];
5555

5656
self.state.set('graphTypes', _.applyOption(

src/DataOptionsView.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@
6262
},
6363
updateState: function(state, cb){
6464
var self = this;
65+
var options = state.get('options') || {};
6566
state.set('seriesFields', self.$('#control-chart-series').val());
66-
state.set('xfield', self.$('#control-chart-xfield').val());
6767
state.set('xDataType', self.$('input[name=control-chart-x-data-type]:checked').val());
68+
options.x = self.$('#control-chart-xfield').val();
69+
state.set('options', options);
70+
6871
cb(state);
6972
}
7073
});

0 commit comments

Comments
 (0)