Improve joshing reporting. Added a JSHint config file.

Fixed JSHint warnings.
This commit is contained in:
etimberg 2016-02-13 20:12:26 -05:00
parent d9af94a715
commit f6951816a0
35 changed files with 220 additions and 214 deletions

4
config.jshintrc Normal file
View File

@ -0,0 +1,4 @@
{
"node": true,
"predef": [ "require", "module" ]
}

140
dist/Chart.bundle.js vendored
View File

@ -4792,47 +4792,47 @@ window.Color = module.exports = Color
*/
var Chart = require('./core/core.js')()
var Chart = require('./core/core.js')();
require('./core/core.helpers')(Chart)
require('./core/core.element')(Chart)
require('./core/core.animation')(Chart)
require('./core/core.controller')(Chart)
require('./core/core.datasetController')(Chart)
require('./core/core.layoutService')(Chart)
require('./core/core.legend')(Chart)
require('./core/core.scale')(Chart)
require('./core/core.scaleService')(Chart)
require('./core/core.title')(Chart)
require('./core/core.tooltip')(Chart)
require('./core/core.helpers')(Chart);
require('./core/core.element')(Chart);
require('./core/core.animation')(Chart);
require('./core/core.controller')(Chart);
require('./core/core.datasetController')(Chart);
require('./core/core.layoutService')(Chart);
require('./core/core.legend')(Chart);
require('./core/core.scale')(Chart);
require('./core/core.scaleService')(Chart);
require('./core/core.title')(Chart);
require('./core/core.tooltip')(Chart);
require('./controllers/controller.bar')(Chart)
require('./controllers/controller.bubble')(Chart)
require('./controllers/controller.doughnut')(Chart)
require('./controllers/controller.line')(Chart)
require('./controllers/controller.polarArea')(Chart)
require('./controllers/controller.radar')(Chart)
require('./controllers/controller.bar')(Chart);
require('./controllers/controller.bubble')(Chart);
require('./controllers/controller.doughnut')(Chart);
require('./controllers/controller.line')(Chart);
require('./controllers/controller.polarArea')(Chart);
require('./controllers/controller.radar')(Chart);
require('./scales/scale.category')(Chart)
require('./scales/scale.linear')(Chart)
require('./scales/scale.logarithmic')(Chart)
require('./scales/scale.radialLinear')(Chart)
require('./scales/scale.time')(Chart)
require('./scales/scale.category')(Chart);
require('./scales/scale.linear')(Chart);
require('./scales/scale.logarithmic')(Chart);
require('./scales/scale.radialLinear')(Chart);
require('./scales/scale.time')(Chart);
require('./elements/element.arc')(Chart)
require('./elements/element.line')(Chart)
require('./elements/element.point')(Chart)
require('./elements/element.rectangle')(Chart)
require('./elements/element.arc')(Chart);
require('./elements/element.line')(Chart);
require('./elements/element.point')(Chart);
require('./elements/element.rectangle')(Chart);
require('./charts/Chart.Bar')(Chart)
require('./charts/Chart.Bubble')(Chart)
require('./charts/Chart.Doughnut')(Chart)
require('./charts/Chart.Line')(Chart)
require('./charts/Chart.PolarArea')(Chart)
require('./charts/Chart.Radar')(Chart)
require('./charts/Chart.Scatter')(Chart)
require('./charts/Chart.Bar')(Chart);
require('./charts/Chart.Bubble')(Chart);
require('./charts/Chart.Doughnut')(Chart);
require('./charts/Chart.Line')(Chart);
require('./charts/Chart.PolarArea')(Chart);
require('./charts/Chart.Radar')(Chart);
require('./charts/Chart.Scatter')(Chart);
window.Chart = module.exports = Chart
window.Chart = module.exports = Chart;
},{"./charts/Chart.Bar":8,"./charts/Chart.Bubble":9,"./charts/Chart.Doughnut":10,"./charts/Chart.Line":11,"./charts/Chart.PolarArea":12,"./charts/Chart.Radar":13,"./charts/Chart.Scatter":14,"./controllers/controller.bar":15,"./controllers/controller.bubble":16,"./controllers/controller.doughnut":17,"./controllers/controller.line":18,"./controllers/controller.polarArea":19,"./controllers/controller.radar":20,"./core/core.animation":21,"./core/core.controller":22,"./core/core.datasetController":23,"./core/core.element":24,"./core/core.helpers":25,"./core/core.js":26,"./core/core.layoutService":27,"./core/core.legend":28,"./core/core.scale":29,"./core/core.scaleService":30,"./core/core.title":31,"./core/core.tooltip":32,"./elements/element.arc":33,"./elements/element.line":34,"./elements/element.point":35,"./elements/element.rectangle":36,"./scales/scale.category":37,"./scales/scale.linear":38,"./scales/scale.logarithmic":39,"./scales/scale.radialLinear":40,"./scales/scale.time":41}],8:[function(require,module,exports){
"use strict";
@ -4903,7 +4903,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
aspectRatio: 1,
@ -4972,7 +4972,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.bar = {
hover: {
@ -5279,7 +5279,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.bubble = {
hover: {
@ -5449,7 +5449,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.doughnut = {
animation: {
@ -5701,7 +5701,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.line = {
showLines: true,
@ -5993,7 +5993,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.polarArea = {
@ -6223,7 +6223,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.radar = {
@ -6431,7 +6431,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.animation = {
duration: 1000,
@ -6550,7 +6550,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
//Create a dictionary of chart types, to allow for extension of existing types
Chart.types = {};
@ -7112,7 +7112,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// Base class for all dataset controllers (line, bar, etc)
Chart.DatasetController = function(chart, datasetIndex) {
@ -7187,7 +7187,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.elements = {};
@ -7282,7 +7282,7 @@ module.exports = function(Chart) {
/*global document: false */
"use strict";
var color = require('chartjs-color')
var color = require('chartjs-color');
module.exports = function(Chart) {
@ -8173,7 +8173,7 @@ module.exports = function(Chart) {
}
};
}
};
},{"chartjs-color":5}],26:[function(require,module,exports){
"use strict";
@ -8275,9 +8275,9 @@ module.exports = function() {
return text.join("");
}
},
}
};
return Chart
return Chart;
};
@ -8286,7 +8286,7 @@ module.exports = function() {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// The layout service is very self explanatory. It's responsible for the layout within a chart.
// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need
@ -8611,7 +8611,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.legend = {
@ -8937,7 +8937,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.scale = {
display: true,
@ -9612,7 +9612,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.scaleService = {
// Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
@ -9648,7 +9648,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.title = {
display: false,
@ -9843,7 +9843,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.tooltips = {
enabled: true,
@ -10457,7 +10457,7 @@ module.exports = function(Chart) {
module.exports = function(Chart, moment) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.arc = {
backgroundColor: Chart.defaults.global.defaultColor,
@ -10540,7 +10540,7 @@ module.exports = function(Chart, moment) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.line = {
tension: 0.4,
@ -10703,7 +10703,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.point = {
radius: 3,
@ -10765,8 +10765,8 @@ module.exports = function(Chart) {
var radius = vm.radius || Chart.defaults.global.elements.point.radius;
var xOffset
var yOffset
var xOffset;
var yOffset;
switch (vm.pointStyle) {
// Default includes circle
@ -10854,7 +10854,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.rectangle = {
backgroundColor: Chart.defaults.global.defaultColor,
@ -10942,7 +10942,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// Default config for a category scale
var defaultConfig = {
position: "bottom",
@ -10992,7 +10992,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
position: "left",
@ -11076,7 +11076,7 @@ module.exports = function(Chart) {
helpers.each(valuesPerType, function(valuesForType) {
var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);
var minVal = helpers.min(values);
var maxVal = helpers.max(values)
var maxVal = helpers.max(values);
this.min = this.min === null ? minVal : Math.min(this.min, minVal);
this.max = this.max === null ? maxVal : Math.max(this.max, maxVal);
}, this);
@ -11250,7 +11250,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
position: "left",
@ -11444,7 +11444,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
display: true,
@ -11876,12 +11876,12 @@ module.exports = function(Chart) {
/*global window: false */
"use strict";
var moment = require('moment')
moment = typeof(moment) === 'function' ? moment : window.moment
var moment = require('moment');
moment = typeof(moment) === 'function' ? moment : window.moment;
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
if (!moment) {
console.warn('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at http://momentjs.com/');

140
dist/Chart.js vendored
View File

@ -1598,47 +1598,47 @@ window.Color = module.exports = Color
*/
var Chart = require('./core/core.js')()
var Chart = require('./core/core.js')();
require('./core/core.helpers')(Chart)
require('./core/core.element')(Chart)
require('./core/core.animation')(Chart)
require('./core/core.controller')(Chart)
require('./core/core.datasetController')(Chart)
require('./core/core.layoutService')(Chart)
require('./core/core.legend')(Chart)
require('./core/core.scale')(Chart)
require('./core/core.scaleService')(Chart)
require('./core/core.title')(Chart)
require('./core/core.tooltip')(Chart)
require('./core/core.helpers')(Chart);
require('./core/core.element')(Chart);
require('./core/core.animation')(Chart);
require('./core/core.controller')(Chart);
require('./core/core.datasetController')(Chart);
require('./core/core.layoutService')(Chart);
require('./core/core.legend')(Chart);
require('./core/core.scale')(Chart);
require('./core/core.scaleService')(Chart);
require('./core/core.title')(Chart);
require('./core/core.tooltip')(Chart);
require('./controllers/controller.bar')(Chart)
require('./controllers/controller.bubble')(Chart)
require('./controllers/controller.doughnut')(Chart)
require('./controllers/controller.line')(Chart)
require('./controllers/controller.polarArea')(Chart)
require('./controllers/controller.radar')(Chart)
require('./controllers/controller.bar')(Chart);
require('./controllers/controller.bubble')(Chart);
require('./controllers/controller.doughnut')(Chart);
require('./controllers/controller.line')(Chart);
require('./controllers/controller.polarArea')(Chart);
require('./controllers/controller.radar')(Chart);
require('./scales/scale.category')(Chart)
require('./scales/scale.linear')(Chart)
require('./scales/scale.logarithmic')(Chart)
require('./scales/scale.radialLinear')(Chart)
require('./scales/scale.time')(Chart)
require('./scales/scale.category')(Chart);
require('./scales/scale.linear')(Chart);
require('./scales/scale.logarithmic')(Chart);
require('./scales/scale.radialLinear')(Chart);
require('./scales/scale.time')(Chart);
require('./elements/element.arc')(Chart)
require('./elements/element.line')(Chart)
require('./elements/element.point')(Chart)
require('./elements/element.rectangle')(Chart)
require('./elements/element.arc')(Chart);
require('./elements/element.line')(Chart);
require('./elements/element.point')(Chart);
require('./elements/element.rectangle')(Chart);
require('./charts/Chart.Bar')(Chart)
require('./charts/Chart.Bubble')(Chart)
require('./charts/Chart.Doughnut')(Chart)
require('./charts/Chart.Line')(Chart)
require('./charts/Chart.PolarArea')(Chart)
require('./charts/Chart.Radar')(Chart)
require('./charts/Chart.Scatter')(Chart)
require('./charts/Chart.Bar')(Chart);
require('./charts/Chart.Bubble')(Chart);
require('./charts/Chart.Doughnut')(Chart);
require('./charts/Chart.Line')(Chart);
require('./charts/Chart.PolarArea')(Chart);
require('./charts/Chart.Radar')(Chart);
require('./charts/Chart.Scatter')(Chart);
window.Chart = module.exports = Chart
window.Chart = module.exports = Chart;
},{"./charts/Chart.Bar":8,"./charts/Chart.Bubble":9,"./charts/Chart.Doughnut":10,"./charts/Chart.Line":11,"./charts/Chart.PolarArea":12,"./charts/Chart.Radar":13,"./charts/Chart.Scatter":14,"./controllers/controller.bar":15,"./controllers/controller.bubble":16,"./controllers/controller.doughnut":17,"./controllers/controller.line":18,"./controllers/controller.polarArea":19,"./controllers/controller.radar":20,"./core/core.animation":21,"./core/core.controller":22,"./core/core.datasetController":23,"./core/core.element":24,"./core/core.helpers":25,"./core/core.js":26,"./core/core.layoutService":27,"./core/core.legend":28,"./core/core.scale":29,"./core/core.scaleService":30,"./core/core.title":31,"./core/core.tooltip":32,"./elements/element.arc":33,"./elements/element.line":34,"./elements/element.point":35,"./elements/element.rectangle":36,"./scales/scale.category":37,"./scales/scale.linear":38,"./scales/scale.logarithmic":39,"./scales/scale.radialLinear":40,"./scales/scale.time":41}],8:[function(require,module,exports){
"use strict";
@ -1709,7 +1709,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
aspectRatio: 1,
@ -1778,7 +1778,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.bar = {
hover: {
@ -2085,7 +2085,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.bubble = {
hover: {
@ -2255,7 +2255,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.doughnut = {
animation: {
@ -2507,7 +2507,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.line = {
showLines: true,
@ -2799,7 +2799,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.polarArea = {
@ -3029,7 +3029,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.radar = {
@ -3237,7 +3237,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.animation = {
duration: 1000,
@ -3356,7 +3356,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
//Create a dictionary of chart types, to allow for extension of existing types
Chart.types = {};
@ -3918,7 +3918,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// Base class for all dataset controllers (line, bar, etc)
Chart.DatasetController = function(chart, datasetIndex) {
@ -3993,7 +3993,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.elements = {};
@ -4088,7 +4088,7 @@ module.exports = function(Chart) {
/*global document: false */
"use strict";
var color = require('chartjs-color')
var color = require('chartjs-color');
module.exports = function(Chart) {
@ -4979,7 +4979,7 @@ module.exports = function(Chart) {
}
};
}
};
},{"chartjs-color":6}],26:[function(require,module,exports){
"use strict";
@ -5081,9 +5081,9 @@ module.exports = function() {
return text.join("");
}
},
}
};
return Chart
return Chart;
};
@ -5092,7 +5092,7 @@ module.exports = function() {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// The layout service is very self explanatory. It's responsible for the layout within a chart.
// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need
@ -5417,7 +5417,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.legend = {
@ -5743,7 +5743,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.scale = {
display: true,
@ -6418,7 +6418,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.scaleService = {
// Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
@ -6454,7 +6454,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.title = {
display: false,
@ -6649,7 +6649,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.tooltips = {
enabled: true,
@ -7263,7 +7263,7 @@ module.exports = function(Chart) {
module.exports = function(Chart, moment) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.arc = {
backgroundColor: Chart.defaults.global.defaultColor,
@ -7346,7 +7346,7 @@ module.exports = function(Chart, moment) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.line = {
tension: 0.4,
@ -7509,7 +7509,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.point = {
radius: 3,
@ -7571,8 +7571,8 @@ module.exports = function(Chart) {
var radius = vm.radius || Chart.defaults.global.elements.point.radius;
var xOffset
var yOffset
var xOffset;
var yOffset;
switch (vm.pointStyle) {
// Default includes circle
@ -7660,7 +7660,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.rectangle = {
backgroundColor: Chart.defaults.global.defaultColor,
@ -7748,7 +7748,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// Default config for a category scale
var defaultConfig = {
position: "bottom",
@ -7798,7 +7798,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
position: "left",
@ -7882,7 +7882,7 @@ module.exports = function(Chart) {
helpers.each(valuesPerType, function(valuesForType) {
var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);
var minVal = helpers.min(values);
var maxVal = helpers.max(values)
var maxVal = helpers.max(values);
this.min = this.min === null ? minVal : Math.min(this.min, minVal);
this.max = this.max === null ? maxVal : Math.max(this.max, maxVal);
}, this);
@ -8056,7 +8056,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
position: "left",
@ -8250,7 +8250,7 @@ module.exports = function(Chart) {
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
display: true,
@ -8682,12 +8682,12 @@ module.exports = function(Chart) {
/*global window: false */
"use strict";
var moment = require('moment')
moment = typeof(moment) === 'function' ? moment : window.moment
var moment = require('moment');
moment = typeof(moment) === 'function' ? moment : window.moment;
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
if (!moment) {
console.warn('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at http://momentjs.com/');

View File

@ -120,8 +120,9 @@ function releaseTask() {
function jshintTask() {
return gulp.src(srcDir + '**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
.pipe(jshint('config.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
}

View File

@ -34,7 +34,8 @@
"karma-jasmine-html-reporter": "^0.1.8",
"merge-stream": "^1.0.0",
"semver": "^3.0.1",
"vinyl-source-stream": "^1.1.0"
"vinyl-source-stream": "^1.1.0",
"jshint-stylish": "~2.1.0"
},
"spm": {
"main": "Chart.js"

View File

@ -3,7 +3,7 @@
<head>
<title>Line Chart</title>
<!-- <script src="../../node_modules/moment/min/moment.min.js"></script> -->
<script src="../../node_modules/moment/min/moment.min.js"></script>
<script src="../../dist/Chart.bundle.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<style>

View File

@ -9,44 +9,44 @@
*/
var Chart = require('./core/core.js')()
var Chart = require('./core/core.js')();
require('./core/core.helpers')(Chart)
require('./core/core.element')(Chart)
require('./core/core.animation')(Chart)
require('./core/core.controller')(Chart)
require('./core/core.datasetController')(Chart)
require('./core/core.layoutService')(Chart)
require('./core/core.legend')(Chart)
require('./core/core.scale')(Chart)
require('./core/core.scaleService')(Chart)
require('./core/core.title')(Chart)
require('./core/core.tooltip')(Chart)
require('./core/core.helpers')(Chart);
require('./core/core.element')(Chart);
require('./core/core.animation')(Chart);
require('./core/core.controller')(Chart);
require('./core/core.datasetController')(Chart);
require('./core/core.layoutService')(Chart);
require('./core/core.legend')(Chart);
require('./core/core.scale')(Chart);
require('./core/core.scaleService')(Chart);
require('./core/core.title')(Chart);
require('./core/core.tooltip')(Chart);
require('./controllers/controller.bar')(Chart)
require('./controllers/controller.bubble')(Chart)
require('./controllers/controller.doughnut')(Chart)
require('./controllers/controller.line')(Chart)
require('./controllers/controller.polarArea')(Chart)
require('./controllers/controller.radar')(Chart)
require('./controllers/controller.bar')(Chart);
require('./controllers/controller.bubble')(Chart);
require('./controllers/controller.doughnut')(Chart);
require('./controllers/controller.line')(Chart);
require('./controllers/controller.polarArea')(Chart);
require('./controllers/controller.radar')(Chart);
require('./scales/scale.category')(Chart)
require('./scales/scale.linear')(Chart)
require('./scales/scale.logarithmic')(Chart)
require('./scales/scale.radialLinear')(Chart)
require('./scales/scale.time')(Chart)
require('./scales/scale.category')(Chart);
require('./scales/scale.linear')(Chart);
require('./scales/scale.logarithmic')(Chart);
require('./scales/scale.radialLinear')(Chart);
require('./scales/scale.time')(Chart);
require('./elements/element.arc')(Chart)
require('./elements/element.line')(Chart)
require('./elements/element.point')(Chart)
require('./elements/element.rectangle')(Chart)
require('./elements/element.arc')(Chart);
require('./elements/element.line')(Chart);
require('./elements/element.point')(Chart);
require('./elements/element.rectangle')(Chart);
require('./charts/Chart.Bar')(Chart)
require('./charts/Chart.Bubble')(Chart)
require('./charts/Chart.Doughnut')(Chart)
require('./charts/Chart.Line')(Chart)
require('./charts/Chart.PolarArea')(Chart)
require('./charts/Chart.Radar')(Chart)
require('./charts/Chart.Scatter')(Chart)
require('./charts/Chart.Bar')(Chart);
require('./charts/Chart.Bubble')(Chart);
require('./charts/Chart.Doughnut')(Chart);
require('./charts/Chart.Line')(Chart);
require('./charts/Chart.PolarArea')(Chart);
require('./charts/Chart.Radar')(Chart);
require('./charts/Chart.Scatter')(Chart);
window.Chart = module.exports = Chart
window.Chart = module.exports = Chart;

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
aspectRatio: 1,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.bar = {
hover: {

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.bubble = {
hover: {

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.doughnut = {
animation: {

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.line = {
showLines: true,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.polarArea = {

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.radar = {

View File

@ -3,7 +3,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.animation = {
duration: 1000,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
//Create a dictionary of chart types, to allow for extension of existing types
Chart.types = {};

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// Base class for all dataset controllers (line, bar, etc)
Chart.DatasetController = function(chart, datasetIndex) {

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.elements = {};

View File

@ -2,7 +2,7 @@
/*global document: false */
"use strict";
var color = require('chartjs-color')
var color = require('chartjs-color');
module.exports = function(Chart) {
@ -893,4 +893,4 @@ module.exports = function(Chart) {
}
};
}
};

View File

@ -97,8 +97,8 @@ module.exports = function() {
return text.join("");
}
},
}
};
return Chart
return Chart;
};

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// The layout service is very self explanatory. It's responsible for the layout within a chart.
// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.legend = {

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.scale = {
display: true,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.scaleService = {
// Scale registration object. Extensions can register new scale types (such as log or DB scales) and then

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.title = {
display: false,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.tooltips = {
enabled: true,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart, moment) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.arc = {
backgroundColor: Chart.defaults.global.defaultColor,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.line = {
tension: 0.4,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.point = {
radius: 3,
@ -64,8 +64,8 @@ module.exports = function(Chart) {
var radius = vm.radius || Chart.defaults.global.elements.point.radius;
var xOffset
var yOffset
var xOffset;
var yOffset;
switch (vm.pointStyle) {
// Default includes circle

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
Chart.defaults.global.elements.rectangle = {
backgroundColor: Chart.defaults.global.defaultColor,

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
// Default config for a category scale
var defaultConfig = {
position: "bottom",

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
position: "left",
@ -86,7 +86,7 @@ module.exports = function(Chart) {
helpers.each(valuesPerType, function(valuesForType) {
var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);
var minVal = helpers.min(values);
var maxVal = helpers.max(values)
var maxVal = helpers.max(values);
this.min = this.min === null ? minVal : Math.min(this.min, minVal);
this.max = this.max === null ? maxVal : Math.max(this.max, maxVal);
}, this);

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
position: "left",

View File

@ -2,7 +2,7 @@
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
var defaultConfig = {
display: true,

View File

@ -1,12 +1,12 @@
/*global window: false */
"use strict";
var moment = require('moment')
moment = typeof(moment) === 'function' ? moment : window.moment
var moment = require('moment');
moment = typeof(moment) === 'function' ? moment : window.moment;
module.exports = function(Chart) {
var helpers = Chart.helpers
var helpers = Chart.helpers;
if (!moment) {
console.warn('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at http://momentjs.com/');