]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Babel @kurkle/color for IE support (#7099)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Fri, 14 Feb 2020 17:29:33 +0000 (19:29 +0200)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 17:29:33 +0000 (12:29 -0500)
Babel @kurkle/color for IE support

25 files changed:
.babelrc [deleted file]
babel.config.json [new file with mode: 0644]
docs/getting-started/v3-migration.md
package-lock.json
package.json
rollup.config.js
src/controllers/controller.bubble.js
src/core/core.adapters.js
src/core/core.animations.js
src/core/core.datasetController.js
src/core/core.element.js
src/core/core.layouts.js
src/core/core.scale.js
src/core/core.scaleService.js
src/elements/element.arc.js
src/elements/element.line.js
src/elements/element.point.js
src/elements/element.rectangle.js
src/helpers/helpers.core.js
src/plugins/plugin.legend.js
src/plugins/plugin.title.js
src/plugins/plugin.tooltip.js
test/specs/helpers.core.tests.js
test/specs/helpers.options.tests.js
test/specs/scale.logarithmic.tests.js

diff --git a/.babelrc b/.babelrc
deleted file mode 100644 (file)
index 1320b9a..0000000
--- a/.babelrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "presets": ["@babel/preset-env"]
-}
diff --git a/babel.config.json b/babel.config.json
new file mode 100644 (file)
index 0000000..016cf26
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "presets": ["@babel/preset-env"],
+  "plugins": ["@babel/plugin-transform-object-assign"]
+}
index 631413c8a62a42bafeee94d2031b5411831c84ff..c8d239d02dd2f8d34c0beefeb71026f66820a47f 100644 (file)
@@ -103,6 +103,7 @@ Animation system was completely rewritten in Chart.js v3. Each property can now
 * `helpers.findIndex`
 * `helpers.findNextWhere`
 * `helpers.findPreviousWhere`
+* `helpers.extend`. Use `Object.assign` instead
 * `helpers.indexOf`
 * `helpers.lineTo`
 * `helpers.longestText` was moved to the `helpers.canvas` namespace and made private
index 46cad3fa8f79b511954b66a5200bf0eec6b44535..6b20e9930cc7681dac3e66c191b7c36d6dda88f6 100644 (file)
         "@babel/helper-plugin-utils": "^7.8.3"
       }
     },
