language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | chartjs | Chart.js | ce8ee02ccd992c062cfa734df713730c077cdb2e.json | Reduce indentation by reversing if check (#6497) | src/plugins/plugin.title.js | @@ -111,23 +111,20 @@ var Title = Element.extend({
fit: function() {
var me = this;
var opts = me.options;
- var display = opts.display;
- var minSize = me.minSize;
- var lineCount = helpers.isArray(opts.text) ? opts.text.length : 1;
- var fontOpts = helpers.options._parseFont(opts);
- var textSize = displ... | true |
Other | chartjs | Chart.js | ce8ee02ccd992c062cfa734df713730c077cdb2e.json | Reduce indentation by reversing if check (#6497) | test/specs/plugin.title.tests.js | @@ -27,7 +27,7 @@ describe('Title block tests', function() {
var minSize = title.update(400, 200);
expect(minSize).toEqual({
- width: 400,
+ width: 0,
height: 0
});
@@ -58,7 +58,7 @@ describe('Title block tests', function() {
expect(minSize).toEqual({
width: 0,
- height: 400
+ height: ... | true |
Other | chartjs | Chart.js | 6e69a38305e532a36b8d8b1ed58a9c3655c58192.json | Add elements.arc.angle in documentation (#6491)
Add elements.arc.angle in documentation | docs/configuration/elements.md | @@ -82,6 +82,7 @@ Global arc options: `Chart.defaults.global.elements.arc`.
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
+| `angle` - for polar only | `number` | `circumference / (arc count)` | Arc angle to cover.
| `backgroundColor` | `Color` | `'rgba(0, 0, 0, 0.1)'` | Arc fill colo... | false |
Other | chartjs | Chart.js | 053729ac44b6a16ce957142fdcacaa5bfd9d8d79.json | Add link back to home page from docs (#6435)
* Add link back to home page from docs #6433
* Modify link texts
* Edit homepage link | docs/SUMMARY.md | @@ -1,6 +1,7 @@
# Summary
-* [Chart.js](README.md)
+* [Chart.js](https://www.chartjs.org)
+* [Introduction](README.md)
* [Getting Started](getting-started/README.md)
* [Installation](getting-started/installation.md)
* [Integration](getting-started/integration.md) | false |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/controllers/controller.bar.js | @@ -32,7 +32,7 @@ defaults._set('bar', {
* @private
*/
function computeMinSampleSize(scale, pixels) {
- var min = scale.isHorizontal() ? scale.width : scale.height;
+ var min = scale._length;
var ticks = scale.getTicks();
var prev, curr, i, ilen;
@@ -42,7 +42,7 @@ function computeMinSampleSize(scale, pixels)... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/core/core.controller.js | @@ -546,6 +546,11 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
me._layers = [];
helpers.each(me.boxes, function(box) {
+ // _configure is called twice, once in core.scale.update and once here.
+ // Here the boxes are fully updated and at their final positions.
+ if (box._configure) {
+ box.... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/core/core.helpers.js | @@ -100,19 +100,6 @@ module.exports = function() {
}
return x > 0 ? 1 : -1;
};
- helpers.log10 = Math.log10 ?
- function(x) {
- return Math.log10(x);
- } :
- function(x) {
- var exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 / Math.LN10.
- // Check for whole powers of 10,
- // which due ... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/core/core.scale.js | @@ -70,9 +70,7 @@ function getPixelForGridLine(scale, index, offsetGridLines) {
if (offsetGridLines) {
if (scale.getTicks().length === 1) {
- lineValue -= scale.isHorizontal() ?
- Math.max(lineValue - scale.left, scale.right - lineValue) :
- Math.max(lineValue - scale.top, scale.bottom - lineValue);
+ ... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/helpers/helpers.math.js | @@ -1,5 +1,7 @@
'use strict';
+var helpers = require('./helpers.core');
+
/**
* @alias Chart.helpers.math
* @namespace
@@ -28,7 +30,28 @@ var exports = {
return a - b;
}).pop();
return result;
+ },
+
+ log10: Math.log10 || function(x) {
+ var exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 /... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/scales/scale.category.js | @@ -63,17 +63,30 @@ module.exports = Scale.extend({
return me.ticks[index - me.minIndex];
},
- // Used to get data value locations. Value can either be an index or a numerical value
- getPixelForValue: function(value, index, datasetIndex) {
+ _configure: function() {
var me = this;
var offset = me.options... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/scales/scale.linear.js | @@ -149,29 +149,12 @@ module.exports = LinearScaleBase.extend({
// Utils
getPixelForValue: function(value) {
- // This must be called after fit has been run so that
- // this.left, this.top, this.right, and this.bottom have been defined
var me = this;
- var start = me.start;
-
- var rightValue = +me.getRig... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/scales/scale.linearbase.js | @@ -231,5 +231,24 @@ module.exports = Scale.extend({
me.zeroLineIndex = me.ticks.indexOf(0);
Scale.prototype.convertTicksToLabels.call(me);
+ },
+
+ _configure: function() {
+ var me = this;
+ var ticks = me.getTicks();
+ var start = me.min;
+ var end = me.max;
+ var offset;
+
+ Scale.prototype._configure... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/scales/scale.logarithmic.js | @@ -6,6 +6,7 @@ var Scale = require('../core/core.scale');
var Ticks = require('../core/core.ticks');
var valueOrDefault = helpers.valueOrDefault;
+var log10 = helpers.math.log10;
/**
* Generate a set of logarithmic ticks
@@ -16,20 +17,20 @@ var valueOrDefault = helpers.valueOrDefault;
function generateTicks(... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | src/scales/scale.time.js | @@ -596,7 +596,6 @@ module.exports = Scale.extend({
me.max = Math.max(min + 1, max);
// PRIVATE
- me._horizontal = me.isHorizontal();
me._table = [];
me._timestamps = {
data: timestamps,
@@ -611,16 +610,16 @@ module.exports = Scale.extend({
var max = me.max;
var options = me.options;
var tim... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | test/specs/core.helpers.tests.js | @@ -26,16 +26,6 @@ describe('Core helper tests', function() {
expect(helpers.sign(-5)).toBe(-1);
});
- it('should do a log10 operation', function() {
- expect(helpers.log10(0)).toBe(-Infinity);
-
- // Check all allowed powers of 10, which should return integer values
- var maxPowerOf10 = Math.floor(helpers.lo... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | test/specs/core.scale.tests.js | @@ -94,7 +94,7 @@ describe('Core.scale', function() {
labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5'],
offsetGridLines: true,
offset: true,
- expected: [-0.5, 102.5, 204.5, 307.5, 409.5]
+ expected: [0.5, 102.5, 204.5, 307.5, 409.5]
}, {
labels: ['tick1'],
offsetGridLines: false, | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | test/specs/helpers.math.tests.js | @@ -1,7 +1,9 @@
'use strict';
+
describe('Chart.helpers.math', function() {
- var factorize = Chart.helpers.math._factorize;
+ var math = Chart.helpers.math;
+ var factorize = math._factorize;
it('should factorize', function() {
expect(factorize(1000)).toEqual([1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 125, 20... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | test/specs/scale.linear.tests.js | @@ -1196,4 +1196,86 @@ describe('Linear Scale', function() {
expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
expect(chart.scales.yScale0.max).toBeGreaterThan(chart.scales.yScale0.min);
});
+
+ it('Should get correct pixel values when horizontal', function() {
+ var chart = window.acquire... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | test/specs/scale.logarithmic.tests.js | @@ -862,6 +862,8 @@ describe('Logarithmic Scale tests', function() {
type: 'logarithmic'
}];
Chart.helpers.extend(scaleConfig, setup.scale);
+ scaleConfig[setup.axis + 'Axes'][0].type = 'logarithmic';
+
var description = 'dataset has stack option and ' + setup.describe
+ ' and axis is "' + setup... | true |
Other | chartjs | Chart.js | cbace1cfe2c1b70ac26d1ee798eb5841fcd978c5.json | Handle reverse support in core.scale (#6343)
* Move log10 from core.helpers to helpers.math
* Refactor scales | test/specs/scale.time.tests.js | @@ -1551,11 +1551,11 @@ describe('Time scale tests', function() {
var firstTickInterval = scale.getPixelForTick(1) - scale.getPixelForTick(0);
var lastTickInterval = scale.getPixelForTick(numTicks - 1) - scale.getPixelForTick(numTicks - 2);
- expect(scale.getValueForPixel(scale.left + firstTickInterval /... | true |
Other | chartjs | Chart.js | 454f519b6ddc2d60dba0ae2257e0252c6555374c.json | Fix jshint warnings | src/Chart.Scale.js | @@ -73,7 +73,7 @@
});
// Adjust the padding to take into account displaying labels
- if (topScales.length == 0 || bottomScales.length == 0) {
+ if (topScales.length === 0 || bottomScales.length === 0) {
var maxFontHeight = 0;
var maxFontHeightFunction = function(scaleInstance) {... | false |
Other | chartjs | Chart.js | d7ad5b6340d1200570b904cce09a1960c8088e55.json | Add a scatter chart sample | samples/scatter.html | @@ -0,0 +1,145 @@
+<!doctype html>
+<html>
+
+<head>
+ <title>Scatter Chart</title>
+ <script src="../Chart.js"></script>
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
+</head>
+
+<body>
+ <div style="width:50%">
+ <div>
+ <canvas id="canvas" he... | false |
Other | chartjs | Chart.js | d26f37236dcd64472b91ed03f90b27e571ef469f.json | Update package.json for color lib location | package.json | @@ -10,7 +10,7 @@
},
"dependences": {},
"devDependencies": {
- "color": "file:../../../../var/folders/rv/vd7mrb5j0hnbrr_2f3q2p6m00000gn/T/npm-53789-2bfe35a6/git-cache-40335d988a8e/54fd04acedef6ccdc54a9929be298945a8093496",
+ "color": "git://github.com/chartjs/color",
"gulp": "3.5.x",
"gulp-conc... | false |
Other | chartjs | Chart.js | 62b29282fd57dd40654e3867350132a245fa4cd5.json | Fix a minor bug | src/Chart.Bar.js | @@ -146,7 +146,7 @@
calculateBarBase: function() {
var base = this.scale.endPoint;
- if (this.scale.beginAtZero || ((this.scale.min < 0 && this.scale.max > 0) || (this.scale.min > 0 && this.scale.max < 0)))
+ if (this.scale.beginAtZero || ((this.scale.min <= 0 && this.scale.max >= 0) || (this.scale.min ... | false |
Other | chartjs | Chart.js | 66f7f96d4b0f8a03b67a45c43f20c1155935f792.json | stop animations when destroying a chart
otherwise the animation keeps updating the chart for some time after it
was supposed to be destroyed, and when the canvas might have been
already reused for a new chart | src/Chart.Core.js | @@ -952,6 +952,7 @@
return template(this.options.legendTemplate,this);
},
destroy : function(){
+ this.stop();
this.clear();
unbindEvents(this, this.events);
var canvas = this.chart.canvas; | false |
Other | chartjs | Chart.js | e69aa04918f0603555ee1b19a82516047a4ac6fc.json | Add StackedArea chart type to community extensions | docs/06-Advanced.md | @@ -159,6 +159,7 @@ new Chart(ctx).LineAlt(data);
### Community extensions
- <a href="https://github.com/Regaddi/Chart.StackedBar.js" target="_blank">Stacked Bar Chart</a> by <a href="https://twitter.com/Regaddi" target="_blank">@Regaddi</a>
+- <a href="https://github.com/tannerlinsley/Chart.StackedArea.js" target=... | false |
Other | chartjs | Chart.js | c476db0dd7269ef47e36162b3f9ab2323f409d2e.json | Use findNextWhere correctly. | src/Chart.Core.js | @@ -2098,7 +2098,7 @@
return animationWrapper.chartInstance === chartInstance;
});
- if (index != -1)
+ if (index)
{
this.animations.splice(index, 1);
} | false |
Other | chartjs | Chart.js | b0bddce017c1e8fa0094e69213a096a98377907d.json | Remove some unused scale code | src/core/core.scale.js | @@ -40,44 +40,6 @@
return scaleInstance.options.position == "bottom";
});
- var visibleLeftScales = helpers.where(chartInstance.scales, function(scaleInstance) {
- return scaleInstance.options.position == "left";
- });
- var visibleRightScales = helpers.where(chartInstance.scales, function(sca... | false |
Other | chartjs | Chart.js | d37e65c58cf4253e33d732c56f8862458de84597.json | Convert line chart to tabs from spaces | src/charts/chart.line.js | @@ -1,547 +1,547 @@
(function() {
- "use strict";
-
- var root = this,
- Chart = root.Chart,
- helpers = Chart.helpers;
-
- var defaultConfig = {
- hover: {
- mode: "label"
- },
-
- scales: {
- xAxes: [{
- type: "category", // scatter sho... | false |
Other | chartjs | Chart.js | 29743e1d63353008d53276cce6db962c636d6c39.json | Use a polyfill when Math.log10 does not exist | src/Chart.Core.js | @@ -329,6 +329,13 @@
return x > 0 ? 1 : -1;
}
},
+ log10 = helpers.log10 = function(x) {
+ if (Math.log10) {
+ return Math.log10(x)
+ } else {
+ return Math.log(x) / Math.LN10;
+ }
+ },
cap = hel... | false |
Other | chartjs | Chart.js | d1cccd354639cfc65b5f82ecd5d58666eda2a0a8.json | Update CDN link | docs/00-Getting-Started.md | @@ -33,7 +33,7 @@ bower install Chart.js --save
Also, Chart.js is available from CDN:
-https://cdnjs.com/libraries/chart.js
+https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js
###Creating a chart
| false |
Other | chartjs | Chart.js | 051f5b015bc9d1fb07cd23ec3bfc78e6e3914360.json | Fix bug with pie/doughnut chart legends
Fixes a rendering issue when there are multiple datasets on a pie chart and they do not all contain the same number of data in their datasets
Fixes #3309 | src/controllers/controller.doughnut.js | @@ -76,7 +76,10 @@ module.exports = function(Chart) {
for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
meta = chart.getDatasetMeta(i);
- meta.data[index].hidden = !meta.data[index].hidden;
+ // toggle visibility of index if exists
+ if (meta.data[index]) {
+ meta.dat... | false |
Other | chartjs | Chart.js | 8bc280e1856c4ab09a8a529347f2ef1e5292807e.json | Allow variable use before define with warning | .eslintrc | @@ -112,7 +112,7 @@ rules:
no-undef: 2
no-undefined: 0
no-unused-vars: 2
- no-use-before-define: 2
+ no-use-before-define: 1
# Node.js and CommonJS
callback-return: 2 | false |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/core/core.helpers.js | @@ -45,7 +45,9 @@ module.exports = function(Chart) {
return objClone;
};
helpers.extend = function(base) {
- var setFn = function(value, key) { base[key] = value; };
+ var setFn = function(value, key) {
+ base[key] = value;
+ };
for (var i = 1, ilen = arguments.length; i < ilen; i++) {
helpers.each(a... | true |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/core/core.layoutService.js | @@ -161,8 +161,8 @@ module.exports = function(Chart) {
// Function to fit a box
function fitBox(box) {
- var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBoxSize) {
- return minBoxSize.box === box;
+ var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {
+ return m... | true |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/core/core.legend.js | @@ -397,12 +397,10 @@ module.exports = function(Chart) {
cursor.line++;
x = cursor.x = me.left + ((legendWidth - lineWidths[cursor.line]) / 2);
}
- } else {
- if (y + itemHeight > me.bottom) {
- x = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;
- y = cursor... | true |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/core/core.scale.js | @@ -406,9 +406,8 @@ module.exports = function(Chart) {
if (typeof(rawValue) === 'object') {
if ((rawValue instanceof Date) || (rawValue.isValid)) {
return rawValue;
- } else {
- return this.getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y);
}
+ return this.getRightValue(this.isH... | true |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/core/core.tooltip.js | @@ -492,12 +492,10 @@ module.exports = function(Chart) {
} else if (xAlign === 'right') {
pt.x -= paddingAndSize;
}
- } else {
- if (xAlign === 'left') {
- pt.x -= radiusAndPadding;
- } else if (xAlign === 'right') {
- pt.x += radiusAndPadding;
- }
+ } else if (xAlign === 'left') {
... | true |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/scales/scale.category.js | @@ -56,9 +56,8 @@ module.exports = function(Chart) {
if ((data.xLabels && isHorizontal) || (data.yLabels && !isHorizontal)) {
return me.getRightValue(data.datasets[datasetIndex].data[index]);
- } else {
- return me.ticks[index];
}
+ return me.ticks[index];
},
// Used to get data value loca... | true |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/scales/scale.linear.js | @@ -54,8 +54,6 @@ module.exports = function(Chart) {
if (opts.stacked) {
var valuesPerType = {};
- var hasPositiveValues = false;
- var hasNegativeValues = false;
helpers.each(datasets, function(dataset, datasetIndex) {
var meta = chart.getDatasetMeta(datasetIndex);
@@ -82,14 +80,10 @@ mod... | true |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/scales/scale.logarithmic.js | @@ -16,9 +16,8 @@ module.exports = function(Chart) {
return '0';
} else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === arr.length - 1) {
return value.toExponential();
- } else {
- return '';
}
+ return '';
}
}
}; | true |
Other | chartjs | Chart.js | bddd4cd94bbb2fa40d36029433069fa7950fd3ef.json | Fix style issues in core and scales | src/scales/scale.radialLinear.js | @@ -195,12 +195,10 @@ module.exports = function(Chart) {
furthestRight = pointPosition.x + textWidth;
furthestRightIndex = i;
}
- } else {
- // More than half the values means we'll right align the text
- if (pointPosition.x - textWidth < furthestLeft) {
- furthestLeft = pointPositio... | true |
Other | chartjs | Chart.js | 11739234a4b218d65a008c1afcb72c8ee42556a9.json | Add keyword spacing to eslint and update code | .eslintrc | @@ -136,13 +136,15 @@ rules:
computed-property-spacing: [2, never]
consistent-this: [2, me]
eol-last: 2
+ func-call-spacing: [2, never]
func-names: [2, never]
func-style: 0
id-length: 0
id-match: 0
indent: [2, tab]
jsx-quotes: 0
key-spacing: 2
+ keyword-spacing: 2
linebreak-style: [2,... | true |
Other | chartjs | Chart.js | 11739234a4b218d65a008c1afcb72c8ee42556a9.json | Add keyword spacing to eslint and update code | src/core/core.controller.js | @@ -415,7 +415,7 @@ module.exports = function(Chart) {
if (me.isDatasetVisible(datasetIndex)) {
var meta = me.getDatasetMeta(datasetIndex),
element = meta.data[found._index];
- if(element && !element._view.skip) {
+ if (element && !element._view.skip) {
elementsArray.push(element);
... | true |
Other | chartjs | Chart.js | 11739234a4b218d65a008c1afcb72c8ee42556a9.json | Add keyword spacing to eslint and update code | src/core/core.legend.js | @@ -151,7 +151,7 @@ module.exports = function(Chart) {
buildLabels: function() {
var me = this;
me.legendItems = me.options.labels.generateLabels.call(me, me.chart);
- if(me.options.reverse) {
+ if (me.options.reverse) {
me.legendItems.reverse();
}
}, | true |
Other | chartjs | Chart.js | 11739234a4b218d65a008c1afcb72c8ee42556a9.json | Add keyword spacing to eslint and update code | src/scales/scale.logarithmic.js | @@ -100,7 +100,7 @@ module.exports = function(Chart) {
me.max = value;
}
- if(value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {
+ if (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {
me.minNotZero = value;
}
});
@@ -144,7 +144,7... | true |
Other | chartjs | Chart.js | f6eb675470485c487c4e8c88f0e4cad265264456.json | Update new eslint rules | .eslintrc | @@ -12,9 +12,8 @@ env:
# http://eslint.org/docs/rules/
rules:
# Possible Errors
- comma-dangle: [2, never]
no-cond-assign: 2
- no-console: 0
+ no-console: 1
no-constant-condition: 2
no-control-regex: 2
no-debugger: 2
@@ -25,7 +24,7 @@ rules:
no-empty-character-class: 2
no-ex-assign: 2
no-ex... | false |
Other | chartjs | Chart.js | 894b9928e77f97dba02181e1f9258a44692dc290.json | Fix broken links in Maintaining.md | MAINTAINING.md | @@ -31,6 +31,6 @@ Finally, [cdnjs](https://cdnjs.com/libraries/Chart.js) is automatically updated
### Further Reading
-* [Travis GitHub releases](/chartjs/Chart.js/pull/2555)
-* [Bower support and dist/* files](/chartjs/Chart.js/issues/3033)
-* [cdnjs npm auto update](/cdnjs/cdnjs/pull/8401)
+* [Travis GitHub rele... | false |
Other | chartjs | Chart.js | 7c93255b16868c4f23249670e998b6c9ce92b9fd.json | Enforce curly braces for single statement block
curly: [error, all] (http://eslint.org/docs/rules/curly) | .eslintrc | @@ -46,7 +46,7 @@ rules:
block-scoped-var: 0
complexity: [2, 6]
consistent-return: 0
- curly: 0
+ curly: [2, all]
default-case: 0
dot-location: 0
dot-notation: 0 | true |
Other | chartjs | Chart.js | 7c93255b16868c4f23249670e998b6c9ce92b9fd.json | Enforce curly braces for single statement block
curly: [error, all] (http://eslint.org/docs/rules/curly) | src/controllers/controller.bar.js | @@ -405,17 +405,19 @@ module.exports = function(Chart) {
// Find first (starting) corner with fallback to 'bottom'
var borders = ['bottom', 'left', 'top', 'right'];
var startCorner = borders.indexOf(vm.borderSkipped, 0);
- if (startCorner === -1)
+ if (startCorner === -1) {
startCorner ... | true |
Other | chartjs | Chart.js | 7c93255b16868c4f23249670e998b6c9ce92b9fd.json | Enforce curly braces for single statement block
curly: [error, all] (http://eslint.org/docs/rules/curly) | src/controllers/controller.line.js | @@ -250,20 +250,23 @@ module.exports = function(Chart) {
var me = this;
var meta = me.getMeta();
var area = me.chart.chartArea;
-
- // Only consider points that are drawn in case the spanGaps option is used
var points = (meta.data || []);
- if (meta.dataset._model.spanGaps) points = points.filter(fu... | true |
Other | chartjs | Chart.js | 7c93255b16868c4f23249670e998b6c9ce92b9fd.json | Enforce curly braces for single statement block
curly: [error, all] (http://eslint.org/docs/rules/curly) | src/core/core.helpers.js | @@ -358,32 +358,48 @@ module.exports = function(Chart) {
var i, pointBefore, pointCurrent, pointAfter;
for (i = 0; i < pointsLen; ++i) {
pointCurrent = pointsWithTangents[i];
- if (pointCurrent.model.skip) continue;
+ if (pointCurrent.model.skip) {
+ continue;
+ }
+
pointBefore = i > 0 ? pointsWi... | true |
Other | chartjs | Chart.js | 7c93255b16868c4f23249670e998b6c9ce92b9fd.json | Enforce curly braces for single statement block
curly: [error, all] (http://eslint.org/docs/rules/curly) | src/core/core.legend.js | @@ -341,11 +341,9 @@ module.exports = function(Chart) {
// Draw pointStyle as legend symbol
Chart.canvasHelpers.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY);
- }
- else {
+ } else {
// Draw box as legend symbol
- if (!isLineWidthZero)
- {
+ if (!isLin... | true |
Other | chartjs | Chart.js | 7c93255b16868c4f23249670e998b6c9ce92b9fd.json | Enforce curly braces for single statement block
curly: [error, all] (http://eslint.org/docs/rules/curly) | src/elements/element.rectangle.js | @@ -48,17 +48,19 @@ module.exports = function(Chart) {
// Find first (starting) corner with fallback to 'bottom'
var borders = ['bottom', 'left', 'top', 'right'];
var startCorner = borders.indexOf(vm.borderSkipped, 0);
- if (startCorner === -1)
+ if (startCorner === -1) {
startCorner = 0;
+ }
... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | .eslintrc | @@ -139,7 +139,7 @@ rules:
func-style: 0
id-length: 0
id-match: 0
- indent: 0
+ indent: [2, tab]
jsx-quotes: 0
key-spacing: 0
linebreak-style: 0 | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/controllers/controller.bar.js | @@ -142,8 +142,8 @@ module.exports = function(Chart) {
var fullBarWidth = categoryWidth / datasetCount;
if (xScale.ticks.length !== me.chart.data.labels.length) {
- var perc = xScale.ticks.length / me.chart.data.labels.length;
- fullBarWidth = fullBarWidth * perc;
+ var perc = xScale.ticks.leng... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/controllers/controller.doughnut.js | @@ -166,8 +166,8 @@ module.exports = function(Chart) {
minSize = Math.min(availableWidth / size.width, availableHeight / size.height);
offset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5};
}
- chart.borderWidth = me.getMaxBorderWidth(meta.data);
+ chart.borderWidth = me.getMaxBor... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/core/core.controller.js | @@ -461,7 +461,7 @@ module.exports = function(Chart) {
}, me);
return elementsArray;
- },
+ },
getElementsAtEventForMode: function(e, mode) {
var me = this;
@@ -472,8 +472,8 @@ module.exports = function(Chart) {
return me.getElementsAtEvent(e);
case 'dataset':
return me.getDatasetAt... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/core/core.datasetController.js | @@ -158,8 +158,7 @@ module.exports = function(Chart) {
model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
}
- });
-
+ });
Chart.DatasetController.extend = helpers.inherits;
};
\ No newline at end of file | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/core/core.element.js | @@ -2,103 +2,103 @@
module.exports = function(Chart) {
- var helpers = Chart.helpers;
-
- Chart.elements = {};
-
- Chart.Element = function(configuration) {
- helpers.extend(this, configuration);
- this.initialize.apply(this, arguments);
- };
-
- helpers.extend(Chart.Element.prototype, {
-
- initiali... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/core/core.legend.js | @@ -346,7 +346,7 @@ module.exports = function(Chart) {
// Draw box as legend symbol
if (!isLineWidthZero)
{
- ctx.strokeRect(x, y, boxWidth, fontSize);
+ ctx.strokeRect(x, y, boxWidth, fontSize);
}
ctx.fillRect(x, y, boxWidth, fontSize);
} | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/core/core.scale.js | @@ -170,12 +170,12 @@ module.exports = function(Chart) {
var me = this;
// Convert ticks to strings
me.ticks = me.ticks.map(function(numericalTick, index, ticks) {
- if (me.options.ticks.userCallback) {
- return me.options.ticks.userCallback(numericalTick, index, ticks);
- }
- return me.opt... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/elements/element.arc.js | @@ -2,92 +2,92 @@
module.exports = function(Chart) {
- var helpers = Chart.helpers,
- globalOpts = Chart.defaults.global;
-
- globalOpts.elements.arc = {
- backgroundColor: globalOpts.defaultColor,
- borderColor: "#fff",
- borderWidth: 2
- };
-
- Chart.elements.Arc = Chart.Element.extend({
- inL... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/scales/scale.category.js | @@ -70,9 +70,9 @@ module.exports = function(Chart) {
var valueWidth = innerWidth / offsetAmt;
var widthOffset = (valueWidth * (index - me.minIndex)) + me.paddingLeft;
- if (me.options.gridLines.offsetGridLines && includeOffset || me.maxIndex === me.minIndex && includeOffset) {
+ if (me.options.gridLine... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/scales/scale.logarithmic.js | @@ -243,7 +243,7 @@ module.exports = function(Chart) {
range = helpers.log10(me.end) - helpers.log10(start);
innerDimension = me.height - (paddingTop + paddingBottom);
pixel = (me.bottom - paddingBottom) - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));
- }
+ }
}... | true |
Other | chartjs | Chart.js | 3d40774c7d835b738227d13dbca365ea50ba7a85.json | Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent) | src/scales/scale.time.js | @@ -78,8 +78,8 @@ module.exports = function(Chart) {
getLabelMoment: function(datasetIndex, index) {
if (datasetIndex === null || index === null) {
return null;
- }
-
+ }
+
if (typeof this.labelMoments[datasetIndex] !== 'undefined') {
return this.labelMoments[datasetIndex][... | true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | .eslintrc | @@ -57,7 +57,6 @@ rules:
no-case-declarations: 2
no-div-regex: 2
no-else-return: 0
- no-empty-label: 2
no-empty-pattern: 2
no-eq-null: 2
no-eval: 2 | true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | README.md | @@ -34,7 +34,7 @@ To build, run `gulp build`.
To test, run `gulp test`.
-To test against code standards, run `gulp jshint`.
+To test against code standards, run `gulp lint`.
More information on building and testing can be found in [gulpfile.js](gulpfile.js).
| true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | docs/10-Notes.md | @@ -34,7 +34,7 @@ New contributions to the library are welcome, but we ask that you please follow
- Use tabs for indentation, not spaces.
- Only change the individual files in `/src`.
-- Check that your code will pass `jshint` code standards, `gulp jshint` will run this for you.
+- Check that your code will pass `e... | true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | gulpfile.js | @@ -1,23 +1,23 @@
-var gulp = require('gulp'),
- concat = require('gulp-concat'),
- file = require('gulp-file'),
- uglify = require('gulp-uglify'),
- util = require('gulp-util'),
- jshint = require('gulp-jshint'),
- size = require('gulp-size'),
- connect = require('gulp-connect'),
- replace = require('gulp-repl... | true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | package.json | @@ -17,10 +17,10 @@
"gulp": "3.9.x",
"gulp-concat": "~2.1.x",
"gulp-connect": "~2.0.5",
+ "gulp-eslint": "^2.0.0",
"gulp-file": "^0.3.0",
"gulp-html-validator": "^0.0.2",
"gulp-insert": "~0.5.0",
- "gulp-jshint": "~1.5.1",
"gulp-karma": "0.0.4",
"gulp-replace": "^0.5.4",
... | true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | src/controllers/controller.line.js | @@ -260,7 +260,7 @@ module.exports = function(Chart) {
return Math.max(Math.min(pt, max), min);
}
- if (meta.dataset._model.cubicInterpolationMode == 'monotone') {
+ if (meta.dataset._model.cubicInterpolationMode === 'monotone') {
helpers.splineCurveMonotone(points);
}
else { | true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | src/core/core.datasetController.js | @@ -7,7 +7,7 @@ module.exports = function(Chart) {
// Base class for all dataset controllers (line, bar, etc)
Chart.DatasetController = function(chart, datasetIndex) {
- this.initialize.call(this, chart, datasetIndex);
+ this.initialize(chart, datasetIndex);
};
helpers.extend(Chart.DatasetController.proto... | true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | src/core/core.helpers.js | @@ -238,7 +238,7 @@ module.exports = function(Chart) {
return function() {
return id++;
};
- })();
+ }());
//-- Math methods
helpers.isNumber = function(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
@@ -366,7 +366,7 @@ module.exports = function(Chart) {
}
if (!pointBefore || pointBefore.mod... | true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | src/scales/scale.time.js | @@ -80,7 +80,7 @@ module.exports = function(Chart) {
return null;
}
- if (typeof this.labelMoments[datasetIndex] != 'undefined') {
+ if (typeof this.labelMoments[datasetIndex] !== 'undefined') {
return this.labelMoments[datasetIndex][index];
}
| true |
Other | chartjs | Chart.js | 69ab0d3e238206fa90b06fcc87054b0a7dc97298.json | Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note t... | test/core.layoutService.tests.js | @@ -230,10 +230,10 @@ describe('Test the layout service', function() {
expect(chart.scales.xScale1.right).toBeCloseToPixel(512);
expect(chart.scales.xScale1.top).toBeCloseToPixel(484);
- expect(chart.scales.xScale2.bottom).toBeCloseToPixel(28);
+ expect(chart.scales.xScale2.bottom).toBeCloseToPixel(60);
ex... | true |
Other | chartjs | Chart.js | 1f67e54d79625575c854e5352bae3d048902bcbc.json | Remove unused npm packages | package.json | @@ -26,12 +26,10 @@
"gulp-size": "~0.4.0",
"gulp-streamify": "^1.0.2",
"gulp-uglify": "~0.2.x",
- "gulp-umd": "~0.2.0",
"gulp-util": "~2.2.x",
"gulp-zip": "~3.2.0",
"jasmine": "^2.3.2",
"jasmine-core": "^2.3.4",
- "jquery": "^2.1.4",
"jshint-stylish": "~2.1.0",
"karma"... | false |
Other | chartjs | Chart.js | 6d5638e4152bd16916309c2e625a489d7a8f5951.json | Describe the release process | MAINTAINING.md | @@ -0,0 +1,36 @@
+# Maintaining
+## Release Process
+Chart.js relies on [Travis CI](https://travis-ci.org/) to automate the library [releases](https://github.com/chartjs/Chart.js/releases).
+
+### Releasing a New Version
+
+1. draft release notes on [GitHub](https://github.com/chartjs/Chart.js/releases/new) for the upc... | false |
Other | chartjs | Chart.js | f12fbbc6ccdd07cb3780ce647723a5994e59ab27.json | Remove encrypted data from .travis.yml
Secure values are now read from environment variables defined in the repository settings: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings | .travis.yml | @@ -43,8 +43,7 @@ deploy:
on:
branch: release
- provider: releases
- api_key:
- secure: E6JiZzA/Qy+UD1so/rVfqYnMhgU4m0cUsljxyrKIiYKlt/ZXo1XJabNkpEIYLvckrNx+g/4cmidNcuLfrnAZJtUg53qHLxyqMTXa9zAqmxxJ6aIpQpNK25FIEk9Xwm2XZdbI5rrm0ZciP5rcgg0X8/j5+RtnU3ZpTOCVkp0P73A=
+ api_key: $GITHUB_AUTH_TOKEN
file:
- "... | false |
Other | chartjs | Chart.js | e8a51d80c809a26c1365070e8570f7a883248831.json | #3033 Deploy dist files and bower.json (tags)
Add a new Travis deploy task to push dist/*.js and bower.json files into tag sources:
- requires Travis GITHUB_AUTH_TOKEN and GITHUB_AUTH_EMAIL environment variables
- skipped if not built from the "release" branch
- release.sh must be executable (see comment)
- reads tag ... | .travis.yml | @@ -33,6 +33,15 @@ addons:
- google-chrome-stable
deploy:
+# Creates a tag containing dist files and bower.json
+# Requires GITHUB_AUTH_TOKEN and GITHUB_AUTH_EMAIL environment variables
+# IMPORTANT: the script has to be set executable in the Git repository (error 127)
+# https://github.com/travis-ci/travis-c... | true |
Other | chartjs | Chart.js | e8a51d80c809a26c1365070e8570f7a883248831.json | #3033 Deploy dist files and bower.json (tags)
Add a new Travis deploy task to push dist/*.js and bower.json files into tag sources:
- requires Travis GITHUB_AUTH_TOKEN and GITHUB_AUTH_EMAIL environment variables
- skipped if not built from the "release" branch
- release.sh must be executable (see comment)
- reads tag ... | scripts/release.sh | @@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -e
+
+if [ "$TRAVIS_BRANCH" != "release" ]; then
+ echo "Skipping release because this is not the 'release' branch"
+ exit 0
+fi
+
+# Travis executes this script from the repository root, so at the same level than package.json
+VERSION=$(node -p -e "require('./package.json').v... | true |
Other | chartjs | Chart.js | 0ebe388611a8d394750aa6dba5634db26e378742.json | Update version for v2.2.2 release | package.json | @@ -2,7 +2,7 @@
"name": "chart.js",
"homepage": "http://www.chartjs.org",
"description": "Simple HTML5 charts using the canvas element.",
- "version": "2.2.1",
+ "version": "2.2.2",
"license": "MIT",
"main": "src/chart.js",
"repository": {
@@ -52,4 +52,4 @@
"chartjs-color": "^2.0.0",
"mome... | false |
Other | chartjs | Chart.js | c283867f73a5caea271304dd42480383ccd515ba.json | Remove smallestLabelSeparation from TimeScale (#3186)
In case of charts with over 4000 points, smallestLabelSeparation
calculation contributes significantly to total cpu usage (about 25% according
to built-in Chrome profiler). Important thing to note is that result
of this calculation is not used at all.
Related... | src/scales/scale.time.js | @@ -255,14 +255,6 @@ module.exports = function(Chart) {
me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
}
- me.smallestLabelSeparation = me.width;
-
- helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
- for (var i = 1; i < me.labelMoments[datasetIndex].len... | false |
Other | chartjs | Chart.js | abfbdd5f312bc3be7add68f356fcaf097ca938f9.json | Remove unneeded trailing commas | src/controllers/controller.bar.js | @@ -500,7 +500,7 @@ module.exports = function(Chart) {
categorySpacing: categorySpacing,
fullBarHeight: fullBarHeight,
barHeight: barHeight,
- barSpacing: barSpacing,
+ barSpacing: barSpacing
};
},
| true |
Other | chartjs | Chart.js | abfbdd5f312bc3be7add68f356fcaf097ca938f9.json | Remove unneeded trailing commas | src/scales/scale.linearbase.js | @@ -120,6 +120,6 @@ module.exports = function(Chart) {
me.zeroLineIndex = me.ticks.indexOf(0);
Chart.Scale.prototype.convertTicksToLabels.call(me);
- },
+ }
});
};
\ No newline at end of file | true |
Other | chartjs | Chart.js | e2dd4483c79956b76fa3a7bddf0e379e48b3877e.json | Add an Ember.js Integration in the Documentation (#4984) | docs/notes/extensions.md | @@ -50,3 +50,6 @@ In addition, many plugins can be found on the [npm registry](https://www.npmjs.c
### Java
- <a href="https://github.com/mdewilde/chart/" target="_blank">Chart.java</a>
+
+### Ember.js
+ - <a href="https://github.com/aomran/ember-cli-chart" target="_blank">ember-cli-chart</a> | false |
Other | chartjs | Chart.js | 6b824d933451243a4fc57d973da6a8ebe6175b8f.json | add check on overwriting canvas height/width (#4874)
* add check on overwriting canvas height/width
* unit test for this | src/core/core.helpers.js | @@ -512,8 +512,10 @@ module.exports = function(Chart) {
// If no style has been set on the canvas, the render size is used as display size,
// making the chart visually bigger, so let's enforce it to the "correct" values.
// See https://github.com/chartjs/Chart.js/issues/3575
- canvas.style.height = height + ... | true |
Other | chartjs | Chart.js | 6b824d933451243a4fc57d973da6a8ebe6175b8f.json | add check on overwriting canvas height/width (#4874)
* add check on overwriting canvas height/width
* unit test for this | test/specs/core.helpers.tests.js | @@ -725,6 +725,23 @@ describe('Core helper tests', function() {
document.body.removeChild(div);
});
+ it ('should leave styled height and width on canvas if explicitly set', function() {
+ var chart = window.acquireChart({}, {
+ canvas: {
+ height: 200,
+ width: 200,
+ style: 'height: 400px; width: 4... | true |
Other | chartjs | Chart.js | e080e782ab44f34d2bcd63ad6255f48bac2292ea.json | Fix bumpy line on smooth data set (#4944)
Linear scale getPixelForValue() method doesn't round the returned value anymore. | src/scales/scale.linear.js | @@ -170,11 +170,10 @@ module.exports = function(Chart) {
if (me.isHorizontal()) {
pixel = me.left + (me.width / range * (rightValue - start));
- return Math.round(pixel);
+ } else {
+ pixel = me.bottom - (me.height / range * (rightValue - start));
}
-
- pixel = me.bottom - (me.height / range * ... | true |
Other | chartjs | Chart.js | e080e782ab44f34d2bcd63ad6255f48bac2292ea.json | Fix bumpy line on smooth data set (#4944)
Linear scale getPixelForValue() method doesn't round the returned value anymore. | test/specs/core.controller.tests.js | @@ -759,8 +759,8 @@ describe('Chart', function() {
// Verify that points are at their initial correct location,
// then we will reset and see that they moved
- expect(meta.data[0]._model.y).toBe(333);
- expect(meta.data[1]._model.y).toBe(183);
+ expect(meta.data[0]._model.y).toBeCloseToPixel(333);
+ e... | true |
Other | chartjs | Chart.js | e080e782ab44f34d2bcd63ad6255f48bac2292ea.json | Fix bumpy line on smooth data set (#4944)
Linear scale getPixelForValue() method doesn't round the returned value anymore. | test/specs/core.tooltip.tests.js | @@ -764,7 +764,7 @@ describe('Core.Tooltip', function() {
it('Should not update if active element has not changed', function() {
var chart = window.acquireChart({
- type: 'bar',
+ type: 'line',
data: {
datasets: [{
label: 'Dataset 1', | true |
Other | chartjs | Chart.js | 939756c26083d5fbd7c8ae2ed7981696566684eb.json | Fix log scale when value is 0 (#4913) | src/scales/scale.logarithmic.js | @@ -177,64 +177,94 @@ module.exports = function(Chart) {
getPixelForTick: function(index) {
return this.getPixelForValue(this.tickValues[index]);
},
+ /**
+ * Returns the value of the first tick.
+ * @param {Number} value - The minimum not zero value.
+ * @return {Number} The first tick value.
+ * @p... | true |
Other | chartjs | Chart.js | 939756c26083d5fbd7c8ae2ed7981696566684eb.json | Fix log scale when value is 0 (#4913) | test/specs/scale.logarithmic.tests.js | @@ -735,47 +735,99 @@ describe('Logarithmic Scale tests', function() {
expect(yScale.getValueForPixel(246)).toBeCloseTo(10, 1e-4);
});
- it('should get the correct pixel value for a point when 0 values are present', function() {
- var chart = window.acquireChart({
- type: 'bar',
- data: {
- datasets: [{
... | true |
Other | chartjs | Chart.js | 95d7d8c20df4377c238224654037e2f4886823a8.json | Add link to chartjs-plugin-waterfall (#4921) | docs/notes/extensions.md | @@ -18,6 +18,7 @@ In addition, many charts can be found on the [npm registry](https://www.npmjs.co
- <a href="https://github.com/chartjs/chartjs-plugin-deferred" target="_blank">chartjs-plugin-deferred</a> - Defers initial chart update until chart scrolls into viewport.
- <a href="https://github.com/compwright/char... | false |
Other | chartjs | Chart.js | ffbdb483105c750c836fde32501f65d9577ddc83.json | Upgrade dependencies (incl. ESLint 4) (#4738) | .codeclimate.yml | @@ -6,7 +6,7 @@ engines:
- javascript
eslint:
enabled: true
- channel: "eslint-3"
+ channel: "eslint-4"
fixme:
enabled: true
ratings: | true |
Other | chartjs | Chart.js | ffbdb483105c750c836fde32501f65d9577ddc83.json | Upgrade dependencies (incl. ESLint 4) (#4738) | .eslintrc | @@ -1,7 +1,3 @@
-ecmaFeatures:
- modules: true
- jsx: true
-
env:
amd: true
browser: true
@@ -72,7 +68,7 @@ rules:
no-lone-blocks: 2
no-loop-func: 2
no-magic-number: 0
- no-multi-spaces: 2
+ no-multi-spaces: [2, {ignoreEOLComments: true}]
no-multi-str: 2
no-native-reassign: 2
no-new-func: 2... | true |
Other | chartjs | Chart.js | ffbdb483105c750c836fde32501f65d9577ddc83.json | Upgrade dependencies (incl. ESLint 4) (#4738) | package.json | @@ -10,30 +10,31 @@
"url": "https://github.com/chartjs/Chart.js.git"
},
"devDependencies": {
- "browserify": "^14.3.0",
- "browserify-istanbul": "^2.0.0",
- "bundle-collapser": "^1.2.1",
+ "browserify": "^14.5.0",
+ "browserify-istanbul": "^3.0.1",
+ "bundle-collapser": "^1.3.0",
"chil... | true |
Other | chartjs | Chart.js | 13e9676625723a4c6d4e8232b2fe3fa02421d38b.json | Reset tooltip when calling Chart.update (#4840) | src/core/core.controller.js | @@ -371,6 +371,14 @@ module.exports = function(Chart) {
me.updateDatasets();
+ // Need to reset tooltip in case it is displayed with elements that are removed
+ // after update.
+ me.tooltip.initialize();
+
+ // Last active contains items that were previously in the tooltip.
+ // When we reset the too... | true |
Other | chartjs | Chart.js | 13e9676625723a4c6d4e8232b2fe3fa02421d38b.json | Reset tooltip when calling Chart.update (#4840) | src/core/core.tooltip.js | @@ -384,6 +384,7 @@ module.exports = function(Chart) {
Chart.Tooltip = Element.extend({
initialize: function() {
this._model = getBaseModel(this._options);
+ this._lastActive = [];
},
// Get the title | true |
Other | chartjs | Chart.js | 13e9676625723a4c6d4e8232b2fe3fa02421d38b.json | Reset tooltip when calling Chart.update (#4840) | test/specs/core.controller.tests.js | @@ -822,6 +822,54 @@ describe('Chart', function() {
expect(chart.tooltip._options).toEqual(jasmine.objectContaining(newTooltipConfig));
});
+ it ('should reset the tooltip on update', function() {
+ var chart = acquireChart({
+ type: 'line',
+ data: {
+ labels: ['A', 'B', 'C', 'D'],
+ datasets... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.