From 96adf9eab3fc1e57e2a689a27aa74352423b18f9 Mon Sep 17 00:00:00 2001 From: Nick Nissen Date: Wed, 31 Jan 2018 07:47:09 +0100 Subject: [PATCH 1/2] Refactor: Extract identical code into a function --- src/BaseCharts.js | 104 +++++++++++++++++++++++++++ src/BaseCharts/Bar.js | 78 -------------------- src/BaseCharts/Bubble.js | 80 --------------------- src/BaseCharts/Doughnut.js | 81 --------------------- src/BaseCharts/HorizontalBar.js | 80 --------------------- src/BaseCharts/Line.js | 80 --------------------- src/BaseCharts/Pie.js | 80 --------------------- src/BaseCharts/PolarArea.js | 80 --------------------- src/BaseCharts/Radar.js | 80 --------------------- src/BaseCharts/Scatter.js | 80 --------------------- src/examples/BarExample.js | 2 +- src/examples/BubbleExample.js | 2 +- src/examples/DoughnutExample.js | 2 +- src/examples/HorizontalBarExample.js | 2 +- src/examples/LineExample.js | 2 +- src/examples/PieExample.js | 2 +- src/examples/PolarAreaExample.js | 2 +- src/examples/RadarExample.js | 2 +- src/examples/ReactiveExample.js | 2 +- src/examples/ReactivePropExample.js | 2 +- src/examples/ScatterExample.js | 2 +- src/index.js | 20 +++--- 22 files changed, 126 insertions(+), 739 deletions(-) create mode 100644 src/BaseCharts.js delete mode 100644 src/BaseCharts/Bar.js delete mode 100644 src/BaseCharts/Bubble.js delete mode 100644 src/BaseCharts/Doughnut.js delete mode 100644 src/BaseCharts/HorizontalBar.js delete mode 100644 src/BaseCharts/Line.js delete mode 100644 src/BaseCharts/Pie.js delete mode 100644 src/BaseCharts/PolarArea.js delete mode 100644 src/BaseCharts/Radar.js delete mode 100644 src/BaseCharts/Scatter.js diff --git a/src/BaseCharts.js b/src/BaseCharts.js new file mode 100644 index 00000000..e198bc3e --- /dev/null +++ b/src/BaseCharts.js @@ -0,0 +1,104 @@ +import Chart from 'chart.js' + +function generateChart (chartId, chartType) { + return { + render: function (createElement) { + return createElement( + 'div', { + style: this.styles, + class: this.cssClasses + }, + [ + createElement( + 'canvas', { + attrs: { + id: this.chartId, + width: this.width, + height: this.height + }, + ref: 'canvas' + } + ) + ] + ) + }, + + props: { + chartId: { + default: chartId, + type: String + }, + width: { + default: 400, + type: Number + }, + height: { + default: 400, + type: Number + }, + cssClasses: { + type: String, + default: '' + }, + styles: { + type: Object + }, + plugins: { + type: Array, + default () { + return [] + } + } + }, + + data () { + return { + _chart: null, + _plugins: this.plugins + } + }, + + methods: { + addPlugin (plugin) { + this.$data._plugins.push(plugin) + }, + renderChart (data, options) { + this.$data._chart = new Chart( + this.$refs.canvas.getContext('2d'), { + type: chartType, + data: data, + options: options, + plugins: this.$data._plugins + } + ) + } + }, + beforeDestroy () { + if (this.$data._chart) { + this.$data._chart.destroy() + } + } + } +} + +export const Bar = generateChart('bar-chart', 'bar') +export const HorizontalBar = generateChart('horizontalbar-chart', 'horizontalBar') +export const Doughnut = generateChart('doughnut-chart', 'doughnut') +export const Line = generateChart('line-chart', 'line') +export const Pie = generateChart('pie-chart', 'pie') +export const PolarArea = generateChart('polar-chart', 'polarArea') +export const Radar = generateChart('radar-chart', 'radar') +export const Bubble = generateChart('bubble-chart', 'bubble') +export const Scatter = generateChart('scatter-chart', 'scatter') + +export default { + Bar, + HorizontalBar, + Doughnut, + Line, + Pie, + PolarArea, + Radar, + Bubble, + Scatter +} diff --git a/src/BaseCharts/Bar.js b/src/BaseCharts/Bar.js deleted file mode 100644 index 41a0df66..00000000 --- a/src/BaseCharts/Bar.js +++ /dev/null @@ -1,78 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - props: { - chartId: { - default: 'bar-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'bar', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/BaseCharts/Bubble.js b/src/BaseCharts/Bubble.js deleted file mode 100644 index af104a77..00000000 --- a/src/BaseCharts/Bubble.js +++ /dev/null @@ -1,80 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - - props: { - chartId: { - default: 'bubble-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'bubble', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/BaseCharts/Doughnut.js b/src/BaseCharts/Doughnut.js deleted file mode 100644 index d106f907..00000000 --- a/src/BaseCharts/Doughnut.js +++ /dev/null @@ -1,81 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - - props: { - chartId: { - default: 'doughnut-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'doughnut', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/BaseCharts/HorizontalBar.js b/src/BaseCharts/HorizontalBar.js deleted file mode 100644 index af07d880..00000000 --- a/src/BaseCharts/HorizontalBar.js +++ /dev/null @@ -1,80 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - - props: { - chartId: { - default: 'horizontalbar-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'horizontalBar', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/BaseCharts/Line.js b/src/BaseCharts/Line.js deleted file mode 100644 index 883a4350..00000000 --- a/src/BaseCharts/Line.js +++ /dev/null @@ -1,80 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - - props: { - chartId: { - default: 'line-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'line', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/BaseCharts/Pie.js b/src/BaseCharts/Pie.js deleted file mode 100644 index e6c61443..00000000 --- a/src/BaseCharts/Pie.js +++ /dev/null @@ -1,80 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - - props: { - chartId: { - default: 'pie-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'pie', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/BaseCharts/PolarArea.js b/src/BaseCharts/PolarArea.js deleted file mode 100644 index 241e2229..00000000 --- a/src/BaseCharts/PolarArea.js +++ /dev/null @@ -1,80 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - - props: { - chartId: { - default: 'polar-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'polarArea', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/BaseCharts/Radar.js b/src/BaseCharts/Radar.js deleted file mode 100644 index ed62e257..00000000 --- a/src/BaseCharts/Radar.js +++ /dev/null @@ -1,80 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - - props: { - chartId: { - default: 'radar-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'radar', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/BaseCharts/Scatter.js b/src/BaseCharts/Scatter.js deleted file mode 100644 index b1b099e8..00000000 --- a/src/BaseCharts/Scatter.js +++ /dev/null @@ -1,80 +0,0 @@ -import Chart from 'chart.js' - -export default { - render: function (createElement) { - return createElement( - 'div', { - style: this.styles, - class: this.cssClasses - }, - [ - createElement( - 'canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - } - ) - ] - ) - }, - - props: { - chartId: { - default: 'scatter-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default () { - return [] - } - } - }, - - data () { - return { - _chart: null, - _plugins: this.plugins - } - }, - - methods: { - addPlugin (plugin) { - this.$data._plugins.push(plugin) - }, - renderChart (data, options) { - this.$data._chart = new Chart( - this.$refs.canvas.getContext('2d'), { - type: 'scatter', - data: data, - options: options, - plugins: this.$data._plugins - } - ) - } - }, - beforeDestroy () { - if (this.$data._chart) { - this.$data._chart.destroy() - } - } -} diff --git a/src/examples/BarExample.js b/src/examples/BarExample.js index 59edd658..b7822d0a 100644 --- a/src/examples/BarExample.js +++ b/src/examples/BarExample.js @@ -1,4 +1,4 @@ -import Bar from '../BaseCharts/Bar' +import { Bar } from '../BaseCharts' export default { extends: Bar, diff --git a/src/examples/BubbleExample.js b/src/examples/BubbleExample.js index 08b0929d..55cbaee3 100644 --- a/src/examples/BubbleExample.js +++ b/src/examples/BubbleExample.js @@ -1,4 +1,4 @@ -import Bubble from '../BaseCharts/Bubble' +import { Bubble } from '../BaseCharts' export default { extends: Bubble, diff --git a/src/examples/DoughnutExample.js b/src/examples/DoughnutExample.js index d9024fe9..046080d7 100644 --- a/src/examples/DoughnutExample.js +++ b/src/examples/DoughnutExample.js @@ -1,4 +1,4 @@ -import Doughnut from '../BaseCharts/Doughnut' +import { Doughnut } from '../BaseCharts' export default { extends: Doughnut, diff --git a/src/examples/HorizontalBarExample.js b/src/examples/HorizontalBarExample.js index f3652cfb..a8463c36 100644 --- a/src/examples/HorizontalBarExample.js +++ b/src/examples/HorizontalBarExample.js @@ -1,4 +1,4 @@ -import HorizontalBar from '../BaseCharts/HorizontalBar' +import { HorizontalBar } from '../BaseCharts' export default { extends: HorizontalBar, diff --git a/src/examples/LineExample.js b/src/examples/LineExample.js index eb645c92..f62517a1 100644 --- a/src/examples/LineExample.js +++ b/src/examples/LineExample.js @@ -1,4 +1,4 @@ -import Line from '../BaseCharts/Line' +import { Line } from '../BaseCharts' export default { extends: Line, diff --git a/src/examples/PieExample.js b/src/examples/PieExample.js index 5f62d931..6df72e49 100644 --- a/src/examples/PieExample.js +++ b/src/examples/PieExample.js @@ -1,4 +1,4 @@ -import Pie from '../BaseCharts/Pie' +import { Pie } from '../BaseCharts' export default { extends: Pie, diff --git a/src/examples/PolarAreaExample.js b/src/examples/PolarAreaExample.js index 8ac67b7f..ffa44399 100644 --- a/src/examples/PolarAreaExample.js +++ b/src/examples/PolarAreaExample.js @@ -1,4 +1,4 @@ -import PolarArea from '../BaseCharts/PolarArea' +import { PolarArea } from '../BaseCharts' export default { extends: PolarArea, diff --git a/src/examples/RadarExample.js b/src/examples/RadarExample.js index 23017ca9..5a48b478 100644 --- a/src/examples/RadarExample.js +++ b/src/examples/RadarExample.js @@ -1,4 +1,4 @@ -import Radar from '../BaseCharts/Radar' +import { Radar } from '../BaseCharts' export default { extends: Radar, diff --git a/src/examples/ReactiveExample.js b/src/examples/ReactiveExample.js index ac6320f4..283484a7 100644 --- a/src/examples/ReactiveExample.js +++ b/src/examples/ReactiveExample.js @@ -1,4 +1,4 @@ -import Bar from '../BaseCharts/Bar' +import { Bar } from '../BaseCharts' import reactiveData from '../mixins/reactiveData' export default { diff --git a/src/examples/ReactivePropExample.js b/src/examples/ReactivePropExample.js index b4489aab..8fa055a0 100644 --- a/src/examples/ReactivePropExample.js +++ b/src/examples/ReactivePropExample.js @@ -1,4 +1,4 @@ -import Bar from '../BaseCharts/Bar' +import { Bar } from '../BaseCharts' import reactiveProp from '../mixins/reactiveProp' export default { diff --git a/src/examples/ScatterExample.js b/src/examples/ScatterExample.js index 3e8d669b..45429114 100644 --- a/src/examples/ScatterExample.js +++ b/src/examples/ScatterExample.js @@ -1,4 +1,4 @@ -import Scatter from '../BaseCharts/Scatter' +import { Scatter } from '../BaseCharts' export default { extends: Scatter, diff --git a/src/index.js b/src/index.js index 3c0a52fe..65376ca1 100644 --- a/src/index.js +++ b/src/index.js @@ -1,14 +1,16 @@ -import Bar from './BaseCharts/Bar' -import HorizontalBar from './BaseCharts/HorizontalBar' -import Doughnut from './BaseCharts/Doughnut' -import Line from './BaseCharts/Line' -import Pie from './BaseCharts/Pie' -import PolarArea from './BaseCharts/PolarArea' -import Radar from './BaseCharts/Radar' -import Bubble from './BaseCharts/Bubble' -import Scatter from './BaseCharts/Scatter' import mixins from './mixins/index.js' import npmCfg from '../package.json' +import { + Bar, + HorizontalBar, + Doughnut, + Line, + Pie, + PolarArea, + Radar, + Bubble, + Scatter +} from './BaseCharts' const VueCharts = { version: npmCfg.version, From 4297872885ed80904165a2db0bd20c4a973b252c Mon Sep 17 00:00:00 2001 From: Nick Nissen Date: Wed, 31 Jan 2018 07:48:16 +0100 Subject: [PATCH 2/2] Chore: Add dist files --- dist/vue-chartjs.js | 746 ++++++---------------------------------- dist/vue-chartjs.min.js | 2 +- 2 files changed, 110 insertions(+), 638 deletions(-) diff --git a/dist/vue-chartjs.js b/dist/vue-chartjs.js index d8e07f52..f0781595 100644 --- a/dist/vue-chartjs.js +++ b/dist/vue-chartjs.js @@ -12,7 +12,7 @@ exports["VueChartJs"] = factory(require("chart.js")); else root["VueChartJs"] = factory(root["Chart"]); -})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__) { +})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_4__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -75,657 +75,131 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1); +/******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_0__; - -/***/ }), -/* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +// EXTERNAL MODULE: ./src/mixins/reactiveData.js +var reactiveData = __webpack_require__(1); +var reactiveData_default = /*#__PURE__*/__webpack_require__.n(reactiveData); + +// EXTERNAL MODULE: ./src/mixins/reactiveProp.js +var reactiveProp = __webpack_require__(2); +var reactiveProp_default = /*#__PURE__*/__webpack_require__.n(reactiveProp); + +// CONCATENATED MODULE: ./src/mixins/index.js + + +/* harmony default export */ var mixins = ({ + reactiveData: reactiveData_default.a, + reactiveProp: reactiveProp_default.a +}); +// EXTERNAL MODULE: ./package.json +var package_0 = __webpack_require__(3); +var package_default = /*#__PURE__*/__webpack_require__.n(package_0); + // EXTERNAL MODULE: external {"root":"Chart","commonjs":"chart.js","commonjs2":"chart.js","amd":"chart.js"} -var external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js__ = __webpack_require__(0); +var external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js__ = __webpack_require__(4); var external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default = /*#__PURE__*/__webpack_require__.n(external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js__); -// CONCATENATED MODULE: ./src/BaseCharts/Bar.js - -/* harmony default export */ var Bar = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'bar-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; - } - } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); - }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'bar', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// CONCATENATED MODULE: ./src/BaseCharts/HorizontalBar.js - -/* harmony default export */ var HorizontalBar = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height +// CONCATENATED MODULE: ./src/BaseCharts.js + + +function generateChart(chartId, chartType) { + return { + render: function render(createElement) { + return createElement('div', { + style: this.styles, + class: this.cssClasses + }, [createElement('canvas', { + attrs: { + id: this.chartId, + width: this.width, + height: this.height + }, + ref: 'canvas' + })]); + }, + props: { + chartId: { + default: chartId, + type: String }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'horizontalbar-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; - } - } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); - }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'horizontalBar', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// CONCATENATED MODULE: ./src/BaseCharts/Doughnut.js - -/* harmony default export */ var Doughnut = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height + width: { + default: 400, + type: Number }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'doughnut-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; - } - } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); - }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'doughnut', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// CONCATENATED MODULE: ./src/BaseCharts/Line.js - -/* harmony default export */ var Line = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height + height: { + default: 400, + type: Number }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'line-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; - } - } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); - }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'line', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// CONCATENATED MODULE: ./src/BaseCharts/Pie.js - -/* harmony default export */ var Pie = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height + cssClasses: { + type: String, + default: '' }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'pie-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; - } - } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); - }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'pie', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// CONCATENATED MODULE: ./src/BaseCharts/PolarArea.js - -/* harmony default export */ var PolarArea = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height + styles: { + type: Object }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'polar-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; + plugins: { + type: Array, + default: function _default() { + return []; + } } - } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'polarArea', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// CONCATENATED MODULE: ./src/BaseCharts/Radar.js - -/* harmony default export */ var Radar = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'radar-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; - } - } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); + data: function data() { + return { + _chart: null, + _plugins: this.plugins + }; }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'radar', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// CONCATENATED MODULE: ./src/BaseCharts/Bubble.js - -/* harmony default export */ var Bubble = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height + methods: { + addPlugin: function addPlugin(plugin) { + this.$data._plugins.push(plugin); }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'bubble-chart', - type: String - }, - width: { - default: 400, - type: Number - }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; + renderChart: function renderChart(data, options) { + this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { + type: chartType, + data: data, + options: options, + plugins: this.$data._plugins + }); } - } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); - }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'bubble', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// CONCATENATED MODULE: ./src/BaseCharts/Scatter.js - -/* harmony default export */ var Scatter = ({ - render: function render(createElement) { - return createElement('div', { - style: this.styles, - class: this.cssClasses - }, [createElement('canvas', { - attrs: { - id: this.chartId, - width: this.width, - height: this.height - }, - ref: 'canvas' - })]); - }, - props: { - chartId: { - default: 'scatter-chart', - type: String - }, - width: { - default: 400, - type: Number }, - height: { - default: 400, - type: Number - }, - cssClasses: { - type: String, - default: '' - }, - styles: { - type: Object - }, - plugins: { - type: Array, - default: function _default() { - return []; + beforeDestroy: function beforeDestroy() { + if (this.$data._chart) { + this.$data._chart.destroy(); } } - }, - data: function data() { - return { - _chart: null, - _plugins: this.plugins - }; - }, - methods: { - addPlugin: function addPlugin(plugin) { - this.$data._plugins.push(plugin); - }, - renderChart: function renderChart(data, options) { - this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), { - type: 'scatter', - data: data, - options: options, - plugins: this.$data._plugins - }); - } - }, - beforeDestroy: function beforeDestroy() { - if (this.$data._chart) { - this.$data._chart.destroy(); - } - } -}); -// EXTERNAL MODULE: ./src/mixins/reactiveData.js -var reactiveData = __webpack_require__(2); -var reactiveData_default = /*#__PURE__*/__webpack_require__.n(reactiveData); - -// EXTERNAL MODULE: ./src/mixins/reactiveProp.js -var reactiveProp = __webpack_require__(3); -var reactiveProp_default = /*#__PURE__*/__webpack_require__.n(reactiveProp); - -// CONCATENATED MODULE: ./src/mixins/index.js - - -/* harmony default export */ var mixins = ({ - reactiveData: reactiveData_default.a, - reactiveProp: reactiveProp_default.a + }; +} + +var Bar = generateChart('bar-chart', 'bar'); +var HorizontalBar = generateChart('horizontalbar-chart', 'horizontalBar'); +var Doughnut = generateChart('doughnut-chart', 'doughnut'); +var Line = generateChart('line-chart', 'line'); +var Pie = generateChart('pie-chart', 'pie'); +var PolarArea = generateChart('polar-chart', 'polarArea'); +var Radar = generateChart('radar-chart', 'radar'); +var Bubble = generateChart('bubble-chart', 'bubble'); +var Scatter = generateChart('scatter-chart', 'scatter'); +/* harmony default export */ var BaseCharts = ({ + Bar: Bar, + HorizontalBar: HorizontalBar, + Doughnut: Doughnut, + Line: Line, + Pie: Pie, + PolarArea: PolarArea, + Radar: Radar, + Bubble: Bubble, + Scatter: Scatter }); -// EXTERNAL MODULE: ./package.json -var package_0 = __webpack_require__(4); -var package_default = /*#__PURE__*/__webpack_require__.n(package_0); - // CONCATENATED MODULE: ./src/index.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VueCharts", function() { return VueCharts; }); /* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "Bar", function() { return Bar; }); @@ -741,14 +215,6 @@ var package_default = /*#__PURE__*/__webpack_require__.n(package_0); - - - - - - - - var VueCharts = { version: package_default.a.version, Bar: Bar, @@ -766,7 +232,7 @@ var VueCharts = { /***/ }), -/* 2 */ +/* 1 */ /***/ (function(module, exports) { module.exports = { @@ -837,7 +303,7 @@ module.exports = { }; /***/ }), -/* 3 */ +/* 2 */ /***/ (function(module, exports) { module.exports = { @@ -908,11 +374,17 @@ module.exports = { }; /***/ }), -/* 4 */ +/* 3 */ /***/ (function(module, exports) { module.exports = {"name":"vue-chartjs","version":"3.1.0","description":"Vue.js wrapper for chart.js for creating beautiful charts.","author":"Jakub Juszczak ","homepage":"http://vue-chartjs.org","license":"MIT","contributors":[{"name":"Thorsten Lünborg","web":"https://github.com/LinusBorg"},{"name":"Juan Carlos Alonso","web":"https://github.com/jcalonso"}],"maintainers":[{"name":"Jakub Juszczak","email":"jakub@posteo.de","web":"http://www.jakubjuszczak.de"}],"repository":{"type":"git","url":"git+ssh://git@github.com:apertureless/vue-chartjs.git"},"bugs":{"url":"https://github.com/apertureless/vue-chartjs/issues"},"keywords":["ChartJs","Vue","Visualisation","Wrapper","Charts"],"main":"dist/vue-chartjs.js","unpkg":"dist/vue-chartjs.min.js","module":"es/index.js","jsnext:main":"es/index.js","files":["src","dist","es"],"scripts":{"dev":"node build/dev-server.js","build":"yarn run release && yarn run build:es","build:es":"cross-env BABEL_ENV=es babel src --out-dir es","unit":"karma start test/unit/karma.conf.js --single-run","e2e":"node test/e2e/runner.js","test":"npm run unit","lint":"eslint --ext .js,.vue src test/unit/specs test/e2e/specs","release":"webpack --progress --hide-modules --config ./build/webpack.release.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js","prepublishOnly":"yarn run lint && yarn run test && yarn run build"},"dependencies":{},"peerDependencies":{"chart.js":"2.7.x"},"devDependencies":{"@babel/cli":"^7.0.0-beta.31","@babel/core":"^7.0.0-beta.31","@babel/preset-env":"^7.0.0-beta.31","@babel/preset-stage-2":"^7.0.0-beta.31","babel-loader":"8.0.0-beta.0","chai":"^3.5.0","chart.js":"2.7.0","chromedriver":"^2.28.0","connect-history-api-fallback":"^1.1.0","cross-env":"^5.1.1","cross-spawn":"^5.1.0","css-loader":"^0.28.0","eslint":"^3.19.0","eslint-config-standard":"^10.2.1","eslint-friendly-formatter":"^2.0.7","eslint-loader":"^1.7.1","eslint-plugin-html":"^2.0.1","eslint-plugin-import":"^2.2.0","eslint-plugin-node":"^4.2.2","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","eventsource-polyfill":"^0.9.6","express":"^4.15.2","extract-text-webpack-plugin":"^3.0.1","file-loader":"^0.10.1","friendly-errors-webpack-plugin":"^1.6.1","function-bind":"^1.0.2","html-webpack-plugin":"^2.28.0","http-proxy-middleware":"^0.17.4","inject-loader":"^3.0.0","isparta":"^4.0.0","jasmine-core":"^2.5.2","json-loader":"^0.5.4","karma":"^1.5.0","karma-coverage":"^1.1.1","karma-jasmine":"^1.0.2","karma-mocha":"^1.2.0","karma-phantomjs-launcher":"^1.0.4","karma-phantomjs-shim":"^1.4.0","karma-sinon-chai":"^1.2.0","karma-sourcemap-loader":"^0.3.7","karma-spec-reporter":"0.0.30","karma-webpack":"2","lolex":"^1.6.0","mocha":"^3.1.0","opn":"^5.1.0","ora":"^1.2.0","phantomjs-prebuilt":"^2.1.13","portfinder":"^1.0.13","selenium-server":"^3.3.1","shelljs":"^0.7.7","sinon":"^2.1.0","sinon-chai":"^2.9.0","url-loader":"^0.5.8","vue":"2.5.2","vue-hot-reload-api":"2.1.0","vue-html-loader":"^1.2.4","vue-loader":"^13.3.0","vue-style-loader":"3.0.1","vue-template-compiler":"2.5.2","webpack":"^3.7.1","webpack-dev-middleware":"^1.10.1","webpack-hot-middleware":"^2.17.1","webpack-merge":"^4.1.0"},"engines":{"node":">=6.9.0","npm":">= 3.0.0"},"browserify":{"transform":["babelify"]},"greenkeeper":{"ignore":["extract-text-webpack-plugin","karma-webpack","webpack","webpack-merge"]}} +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_4__; + /***/ }) /******/ ]); }); \ No newline at end of file diff --git a/dist/vue-chartjs.min.js b/dist/vue-chartjs.min.js index 2e48857d..fc4073a0 100644 --- a/dist/vue-chartjs.min.js +++ b/dist/vue-chartjs.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("chart.js")):"function"==typeof define&&define.amd?define("VueChartJs",["chart.js"],e):"object"==typeof exports?exports.VueChartJs=e(require("chart.js")):t.VueChartJs=e(t.Chart)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(s){if(a[s])return a[s].exports;var r=a[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var a={};return e.m=t,e.c=a,e.d=function(t,a,s){e.o(t,a)||Object.defineProperty(t,a,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(a,"a",a),a},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(e,a){e.exports=t},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a(0),r=a.n(s),n={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"bar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"bar",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},i={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"horizontalbar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"horizontalBar",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},u={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"doughnut-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"doughnut",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},h={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"line-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"line",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},d={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"pie-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"pie",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},l={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"polar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"polarArea",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},c={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"radar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"radar",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},o={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"bubble-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"bubble",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},p={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"scatter-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"scatter",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},f=a(2),y=a.n(f),g=a(3),b=a.n(g),m={reactiveData:y.a,reactiveProp:b.a},v=a(4),_=a.n(v);a.d(e,"VueCharts",function(){return w}),a.d(e,"Bar",function(){return n}),a.d(e,"HorizontalBar",function(){return i}),a.d(e,"Doughnut",function(){return u}),a.d(e,"Line",function(){return h}),a.d(e,"Pie",function(){return d}),a.d(e,"PolarArea",function(){return l}),a.d(e,"Radar",function(){return c}),a.d(e,"Bubble",function(){return o}),a.d(e,"Scatter",function(){return p}),a.d(e,"mixins",function(){return m});var w={version:_.a.version,Bar:n,HorizontalBar:i,Doughnut:u,Line:h,Pie:d,PolarArea:l,Radar:c,Bubble:o,Scatter:p,mixins:m};e.default=w},function(t,e){t.exports={data:function(){return{chartData:null}},watch:{chartData:{handler:function(t,e){if(e){var a=this.$data._chart,s=t.datasets.map(function(t){return t.label}),r=e.datasets.map(function(t){return t.label}),n=JSON.stringify(r);JSON.stringify(s)===n&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,s){var r=Object.keys(e.datasets[s]),n=Object.keys(t);r.filter(function(t){return"_meta"!==t&&-1===n.indexOf(t)}).forEach(function(t){delete a.data.datasets[s][t]});for(var i in t)t.hasOwnProperty(i)&&(a.data.datasets[s][i]=t[i])}),t.hasOwnProperty("labels")&&(a.data.labels=t.labels),t.hasOwnProperty("xLabels")&&(a.data.xLabels=t.xLabels),t.hasOwnProperty("yLabels")&&(a.data.yLabels=t.yLabels),a.update()):(a.destroy(),this.renderChart(this.chartData,this.options))}else this.$data._chart&&this.$data._chart.destroy(),this.renderChart(this.chartData,this.options)}}}}},function(t,e){t.exports={props:{chartData:{required:!0}},watch:{chartData:{handler:function(t,e){if(e){var a=this.$data._chart,s=t.datasets.map(function(t){return t.label}),r=e.datasets.map(function(t){return t.label}),n=JSON.stringify(r);JSON.stringify(s)===n&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,s){var r=Object.keys(e.datasets[s]),n=Object.keys(t);r.filter(function(t){return"_meta"!==t&&-1===n.indexOf(t)}).forEach(function(t){delete a.data.datasets[s][t]});for(var i in t)t.hasOwnProperty(i)&&(a.data.datasets[s][i]=t[i])}),t.hasOwnProperty("labels")&&(a.data.labels=t.labels),t.hasOwnProperty("xLabels")&&(a.data.xLabels=t.xLabels),t.hasOwnProperty("yLabels")&&(a.data.yLabels=t.yLabels),a.update()):(a.destroy(),this.renderChart(this.chartData,this.options))}else this.$data._chart&&this.$data._chart.destroy(),this.renderChart(this.chartData,this.options)}}}}},function(t,e){t.exports={name:"vue-chartjs",version:"3.1.0",description:"Vue.js wrapper for chart.js for creating beautiful charts.",author:"Jakub Juszczak ",homepage:"http://vue-chartjs.org",license:"MIT",contributors:[{name:"Thorsten Lünborg",web:"https://github.com/LinusBorg"},{name:"Juan Carlos Alonso",web:"https://github.com/jcalonso"}],maintainers:[{name:"Jakub Juszczak",email:"jakub@posteo.de",web:"http://www.jakubjuszczak.de"}],repository:{type:"git",url:"git+ssh://git@github.com:apertureless/vue-chartjs.git"},bugs:{url:"https://github.com/apertureless/vue-chartjs/issues"},keywords:["ChartJs","Vue","Visualisation","Wrapper","Charts"],main:"dist/vue-chartjs.js",unpkg:"dist/vue-chartjs.min.js",module:"es/index.js","jsnext:main":"es/index.js",files:["src","dist","es"],scripts:{dev:"node build/dev-server.js",build:"yarn run release && yarn run build:es","build:es":"cross-env BABEL_ENV=es babel src --out-dir es",unit:"karma start test/unit/karma.conf.js --single-run",e2e:"node test/e2e/runner.js",test:"npm run unit",lint:"eslint --ext .js,.vue src test/unit/specs test/e2e/specs",release:"webpack --progress --hide-modules --config ./build/webpack.release.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js",prepublishOnly:"yarn run lint && yarn run test && yarn run build"},dependencies:{},peerDependencies:{"chart.js":"2.7.x"},devDependencies:{"@babel/cli":"^7.0.0-beta.31","@babel/core":"^7.0.0-beta.31","@babel/preset-env":"^7.0.0-beta.31","@babel/preset-stage-2":"^7.0.0-beta.31","babel-loader":"8.0.0-beta.0",chai:"^3.5.0","chart.js":"2.7.0",chromedriver:"^2.28.0","connect-history-api-fallback":"^1.1.0","cross-env":"^5.1.1","cross-spawn":"^5.1.0","css-loader":"^0.28.0",eslint:"^3.19.0","eslint-config-standard":"^10.2.1","eslint-friendly-formatter":"^2.0.7","eslint-loader":"^1.7.1","eslint-plugin-html":"^2.0.1","eslint-plugin-import":"^2.2.0","eslint-plugin-node":"^4.2.2","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","eventsource-polyfill":"^0.9.6",express:"^4.15.2","extract-text-webpack-plugin":"^3.0.1","file-loader":"^0.10.1","friendly-errors-webpack-plugin":"^1.6.1","function-bind":"^1.0.2","html-webpack-plugin":"^2.28.0","http-proxy-middleware":"^0.17.4","inject-loader":"^3.0.0",isparta:"^4.0.0","jasmine-core":"^2.5.2","json-loader":"^0.5.4",karma:"^1.5.0","karma-coverage":"^1.1.1","karma-jasmine":"^1.0.2","karma-mocha":"^1.2.0","karma-phantomjs-launcher":"^1.0.4","karma-phantomjs-shim":"^1.4.0","karma-sinon-chai":"^1.2.0","karma-sourcemap-loader":"^0.3.7","karma-spec-reporter":"0.0.30","karma-webpack":"2",lolex:"^1.6.0",mocha:"^3.1.0",opn:"^5.1.0",ora:"^1.2.0","phantomjs-prebuilt":"^2.1.13",portfinder:"^1.0.13","selenium-server":"^3.3.1",shelljs:"^0.7.7",sinon:"^2.1.0","sinon-chai":"^2.9.0","url-loader":"^0.5.8",vue:"2.5.2","vue-hot-reload-api":"2.1.0","vue-html-loader":"^1.2.4","vue-loader":"^13.3.0","vue-style-loader":"3.0.1","vue-template-compiler":"2.5.2",webpack:"^3.7.1","webpack-dev-middleware":"^1.10.1","webpack-hot-middleware":"^2.17.1","webpack-merge":"^4.1.0"},engines:{node:">=6.9.0",npm:">= 3.0.0"},browserify:{transform:["babelify"]},greenkeeper:{ignore:["extract-text-webpack-plugin","karma-webpack","webpack","webpack-merge"]}}}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("chart.js")):"function"==typeof define&&define.amd?define("VueChartJs",["chart.js"],t):"object"==typeof exports?exports.VueChartJs=t(require("chart.js")):e.VueChartJs=t(e.Chart)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(r){if(a[r])return a[r].exports;var s=a[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var a={};return t.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,a){"use strict";function r(e,t){return{render:function(e){return e("div",{style:this.styles,class:this.cssClasses},[e("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:e,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(e){this.$data._plugins.push(e)},renderChart:function(e,a){this.$data._chart=new h.a(this.$refs.canvas.getContext("2d"),{type:t,data:e,options:a,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}}}Object.defineProperty(t,"__esModule",{value:!0});var s=a(1),n=a.n(s),i=a(2),o=a.n(i),u={reactiveData:n.a,reactiveProp:o.a},l=a(3),c=a.n(l),d=a(4),h=a.n(d),p=r("bar-chart","bar"),b=r("horizontalbar-chart","horizontalBar"),f=r("doughnut-chart","doughnut"),m=r("line-chart","line"),y=r("pie-chart","pie"),g=r("polar-chart","polarArea"),j=r("radar-chart","radar"),v=r("bubble-chart","bubble"),k=r("scatter-chart","scatter");a.d(t,"VueCharts",function(){return w}),a.d(t,"Bar",function(){return p}),a.d(t,"HorizontalBar",function(){return b}),a.d(t,"Doughnut",function(){return f}),a.d(t,"Line",function(){return m}),a.d(t,"Pie",function(){return y}),a.d(t,"PolarArea",function(){return g}),a.d(t,"Radar",function(){return j}),a.d(t,"Bubble",function(){return v}),a.d(t,"Scatter",function(){return k}),a.d(t,"mixins",function(){return u});var w={version:c.a.version,Bar:p,HorizontalBar:b,Doughnut:f,Line:m,Pie:y,PolarArea:g,Radar:j,Bubble:v,Scatter:k,mixins:u};t.default=w},function(e,t){e.exports={data:function(){return{chartData:null}},watch:{chartData:{handler:function(e,t){if(t){var a=this.$data._chart,r=e.datasets.map(function(e){return e.label}),s=t.datasets.map(function(e){return e.label}),n=JSON.stringify(s);JSON.stringify(r)===n&&t.datasets.length===e.datasets.length?(e.datasets.forEach(function(e,r){var s=Object.keys(t.datasets[r]),n=Object.keys(e);s.filter(function(e){return"_meta"!==e&&-1===n.indexOf(e)}).forEach(function(e){delete a.data.datasets[r][e]});for(var i in e)e.hasOwnProperty(i)&&(a.data.datasets[r][i]=e[i])}),e.hasOwnProperty("labels")&&(a.data.labels=e.labels),e.hasOwnProperty("xLabels")&&(a.data.xLabels=e.xLabels),e.hasOwnProperty("yLabels")&&(a.data.yLabels=e.yLabels),a.update()):(a.destroy(),this.renderChart(this.chartData,this.options))}else this.$data._chart&&this.$data._chart.destroy(),this.renderChart(this.chartData,this.options)}}}}},function(e,t){e.exports={props:{chartData:{required:!0}},watch:{chartData:{handler:function(e,t){if(t){var a=this.$data._chart,r=e.datasets.map(function(e){return e.label}),s=t.datasets.map(function(e){return e.label}),n=JSON.stringify(s);JSON.stringify(r)===n&&t.datasets.length===e.datasets.length?(e.datasets.forEach(function(e,r){var s=Object.keys(t.datasets[r]),n=Object.keys(e);s.filter(function(e){return"_meta"!==e&&-1===n.indexOf(e)}).forEach(function(e){delete a.data.datasets[r][e]});for(var i in e)e.hasOwnProperty(i)&&(a.data.datasets[r][i]=e[i])}),e.hasOwnProperty("labels")&&(a.data.labels=e.labels),e.hasOwnProperty("xLabels")&&(a.data.xLabels=e.xLabels),e.hasOwnProperty("yLabels")&&(a.data.yLabels=e.yLabels),a.update()):(a.destroy(),this.renderChart(this.chartData,this.options))}else this.$data._chart&&this.$data._chart.destroy(),this.renderChart(this.chartData,this.options)}}}}},function(e,t){e.exports={name:"vue-chartjs",version:"3.1.0",description:"Vue.js wrapper for chart.js for creating beautiful charts.",author:"Jakub Juszczak ",homepage:"http://vue-chartjs.org",license:"MIT",contributors:[{name:"Thorsten Lünborg",web:"https://github.com/LinusBorg"},{name:"Juan Carlos Alonso",web:"https://github.com/jcalonso"}],maintainers:[{name:"Jakub Juszczak",email:"jakub@posteo.de",web:"http://www.jakubjuszczak.de"}],repository:{type:"git",url:"git+ssh://git@github.com:apertureless/vue-chartjs.git"},bugs:{url:"https://github.com/apertureless/vue-chartjs/issues"},keywords:["ChartJs","Vue","Visualisation","Wrapper","Charts"],main:"dist/vue-chartjs.js",unpkg:"dist/vue-chartjs.min.js",module:"es/index.js","jsnext:main":"es/index.js",files:["src","dist","es"],scripts:{dev:"node build/dev-server.js",build:"yarn run release && yarn run build:es","build:es":"cross-env BABEL_ENV=es babel src --out-dir es",unit:"karma start test/unit/karma.conf.js --single-run",e2e:"node test/e2e/runner.js",test:"npm run unit",lint:"eslint --ext .js,.vue src test/unit/specs test/e2e/specs",release:"webpack --progress --hide-modules --config ./build/webpack.release.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js",prepublishOnly:"yarn run lint && yarn run test && yarn run build"},dependencies:{},peerDependencies:{"chart.js":"2.7.x"},devDependencies:{"@babel/cli":"^7.0.0-beta.31","@babel/core":"^7.0.0-beta.31","@babel/preset-env":"^7.0.0-beta.31","@babel/preset-stage-2":"^7.0.0-beta.31","babel-loader":"8.0.0-beta.0",chai:"^3.5.0","chart.js":"2.7.0",chromedriver:"^2.28.0","connect-history-api-fallback":"^1.1.0","cross-env":"^5.1.1","cross-spawn":"^5.1.0","css-loader":"^0.28.0",eslint:"^3.19.0","eslint-config-standard":"^10.2.1","eslint-friendly-formatter":"^2.0.7","eslint-loader":"^1.7.1","eslint-plugin-html":"^2.0.1","eslint-plugin-import":"^2.2.0","eslint-plugin-node":"^4.2.2","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","eventsource-polyfill":"^0.9.6",express:"^4.15.2","extract-text-webpack-plugin":"^3.0.1","file-loader":"^0.10.1","friendly-errors-webpack-plugin":"^1.6.1","function-bind":"^1.0.2","html-webpack-plugin":"^2.28.0","http-proxy-middleware":"^0.17.4","inject-loader":"^3.0.0",isparta:"^4.0.0","jasmine-core":"^2.5.2","json-loader":"^0.5.4",karma:"^1.5.0","karma-coverage":"^1.1.1","karma-jasmine":"^1.0.2","karma-mocha":"^1.2.0","karma-phantomjs-launcher":"^1.0.4","karma-phantomjs-shim":"^1.4.0","karma-sinon-chai":"^1.2.0","karma-sourcemap-loader":"^0.3.7","karma-spec-reporter":"0.0.30","karma-webpack":"2",lolex:"^1.6.0",mocha:"^3.1.0",opn:"^5.1.0",ora:"^1.2.0","phantomjs-prebuilt":"^2.1.13",portfinder:"^1.0.13","selenium-server":"^3.3.1",shelljs:"^0.7.7",sinon:"^2.1.0","sinon-chai":"^2.9.0","url-loader":"^0.5.8",vue:"2.5.2","vue-hot-reload-api":"2.1.0","vue-html-loader":"^1.2.4","vue-loader":"^13.3.0","vue-style-loader":"3.0.1","vue-template-compiler":"2.5.2",webpack:"^3.7.1","webpack-dev-middleware":"^1.10.1","webpack-hot-middleware":"^2.17.1","webpack-merge":"^4.1.0"},engines:{node:">=6.9.0",npm:">= 3.0.0"},browserify:{transform:["babelify"]},greenkeeper:{ignore:["extract-text-webpack-plugin","karma-webpack","webpack","webpack-merge"]}}},function(t,a){t.exports=e}])}); \ No newline at end of file