+    "@babel/plugin-transform-object-assign": {
+      "version": "7.8.3",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.8.3.tgz",
+      "integrity": "sha512-i3LuN8tPDqUCRFu3dkzF2r1Nx0jp4scxtm7JxtIqI9he9Vk20YD+/zshdzR9JLsoBMlJlNR82a62vQExNEVx/Q==",
+      "dev": true,
+      "requires": {
+        "@babel/helper-plugin-utils": "^7.8.3"
+      }
+    },
     "@babel/plugin-transform-object-super": {
       "version": "7.8.3",
       "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz",
index edcd63255ba4870b46a895f480845d5f884e70f5..22ab9883e0c9a5bdc612f310b57c9773bd062a2b 100644 (file)
@@ -31,6 +31,7 @@
   ],
   "devDependencies": {
     "@babel/core": "^7.8.4",
+    "@babel/plugin-transform-object-assign": "^7.8.3",
     "@babel/preset-env": "^7.8.4",
     "babel-preset-es2015-rollup": "^3.0.0",
     "clean-css": "^4.2.3",
index 3cbfe0b5c9028802c0a338dcd38851e0ec10b750..276b8738ef4a3c789aee218c59700e59b2626678 100644 (file)
@@ -1,3 +1,4 @@
+/* eslint-disable import/no-commonjs */
 /* eslint-env es6 */
 
 const commonjs = require('rollup-plugin-commonjs');
@@ -9,6 +10,7 @@ const stylesheet = require('./rollup.plugins').stylesheet;
 const pkg = require('./package.json');
 
 const input = 'src/index.js';
+
 const banner = `/*!
  * Chart.js v${pkg.version}
  * ${pkg.homepage}
@@ -17,26 +19,27 @@ const banner = `/*!
  */`;
 
 module.exports = [
-       // ES6 builds
-       // dist/Chart.esm.min.js
-       // dist/Chart.esm.js
+       // UMD builds
+       // dist/Chart.min.js
+       // dist/Chart.js
        {
-               input: input,
+               input,
                plugins: [
                        resolve(),
                        commonjs(),
-                       babel({
-                               exclude: 'node_modules/**'
-                       }),
+                       babel(),
                        stylesheet({
                                extract: true
                        }),
+                       optional({
+                               include: ['moment']
+                       })
                ],
                output: {
                        name: 'Chart',
-                       file: 'dist/Chart.esm.js',
-                       banner: banner,
-                       format: 'esm',
+                       file: 'dist/Chart.js',
+                       banner,
+                       format: 'umd',
                        indent: false,
                        globals: {
                                moment: 'moment'
@@ -47,12 +50,13 @@ module.exports = [
                ]
        },
        {
-               input: input,
+               input,
                plugins: [
                        resolve(),
                        commonjs(),
-                       babel({
-                               exclude: 'node_modules/**'
+                       babel(),
+                       optional({
+                               include: ['moment']
                        }),
                        stylesheet({
                                extract: true,
@@ -66,8 +70,8 @@ module.exports = [
                ],
                output: {
                        name: 'Chart',
-                       file: 'dist/Chart.esm.min.js',
-                       format: 'esm',
+                       file: 'dist/Chart.min.js',
+                       format: 'umd',
                        indent: false,
                        globals: {
                                moment: 'moment'
@@ -77,29 +81,25 @@ module.exports = [
                        'moment'
                ]
        },
-       // UMD builds
-       // dist/Chart.min.js
-       // dist/Chart.js
+
+       // ES6 builds
+       // dist/Chart.esm.min.js
+       // dist/Chart.esm.js
        {
-               input: input,
+               input,
                plugins: [
                        resolve(),
                        commonjs(),
-                       babel({
-                               exclude: 'node_modules/**'
-                       }),
+                       babel(),
                        stylesheet({
                                extract: true
                        }),
-                       optional({
-                               include: ['moment']
-                       })
                ],
                output: {
                        name: 'Chart',
-                       file: 'dist/Chart.js',
-                       banner: banner,
-                       format: 'umd',
+                       file: 'dist/Chart.esm.js',
+                       banner,
+                       format: 'esm',
                        indent: false,
                        globals: {
                                moment: 'moment'
@@ -110,16 +110,11 @@ module.exports = [
                ]
        },
        {
-               input: input,
+               input,
                plugins: [
                        resolve(),
                        commonjs(),
-                       babel({
-                               exclude: 'node_modules/**'
-                       }),
-                       optional({
-                               include: ['moment']
-                       }),
+                       babel(),
                        stylesheet({
                                extract: true,
                                minify: true
@@ -132,8 +127,8 @@ module.exports = [
                ],
                output: {
                        name: 'Chart',
-                       file: 'dist/Chart.min.js',
-                       format: 'umd',
+                       file: 'dist/Chart.esm.min.js',
+                       format: 'esm',
                        indent: false,
                        globals: {
                                moment: 'moment'
@@ -142,5 +137,5 @@ module.exports = [
                external: [
                        'moment'
                ]
-       }
+       },
 ];
index 0ebf5b81e174739b91400a0cff5b25f3a26dd898..2739c40001a80d366105c353c44b7e1521315c88 100644 (file)
@@ -1,7 +1,6 @@
 import DatasetController from '../core/core.datasetController';
 import defaults from '../core/core.defaults';
 import Point from '../elements/element.point';
-import {extend} from '../helpers/helpers.core';
 import {resolve} from '../helpers/helpers.options';
 
 defaults.set('bubble', {
@@ -152,7 +151,7 @@ class BubbleController extends DatasetController {
 
                // In case values were cached (and thus frozen), we need to clone the values
                if (values.$shared) {
-                       values = extend({}, values, {$shared: false});
+                       values = Object.assign({}, values, {$shared: false});
                }
 
 
index 85e929ed12c99dc5b5ab6027c6e2ad696e9a68b1..ea26870fd602b28797f5c4419febf0cce7929ec4 100644 (file)
@@ -4,8 +4,6 @@
  * @private
  */
 
-import {extend} from '../helpers/helpers.core';
-
 /**
  * @return {*}
  */
@@ -108,7 +106,7 @@ class DateAdapter {
 }
 
 DateAdapter.override = function(members) {
-       extend(DateAdapter.prototype, members);
+       Object.assign(DateAdapter.prototype, members);
 };
 
 export default {
index 8ed966e0a04ebd7d30911f2e87f9e8c4eb0ba879..427eb61543915a19628442142cbe8b89abf3efdf 100644 (file)
@@ -1,7 +1,7 @@
 import Animator from './core.animator';
 import Animation from './core.animation';
 import defaults from '../core/core.defaults';
-import {noop, extend, isObject} from '../helpers/helpers.core';
+import {noop, isObject} from '../helpers/helpers.core';
 
 const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];
 const colors = ['borderColor', 'backgroundColor'];
@@ -61,9 +61,9 @@ function copyOptions(target, values) {
                return;
        }
        if (oldOpts.$shared) {
-               target.options = extend({}, oldOpts, newOpts, {$shared: false});
+               target.options = Object.assign({}, oldOpts, newOpts, {$shared: false});
        } else {
-               extend(oldOpts, newOpts);
+               Object.assign(oldOpts, newOpts);
        }
        delete values.options;
 }
@@ -102,10 +102,10 @@ export default class Animations {
                        (cfg.properties || [key]).forEach((prop) => {
                                // Can have only one config per animation.
                                if (!animatedProps.has(prop)) {
-                                       animatedProps.set(prop, extend({}, animDefaults, cfg));
+                                       animatedProps.set(prop, Object.assign({}, animDefaults, cfg));
                                } else if (prop === key) {
                                        // Single property targetting config wins over multi-targetting.
-                                       animatedProps.set(prop, extend({}, animatedProps.get(prop), cfg));
+                                       animatedProps.set(prop, Object.assign({}, animatedProps.get(prop), cfg));
                                }
                        });
                });
@@ -130,7 +130,7 @@ export default class Animations {
                        if (options.$shared) {
                                // If the current / old options are $shared, meaning other elements are
                                // using the same options, we need to clone to become unique.
-                               target.options = options = extend({}, options, {$shared: false, $animations: {}});
+                               target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});
                        }
                        animations = this._createAnimations(options, newOptions);
                } else {
@@ -192,7 +192,7 @@ export default class Animations {
                        copyOptions(target, values);
                        // copyOptions removes the `options` from `values`,
                        // unless it can be directly assigned.
-                       extend(target, values);
+                       Object.assign(target, values);
                        return;
                }
 
index dc8e16f525b0cfe9b9d957d9ca88281a504ba16a..08bb7ea9561b939f8e4dea92294b2784e74feda5 100644 (file)
@@ -932,7 +932,7 @@ class DatasetController {
                let config = helpers.mergeIf({}, [datasetAnim, chartAnim]);
 
                if (config[mode]) {
-                       config = helpers.extend({}, config, config[mode]);
+                       config = Object.assign({}, config, config[mode]);
                }
 
                const animations = new Animations(chart, config);
@@ -975,7 +975,7 @@ class DatasetController {
         */
        _updateElement(element, index, properties, mode) {
                if (mode === 'reset' || mode === 'none') {
-                       helpers.extend(element, properties);
+                       Object.assign(element, properties);
                } else {
                        this._resolveAnimations(index, mode).update(element, properties);
                }
index 02a4bb2aed9002559941b09eb24229fdff230379..77cbc8ccb527aa6ee27755097eb3cbd7679ab20d 100644 (file)
@@ -1,4 +1,4 @@
-import {extend, inherits} from '../helpers/helpers.core';
+import {inherits} from '../helpers/helpers.core';
 import {isNumber} from '../helpers/helpers.math';
 
 class Element {
@@ -12,7 +12,7 @@ class Element {
                this.hidden = undefined;
 
                if (cfg) {
-                       extend(this, cfg);
+                       Object.assign(this, cfg);
                }
        }
 
index 9bb0ab335480dc4d093bc30b939110aa677cf14d..0bf54834d7df449f53cb5551fd04cd602610e147 100644 (file)
@@ -1,5 +1,5 @@
 import defaults from './core.defaults';
-import {each, extend} from '../helpers/helpers.core';
+import {each} from '../helpers/helpers.core';
 import {toPadding} from '../helpers/helpers.options';
 
 /**
@@ -348,8 +348,8 @@ export default {
                        vBoxMaxWidth: availableWidth / 2 / verticalBoxes.length,
                        hBoxMaxHeight: availableHeight / 2
                });
-               const chartArea = extend({
-                       maxPadding: extend({}, padding),
+               const chartArea = Object.assign({
+                       maxPadding: Object.assign({}, padding),
                        w: availableWidth,
                        h: availableHeight,
                        x: padding.left,
@@ -390,7 +390,7 @@ export default {
                // Finally update boxes in chartArea (radial scale for example)
                each(boxes.chartArea, (layout) => {
                        const box = layout.box;
-                       extend(box, chart.chartArea);
+                       Object.assign(box, chart.chartArea);
                        box.update(chartArea.w, chartArea.h);
                });
        }
index 0a4ac9cb642645fa3e91728e4f1d64a0387da4b8..9f28ac4ed2b67aeabe05002c2606b36af3c27276 100644 (file)
@@ -1,7 +1,7 @@
 import defaults from './core.defaults';
 import Element from './core.element';
 import {_alignPixel, _measureText} from '../helpers/helpers.canvas';
-import {callback as call, each, extend, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core';
+import {callback as call, each, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core';
 import {_factorize, toDegrees, toRadians} from '../helpers/helpers.math';
 import {_parseFont, resolve, toPadding} from '../helpers/helpers.options';
 import Ticks from './core.ticks';
@@ -436,7 +436,7 @@ class Scale extends Element {
                // Absorb the master measurements
                me.maxWidth = maxWidth;
                me.maxHeight = maxHeight;
-               me.margins = extend({
+               me.margins = Object.assign({
                        left: 0,
                        right: 0,
                        top: 0,
@@ -1555,7 +1555,7 @@ class Scale extends Element {
                        tick: me.ticks[index],
                        index
                };
-               return extend(_parseFont({
+               return Object.assign(_parseFont({
                        fontFamily: resolve([options.fontFamily], context),
                        fontSize: resolve([options.fontSize], context),
                        fontStyle: resolve([options.fontStyle], context),
index 01713ce03a4c3964f7981e8fc31ca8fb6b7d7950..6e83448a7b50c6b26a655207b23bf24a0d5a2991 100644 (file)
@@ -1,5 +1,5 @@
 import defaults from './core.defaults';
-import {clone, each, extend, merge} from '../helpers/helpers.core';
+import {clone, each, merge} from '../helpers/helpers.core';
 import layouts from './core.layouts';
 
 export default {
@@ -25,7 +25,7 @@ export default {
        updateScaleDefaults(type, additions) {
                const me = this;
                if (Object.prototype.hasOwnProperty.call(me.defaults, type)) {
-                       me.defaults[type] = extend(me.defaults[type], additions);
+                       me.defaults[type] = Object.assign(me.defaults[type], additions);
                }
        },
        addScalesToLayout(chart) {
index 984310890c067bf16d27e3dca7ae4e8c95e4ee30..5860216f1524871c0f86681cbb0843da02e6f6e1 100644 (file)
@@ -1,6 +1,5 @@
 import defaults from '../core/core.defaults';
 import Element from '../core/core.element';
-import {extend} from '../helpers/helpers.core';
 import {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math';
 const TAU = Math.PI * 2;
 
@@ -98,7 +97,7 @@ class Arc extends Element {
                this.outerRadius = undefined;
 
                if (cfg) {
-                       extend(this, cfg);
+                       Object.assign(this, cfg);
                }
        }
 
index 84582438e8658dad33afa8efe5bd17b26e20bb5d..a5913cf3878ea4fb3a62026bb6a5e1f462628979 100644 (file)
@@ -1,6 +1,5 @@
 import defaults from '../core/core.defaults';
 import Element from '../core/core.element';
-import {extend} from '../helpers/helpers.core';
 import {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation';
 import {_computeSegments, _boundSegments} from '../helpers/helpers.segment';
 import {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas';
@@ -210,7 +209,7 @@ class Line extends Element {
                this._segments = undefined;
 
                if (cfg) {
-                       extend(this, cfg);
+                       Object.assign(this, cfg);
                }
        }
 
index 82a8089bd79d4d0387108317bf556a5e513f8459..e3c7c4e8ee66453ab76f283e206c7cb23cadff5f 100644 (file)
@@ -1,7 +1,6 @@
 import defaults from '../core/core.defaults';
 import Element from '../core/core.element';
 import {_isPointInArea, drawPoint} from '../helpers/helpers.canvas';
-import {extend} from '../helpers/helpers.core';
 
 const defaultColor = defaults.color;
 
@@ -29,7 +28,7 @@ class Point extends Element {
                this.stop = undefined;
 
                if (cfg) {
-                       extend(this, cfg);
+                       Object.assign(this, cfg);
                }
        }
 
index b4ca3fa8adb56bdab2c2c094b33317eeb467cb6f..b9bab5ac8505e495ea9dd67bb2f390c694fc6e28 100644 (file)
@@ -1,6 +1,6 @@
 import defaults from '../core/core.defaults';
 import Element from '../core/core.element';
-import {extend, isObject} from '../helpers/helpers.core';
+import {isObject} from '../helpers/helpers.core';
 
 const defaultColor = defaults.color;
 
@@ -138,7 +138,7 @@ class Rectangle extends Element {
                this.height = undefined;
 
                if (cfg) {
-                       extend(this, cfg);
+                       Object.assign(this, cfg);
                }
        }
 
index be5a1cd4195490878716d59ea88b9930787f416e..ffcc0eae38a7e5632c8a021fdfa8cede7deb0f9b 100644 (file)
@@ -293,21 +293,6 @@ export function _mergerIf(key, target, source) {
        }
 }
 
-/**
- * Applies the contents of two or more objects together into the first object.
- * @param {object} target - The target object in which all objects are merged into.
- * @param {object} arg1 - Object containing additional properties to merge in target.
- * @param {object} argN - Additional objects containing properties to merge in target.
- * @returns {object} The `target` object.
- */
-export const extend = Object.assign || function(target, ...args) {
-       return merge(target, args, {
-               merger(key, dst, src) {
-                       dst[key] = src[key];
-               }
-       });
-};
-
 /**
  * Basic javascript inheritance based on the model created in Backbone.js
  */
@@ -328,7 +313,7 @@ export function inherits(extensions) {
        ChartElement.extend = inherits;
 
        if (extensions) {
-               extend(ChartElement.prototype, extensions);
+               Object.assign(ChartElement.prototype, extensions);
        }
 
        ChartElement.__super__ = me.prototype;
index 76cc6599d0362cb8eba97ffa3b52b26e18fef6e3..f947d108a7258ee9b1a3cf6011e9856812b6f430 100644 (file)
@@ -2,7 +2,7 @@ import defaults from '../core/core.defaults';
 import Element from '../core/core.element';
 import layouts from '../core/core.layouts';
 import {drawPoint} from '../helpers/helpers.canvas';
-import {callback as call, extend, mergeIf, valueOrDefault} from '../helpers/helpers.core';
+import {callback as call, mergeIf, valueOrDefault} from '../helpers/helpers.core';
 import {_parseFont, toPadding} from '../helpers/helpers.options';
 import {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl';
 
@@ -103,7 +103,7 @@ class Legend extends Element {
        constructor(config) {
                super();
 
-               extend(this, config);
+               Object.assign(this, config);
 
                // Contains hit boxes for each dataset (in dataset order)
                this.legendHitBoxes = [];
index e12c1572388001d92fbdac5aaaaa773aaa02c26d..505d492d748d3f0b89f099ec5f05c33d3e05a07b 100644 (file)
@@ -21,7 +21,7 @@ class Title extends Element {
        constructor(config) {
                super();
 
-               helpers.extend(this, config);
+               Object.assign(this, config);
 
                this.chart = config.chart;
                this.options = config.options;
index a38f0923c3077f7d3a98b1d4f129edd011b3e22f..85664e721b9451d02a61454c4763e72eb8c99e42 100644 (file)
@@ -236,7 +236,7 @@ function createTooltipItem(chart, item) {
  */
 function resolveOptions(options) {
 
-       options = helpers.extend({}, defaults.tooltips, options);
+       options = Object.assign({}, defaults.tooltips, options);
 
        options.bodyFontFamily = valueOrDefault(options.bodyFontFamily, defaults.fontFamily);
        options.bodyFontStyle = valueOrDefault(options.bodyFontStyle, defaults.fontStyle);
@@ -636,7 +636,7 @@ class Tooltip extends Element {
                        me.footer = me.getFooter(tooltipItems, data);
 
                        const size = me._size = getTooltipSize(me);
-                       const positionAndSize = helpers.extend({}, position, size);
+                       const positionAndSize = Object.assign({}, position, size);
                        const alignment = determineAlignment(me._chart, options, positionAndSize);
                        const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, me._chart);
 
@@ -917,7 +917,7 @@ class Tooltip extends Element {
                        if (!position) {
                                return;
                        }
-                       const positionAndSize = helpers.extend({}, position, me._size);
+                       const positionAndSize = Object.assign({}, position, me._size);
                        const alignment = determineAlignment(chart, options, positionAndSize);
                        const point = getBackgroundPoint(options, positionAndSize, alignment, chart);
                        if (animX._to !== point.x || animY._to !== point.y) {
index de3892a83ea46000d07d6b63b4369f5d1bb23b79..869e9dfd182597ba11f0e6a13385e9aa00e7aa86 100644 (file)
@@ -413,7 +413,7 @@ describe('Chart.helpers.core', function() {
                it('should merge object properties in target and return target', function() {
                        var target = {a: 'abc', b: 56};
                        var object = {b: 0, c: [2, 5, 6]};
-                       var result = helpers.extend(target, object);
+                       var result = Object.assign(target, object);
 
                        expect(result).toBe(target);
                        expect(target).toEqual({a: 'abc', b: 0, c: [2, 5, 6]});
@@ -424,7 +424,7 @@ describe('Chart.helpers.core', function() {
                        var o1 = {a: 5, c: 6};
                        var o2 = {a: 7, e: 8};
 
-                       helpers.extend(target, o0, o1, o2);
+                       Object.assign(target, o0, o1, o2);
 
                        expect(target).toEqual({a: 7, b: 1, c: 6, d: 4, e: 8});
                });
@@ -432,7 +432,7 @@ describe('Chart.helpers.core', function() {
                        var target = {a: {b: 0, c: 1}};
                        var object = {a: {b: 2, d: 3}};
 
-                       helpers.extend(target, object);
+                       Object.assign(target, object);
 
                        expect(target).toEqual({a: {b: 2, d: 3}});
                        expect(target.a).toBe(object.a);
index 268e9a9f6b243862a5976f1050c45716304ac4bf..41aaa8f3c4b6711a2ec9aad66b1e1f76b8a4c417 100644 (file)
@@ -75,7 +75,7 @@ describe('Chart.helpers.options', function() {
                        const fontStyle = Chart.defaults.fontStyle;
                        const lineHeight = Chart.defaults.lineHeight;
 
-                       Chart.helpers.extend(Chart.defaults, {
+                       Object.assign(Chart.defaults, {
                                fontFamily: 'foobar',
                                fontSize: 42,
                                fontStyle: 'xxxyyy',
@@ -91,7 +91,7 @@ describe('Chart.helpers.options', function() {
                                weight: null
                        });
 
-                       Chart.helpers.extend(Chart.defaults, {
+                       Object.assign(Chart.defaults, {
                                fontFamily,
                                fontSize,
                                fontStyle,
index 15c3065f0983973ad62514385c63a691723f4559..323084a9e2d25a3adcfcfca16fbcb774481296d4 100644 (file)
@@ -842,7 +842,7 @@ describe('Logarithmic Scale tests', function() {
                        scaleConfig[setup.axis] = {
                                type: 'logarithmic'
                        };
-                       Chart.helpers.extend(scaleConfig, setup.scale);
+                       Object.assign(scaleConfig, setup.scale);
                        scaleConfig[setup.axis].type = 'logarithmic';
 
                        var description = 'dataset has stack option and ' + setup.describe
@@ -987,9 +987,9 @@ describe('Logarithmic Scale tests', function() {
                                                                data: setup.dataset
                                                        }],
                                                };
-                                               Chart.helpers.extend(xConfig, setup.scale);
-                                               Chart.helpers.extend(yConfig, setup.scale);
-                                               Chart.helpers.extend(data, setup.data || {});
+                                               Object.assign(xConfig, setup.scale);
+                                               Object.assign(yConfig, setup.scale);
+                                               Object.assign(data, setup.data || {});
                                                this.chart = window.acquireChart({
                                                        type: 'line',
                                                        data: data,
@@ -1109,9 +1109,9 @@ describe('Logarithmic Scale tests', function() {
                                                                data: setup.dataset
                                                        }],
                                                };
-                                               Chart.helpers.extend(xConfig, setup.scale);
-                                               Chart.helpers.extend(yConfig, setup.scale);
-                                               Chart.helpers.extend(data, setup.data || {});
+                                               Object.assign(xConfig, setup.scale);
+                                               Object.assign(yConfig, setup.scale);
+                                               Object.assign(data, setup.data || {});
                                                this.chart = window.acquireChart({
                                                        type: 'line',
                                                        data: data,