diff --git a/.gitignore b/.gitignore index 6a066b92f38..9fbcff2ef8a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ bower.json *.log *.swp *.stackdump + +chart.js-*.tgz diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index c8fbe87903e..72760b12127 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -16,6 +16,7 @@ * [Options](general/options.md) * [Colors](general/colors.md) * [Fonts](general/fonts.md) + * [Performance](general/performance.md) * [Configuration](configuration/README.md) * [Animations](configuration/animations.md) * [Layout](configuration/layout.md) diff --git a/docs/charts/line.md b/docs/charts/line.md index cca8bb65543..50710180c01 100644 --- a/docs/charts/line.md +++ b/docs/charts/line.md @@ -51,6 +51,7 @@ The line chart allows a number of properties to be specified for each dataset. T | [`borderJoinStyle`](#line-styling) | `string` | Yes | - | `'miter'` | [`borderWidth`](#line-styling) | `number` | Yes | - | `3` | [`cubicInterpolationMode`](#cubicinterpolationmode) | `string` | Yes | - | `'default'` +| [`clip`](#line-styling) | number|object | - | - | `borderWidth / 2` | [`fill`](#line-styling) | boolean|string | Yes | - | `true` | [`hoverBackgroundColor`](#line-styling) | [`Color`](../general/colors.md) | Yes | - | `undefined` | [`hoverBorderCapStyle`](#line-styling) | `string` | Yes | - | `undefined` @@ -117,6 +118,7 @@ The style of the line can be controlled with the following properties: | `borderDashOffset` | Offset for line dashes. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset). | `borderJoinStyle` | Line joint style. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin). | `borderWidth` | The line width (in pixels). +| `clip` | How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. `0` = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}` | `fill` | How to fill the area under the line. See [area charts](area.md). | `lineTension` | Bezier curve tension of the line. Set to 0 to draw straightlines. This option is ignored if monotone cubic interpolation is used. | `showLine` | If false, the line is not drawn for this dataset. @@ -216,75 +218,3 @@ var stackedLine = new Chart(ctx, { } }); ``` - -## High Performance Line Charts - -When charting a lot of data, the chart render time may start to get quite large. In that case, the following strategies can be used to improve performance. - -### Data Decimation - -Decimating your data will achieve the best results. When there is a lot of data to display on the graph, it doesn't make sense to show tens of thousands of data points on a graph that is only a few hundred pixels wide. - -There are many approaches to data decimation and selection of an algorithm will depend on your data and the results you want to achieve. For instance, [min/max](https://digital.ni.com/public.nsf/allkb/F694FFEEA0ACF282862576020075F784) decimation will preserve peaks in your data but could require up to 4 points for each pixel. This type of decimation would work well for a very noisy signal where you need to see data peaks. - -### Disable Bezier Curves - -If you are drawing lines on your chart, disabling bezier curves will improve render times since drawing a straight line is more performant than a bezier curve. - -To disable bezier curves for an entire chart: - -```javascript -new Chart(ctx, { - type: 'line', - data: data, - options: { - elements: { - line: { - tension: 0 // disables bezier curves - } - } - } -}); -``` - -### Disable Line Drawing - -If you have a lot of data points, it can be more performant to disable rendering of the line for a dataset and only draw points. Doing this means that there is less to draw on the canvas which will improve render performance. - -To disable lines: - -```javascript -new Chart(ctx, { - type: 'line', - data: { - datasets: [{ - showLine: false // disable for a single dataset - }] - }, - options: { - showLines: false // disable for all datasets - } -}); -``` - -### Disable Animations - -If your charts have long render times, it is a good idea to disable animations. Doing so will mean that the chart needs to only be rendered once during an update instead of multiple times. This will have the effect of reducing CPU usage and improving general page performance. - -To disable animations - -```javascript -new Chart(ctx, { - type: 'line', - data: data, - options: { - animation: { - duration: 0 // general animation time - }, - hover: { - animationDuration: 0 // duration of animations when hovering an item - }, - responsiveAnimationDuration: 0 // animation duration after a resize - } -}); -``` diff --git a/docs/general/README.md b/docs/general/README.md index 950188ff1d5..fc4821d31f1 100644 --- a/docs/general/README.md +++ b/docs/general/README.md @@ -8,3 +8,4 @@ These sections describe general configuration options that can apply elsewhere i * [Options](./options.md) scriptable and indexable options syntax. * [Colors](./colors.md) defines acceptable color values. * [Font](./fonts.md) defines various font options. +* [Performance](./performance.md) gives tips for performance-sensitive applications. diff --git a/docs/general/performance.md b/docs/general/performance.md index 96e0b5e1ba8..f6e17d0086f 100644 --- a/docs/general/performance.md +++ b/docs/general/performance.md @@ -1,9 +1,84 @@ # Performance -Chart.js charts are rendered on `canvas` elements, which makes rendering quite fast. For large datasets or performance sensitive applications, you may wish to consider the tips below: +Chart.js charts are rendered on `canvas` elements, which makes rendering quite fast. For large datasets or performance sensitive applications, you may wish to consider the tips below. -* Set `animation: { duration: 0 }` to disable [animations](../configuration/animations.md). -* [Specify a rotation value](https://www.chartjs.org/docs/latest/axes/cartesian/#tick-configuration) by setting `minRotation` and `maxRotation` to the same value -* For large datasets: - * You may wish to sample your data before providing it to Chart.js. E.g. if you have a data point for each day, you may find it more performant to pass in a data point for each week instead - * Set the [`ticks.sampleSize`](../axes/cartesian/README.md#tick-configuration) option in order to render axes more quickly +## Tick Calculation + +### Rotation + +[Specify a rotation value](https://www.chartjs.org/docs/latest/axes/cartesian/#tick-configuration) by setting `minRotation` and `maxRotation` to the same value, which avoids the chart from having to automatically determine a value to use. + +### Sampling + +Set the [`ticks.sampleSize`](../axes/cartesian/README.md#tick-configuration) option. This will determine how large your labels are by looking at only a subset of them in order to render axes more quickly. This works best if there is not a large variance in the size of your labels. + +## Disable Animations + +If your charts have long render times, it is a good idea to disable animations. Doing so will mean that the chart needs to only be rendered once during an update instead of multiple times. This will have the effect of reducing CPU usage and improving general page performance. + +To disable animations + +```javascript +new Chart(ctx, { + type: 'line', + data: data, + options: { + animation: { + duration: 0 // general animation time + }, + hover: { + animationDuration: 0 // duration of animations when hovering an item + }, + responsiveAnimationDuration: 0 // animation duration after a resize + } +}); +``` + +## Data Decimation + +Decimating your data will achieve the best results. When there is a lot of data to display on the graph, it doesn't make sense to show tens of thousands of data points on a graph that is only a few hundred pixels wide. + +There are many approaches to data decimation and selection of an algorithm will depend on your data and the results you want to achieve. For instance, [min/max](https://digital.ni.com/public.nsf/allkb/F694FFEEA0ACF282862576020075F784) decimation will preserve peaks in your data but could require up to 4 points for each pixel. This type of decimation would work well for a very noisy signal where you need to see data peaks. + + +## Line Charts + +### Disable Bezier Curves + +If you are drawing lines on your chart, disabling bezier curves will improve render times since drawing a straight line is more performant than a bezier curve. + +To disable bezier curves for an entire chart: + +```javascript +new Chart(ctx, { + type: 'line', + data: data, + options: { + elements: { + line: { + tension: 0 // disables bezier curves + } + } + } +}); +``` + +### Disable Line Drawing + +If you have a lot of data points, it can be more performant to disable rendering of the line for a dataset and only draw points. Doing this means that there is less to draw on the canvas which will improve render performance. + +To disable lines: + +```javascript +new Chart(ctx, { + type: 'line', + data: { + datasets: [{ + showLine: false // disable for a single dataset + }] + }, + options: { + showLines: false // disable for all datasets + } +}); +``` diff --git a/package-lock.json b/package-lock.json index ab114a43f95..b6259567a6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "chart.js", - "version": "2.8.0", + "version": "2.9.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -31,9 +31,9 @@ "dev": true }, "@types/node": { - "version": "12.7.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.3.tgz", - "integrity": "sha512-3SiLAIBkDWDg6vFo0+5YJyHPWU9uwu40Qe+v+0MH8wRKYBimHvvAOyk3EzMrD/TrIlLYfXrqDqrg913PynrMJQ==", + "version": "12.12.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.3.tgz", + "integrity": "sha512-opgSsy+cEF9N8MgaVPnWVtdJ3o4mV2aMHvDq7thkQUFt0EuOHJon4rQpJfhjmNHB+ikl0Cd6WhWIErOyQ+f7tw==", "dev": true }, "@types/resolve": { @@ -68,9 +68,9 @@ "dev": true }, "acorn-jsx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz", - "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", + "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", "dev": true }, "after": { @@ -153,23 +153,6 @@ "dev": true, "requires": { "color-convert": "^1.9.0" - }, - "dependencies": { - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - } } }, "ansi-wrap": { @@ -531,14 +514,6 @@ "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" - }, - "dependencies": { - "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", - "dev": true - } } }, "babel-template": { @@ -751,9 +726,9 @@ "dev": true }, "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", + "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==", "dev": true }, "body-parser": { @@ -974,12 +949,12 @@ "dev": true }, "chartjs-color": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.3.0.tgz", - "integrity": "sha512-hEvVheqczsoHD+fZ+tfPUE+1+RbV6b+eksp2LwAhwRTVXEjCSEavvk+Hg3H6SZfGlPh/UfmWKGIvZbtobOEm3g==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.4.1.tgz", + "integrity": "sha512-haqOg1+Yebys/Ts/9bLo/BqUcONQOdr/hoEr2LLTRl6C5LXctUdHxsCYfvQVg5JIxITrfCNUDr4ntqmQk9+/0w==", "requires": { "chartjs-color-string": "^0.6.0", - "color-convert": "^0.5.3" + "color-convert": "^1.9.3" } }, "chartjs-color-string": { @@ -1202,9 +1177,19 @@ } }, "color-convert": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz", - "integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=" + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + }, + "dependencies": { + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + } + } }, "color-name": { "version": "1.1.4", @@ -1218,9 +1203,9 @@ "dev": true }, "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true }, "combined-stream": { @@ -1381,9 +1366,9 @@ } }, "core-js": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.2.1.tgz", - "integrity": "sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw==", + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz", + "integrity": "sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA==", "dev": true }, "core-util-is": { @@ -1393,9 +1378,9 @@ "dev": true }, "coveralls": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.6.tgz", - "integrity": "sha512-Pgh4v3gCI4T/9VijVrm8Ym5v0OgjvGLKj3zTUwkvsCiwqae/p6VLzpsFNjQS2i6ewV7ef+DjFJ5TSKxYt/mCrA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.7.tgz", + "integrity": "sha512-mUuH2MFOYB2oBaA4D4Ykqi9LaEYpMMlsiOMJOrv358yAjP6enPIk55fod2fNJ8AvwoYXStWQls37rA+s5e7boA==", "dev": true, "requires": { "growl": "~> 1.10.0", @@ -1773,9 +1758,9 @@ "dev": true }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "requires": { "once": "^1.4.0" @@ -1889,14 +1874,14 @@ } }, "es5-ext": { - "version": "0.10.51", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz", - "integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==", + "version": "0.10.52", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.52.tgz", + "integrity": "sha512-bWCbE9fbpYQY4CU6hJbJ1vSz70EClMlDgJ7BmwI+zEJhxrwjesZRPglGJlsZhu0334U3hI+gaspwksH9IGD6ag==", "dev": true, "requires": { "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" + "es6-symbol": "~3.1.2", + "next-tick": "~1.0.0" } }, "es6-iterator": { @@ -1911,13 +1896,13 @@ } }, "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "dev": true, "requires": { - "d": "1", - "es5-ext": "~0.10.14" + "d": "^1.0.1", + "ext": "^1.1.2" } }, "es6-weak-map": { @@ -2051,12 +2036,12 @@ } }, "eslint-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz", - "integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.0.0" + "eslint-visitor-keys": "^1.1.0" } }, "eslint-visitor-keys": { @@ -2119,9 +2104,9 @@ "dev": true }, "eventemitter3": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", - "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", + "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==", "dev": true }, "execa": { @@ -2219,6 +2204,23 @@ "homedir-polyfill": "^1.0.1" } }, + "ext": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.1.2.tgz", + "integrity": "sha512-/KLjJdTNyDepCihrk4HQt57nAE1IRCEo5jUt+WgWGCr1oARhibDvmI2DMcSNWood1T9AUWwq+jaV1wvRqaXfnA==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "dev": true + } + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -2532,9 +2534,9 @@ } }, "follow-redirects": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.8.1.tgz", - "integrity": "sha512-micCIbldHioIegeKs41DoH0KS3AXfFzgS30qVkM6z/XOE/GJgvmsoc839NUqa1B9udYe9dQxgv7KFwng6+p/dw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.9.0.tgz", + "integrity": "sha512-CRcPzsSIbXyVDl0QI01muNDu69S8trU4jArW9LpOt2WtC6LyUJetcIrmfHsRBx7/Jb6GHJUiuqyYxPooFfNt6A==", "dev": true, "requires": { "debug": "^3.0.0" @@ -3264,9 +3266,9 @@ } }, "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", + "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -3402,9 +3404,9 @@ } }, "graceful-fs": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", - "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true }, "growl": { @@ -3837,9 +3839,9 @@ } }, "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.1.tgz", + "integrity": "sha512-C29UoFzHe9yM61lOsIlCE5/mQVGrnIOrOq7maQl76L7tYPCgC1og0Ajt6uWnX4ZTxBPnjw+CUvawphwCfJgUnA==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -3958,9 +3960,9 @@ } }, "hosted-git-info": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.4.tgz", - "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==", + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", "dev": true }, "htmllint": { @@ -4011,12 +4013,12 @@ } }, "http-proxy": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", - "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", + "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", "dev": true, "requires": { - "eventemitter3": "^3.0.0", + "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", "requires-port": "^1.0.0" } @@ -4333,9 +4335,9 @@ "dev": true }, "is-reference": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.3.tgz", - "integrity": "sha512-W1iHHv/oyBb2pPxkBxtaewxa1BC58Pn5J0hogyCdefwUIvb6R+TGbAcIa4qPNYLqLhb3EnOgUf2MQkkF76BcKw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", + "integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==", "dev": true, "requires": { "@types/estree": "0.0.39" @@ -4390,9 +4392,9 @@ "dev": true }, "is-wsl": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.1.0.tgz", - "integrity": "sha512-pFTjpv/x5HRj8kbZ/Msxi9VrvtOMRBqaDi3OIcbwPI3OuH+r3lLxVWukLITBaOGJIbA/w2+M1eVmVa4XNQlAmQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.1.1.tgz", + "integrity": "sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog==", "dev": true }, "isarray": { @@ -4531,19 +4533,19 @@ } }, "jasmine": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.4.0.tgz", - "integrity": "sha512-sR9b4n+fnBFDEd7VS2el2DeHgKcPiMVn44rtKFumq9q7P/t8WrxsVIZPob4UDdgcDNCwyDqwxCt4k9TDRmjPoQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz", + "integrity": "sha512-DYypSryORqzsGoMazemIHUfMkXM7I7easFaxAvNM3Mr6Xz3Fy36TupTrAOxZWN8MVKEU5xECv22J4tUQf3uBzQ==", "dev": true, "requires": { - "glob": "^7.1.3", - "jasmine-core": "~3.4.0" + "glob": "^7.1.4", + "jasmine-core": "~3.5.0" } }, "jasmine-core": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.4.0.tgz", - "integrity": "sha512-HU/YxV4i6GcmiH4duATwAbJQMlE0MsDIR5XmSVxURxKHn3aGAdbY1/ZJFmVRbKtnLwIxxMJD7gYaPsypcbYimg==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.5.0.tgz", + "integrity": "sha512-nCeAiw37MIMA9w9IXso7bRaLl+c/ef3wnxsoSAlYrzS+Ot0zTG6nU8G/cIfGkqpkjX2wNaIW9RFG0TwIFnG6bA==", "dev": true }, "jest-worker": { @@ -4653,9 +4655,9 @@ "dev": true }, "karma": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/karma/-/karma-4.3.0.tgz", - "integrity": "sha512-NSPViHOt+RW38oJklvYxQC4BSQsv737oQlr/r06pCM+slDOr4myuI1ivkRmp+3dVpJDfZt2DmaPJ2wkx+ZZuMQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-4.4.1.tgz", + "integrity": "sha512-L5SIaXEYqzrh6b1wqYC42tNsFMx2PWuxky84pK9coK09MvmL7mxii3G3bZBh/0rvD27lqDd0le9jyhzvwif73A==", "dev": true, "requires": { "bluebird": "^3.3.0", @@ -4664,7 +4666,6 @@ "chokidar": "^3.0.0", "colors": "^1.1.0", "connect": "^3.6.0", - "core-js": "^3.1.3", "di": "^0.0.1", "dom-serialize": "^2.2.0", "flatted": "^2.0.0", @@ -4688,9 +4689,9 @@ }, "dependencies": { "anymatch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.0.tgz", - "integrity": "sha512-Ozz7l4ixzI7Oxj2+cw+p0tVUt27BpaJ+1+q1TCeANWxHpvyn2+Un+YamBdfKu0uh8xLodGhoa1v7595NhKDAuA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -4713,19 +4714,19 @@ } }, "chokidar": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.0.2.tgz", - "integrity": "sha512-c4PR2egjNjI1um6bamCQ6bUNPDiyofNQruHvKgHQ4gDUP/ITSVSzNsiI5OWtHOsX323i5ha/kk4YmOZ1Ktg7KA==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.2.3.tgz", + "integrity": "sha512-GtrxGuRf6bzHQmXWRepvsGnXpkQkVU+D2/9a7dAe4a7v1NhrfZOZ2oKf76M3nOs46fFYL8D+Q8JYA4GYeJ8Cjw==", "dev": true, "requires": { - "anymatch": "^3.0.1", - "braces": "^3.0.2", - "fsevents": "^2.0.6", - "glob-parent": "^5.0.0", - "is-binary-path": "^2.1.0", - "is-glob": "^4.0.1", - "normalize-path": "^3.0.0", - "readdirp": "^3.1.1" + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" } }, "fill-range": { @@ -4738,16 +4739,16 @@ } }, "fsevents": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz", - "integrity": "sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.1.tgz", + "integrity": "sha512-4FRPXWETxtigtJW/gxzEDsX1LVbPAM93VleB83kZB+ellqbHMkyt2aJfuzNLRvFPnGi6bcE5SvfxgbXPeKteJw==", "dev": true, "optional": true }, "glob-parent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", - "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -4775,9 +4776,9 @@ "dev": true }, "readdirp": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.2.tgz", - "integrity": "sha512-8rhl0xs2cxfVsqzreYCvs8EwBfn/DhVdqtoLmw19uI3SC5avYX9teCurlErfpPXGmYtMHReGaP2RsLnFvz/lnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", "dev": true, "requires": { "picomatch": "^2.0.4" @@ -4860,9 +4861,9 @@ }, "dependencies": { "anymatch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.0.tgz", - "integrity": "sha512-Ozz7l4ixzI7Oxj2+cw+p0tVUt27BpaJ+1+q1TCeANWxHpvyn2+Un+YamBdfKu0uh8xLodGhoa1v7595NhKDAuA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -4885,19 +4886,19 @@ } }, "chokidar": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.0.2.tgz", - "integrity": "sha512-c4PR2egjNjI1um6bamCQ6bUNPDiyofNQruHvKgHQ4gDUP/ITSVSzNsiI5OWtHOsX323i5ha/kk4YmOZ1Ktg7KA==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.2.3.tgz", + "integrity": "sha512-GtrxGuRf6bzHQmXWRepvsGnXpkQkVU+D2/9a7dAe4a7v1NhrfZOZ2oKf76M3nOs46fFYL8D+Q8JYA4GYeJ8Cjw==", "dev": true, "requires": { - "anymatch": "^3.0.1", - "braces": "^3.0.2", - "fsevents": "^2.0.6", - "glob-parent": "^5.0.0", - "is-binary-path": "^2.1.0", - "is-glob": "^4.0.1", - "normalize-path": "^3.0.0", - "readdirp": "^3.1.1" + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" } }, "fill-range": { @@ -4910,16 +4911,16 @@ } }, "fsevents": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz", - "integrity": "sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.1.tgz", + "integrity": "sha512-4FRPXWETxtigtJW/gxzEDsX1LVbPAM93VleB83kZB+ellqbHMkyt2aJfuzNLRvFPnGi6bcE5SvfxgbXPeKteJw==", "dev": true, "optional": true }, "glob-parent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", - "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -4947,9 +4948,9 @@ "dev": true }, "readdirp": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.2.tgz", - "integrity": "sha512-8rhl0xs2cxfVsqzreYCvs8EwBfn/DhVdqtoLmw19uI3SC5avYX9teCurlErfpPXGmYtMHReGaP2RsLnFvz/lnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", "dev": true, "requires": { "picomatch": "^2.0.4" @@ -5159,9 +5160,9 @@ } }, "magic-string": { - "version": "0.25.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.3.tgz", - "integrity": "sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA==", + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.4.tgz", + "integrity": "sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw==", "dev": true, "requires": { "sourcemap-codec": "^1.4.4" @@ -10571,9 +10572,9 @@ "dev": true }, "picomatch": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", - "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.1.0.tgz", + "integrity": "sha512-uhnEDzAbrcJ8R3g2fANnSuXZMBtkpSjxTTgn2LeSiQlfmq72enQJWdQllXW24MBLYnA1SBD2vfvx2o0Zw3Ielw==", "dev": true }, "pify": { @@ -10718,9 +10719,9 @@ "dev": true }, "psl": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", - "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", + "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==", "dev": true }, "pump": { @@ -11128,20 +11129,20 @@ } }, "rollup": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.20.3.tgz", - "integrity": "sha512-/OMCkY0c6E8tleeVm4vQVDz24CkVgvueK3r8zTYu2AQNpjrcaPwO9hE+pWj5LTFrvvkaxt4MYIp2zha4y0lRvg==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.26.0.tgz", + "integrity": "sha512-5HljNYn9icFvXX+Oe97qY5TWvnWhKqgGT0HGeWWqFPx7w7+Anzg7dfHMtUif7YYy6QxAgynDSwK6uxbgcrVUxw==", "dev": true, "requires": { - "@types/estree": "0.0.39", - "@types/node": "^12.7.2", - "acorn": "^7.0.0" + "@types/estree": "*", + "@types/node": "*", + "acorn": "^7.1.0" }, "dependencies": { "acorn": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz", - "integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", "dev": true } } @@ -11183,9 +11184,9 @@ } }, "rollup-plugin-terser": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.1.1.tgz", - "integrity": "sha512-McIMCDEY8EU6Y839C09UopeRR56wXHGdvKKjlfiZG/GrP6wvZQ62u2ko/Xh1MNH2M9WDL+obAAHySljIZYCuPQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.1.2.tgz", + "integrity": "sha512-sWKBCOS+vUkRtHtEiJPAf+WnBqk/C402fBD9AVHxSIXMqjsY7MnYWKYEUqGixtr0c8+1DjzUEPlNgOYQPVrS1g==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -11196,9 +11197,9 @@ } }, "rollup-pluginutils": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz", - "integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==", + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", "dev": true, "requires": { "estree-walker": "^0.6.1" @@ -11214,9 +11215,9 @@ } }, "rxjs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", - "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", + "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -11259,9 +11260,9 @@ } }, "serialize-javascript": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.0.tgz", - "integrity": "sha512-UkGlcYMtw4d9w7YfCtJFgdRTps8N4L0A48R+SmcGL57ki1+yHwJXnalk5bjgrw+ljv6SfzjzPjhohod2qllg/Q==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", + "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", "dev": true }, "set-blocking": { @@ -11601,9 +11602,9 @@ } }, "source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -11905,9 +11906,9 @@ } }, "terser": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.2.1.tgz", - "integrity": "sha512-cGbc5utAcX4a9+2GGVX4DsenG6v0x3glnDi5hx8816X1McEAwPlPgRtXPJzSBsbpILxZ8MQMT0KvArLuE0HP5A==", + "version": "4.3.9", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.3.9.tgz", + "integrity": "sha512-NFGMpHjlzmyOtPL+fDw3G7+6Ueh/sz4mkaUYa4lJCxOPTNzd0Uj0aZJOmsDYoSQyfuVoWDMSWTPU3huyOm2zdA==", "dev": true, "requires": { "commander": "^2.20.0", @@ -11916,9 +11917,9 @@ }, "dependencies": { "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true } } @@ -12139,9 +12140,9 @@ "dev": true }, "type": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz", - "integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", "dev": true }, "type-check": { @@ -12170,20 +12171,20 @@ "dev": true }, "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.5.tgz", + "integrity": "sha512-7L3W+Npia1OCr5Blp4/Vw83tK1mu5gnoIURtT1fUVfQ3Kf8WStWV6NJz0fdoBJZls0KlweruRTLVe6XLafmy5g==", "dev": true, "optional": true, "requires": { - "commander": "~2.20.0", + "commander": "~2.20.3", "source-map": "~0.6.1" }, "dependencies": { "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "optional": true } @@ -12299,9 +12300,9 @@ } }, "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, "uri-js": { diff --git a/package.json b/package.json index 1550d567a37..afb129b7dcd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "chart.js", "homepage": "https://www.chartjs.org", "description": "Simple HTML5 charts using the canvas element.", - "version": "2.9.0", + "version": "2.9.3", "license": "MIT", "jsdelivr": "dist/Chart.min.js", "unpkg": "dist/Chart.min.js", diff --git a/src/controllers/controller.horizontalBar.js b/src/controllers/controller.horizontalBar.js index ebfc6d84ae1..7b11bcc6627 100644 --- a/src/controllers/controller.horizontalBar.js +++ b/src/controllers/controller.horizontalBar.js @@ -18,8 +18,6 @@ defaults._set('horizontalBar', { yAxes: [{ type: 'category', position: 'left', - categoryPercentage: 0.8, - barPercentage: 0.9, offset: true, gridLines: { offsetGridLines: true @@ -39,6 +37,15 @@ defaults._set('horizontalBar', { } }); +defaults._set('global', { + datasets: { + horizontalBar: { + categoryPercentage: 0.8, + barPercentage: 0.9 + } + } +}); + module.exports = BarController.extend({ /** * @private @@ -54,4 +61,3 @@ module.exports = BarController.extend({ return this.getMeta().yAxisID; } }); - diff --git a/src/controllers/controller.line.js b/src/controllers/controller.line.js index dc1fc689b24..4f452d66d0a 100644 --- a/src/controllers/controller.line.js +++ b/src/controllers/controller.line.js @@ -29,6 +29,51 @@ defaults._set('line', { } }); +function scaleClip(scale, halfBorderWidth) { + var tickOpts = scale && scale.options.ticks || {}; + var reverse = tickOpts.reverse; + var min = tickOpts.min === undefined ? halfBorderWidth : 0; + var max = tickOpts.max === undefined ? halfBorderWidth : 0; + return { + start: reverse ? max : min, + end: reverse ? min : max + }; +} + +function defaultClip(xScale, yScale, borderWidth) { + var halfBorderWidth = borderWidth / 2; + var x = scaleClip(xScale, halfBorderWidth); + var y = scaleClip(yScale, halfBorderWidth); + + return { + top: y.end, + right: x.end, + bottom: y.start, + left: x.start + }; +} + +function toClip(value) { + var t, r, b, l; + + if (helpers.isObject(value)) { + t = value.top; + r = value.right; + b = value.bottom; + l = value.left; + } else { + t = r = b = l = value; + } + + return { + top: t, + right: r, + bottom: b, + left: l + }; +} + + module.exports = DatasetController.extend({ datasetElementType: elements.Line, @@ -173,6 +218,7 @@ module.exports = DatasetController.extend({ values.spanGaps = valueOrDefault(config.spanGaps, options.spanGaps); values.tension = valueOrDefault(config.lineTension, lineOptions.tension); values.steppedLine = resolve([custom.steppedLine, config.steppedLine, lineOptions.stepped]); + values.clip = toClip(valueOrDefault(config.clip, defaultClip(me._xScale, me._yScale, values.borderWidth))); return values; }, @@ -183,12 +229,13 @@ module.exports = DatasetController.extend({ var yScale = me._yScale; var sumPos = 0; var sumNeg = 0; - var rightValue = +yScale.getRightValue(value); - var metasets = chart._getSortedVisibleDatasetMetas(); - var ilen = metasets.length; - var i, ds, dsMeta, stackedRightValue; + var i, ds, dsMeta, stackedRightValue, rightValue, metasets, ilen; if (yScale.options.stacked) { + rightValue = +yScale.getRightValue(value); + metasets = chart._getSortedVisibleDatasetMetas(); + ilen = metasets.length; + for (i = 0; i < ilen; ++i) { dsMeta = metasets[i]; if (dsMeta.index === datasetIndex) { @@ -209,8 +256,9 @@ module.exports = DatasetController.extend({ if (rightValue < 0) { return yScale.getPixelForValue(sumNeg + rightValue); } + return yScale.getPixelForValue(sumPos + rightValue); } - return yScale.getPixelForValue(sumPos + rightValue); + return yScale.getPixelForValue(value); }, updateBezierControlPoints: function() { @@ -274,18 +322,19 @@ module.exports = DatasetController.extend({ var meta = me.getMeta(); var points = meta.data || []; var area = chart.chartArea; + var canvas = chart.canvas; var i = 0; var ilen = points.length; - var halfBorderWidth; + var clip; if (me._showLine) { - halfBorderWidth = (meta.dataset._model.borderWidth || 0) / 2; + clip = meta.dataset._model.clip; helpers.canvas.clipArea(chart.ctx, { - left: area.left - halfBorderWidth, - right: area.right + halfBorderWidth, - top: area.top - halfBorderWidth, - bottom: area.bottom + halfBorderWidth + left: clip.left === false ? 0 : area.left - clip.left, + right: clip.right === false ? canvas.width : area.right + clip.right, + top: clip.top === false ? 0 : area.top - clip.top, + bottom: clip.bottom === false ? canvas.height : area.bottom + clip.bottom }); meta.dataset.draw(); diff --git a/src/controllers/controller.radar.js b/src/controllers/controller.radar.js index 803c7fb7f62..dffe29e1507 100644 --- a/src/controllers/controller.radar.js +++ b/src/controllers/controller.radar.js @@ -14,6 +14,7 @@ defaults._set('radar', { }, elements: { line: { + fill: 'start', tension: 0 // no bezier in radar } } diff --git a/src/core/core.datasetController.js b/src/core/core.datasetController.js index 2d8972e6e2f..d17c7be0029 100644 --- a/src/core/core.datasetController.js +++ b/src/core/core.datasetController.js @@ -347,7 +347,7 @@ helpers.extend(DatasetController.prototype, { } if (style.fill === false || style.fill === null) { - style.backgroundColor = 'rgba(0,0,0,0)'; + style.backgroundColor = style.borderColor; } return style; diff --git a/src/core/core.helpers.js b/src/core/core.helpers.js index 33c94799e15..20d4cfaba48 100644 --- a/src/core/core.helpers.js +++ b/src/core/core.helpers.js @@ -454,7 +454,7 @@ module.exports = function() { * @private */ helpers._calculatePadding = function(container, padding, parentDimension) { - padding = helpers.getStyle(container, padding); + padding = helpers.getStyle(container, padding) || '0'; return padding.indexOf('%') > -1 ? parentDimension * parseInt(padding, 10) / 100 : parseInt(padding, 10); }; diff --git a/src/core/core.scale.js b/src/core/core.scale.js index f292bd2c2e5..0c1413d4a03 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -356,7 +356,7 @@ var Scale = Element.extend({ */ _getLabels: function() { var data = this.chart.data; - return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels; + return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || []; }, // These methods are ordered by lifecyle. Utilities then follow. @@ -929,7 +929,7 @@ var Scale = Element.extend({ getDecimalForPixel: function(pixel) { var decimal = (pixel - this._startPixel) / this._length; - return Math.min(1, Math.max(0, this._reversePixels ? 1 - decimal : decimal)); + return this._reversePixels ? 1 - decimal : decimal; }, /** diff --git a/src/platforms/platform.dom.js b/src/platforms/platform.dom.js index 03f8486be43..457cc7c90f8 100644 --- a/src/platforms/platform.dom.js +++ b/src/platforms/platform.dom.js @@ -339,7 +339,7 @@ module.exports = { // If the canvas is in a shadow DOM, then the styles must also be inserted // into the same shadow DOM. // https://github.com/chartjs/Chart.js/issues/5763 - var root = canvas.getRootNode(); + var root = canvas.getRootNode ? canvas.getRootNode() : document; var targetNode = root.host ? root : document.head; injectCSS(targetNode, stylesheet); } diff --git a/src/plugins/plugin.legend.js b/src/plugins/plugin.legend.js index c358ff6804c..e790e9ba43e 100644 --- a/src/plugins/plugin.legend.js +++ b/src/plugins/plugin.legend.js @@ -53,13 +53,13 @@ defaults._set('global', { var options = chart.options.legend || {}; var usePointStyle = options.labels && options.labels.usePointStyle; - return chart._getSortedDatasetMetas().map(function(meta, i) { + return chart._getSortedDatasetMetas().map(function(meta) { var style = meta.controller.getStyle(usePointStyle ? 0 : undefined); return { text: datasets[meta.index].label, fillStyle: style.backgroundColor, - hidden: !chart.isDatasetVisible(i), + hidden: !chart.isDatasetVisible(meta.index), lineCap: style.borderCapStyle, lineDash: style.borderDash, lineDashOffset: style.borderDashOffset, @@ -70,7 +70,7 @@ defaults._set('global', { rotation: style.rotation, // Below is extra data used for toggling the datasets - datasetIndex: i + datasetIndex: meta.index }; }, this); } diff --git a/test/fixtures/controller.bar/bar-thickness-absolute.json b/test/fixtures/controller.bar/bar-thickness-absolute.json index 58b6e113244..4c5ed53391d 100644 --- a/test/fixtures/controller.bar/bar-thickness-absolute.json +++ b/test/fixtures/controller.bar/bar-thickness-absolute.json @@ -5,6 +5,9 @@ "labels": ["2017", "2018", "2019", "2024", "2025"], "datasets": [{ "backgroundColor": "rgba(255, 99, 132, 0.5)", + "barPercentage": 1, + "categoryPercentage": 1, + "barThickness": 128, "data": [1, null, 3, 4, 5] }] }, @@ -17,9 +20,6 @@ "type": "time", "offset": true, "display": false, - "barPercentage": 1, - "categoryPercentage": 1, - "barThickness": 128, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-flex-offset.json b/test/fixtures/controller.bar/bar-thickness-flex-offset.json index 6b0829dd561..6672516e472 100644 --- a/test/fixtures/controller.bar/bar-thickness-flex-offset.json +++ b/test/fixtures/controller.bar/bar-thickness-flex-offset.json @@ -5,6 +5,9 @@ "labels": ["2017", "2018", "2020", "2024", "2038"], "datasets": [{ "backgroundColor": "#FF6384", + "barPercentage": 1, + "categoryPercentage": 1, + "barThickness": "flex", "data": [1, null, 3, 4, 5] }] }, @@ -17,9 +20,6 @@ "type": "time", "offset": true, "display": false, - "barPercentage": 1, - "categoryPercentage": 1, - "barThickness": "flex", "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-flex-single-reverse.json b/test/fixtures/controller.bar/bar-thickness-flex-single-reverse.json index 6f63ca93468..e6d12373666 100644 --- a/test/fixtures/controller.bar/bar-thickness-flex-single-reverse.json +++ b/test/fixtures/controller.bar/bar-thickness-flex-single-reverse.json @@ -5,6 +5,9 @@ "labels": ["2016", "2018", "2020", "2024", "2030"], "datasets": [{ "backgroundColor": "#FF6384", + "barThickness": "flex", + "barPercentage": 1, + "categoryPercentage": 1, "data": [1] }] }, @@ -16,9 +19,6 @@ "xAxes": [{ "type": "time", "display": false, - "barThickness": "flex", - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-flex-single.json b/test/fixtures/controller.bar/bar-thickness-flex-single.json index f523f4f5fc6..a59b2aff802 100644 --- a/test/fixtures/controller.bar/bar-thickness-flex-single.json +++ b/test/fixtures/controller.bar/bar-thickness-flex-single.json @@ -5,6 +5,9 @@ "labels": ["2016", "2018", "2020", "2024", "2030"], "datasets": [{ "backgroundColor": "#FF6384", + "barThickness": "flex", + "barPercentage": 1, + "categoryPercentage": 1, "data": [1] }] }, @@ -16,9 +19,6 @@ "xAxes": [{ "type": "time", "display": false, - "barThickness": "flex", - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-flex.json b/test/fixtures/controller.bar/bar-thickness-flex.json index c800a0af067..b9048faed0a 100644 --- a/test/fixtures/controller.bar/bar-thickness-flex.json +++ b/test/fixtures/controller.bar/bar-thickness-flex.json @@ -5,6 +5,9 @@ "labels": ["2017", "2018", "2020", "2024", "2038"], "datasets": [{ "backgroundColor": "#FF6384", + "barPercentage": 1, + "categoryPercentage": 1, + "barThickness": "flex", "data": [1, null, 3, 4, 5] }] }, @@ -16,9 +19,6 @@ "xAxes": [{ "type": "time", "display": false, - "barPercentage": 1, - "categoryPercentage": 1, - "barThickness": "flex", "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-max.json b/test/fixtures/controller.bar/bar-thickness-max.json index 3430b8c9390..2ca185516bc 100644 --- a/test/fixtures/controller.bar/bar-thickness-max.json +++ b/test/fixtures/controller.bar/bar-thickness-max.json @@ -5,6 +5,9 @@ "labels": ["2016", "2018", "2020", "2024", "2030"], "datasets": [{ "backgroundColor": "#FF6384", + "barPercentage": 1, + "categoryPercentage": 1, + "maxBarThickness": 8, "data": [1, null, 3, 4, 5] }] }, @@ -16,9 +19,6 @@ "xAxes": [{ "type": "time", "display": false, - "barPercentage": 1, - "categoryPercentage": 1, - "maxBarThickness": 8, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-min-interval.json b/test/fixtures/controller.bar/bar-thickness-min-interval.json index 41fd8676a45..954e15cfdf6 100644 --- a/test/fixtures/controller.bar/bar-thickness-min-interval.json +++ b/test/fixtures/controller.bar/bar-thickness-min-interval.json @@ -5,6 +5,8 @@ "labels": ["2016", "2018", "2020", "2024", "2030"], "datasets": [{ "backgroundColor": "#FF6384", + "barPercentage": 1, + "categoryPercentage": 1, "data": [1, null, 3, 4, 5] }] }, @@ -16,8 +18,6 @@ "xAxes": [{ "type": "time", "display": false, - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-multiple.json b/test/fixtures/controller.bar/bar-thickness-multiple.json index 3dcddaff0e7..f26a395fb4d 100644 --- a/test/fixtures/controller.bar/bar-thickness-multiple.json +++ b/test/fixtures/controller.bar/bar-thickness-multiple.json @@ -18,12 +18,16 @@ "responsive": false, "legend": false, "title": false, + "datasets": { + "bar": { + "barPercentage": 1, + "categoryPercentage": 1 + } + }, "scales": { "xAxes": [{ "type": "time", "display": false, - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-no-overlap.json b/test/fixtures/controller.bar/bar-thickness-no-overlap.json index 9b06e512718..2bfee4436c6 100644 --- a/test/fixtures/controller.bar/bar-thickness-no-overlap.json +++ b/test/fixtures/controller.bar/bar-thickness-no-overlap.json @@ -18,12 +18,16 @@ "responsive": false, "legend": false, "title": false, + "datasets": { + "bar": { + "barPercentage": 1, + "categoryPercentage": 1 + } + }, "scales": { "xAxes": [{ "type": "time", "display": false, - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY-MM" }, diff --git a/test/fixtures/controller.bar/bar-thickness-offset.json b/test/fixtures/controller.bar/bar-thickness-offset.json index 78ff4e2dd9c..8785569570b 100644 --- a/test/fixtures/controller.bar/bar-thickness-offset.json +++ b/test/fixtures/controller.bar/bar-thickness-offset.json @@ -18,13 +18,17 @@ "responsive": false, "legend": false, "title": false, + "datasets": { + "bar": { + "barPercentage": 1, + "categoryPercentage": 1 + } + }, "scales": { "xAxes": [{ "type": "time", "offset": true, "display": false, - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-reverse.json b/test/fixtures/controller.bar/bar-thickness-reverse.json index 5e868370f75..215858dd8b7 100644 --- a/test/fixtures/controller.bar/bar-thickness-reverse.json +++ b/test/fixtures/controller.bar/bar-thickness-reverse.json @@ -18,12 +18,16 @@ "responsive": false, "legend": false, "title": false, + "datasets": { + "bar": { + "barPercentage": 1, + "categoryPercentage": 1 + } + }, "scales": { "xAxes": [{ "type": "time", "display": false, - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-single-xy.json b/test/fixtures/controller.bar/bar-thickness-single-xy.json index 20446e80887..68a99a90853 100644 --- a/test/fixtures/controller.bar/bar-thickness-single-xy.json +++ b/test/fixtures/controller.bar/bar-thickness-single-xy.json @@ -4,6 +4,8 @@ "data": { "labels": ["2016", "2018", "2020", "2024", "2030"], "datasets": [{ + "barPercentage": 1, + "categoryPercentage": 1, "backgroundColor": "#FF6384", "data": [{"x": "2022", "y": 42}] }] @@ -16,8 +18,6 @@ "xAxes": [{ "type": "time", "display": false, - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-single.json b/test/fixtures/controller.bar/bar-thickness-single.json index 59e5fcb9a90..1b6565ed0a2 100644 --- a/test/fixtures/controller.bar/bar-thickness-single.json +++ b/test/fixtures/controller.bar/bar-thickness-single.json @@ -4,6 +4,8 @@ "data": { "labels": ["2016", "2018", "2020", "2024", "2030"], "datasets": [{ + "barPercentage": 1, + "categoryPercentage": 1, "backgroundColor": "#FF6384", "data": [1] }] @@ -16,8 +18,6 @@ "xAxes": [{ "type": "time", "display": false, - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.bar/bar-thickness-stacked.json b/test/fixtures/controller.bar/bar-thickness-stacked.json index effb2f4fb71..3c9f01c2867 100644 --- a/test/fixtures/controller.bar/bar-thickness-stacked.json +++ b/test/fixtures/controller.bar/bar-thickness-stacked.json @@ -18,13 +18,17 @@ "responsive": false, "legend": false, "title": false, + "datasets": { + "bar": { + "barPercentage": 1, + "categoryPercentage": 1 + } + }, "scales": { "xAxes": [{ "type": "time", "stacked": true, "display": false, - "barPercentage": 1, - "categoryPercentage": 1, "time": { "parser": "YYYY" }, diff --git a/test/fixtures/controller.line/clip/default-x-max.json b/test/fixtures/controller.line/clip/default-x-max.json new file mode 100644 index 00000000000..f69182d1f51 --- /dev/null +++ b/test/fixtures/controller.line/clip/default-x-max.json @@ -0,0 +1,38 @@ +{ + "config": { + "type": "scatter", + "data": { + "datasets": [{ + "borderColor": "red", + "data": [{"x":-5,"y":5},{"x":-4,"y":6},{"x":-3,"y":7},{"x":-2,"y":6},{"x":-1,"y":5},{"x":0,"y":4},{"x":1,"y":3},{"x":2,"y":2},{"x":3,"y":5},{"x":4,"y":7},{"x":5,"y":9}], + "fill": false, + "showLine": true, + "borderWidth": 20, + "pointRadius": 0 + }] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{ + "ticks": { + "max": 3, + "display": false + } + }], + "yAxes": [{"ticks": {"display": false}}] + }, + "layout": { + "padding": 24 + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/clip/default-x-max.png b/test/fixtures/controller.line/clip/default-x-max.png new file mode 100644 index 00000000000..8bb7d981c36 Binary files /dev/null and b/test/fixtures/controller.line/clip/default-x-max.png differ diff --git a/test/fixtures/controller.line/clip/default-x-min.json b/test/fixtures/controller.line/clip/default-x-min.json new file mode 100644 index 00000000000..b4a4b0c3e40 --- /dev/null +++ b/test/fixtures/controller.line/clip/default-x-min.json @@ -0,0 +1,38 @@ +{ + "config": { + "type": "scatter", + "data": { + "datasets": [{ + "borderColor": "red", + "data": [{"x":-5,"y":5},{"x":-4,"y":6},{"x":-3,"y":7},{"x":-2,"y":6},{"x":-1,"y":5},{"x":0,"y":4},{"x":1,"y":3},{"x":2,"y":2},{"x":3,"y":5},{"x":4,"y":7},{"x":5,"y":9}], + "fill": false, + "showLine": true, + "borderWidth": 20, + "pointRadius": 0 + }] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{ + "ticks": { + "min": -2, + "display": false + } + }], + "yAxes": [{"ticks": {"display": false}}] + }, + "layout": { + "padding": 24 + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/clip/default-x-min.png b/test/fixtures/controller.line/clip/default-x-min.png new file mode 100644 index 00000000000..5406dd5eafd Binary files /dev/null and b/test/fixtures/controller.line/clip/default-x-min.png differ diff --git a/test/fixtures/controller.line/clip/default-x.json b/test/fixtures/controller.line/clip/default-x.json new file mode 100644 index 00000000000..79dc08cd9b7 --- /dev/null +++ b/test/fixtures/controller.line/clip/default-x.json @@ -0,0 +1,39 @@ +{ + "config": { + "type": "scatter", + "data": { + "datasets": [{ + "borderColor": "red", + "data": [{"x":-5,"y":5},{"x":-4,"y":6},{"x":-3,"y":7},{"x":-2,"y":6},{"x":-1,"y":5},{"x":0,"y":4},{"x":1,"y":3},{"x":2,"y":2},{"x":3,"y":5},{"x":4,"y":7},{"x":5,"y":9}], + "fill": false, + "showLine": true, + "borderWidth": 20, + "pointRadius": 0 + }] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{ + "ticks": { + "min": -2, + "max": 3, + "display": false + } + }], + "yAxes": [{"ticks": {"display": false}}] + }, + "layout": { + "padding": 24 + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/clip/default-x.png b/test/fixtures/controller.line/clip/default-x.png new file mode 100644 index 00000000000..abd33d409b7 Binary files /dev/null and b/test/fixtures/controller.line/clip/default-x.png differ diff --git a/test/fixtures/controller.line/clip/default-y-max.json b/test/fixtures/controller.line/clip/default-y-max.json new file mode 100644 index 00000000000..1ab631bb4e6 --- /dev/null +++ b/test/fixtures/controller.line/clip/default-y-max.json @@ -0,0 +1,38 @@ +{ + "config": { + "type": "scatter", + "data": { + "datasets": [{ + "borderColor": "red", + "data": [{"x":-5,"y":5},{"x":-4,"y":6},{"x":-3,"y":7},{"x":-2,"y":6},{"x":-1,"y":5},{"x":0,"y":4},{"x":1,"y":3},{"x":2,"y":2},{"x":3,"y":5},{"x":4,"y":7},{"x":5,"y":9}], + "fill": false, + "showLine": true, + "borderWidth": 20, + "pointRadius": 0 + }] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{"ticks": {"display": false}}], + "yAxes": [{ + "ticks": { + "max": 6, + "display": false + } + }] + }, + "layout": { + "padding": 24 + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/clip/default-y-max.png b/test/fixtures/controller.line/clip/default-y-max.png new file mode 100644 index 00000000000..c317ed0cebd Binary files /dev/null and b/test/fixtures/controller.line/clip/default-y-max.png differ diff --git a/test/fixtures/controller.line/clip/default-y-min.json b/test/fixtures/controller.line/clip/default-y-min.json new file mode 100644 index 00000000000..7c6114a9c29 --- /dev/null +++ b/test/fixtures/controller.line/clip/default-y-min.json @@ -0,0 +1,38 @@ +{ + "config": { + "type": "scatter", + "data": { + "datasets": [{ + "borderColor": "red", + "data": [{"x":-5,"y":5},{"x":-4,"y":6},{"x":-3,"y":7},{"x":-2,"y":6},{"x":-1,"y":5},{"x":0,"y":4},{"x":1,"y":3},{"x":2,"y":2},{"x":3,"y":5},{"x":4,"y":7},{"x":5,"y":9}], + "fill": false, + "showLine": true, + "borderWidth": 20, + "pointRadius": 0 + }] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{"ticks": {"display": false}}], + "yAxes": [{ + "ticks": { + "min": 2, + "display": false + } + }] + }, + "layout": { + "padding": 24 + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/clip/default-y-min.png b/test/fixtures/controller.line/clip/default-y-min.png new file mode 100644 index 00000000000..515dd3f1882 Binary files /dev/null and b/test/fixtures/controller.line/clip/default-y-min.png differ diff --git a/test/fixtures/controller.line/clip/default-y.json b/test/fixtures/controller.line/clip/default-y.json new file mode 100644 index 00000000000..30751446aa3 --- /dev/null +++ b/test/fixtures/controller.line/clip/default-y.json @@ -0,0 +1,39 @@ +{ + "config": { + "type": "scatter", + "data": { + "datasets": [{ + "borderColor": "red", + "data": [{"x":-5,"y":5},{"x":-4,"y":6},{"x":-3,"y":7},{"x":-2,"y":6},{"x":-1,"y":5},{"x":0,"y":4},{"x":1,"y":3},{"x":2,"y":2},{"x":3,"y":5},{"x":4,"y":7},{"x":5,"y":9}], + "fill": false, + "showLine": true, + "borderWidth": 20, + "pointRadius": 0 + }] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{"ticks": {"display": false}}], + "yAxes": [{ + "ticks": { + "min": 2, + "max": 6, + "display": false + } + }] + }, + "layout": { + "padding": 24 + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/clip/default-y.png b/test/fixtures/controller.line/clip/default-y.png new file mode 100644 index 00000000000..46ba6299512 Binary files /dev/null and b/test/fixtures/controller.line/clip/default-y.png differ diff --git a/test/fixtures/controller.line/clip/specified.json b/test/fixtures/controller.line/clip/specified.json new file mode 100644 index 00000000000..5885240c7e9 --- /dev/null +++ b/test/fixtures/controller.line/clip/specified.json @@ -0,0 +1,77 @@ +{ + "config": { + "type": "scatter", + "data": { + "datasets": [ + { + "showLine": true, + "borderColor": "red", + "data": [{"x":-4,"y":-4},{"x":4,"y":4}], + "clip": false + }, + { + "showLine": true, + "borderColor": "green", + "data": [{"x":-4,"y":-5},{"x":4,"y":3}], + "clip": 5 + }, + { + "showLine": true, + "borderColor": "blue", + "data": [{"x":-4,"y":-3},{"x":4,"y":5}], + "clip": -5 + }, + { + "showLine": true, + "borderColor": "brown", + "data": [{"x":-3,"y":-3},{"x":-1,"y":3},{"x":1,"y":-2},{"x":2,"y":3}], + "clip": { + "top": 8, + "left": false, + "right": -20, + "bottom": -20 + } + } + ] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{ + "ticks": { + "min": -2, + "max": 2, + "display": false + } + }], + "yAxes": [{ + "ticks": { + "min": -2, + "max": 2, + "display": false + } + }] + }, + "layout": { + "padding": 24 + }, + "elements": { + "line": { + "fill": false, + "borderWidth": 20 + }, + "point": { + "radius": 0 + } + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/clip/specified.png b/test/fixtures/controller.line/clip/specified.png new file mode 100644 index 00000000000..5c765a1162f Binary files /dev/null and b/test/fixtures/controller.line/clip/specified.png differ diff --git a/test/fixtures/controller.line/non-numeric-y.json b/test/fixtures/controller.line/non-numeric-y.json new file mode 100644 index 00000000000..db5f3c38180 --- /dev/null +++ b/test/fixtures/controller.line/non-numeric-y.json @@ -0,0 +1,34 @@ +{ + "config": { + "type": "line", + "data": { + "xLabels": ["January", "February", "March", "April", "May", "June", "July"], + "yLabels": ["", "Request Added", "Request Viewed", "Request Accepted", "Request Solved", "Solving Confirmed"], + "datasets": [{ + "label": "My First dataset", + "data": ["", "Request Added", "Request Added", "Request Added", "Request Viewed", "Request Viewed", "Request Viewed"], + "fill": false, + "borderColor": "red", + "backgroundColor": "red" + }] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{"display": false}], + "yAxes": [{ + "type": "category", + "display": false + }] + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/non-numeric-y.png b/test/fixtures/controller.line/non-numeric-y.png new file mode 100644 index 00000000000..5ebecd597b5 Binary files /dev/null and b/test/fixtures/controller.line/non-numeric-y.png differ diff --git a/test/fixtures/controller.radar/backgroundColor/scriptable.js b/test/fixtures/controller.radar/backgroundColor/scriptable.js index 4c714a45120..be2a29e76d9 100644 --- a/test/fixtures/controller.radar/backgroundColor/scriptable.js +++ b/test/fixtures/controller.radar/backgroundColor/scriptable.js @@ -25,6 +25,7 @@ module.exports = { title: false, elements: { line: { + fill: true, backgroundColor: function(ctx) { var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex); return index === 0 ? '#ff0000' diff --git a/test/fixtures/controller.radar/backgroundColor/value.js b/test/fixtures/controller.radar/backgroundColor/value.js index d9347ee5d73..dd118470d44 100644 --- a/test/fixtures/controller.radar/backgroundColor/value.js +++ b/test/fixtures/controller.radar/backgroundColor/value.js @@ -20,6 +20,7 @@ module.exports = { title: false, elements: { line: { + fill: true, backgroundColor: '#00ff00' }, point: { diff --git a/test/fixtures/controller.radar/borderDash/scriptable.js b/test/fixtures/controller.radar/borderDash/scriptable.js index 0bee9a8a669..8548c88e877 100644 --- a/test/fixtures/controller.radar/borderDash/scriptable.js +++ b/test/fixtures/controller.radar/borderDash/scriptable.js @@ -22,6 +22,7 @@ module.exports = { title: false, elements: { line: { + fill: true, borderColor: '#00ff00', borderDash: function(ctx) { return ctx.datasetIndex === 0 ? [5] : [10]; diff --git a/test/specs/controller.bar.tests.js b/test/specs/controller.bar.tests.js index 3874c3325df..49b586fd81e 100644 --- a/test/specs/controller.bar.tests.js +++ b/test/specs/controller.bar.tests.js @@ -1214,12 +1214,16 @@ describe('Chart.controllers.bar', function() { options: { legend: false, title: false, + datasets: { + bar: { + barPercentage: 1, + } + }, scales: { xAxes: [{ type: 'category', display: false, stacked: true, - barPercentage: 1, }], yAxes: [{ type: 'logarithmic', @@ -1275,12 +1279,16 @@ describe('Chart.controllers.bar', function() { options: { legend: false, title: false, + datasets: { + bar: { + barPercentage: 1, + } + }, scales: { xAxes: [{ type: 'category', display: false, stacked: true, - barPercentage: 1, }], yAxes: [{ type: 'logarithmic', @@ -1593,8 +1601,9 @@ describe('Chart.controllers.bar', function() { var meta = chart.getDatasetMeta(0); var yScale = chart.scales[meta.yAxisID]; - var categoryPercentage = yScale.options.categoryPercentage; - var barPercentage = yScale.options.barPercentage; + var config = meta.controller._config; + var categoryPercentage = config.categoryPercentage; + var barPercentage = config.barPercentage; var stacked = yScale.options.stacked; var totalBarHeight = 0; @@ -1669,11 +1678,15 @@ describe('Chart.controllers.bar', function() { options: { legend: false, title: false, + datasets: { + bar: { + barThickness: barThickness + } + }, scales: { xAxes: [{ id: 'x', type: 'category', - barThickness: barThickness }], yAxes: [{ type: 'linear', diff --git a/test/specs/plugin.legend.tests.js b/test/specs/plugin.legend.tests.js index 1fd4821bb59..880a72c6532 100644 --- a/test/specs/plugin.legend.tests.js +++ b/test/specs/plugin.legend.tests.js @@ -149,7 +149,7 @@ describe('Legend block tests', function() { datasetIndex: 1 }, { text: 'dataset3', - fillStyle: 'rgba(0,0,0,0)', + fillStyle: 'green', hidden: false, lineCap: 'butt', lineDash: [], @@ -198,7 +198,7 @@ describe('Legend block tests', function() { expect(chart.legend.legendItems).toEqual([{ text: 'dataset3', - fillStyle: 'rgba(0,0,0,0)', + fillStyle: 'green', hidden: false, lineCap: 'butt', lineDash: [],