diff --git a/.babelrc b/.babelrc
index 26b35ea7..cee89e82 100644
--- a/.babelrc
+++ b/.babelrc
@@ -8,7 +8,7 @@
]
}
}],
- "@babel/stage-2"
+ ["@babel/stage-2",{"decoratorsLegacy":true}]
],
"comments": false
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e47865e7..23f38c14 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,16 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+## [3.3.1](https://github.com/apertureless/vue-chartjs/compare/v3.3.0...v3.3.1) (2018-03-26)
+
+
+### Bug Fixes
+
+* **release:** Add exports to index ([8341f94](https://github.com/apertureless/vue-chartjs/commit/8341f94))
+
+
+
# [3.3.0](https://github.com/apertureless/vue-chartjs/compare/v3.2.1...v3.3.0) (2018-03-23)
diff --git a/dist/vue-chartjs.js b/dist/vue-chartjs.js
index 9a96b9d0..db038f3d 100644
--- a/dist/vue-chartjs.js
+++ b/dist/vue-chartjs.js
@@ -92,6 +92,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Bubble", function() { return __WEBPACK_IMPORTED_MODULE_1__BaseCharts__["b"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Scatter", function() { return __WEBPACK_IMPORTED_MODULE_1__BaseCharts__["i"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mixins", function() { return __WEBPACK_IMPORTED_MODULE_0__mixins_index_js__["a"]; });
+/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "generateChart", function() { return __WEBPACK_IMPORTED_MODULE_1__BaseCharts__["j"]; });
var VueCharts = {
@@ -104,7 +105,8 @@ var VueCharts = {
Radar: __WEBPACK_IMPORTED_MODULE_1__BaseCharts__["h" /* Radar */],
Bubble: __WEBPACK_IMPORTED_MODULE_1__BaseCharts__["b" /* Bubble */],
Scatter: __WEBPACK_IMPORTED_MODULE_1__BaseCharts__["i" /* Scatter */],
- mixins: __WEBPACK_IMPORTED_MODULE_0__mixins_index_js__["a" /* default */]
+ mixins: __WEBPACK_IMPORTED_MODULE_0__mixins_index_js__["a" /* default */],
+ generateChart: __WEBPACK_IMPORTED_MODULE_1__BaseCharts__["j" /* generateChart */]
};
/* harmony default export */ __webpack_exports__["default"] = (VueCharts);
@@ -202,7 +204,7 @@ var reactiveProp = {
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
-/* unused harmony export generateChart */
+/* harmony export (immutable) */ __webpack_exports__["j"] = generateChart;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Bar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return HorizontalBar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return Doughnut; });
diff --git a/dist/vue-chartjs.js.map b/dist/vue-chartjs.js.map
index 0996b262..4e482b31 100644
--- a/dist/vue-chartjs.js.map
+++ b/dist/vue-chartjs.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 4fca1eee413f493dd7dd","webpack:///./src/index.js","webpack:///./src/mixins/index.js","webpack:///./src/BaseCharts.js","webpack:///external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}"],"names":["VueCharts","Bar","HorizontalBar","Doughnut","Line","Pie","PolarArea","Radar","Bubble","Scatter","mixins","dataHandler","newData","oldData","chart","$data","_chart","newDatasetLabels","datasets","map","dataset","label","oldDatasetLabels","oldLabels","JSON","stringify","newLabels","length","forEach","i","oldDatasetKeys","Object","keys","newDatasetKeys","deletionKeys","filter","key","indexOf","deletionKey","data","attribute","hasOwnProperty","labels","xLabels","yLabels","update","destroy","renderChart","chartData","options","reactiveData","watch","reactiveProp","props","required","generateChart","chartId","chartType","render","createElement","style","styles","class","cssClasses","attrs","id","width","height","ref","default","type","String","Number","plugins","Array","_plugins","methods","addPlugin","plugin","push","$refs","canvas","getContext","beforeDestroy"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;AC7DA;AAEA;AAYA,IAAMA,YAAY;AAChBC,OAAA,wDADgB;AAEhBC,iBAAA,kEAFgB;AAGhBC,YAAA,6DAHgB;AAIhBC,QAAA,yDAJgB;AAKhBC,OAAA,wDALgB;AAMhBC,aAAA,8DANgB;AAOhBC,SAAA,0DAPgB;AAQhBC,UAAA,2DARgB;AAShBC,WAAA,4DATgB;AAUhBC,UAAA,iEAAAA;AAVgB,CAAlB;AAaA,+DAAeV,SAAf;;;;;;;;;AC3BA;AAAA,SAASW,WAAT,CAAsBC,OAAtB,EAA+BC,OAA/B,EAAwC;AACtC,MAAIA,OAAJ,EAAa;AACX,QAAIC,QAAQ,KAAKC,KAAL,CAAWC,MAAvB;AAGA,QAAIC,mBAAmBL,QAAQM,QAAR,CAAiBC,GAAjB,CAAqB,UAACC,OAAD,EAAa;AACvD,aAAOA,QAAQC,KAAf;AACD,KAFsB,CAAvB;AAIA,QAAIC,mBAAmBT,QAAQK,QAAR,CAAiBC,GAAjB,CAAqB,UAACC,OAAD,EAAa;AACvD,aAAOA,QAAQC,KAAf;AACD,KAFsB,CAAvB;AAKA,QAAME,YAAYC,KAAKC,SAAL,CAAeH,gB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AACA,IAAMjD,YAAYiD,cAAc,aAAd,EAA6B,WAA7B,CAAlB;AACA,IAAMhD,QAAQgD,cAAc,aAAd,EAA6B,OAA7B,CAAd;AACA,IAAM/C,SAAS+C,cAAc,cAAd,EAA8B,QAA9B,CAAf;AACA,IAAM9C,UAAU8C,cAAc,eAAd,EAA+B,SAA/B,CAAhB;AAEP,0EAAe;AACbtD,UADa;AAEbC,8BAFa;AAGbC,oBAHa;AAIbC,YAJa;AAKbC,UALa;AAMbC,sBANa;AAObC,cAPa;AAQbC,gBARa;AASbC;AATa,CAAf,E;;;;;;AC7FA,+C","file":"./dist/vue-chartjs.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"chart.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VueChartJs\", [\"chart.js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueChartJs\"] = factory(require(\"chart.js\"));\n\telse\n\t\troot[\"VueChartJs\"] = factory(root[\"Chart\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4fca1eee413f493dd7dd","import mixins from './mixins/index.js'\n\nimport {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter\n} from './BaseCharts'\n\nconst VueCharts = {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n mixins\n}\n\nexport default VueCharts\n\nexport {\n VueCharts,\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n mixins\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","function dataHandler (newData, oldData) {\n if (oldData) {\n let chart = this.$data._chart\n\n // Get new and old DataSet Labels\n let newDatasetLabels = newData.datasets.map((dataset) => {\n return dataset.label\n })\n\n let oldDatasetLabels = oldData.datasets.map((dataset) => {\n return dataset.label\n })\n\n // Stringify 'em for easier compare\n const oldLabels = JSON.stringify(oldDatasetLabels)\n const newLabels = JSON.stringify(newDatasetLabels)\n\n // Check if Labels are equal and if dataset length is equal\n if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) {\n newData.datasets.forEach((dataset, i) => {\n // Get new and old dataset keys\n const oldDatasetKeys = Object.keys(oldData.datasets[i])\n const newDatasetKeys = Object.keys(dataset)\n\n // Get keys that aren't present in the new data\n const deletionKeys = oldDatasetKeys.filter((key) => {\n return key !== '_meta' && newDatasetKeys.indexOf(key) === -1\n })\n\n // Remove outdated key-value pairs\n deletionKeys.forEach((deletionKey) => {\n delete chart.data.datasets[i][deletionKey]\n })\n\n // Update attributes individually to avoid re-rendering the entire chart\n for (const attribute in dataset) {\n if (dataset.hasOwnProperty(attribute)) {\n chart.data.datasets[i][attribute] = dataset[attribute]\n }\n }\n })\n\n if (newData.hasOwnProperty('labels')) {\n chart.data.labels = newData.labels\n }\n if (newData.hasOwnProperty('xLabels')) {\n chart.data.xLabels = newData.xLabels\n }\n if (newData.hasOwnProperty('yLabels')) {\n chart.data.yLabels = newData.yLabels\n }\n chart.update()\n } else {\n chart.destroy()\n this.renderChart(this.chartData, this.options)\n }\n } else {\n if (this.$data._chart) {\n this.$data._chart.destroy()\n }\n this.renderChart(this.chartData, this.options)\n }\n}\n\nexport const reactiveData = {\n data () {\n return {\n chartData: null\n }\n },\n\n watch: {\n 'chartData': dataHandler\n }\n}\n\nexport const reactiveProp = {\n props: {\n chartData: {\n required: true\n }\n },\n watch: {\n 'chartData': dataHandler\n }\n}\n\nexport default {\n reactiveData,\n reactiveProp\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/index.js","import Chart from 'chart.js'\n\nexport function generateChart (chartId, chartType) {\n return {\n render: function (createElement) {\n return createElement(\n 'div', {\n style: this.styles,\n class: this.cssClasses\n },\n [\n createElement(\n 'canvas', {\n attrs: {\n id: this.chartId,\n width: this.width,\n height: this.height\n },\n ref: 'canvas'\n }\n )\n ]\n )\n },\n\n props: {\n chartId: {\n default: chartId,\n type: String\n },\n width: {\n default: 400,\n type: Number\n },\n height: {\n default: 400,\n type: Number\n },\n cssClasses: {\n type: String,\n default: ''\n },\n styles: {\n type: Object\n },\n plugins: {\n type: Array,\n default () {\n return []\n }\n }\n },\n\n data () {\n return {\n _chart: null,\n _plugins: this.plugins\n }\n },\n\n methods: {\n addPlugin (plugin) {\n this.$data._plugins.push(plugin)\n },\n renderChart (data, options) {\n this.$data._chart = new Chart(\n this.$refs.canvas.getContext('2d'), {\n type: chartType,\n data: data,\n options: options,\n plugins: this.$data._plugins\n }\n )\n }\n },\n beforeDestroy () {\n if (this.$data._chart) {\n this.$data._chart.destroy()\n }\n }\n }\n}\n\nexport const Bar = generateChart('bar-chart', 'bar')\nexport const HorizontalBar = generateChart('horizontalbar-chart', 'horizontalBar')\nexport const Doughnut = generateChart('doughnut-chart', 'doughnut')\nexport const Line = generateChart('line-chart', 'line')\nexport const Pie = generateChart('pie-chart', 'pie')\nexport const PolarArea = generateChart('polar-chart', 'polarArea')\nexport const Radar = generateChart('radar-chart', 'radar')\nexport const Bubble = generateChart('bubble-chart', 'bubble')\nexport const Scatter = generateChart('scatter-chart', 'scatter')\n\nexport default {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/BaseCharts.js","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}\n// module id = 3\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap aeaf28a76f74cf1e068a","webpack:///./src/index.js","webpack:///./src/mixins/index.js","webpack:///./src/BaseCharts.js","webpack:///external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}"],"names":["VueCharts","Bar","HorizontalBar","Doughnut","Line","Pie","PolarArea","Radar","Bubble","Scatter","mixins","generateChart","dataHandler","newData","oldData","chart","$data","_chart","newDatasetLabels","datasets","map","dataset","label","oldDatasetLabels","oldLabels","JSON","stringify","newLabels","length","forEach","i","oldDatasetKeys","Object","keys","newDatasetKeys","deletionKeys","filter","key","indexOf","deletionKey","data","attribute","hasOwnProperty","labels","xLabels","yLabels","update","destroy","renderChart","chartData","options","reactiveData","watch","reactiveProp","props","required","chartId","chartType","render","createElement","style","styles","class","cssClasses","attrs","id","width","height","ref","default","type","String","Number","plugins","Array","_plugins","methods","addPlugin","plugin","push","$refs","canvas","getContext","beforeDestroy"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;AC7DA;AAEA;AAaA,IAAMA,YAAY;AAChBC,OAAA,wDADgB;AAEhBC,iBAAA,kEAFgB;AAGhBC,YAAA,6DAHgB;AAIhBC,QAAA,yDAJgB;AAKhBC,OAAA,wDALgB;AAMhBC,aAAA,8DANgB;AAOhBC,SAAA,0DAPgB;AAQhBC,UAAA,2DARgB;AAShBC,WAAA,4DATgB;AAUhBC,UAAA,iEAVgB;AAWhBC,iBAAA,kEAAAA;AAXgB,CAAlB;+DAceX,SAAf;;;;;;;;;AC7BA;AAAA,SAASY,WAAT,CAAsBC,OAAtB,EAA+BC,OAA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WC,MAAf,EAAuB;AACrB,aAAKD,KAAL,CAAWC,MAAX,CAAkB8B,OAAlB;AACD;AACF;AA5EI,GAAP;AA8ED;AAEM,IAAM9C,MAAMU,cAAc,WAAd,EAA2B,KAA3B,CAAZ;AACA,IAAMT,gBAAgBS,cAAc,qBAAd,EAAqC,eAArC,CAAtB;AACA,IAAMR,WAAWQ,cAAc,gBAAd,EAAgC,UAAhC,CAAjB;AACA,IAAMP,OAAOO,cAAc,YAAd,EAA4B,MAA5B,CAAb;AACA,IAAMN,MAAMM,cAAc,WAAd,EAA2B,KAA3B,CAAZ;AACA,IAAML,YAAYK,cAAc,aAAd,EAA6B,WAA7B,CAAlB;AACA,IAAMJ,QAAQI,cAAc,aAAd,EAA6B,OAA7B,CAAd;AACA,IAAMH,SAASG,cAAc,cAAd,EAA8B,QAA9B,CAAf;AACA,IAAMF,UAAUE,cAAc,eAAd,EAA+B,SAA/B,CAAhB;AAEP,0EAAe;AACbV,UADa;AAEbC,8BAFa;AAGbC,oBAHa;AAIbC,YAJa;AAKbC,UALa;AAMbC,sBANa;AAObC,cAPa;AAQbC,gBARa;AASbC;AATa,CAAf,E;;;;;;AC7FA,+C","file":"./dist/vue-chartjs.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"chart.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VueChartJs\", [\"chart.js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueChartJs\"] = factory(require(\"chart.js\"));\n\telse\n\t\troot[\"VueChartJs\"] = factory(root[\"Chart\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap aeaf28a76f74cf1e068a","import mixins from './mixins/index.js'\n\nimport {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n generateChart\n} from './BaseCharts'\n\nconst VueCharts = {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n mixins,\n generateChart\n}\n\nexport default VueCharts\n\nexport {\n VueCharts,\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n mixins,\n generateChart\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","function dataHandler (newData, oldData) {\n if (oldData) {\n let chart = this.$data._chart\n\n // Get new and old DataSet Labels\n let newDatasetLabels = newData.datasets.map((dataset) => {\n return dataset.label\n })\n\n let oldDatasetLabels = oldData.datasets.map((dataset) => {\n return dataset.label\n })\n\n // Stringify 'em for easier compare\n const oldLabels = JSON.stringify(oldDatasetLabels)\n const newLabels = JSON.stringify(newDatasetLabels)\n\n // Check if Labels are equal and if dataset length is equal\n if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) {\n newData.datasets.forEach((dataset, i) => {\n // Get new and old dataset keys\n const oldDatasetKeys = Object.keys(oldData.datasets[i])\n const newDatasetKeys = Object.keys(dataset)\n\n // Get keys that aren't present in the new data\n const deletionKeys = oldDatasetKeys.filter((key) => {\n return key !== '_meta' && newDatasetKeys.indexOf(key) === -1\n })\n\n // Remove outdated key-value pairs\n deletionKeys.forEach((deletionKey) => {\n delete chart.data.datasets[i][deletionKey]\n })\n\n // Update attributes individually to avoid re-rendering the entire chart\n for (const attribute in dataset) {\n if (dataset.hasOwnProperty(attribute)) {\n chart.data.datasets[i][attribute] = dataset[attribute]\n }\n }\n })\n\n if (newData.hasOwnProperty('labels')) {\n chart.data.labels = newData.labels\n }\n if (newData.hasOwnProperty('xLabels')) {\n chart.data.xLabels = newData.xLabels\n }\n if (newData.hasOwnProperty('yLabels')) {\n chart.data.yLabels = newData.yLabels\n }\n chart.update()\n } else {\n chart.destroy()\n this.renderChart(this.chartData, this.options)\n }\n } else {\n if (this.$data._chart) {\n this.$data._chart.destroy()\n }\n this.renderChart(this.chartData, this.options)\n }\n}\n\nexport const reactiveData = {\n data () {\n return {\n chartData: null\n }\n },\n\n watch: {\n 'chartData': dataHandler\n }\n}\n\nexport const reactiveProp = {\n props: {\n chartData: {\n required: true\n }\n },\n watch: {\n 'chartData': dataHandler\n }\n}\n\nexport default {\n reactiveData,\n reactiveProp\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/index.js","import Chart from 'chart.js'\n\nexport function generateChart (chartId, chartType) {\n return {\n render: function (createElement) {\n return createElement(\n 'div', {\n style: this.styles,\n class: this.cssClasses\n },\n [\n createElement(\n 'canvas', {\n attrs: {\n id: this.chartId,\n width: this.width,\n height: this.height\n },\n ref: 'canvas'\n }\n )\n ]\n )\n },\n\n props: {\n chartId: {\n default: chartId,\n type: String\n },\n width: {\n default: 400,\n type: Number\n },\n height: {\n default: 400,\n type: Number\n },\n cssClasses: {\n type: String,\n default: ''\n },\n styles: {\n type: Object\n },\n plugins: {\n type: Array,\n default () {\n return []\n }\n }\n },\n\n data () {\n return {\n _chart: null,\n _plugins: this.plugins\n }\n },\n\n methods: {\n addPlugin (plugin) {\n this.$data._plugins.push(plugin)\n },\n renderChart (data, options) {\n this.$data._chart = new Chart(\n this.$refs.canvas.getContext('2d'), {\n type: chartType,\n data: data,\n options: options,\n plugins: this.$data._plugins\n }\n )\n }\n },\n beforeDestroy () {\n if (this.$data._chart) {\n this.$data._chart.destroy()\n }\n }\n }\n}\n\nexport const Bar = generateChart('bar-chart', 'bar')\nexport const HorizontalBar = generateChart('horizontalbar-chart', 'horizontalBar')\nexport const Doughnut = generateChart('doughnut-chart', 'doughnut')\nexport const Line = generateChart('line-chart', 'line')\nexport const Pie = generateChart('pie-chart', 'pie')\nexport const PolarArea = generateChart('polar-chart', 'polarArea')\nexport const Radar = generateChart('radar-chart', 'radar')\nexport const Bubble = generateChart('bubble-chart', 'bubble')\nexport const Scatter = generateChart('scatter-chart', 'scatter')\n\nexport default {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/BaseCharts.js","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}\n// module id = 3\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/vue-chartjs.min.js b/dist/vue-chartjs.min.js
index bd481f10..3677467d 100644
--- a/dist/vue-chartjs.min.js
+++ b/dist/vue-chartjs.min.js
@@ -1,2 +1,2 @@
-!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(a){if(r[a])return r[a].exports;var n=r[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,a){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,r){"use strict";function a(t,e){if(e){var r=this.$data._chart,a=t.datasets.map(function(t){return t.label}),n=e.datasets.map(function(t){return t.label}),s=JSON.stringify(n);JSON.stringify(a)===s&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,a){var n=Object.keys(e.datasets[a]),s=Object.keys(t);n.filter(function(t){return"_meta"!==t&&-1===s.indexOf(t)}).forEach(function(t){delete r.data.datasets[a][t]});for(var i in t)t.hasOwnProperty(i)&&(r.data.datasets[a][i]=t[i])}),t.hasOwnProperty("labels")&&(r.data.labels=t.labels),t.hasOwnProperty("xLabels")&&(r.data.xLabels=t.xLabels),t.hasOwnProperty("yLabels")&&(r.data.yLabels=t.yLabels),r.update()):(r.destroy(),this.renderChart(this.chartData,this.options))}else this.$data._chart&&this.$data._chart.destroy(),this.renderChart(this.chartData,this.options)}function n(t,e){return{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:t,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,r){this.$data._chart=new c.a(this.$refs.canvas.getContext("2d"),{type:e,data:t,options:r,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}}}Object.defineProperty(e,"__esModule",{value:!0});var s={data:function(){return{chartData:null}},watch:{chartData:a}},i={props:{chartData:{required:!0}},watch:{chartData:a}},u={reactiveData:s,reactiveProp:i},o=r(1),c=r.n(o),h=n("bar-chart","bar"),d=n("horizontalbar-chart","horizontalBar"),l=n("doughnut-chart","doughnut"),f=n("line-chart","line"),p=n("pie-chart","pie"),b=n("polar-chart","polarArea"),y=n("radar-chart","radar"),g=n("bubble-chart","bubble"),x=n("scatter-chart","scatter");r.d(e,"VueCharts",function(){return v}),r.d(e,"Bar",function(){return h}),r.d(e,"HorizontalBar",function(){return d}),r.d(e,"Doughnut",function(){return l}),r.d(e,"Line",function(){return f}),r.d(e,"Pie",function(){return p}),r.d(e,"PolarArea",function(){return b}),r.d(e,"Radar",function(){return y}),r.d(e,"Bubble",function(){return g}),r.d(e,"Scatter",function(){return x}),r.d(e,"mixins",function(){return u});var v={Bar:h,HorizontalBar:d,Doughnut:l,Line:f,Pie:p,PolarArea:b,Radar:y,Bubble:g,Scatter:x,mixins:u};e.default=v},function(e,r){e.exports=t}])});
+!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(a){if(r[a])return r[a].exports;var n=r[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,a){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,r){"use strict";function a(t,e){if(e){var r=this.$data._chart,a=t.datasets.map(function(t){return t.label}),n=e.datasets.map(function(t){return t.label}),s=JSON.stringify(n);JSON.stringify(a)===s&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,a){var n=Object.keys(e.datasets[a]),s=Object.keys(t);n.filter(function(t){return"_meta"!==t&&-1===s.indexOf(t)}).forEach(function(t){delete r.data.datasets[a][t]});for(var i in t)t.hasOwnProperty(i)&&(r.data.datasets[a][i]=t[i])}),t.hasOwnProperty("labels")&&(r.data.labels=t.labels),t.hasOwnProperty("xLabels")&&(r.data.xLabels=t.xLabels),t.hasOwnProperty("yLabels")&&(r.data.yLabels=t.yLabels),r.update()):(r.destroy(),this.renderChart(this.chartData,this.options))}else this.$data._chart&&this.$data._chart.destroy(),this.renderChart(this.chartData,this.options)}function n(t,e){return{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:t,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,r){this.$data._chart=new c.a(this.$refs.canvas.getContext("2d"),{type:e,data:t,options:r,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}}}Object.defineProperty(e,"__esModule",{value:!0});var s={data:function(){return{chartData:null}},watch:{chartData:a}},i={props:{chartData:{required:!0}},watch:{chartData:a}},u={reactiveData:s,reactiveProp:i},o=r(1),c=r.n(o),h=n("bar-chart","bar"),d=n("horizontalbar-chart","horizontalBar"),l=n("doughnut-chart","doughnut"),f=n("line-chart","line"),p=n("pie-chart","pie"),b=n("polar-chart","polarArea"),y=n("radar-chart","radar"),g=n("bubble-chart","bubble"),x=n("scatter-chart","scatter");r.d(e,"VueCharts",function(){return v}),r.d(e,"Bar",function(){return h}),r.d(e,"HorizontalBar",function(){return d}),r.d(e,"Doughnut",function(){return l}),r.d(e,"Line",function(){return f}),r.d(e,"Pie",function(){return p}),r.d(e,"PolarArea",function(){return b}),r.d(e,"Radar",function(){return y}),r.d(e,"Bubble",function(){return g}),r.d(e,"Scatter",function(){return x}),r.d(e,"mixins",function(){return u}),r.d(e,"generateChart",function(){return n});var v={Bar:h,HorizontalBar:d,Doughnut:l,Line:f,Pie:p,PolarArea:b,Radar:y,Bubble:g,Scatter:x,mixins:u,generateChart:n};e.default=v},function(e,r){e.exports=t}])});
//# sourceMappingURL=vue-chartjs.min.js.map
\ No newline at end of file
diff --git a/dist/vue-chartjs.min.js.map b/dist/vue-chartjs.min.js.map
index b2568a21..f1bbbb8f 100644
--- a/dist/vue-chartjs.min.js.map
+++ b/dist/vue-chartjs.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///dist/vue-chartjs.min.js","webpack:///webpack/bootstrap 67a9b562bb0c3d81fd64","webpack:///./src/mixins/index.js","webpack:///./src/BaseCharts.js","webpack:///./src/index.js","webpack:///external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE_1__","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","dataHandler","newData","oldData","chart","$data","_chart","newDatasetLabels","datasets","map","dataset","label","oldDatasetLabels","oldLabels","JSON","stringify","length","forEach","oldDatasetKeys","keys","newDatasetKeys","filter","key","indexOf","deletionKey","data","attribute","labels","xLabels","yLabels","update","destroy","renderChart","chartData","options","generateChart","chartId","chartType","render","createElement","style","styles","class","cssClasses","attrs","id","width","height","ref","props","default","type","String","Number","plugins","Array","_plugins","methods","addPlugin","plugin","push","external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default","a","$refs","canvas","getContext","beforeDestroy","value","reactiveData","watch","reactiveProp","required","mixins","external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js__","Bar","HorizontalBar","Doughnut","Line","Pie","PolarArea","Radar","Bubble","Scatter","VueCharts"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,aACA,kBAAAC,gBAAAC,IACAD,OAAA,0BAAAJ,GACA,gBAAAC,SACAA,QAAA,WAAAD,EAAAG,QAAA,aAEAJ,EAAA,WAAAC,EAAAD,EAAA,QACC,mBAAAO,WAAAC,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAV,OAGA,IAAAC,GAAAU,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAb,WAUA,OANAQ,GAAAE,GAAAI,KAAAb,EAAAD,QAAAC,IAAAD,QAAAS,GAGAR,EAAAY,GAAA,EAGAZ,EAAAD,QAvBA,GAAAW,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAjB,EAAAkB,EAAAC,GACAV,EAAAW,EAAApB,EAAAkB,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,gBF2EEG,EAA0FlG,EAAoB,GAC9GsF,EAA+GtF,EAAoBiB,EAAEiF,GGlF5HC,EAAMvC,EAAc,YAAa,OACjCwC,EAAgBxC,EAAc,sBAAuB,iBACrDyC,EAAWzC,EAAc,iBAAkB,YAC3C0C,EAAO1C,EAAc,aAAc,QACnC2C,EAAM3C,EAAc,YAAa,OACjC4C,EAAY5C,EAAc,cAAe,aACzC6C,EAAQ7C,EAAc,cAAe,SACrC8C,EAAS9C,EAAc,eAAgB,UACvC+C,EAAU/C,EAAc,gBAAiB,UHuKvB5D,GAAoBQ,EAAEiB,EAAqB,YAAa,WAAa,MAAOmF,KAC5E5G,EAAoBQ,EAAEiB,EAAqB,MAAO,WAAa,MAAO0E,KACtEnG,EAAoBQ,EAAEiB,EAAqB,gBAAiB,WAAa,MAAO2E,KAChFpG,EAAoBQ,EAAEiB,EAAqB,WAAY,WAAa,MAAO4E,KAC3ErG,EAAoBQ,EAAEiB,EAAqB,OAAQ,WAAa,MAAO6E,KACvEtG,EAAoBQ,EAAEiB,EAAqB,MAAO,WAAa,MAAO8E,KACtEvG,EAAoBQ,EAAEiB,EAAqB,YAAa,WAAa,MAAO+E,KAC5ExG,EAAoBQ,EAAEiB,EAAqB,QAAS,WAAa,MAAOgF,KACxEzG,EAAoBQ,EAAEiB,EAAqB,SAAU,WAAa,MAAOiF,KACzE1G,EAAoBQ,EAAEiB,EAAqB,UAAW,WAAa,MAAOkF,KAC1E3G,EAAoBQ,EAAEiB,EAAqB,SAAU,WAAa,MAAOwE,II9PxG,IAAMW,IACJT,MACAC,gBACAC,WACAC,OACAC,MACAC,YACAC,QACAC,SACAC,UACAV,SAGFxE,GAAA,WJqQM,SAAUjC,EAAQD,GKhSxBC,EAAAD,QAAAO","file":"./dist/vue-chartjs.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"chart.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VueChartJs\", [\"chart.js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueChartJs\"] = factory(require(\"chart.js\"));\n\telse\n\t\troot[\"VueChartJs\"] = factory(root[\"Chart\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"chart.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VueChartJs\", [\"chart.js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueChartJs\"] = factory(require(\"chart.js\"));\n\telse\n\t\troot[\"VueChartJs\"] = factory(root[\"Chart\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n\n// CONCATENATED MODULE: ./src/mixins/index.js\nfunction dataHandler(newData, oldData) {\n if (oldData) {\n var chart = this.$data._chart;\n var newDatasetLabels = newData.datasets.map(function (dataset) {\n return dataset.label;\n });\n var oldDatasetLabels = oldData.datasets.map(function (dataset) {\n return dataset.label;\n });\n var oldLabels = JSON.stringify(oldDatasetLabels);\n var newLabels = JSON.stringify(newDatasetLabels);\n\n if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) {\n newData.datasets.forEach(function (dataset, i) {\n var oldDatasetKeys = Object.keys(oldData.datasets[i]);\n var newDatasetKeys = Object.keys(dataset);\n var deletionKeys = oldDatasetKeys.filter(function (key) {\n return key !== '_meta' && newDatasetKeys.indexOf(key) === -1;\n });\n deletionKeys.forEach(function (deletionKey) {\n delete chart.data.datasets[i][deletionKey];\n });\n\n for (var attribute in dataset) {\n if (dataset.hasOwnProperty(attribute)) {\n chart.data.datasets[i][attribute] = dataset[attribute];\n }\n }\n });\n\n if (newData.hasOwnProperty('labels')) {\n chart.data.labels = newData.labels;\n }\n\n if (newData.hasOwnProperty('xLabels')) {\n chart.data.xLabels = newData.xLabels;\n }\n\n if (newData.hasOwnProperty('yLabels')) {\n chart.data.yLabels = newData.yLabels;\n }\n\n chart.update();\n } else {\n chart.destroy();\n this.renderChart(this.chartData, this.options);\n }\n } else {\n if (this.$data._chart) {\n this.$data._chart.destroy();\n }\n\n this.renderChart(this.chartData, this.options);\n }\n}\n\nvar reactiveData = {\n data: function data() {\n return {\n chartData: null\n };\n },\n watch: {\n 'chartData': dataHandler\n }\n};\nvar reactiveProp = {\n props: {\n chartData: {\n required: true\n }\n },\n watch: {\n 'chartData': dataHandler\n }\n};\n/* harmony default export */ var mixins = ({\n reactiveData: reactiveData,\n reactiveProp: reactiveProp\n});\n// EXTERNAL MODULE: external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}\nvar external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js__ = __webpack_require__(1);\nvar 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__);\n\n// CONCATENATED MODULE: ./src/BaseCharts.js\n\nfunction generateChart(chartId, chartType) {\n return {\n render: function render(createElement) {\n return createElement('div', {\n style: this.styles,\n class: this.cssClasses\n }, [createElement('canvas', {\n attrs: {\n id: this.chartId,\n width: this.width,\n height: this.height\n },\n ref: 'canvas'\n })]);\n },\n props: {\n chartId: {\n default: chartId,\n type: String\n },\n width: {\n default: 400,\n type: Number\n },\n height: {\n default: 400,\n type: Number\n },\n cssClasses: {\n type: String,\n default: ''\n },\n styles: {\n type: Object\n },\n plugins: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n },\n data: function data() {\n return {\n _chart: null,\n _plugins: this.plugins\n };\n },\n methods: {\n addPlugin: function addPlugin(plugin) {\n this.$data._plugins.push(plugin);\n },\n renderChart: function renderChart(data, options) {\n this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), {\n type: chartType,\n data: data,\n options: options,\n plugins: this.$data._plugins\n });\n }\n },\n beforeDestroy: function beforeDestroy() {\n if (this.$data._chart) {\n this.$data._chart.destroy();\n }\n }\n };\n}\nvar Bar = generateChart('bar-chart', 'bar');\nvar HorizontalBar = generateChart('horizontalbar-chart', 'horizontalBar');\nvar Doughnut = generateChart('doughnut-chart', 'doughnut');\nvar Line = generateChart('line-chart', 'line');\nvar Pie = generateChart('pie-chart', 'pie');\nvar PolarArea = generateChart('polar-chart', 'polarArea');\nvar Radar = generateChart('radar-chart', 'radar');\nvar Bubble = generateChart('bubble-chart', 'bubble');\nvar Scatter = generateChart('scatter-chart', 'scatter');\n/* harmony default export */ var BaseCharts = ({\n Bar: Bar,\n HorizontalBar: HorizontalBar,\n Doughnut: Doughnut,\n Line: Line,\n Pie: Pie,\n PolarArea: PolarArea,\n Radar: Radar,\n Bubble: Bubble,\n Scatter: Scatter\n});\n// CONCATENATED MODULE: ./src/index.js\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VueCharts\", function() { return VueCharts; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Bar\", function() { return Bar; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"HorizontalBar\", function() { return HorizontalBar; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Doughnut\", function() { return Doughnut; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Line\", function() { return Line; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Pie\", function() { return Pie; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"PolarArea\", function() { return PolarArea; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Radar\", function() { return Radar; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Bubble\", function() { return Bubble; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Scatter\", function() { return Scatter; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"mixins\", function() { return mixins; });\n\n\nvar VueCharts = {\n Bar: Bar,\n HorizontalBar: HorizontalBar,\n Doughnut: Doughnut,\n Line: Line,\n Pie: Pie,\n PolarArea: PolarArea,\n Radar: Radar,\n Bubble: Bubble,\n Scatter: Scatter,\n mixins: mixins\n};\n/* harmony default export */ var src = __webpack_exports__[\"default\"] = (VueCharts);\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// dist/vue-chartjs.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 67a9b562bb0c3d81fd64","function dataHandler (newData, oldData) {\n if (oldData) {\n let chart = this.$data._chart\n\n // Get new and old DataSet Labels\n let newDatasetLabels = newData.datasets.map((dataset) => {\n return dataset.label\n })\n\n let oldDatasetLabels = oldData.datasets.map((dataset) => {\n return dataset.label\n })\n\n // Stringify 'em for easier compare\n const oldLabels = JSON.stringify(oldDatasetLabels)\n const newLabels = JSON.stringify(newDatasetLabels)\n\n // Check if Labels are equal and if dataset length is equal\n if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) {\n newData.datasets.forEach((dataset, i) => {\n // Get new and old dataset keys\n const oldDatasetKeys = Object.keys(oldData.datasets[i])\n const newDatasetKeys = Object.keys(dataset)\n\n // Get keys that aren't present in the new data\n const deletionKeys = oldDatasetKeys.filter((key) => {\n return key !== '_meta' && newDatasetKeys.indexOf(key) === -1\n })\n\n // Remove outdated key-value pairs\n deletionKeys.forEach((deletionKey) => {\n delete chart.data.datasets[i][deletionKey]\n })\n\n // Update attributes individually to avoid re-rendering the entire chart\n for (const attribute in dataset) {\n if (dataset.hasOwnProperty(attribute)) {\n chart.data.datasets[i][attribute] = dataset[attribute]\n }\n }\n })\n\n if (newData.hasOwnProperty('labels')) {\n chart.data.labels = newData.labels\n }\n if (newData.hasOwnProperty('xLabels')) {\n chart.data.xLabels = newData.xLabels\n }\n if (newData.hasOwnProperty('yLabels')) {\n chart.data.yLabels = newData.yLabels\n }\n chart.update()\n } else {\n chart.destroy()\n this.renderChart(this.chartData, this.options)\n }\n } else {\n if (this.$data._chart) {\n this.$data._chart.destroy()\n }\n this.renderChart(this.chartData, this.options)\n }\n}\n\nexport const reactiveData = {\n data () {\n return {\n chartData: null\n }\n },\n\n watch: {\n 'chartData': dataHandler\n }\n}\n\nexport const reactiveProp = {\n props: {\n chartData: {\n required: true\n }\n },\n watch: {\n 'chartData': dataHandler\n }\n}\n\nexport default {\n reactiveData,\n reactiveProp\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/index.js","import Chart from 'chart.js'\n\nexport function generateChart (chartId, chartType) {\n return {\n render: function (createElement) {\n return createElement(\n 'div', {\n style: this.styles,\n class: this.cssClasses\n },\n [\n createElement(\n 'canvas', {\n attrs: {\n id: this.chartId,\n width: this.width,\n height: this.height\n },\n ref: 'canvas'\n }\n )\n ]\n )\n },\n\n props: {\n chartId: {\n default: chartId,\n type: String\n },\n width: {\n default: 400,\n type: Number\n },\n height: {\n default: 400,\n type: Number\n },\n cssClasses: {\n type: String,\n default: ''\n },\n styles: {\n type: Object\n },\n plugins: {\n type: Array,\n default () {\n return []\n }\n }\n },\n\n data () {\n return {\n _chart: null,\n _plugins: this.plugins\n }\n },\n\n methods: {\n addPlugin (plugin) {\n this.$data._plugins.push(plugin)\n },\n renderChart (data, options) {\n this.$data._chart = new Chart(\n this.$refs.canvas.getContext('2d'), {\n type: chartType,\n data: data,\n options: options,\n plugins: this.$data._plugins\n }\n )\n }\n },\n beforeDestroy () {\n if (this.$data._chart) {\n this.$data._chart.destroy()\n }\n }\n }\n}\n\nexport const Bar = generateChart('bar-chart', 'bar')\nexport const HorizontalBar = generateChart('horizontalbar-chart', 'horizontalBar')\nexport const Doughnut = generateChart('doughnut-chart', 'doughnut')\nexport const Line = generateChart('line-chart', 'line')\nexport const Pie = generateChart('pie-chart', 'pie')\nexport const PolarArea = generateChart('polar-chart', 'polarArea')\nexport const Radar = generateChart('radar-chart', 'radar')\nexport const Bubble = generateChart('bubble-chart', 'bubble')\nexport const Scatter = generateChart('scatter-chart', 'scatter')\n\nexport default {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/BaseCharts.js","import mixins from './mixins/index.js'\n\nimport {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter\n} from './BaseCharts'\n\nconst VueCharts = {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n mixins\n}\n\nexport default VueCharts\n\nexport {\n VueCharts,\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n mixins\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}\n// module id = 1\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///dist/vue-chartjs.min.js","webpack:///webpack/bootstrap 4af6266f3e7928e7284a","webpack:///./src/mixins/index.js","webpack:///./src/BaseCharts.js","webpack:///./src/index.js","webpack:///external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE_1__","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","dataHandler","newData","oldData","chart","$data","_chart","newDatasetLabels","datasets","map","dataset","label","oldDatasetLabels","oldLabels","JSON","stringify","length","forEach","oldDatasetKeys","keys","newDatasetKeys","filter","key","indexOf","deletionKey","data","attribute","labels","xLabels","yLabels","update","destroy","renderChart","chartData","options","generateChart","chartId","chartType","render","createElement","style","styles","class","cssClasses","attrs","id","width","height","ref","props","default","type","String","Number","plugins","Array","_plugins","methods","addPlugin","plugin","push","external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default","a","$refs","canvas","getContext","beforeDestroy","value","reactiveData","watch","reactiveProp","required","mixins","external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js__","Bar","HorizontalBar","Doughnut","Line","Pie","PolarArea","Radar","Bubble","Scatter","VueCharts"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,aACA,kBAAAC,gBAAAC,IACAD,OAAA,0BAAAJ,GACA,gBAAAC,SACAA,QAAA,WAAAD,EAAAG,QAAA,aAEAJ,EAAA,WAAAC,EAAAD,EAAA,QACC,mBAAAO,WAAAC,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAV,OAGA,IAAAC,GAAAU,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAb,WAUA,OANAQ,GAAAE,GAAAI,KAAAb,EAAAD,QAAAC,IAAAD,QAAAS,GAGAR,EAAAY,GAAA,EAGAZ,EAAAD,QAvBA,GAAAW,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAjB,E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["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"chart.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VueChartJs\", [\"chart.js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueChartJs\"] = factory(require(\"chart.js\"));\n\telse\n\t\troot[\"VueChartJs\"] = factory(root[\"Chart\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"chart.js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VueChartJs\", [\"chart.js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueChartJs\"] = factory(require(\"chart.js\"));\n\telse\n\t\troot[\"VueChartJs\"] = factory(root[\"Chart\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n\n// CONCATENATED MODULE: ./src/mixins/index.js\nfunction dataHandler(newData, oldData) {\n if (oldData) {\n var chart = this.$data._chart;\n var newDatasetLabels = newData.datasets.map(function (dataset) {\n return dataset.label;\n });\n var oldDatasetLabels = oldData.datasets.map(function (dataset) {\n return dataset.label;\n });\n var oldLabels = JSON.stringify(oldDatasetLabels);\n var newLabels = JSON.stringify(newDatasetLabels);\n\n if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) {\n newData.datasets.forEach(function (dataset, i) {\n var oldDatasetKeys = Object.keys(oldData.datasets[i]);\n var newDatasetKeys = Object.keys(dataset);\n var deletionKeys = oldDatasetKeys.filter(function (key) {\n return key !== '_meta' && newDatasetKeys.indexOf(key) === -1;\n });\n deletionKeys.forEach(function (deletionKey) {\n delete chart.data.datasets[i][deletionKey];\n });\n\n for (var attribute in dataset) {\n if (dataset.hasOwnProperty(attribute)) {\n chart.data.datasets[i][attribute] = dataset[attribute];\n }\n }\n });\n\n if (newData.hasOwnProperty('labels')) {\n chart.data.labels = newData.labels;\n }\n\n if (newData.hasOwnProperty('xLabels')) {\n chart.data.xLabels = newData.xLabels;\n }\n\n if (newData.hasOwnProperty('yLabels')) {\n chart.data.yLabels = newData.yLabels;\n }\n\n chart.update();\n } else {\n chart.destroy();\n this.renderChart(this.chartData, this.options);\n }\n } else {\n if (this.$data._chart) {\n this.$data._chart.destroy();\n }\n\n this.renderChart(this.chartData, this.options);\n }\n}\n\nvar reactiveData = {\n data: function data() {\n return {\n chartData: null\n };\n },\n watch: {\n 'chartData': dataHandler\n }\n};\nvar reactiveProp = {\n props: {\n chartData: {\n required: true\n }\n },\n watch: {\n 'chartData': dataHandler\n }\n};\n/* harmony default export */ var mixins = ({\n reactiveData: reactiveData,\n reactiveProp: reactiveProp\n});\n// EXTERNAL MODULE: external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}\nvar external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js__ = __webpack_require__(1);\nvar 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__);\n\n// CONCATENATED MODULE: ./src/BaseCharts.js\n\nfunction generateChart(chartId, chartType) {\n return {\n render: function render(createElement) {\n return createElement('div', {\n style: this.styles,\n class: this.cssClasses\n }, [createElement('canvas', {\n attrs: {\n id: this.chartId,\n width: this.width,\n height: this.height\n },\n ref: 'canvas'\n })]);\n },\n props: {\n chartId: {\n default: chartId,\n type: String\n },\n width: {\n default: 400,\n type: Number\n },\n height: {\n default: 400,\n type: Number\n },\n cssClasses: {\n type: String,\n default: ''\n },\n styles: {\n type: Object\n },\n plugins: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n },\n data: function data() {\n return {\n _chart: null,\n _plugins: this.plugins\n };\n },\n methods: {\n addPlugin: function addPlugin(plugin) {\n this.$data._plugins.push(plugin);\n },\n renderChart: function renderChart(data, options) {\n this.$data._chart = new external___root___Chart___commonjs___chart_js___commonjs2___chart_js___amd___chart_js___default.a(this.$refs.canvas.getContext('2d'), {\n type: chartType,\n data: data,\n options: options,\n plugins: this.$data._plugins\n });\n }\n },\n beforeDestroy: function beforeDestroy() {\n if (this.$data._chart) {\n this.$data._chart.destroy();\n }\n }\n };\n}\nvar Bar = generateChart('bar-chart', 'bar');\nvar HorizontalBar = generateChart('horizontalbar-chart', 'horizontalBar');\nvar Doughnut = generateChart('doughnut-chart', 'doughnut');\nvar Line = generateChart('line-chart', 'line');\nvar Pie = generateChart('pie-chart', 'pie');\nvar PolarArea = generateChart('polar-chart', 'polarArea');\nvar Radar = generateChart('radar-chart', 'radar');\nvar Bubble = generateChart('bubble-chart', 'bubble');\nvar Scatter = generateChart('scatter-chart', 'scatter');\n/* harmony default export */ var BaseCharts = ({\n Bar: Bar,\n HorizontalBar: HorizontalBar,\n Doughnut: Doughnut,\n Line: Line,\n Pie: Pie,\n PolarArea: PolarArea,\n Radar: Radar,\n Bubble: Bubble,\n Scatter: Scatter\n});\n// CONCATENATED MODULE: ./src/index.js\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VueCharts\", function() { return VueCharts; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Bar\", function() { return Bar; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"HorizontalBar\", function() { return HorizontalBar; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Doughnut\", function() { return Doughnut; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Line\", function() { return Line; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Pie\", function() { return Pie; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"PolarArea\", function() { return PolarArea; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Radar\", function() { return Radar; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Bubble\", function() { return Bubble; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Scatter\", function() { return Scatter; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"mixins\", function() { return mixins; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"generateChart\", function() { return generateChart; });\n\n\nvar VueCharts = {\n Bar: Bar,\n HorizontalBar: HorizontalBar,\n Doughnut: Doughnut,\n Line: Line,\n Pie: Pie,\n PolarArea: PolarArea,\n Radar: Radar,\n Bubble: Bubble,\n Scatter: Scatter,\n mixins: mixins,\n generateChart: generateChart\n};\n/* harmony default export */ var src = __webpack_exports__[\"default\"] = (VueCharts);\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// dist/vue-chartjs.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4af6266f3e7928e7284a","function dataHandler (newData, oldData) {\n if (oldData) {\n let chart = this.$data._chart\n\n // Get new and old DataSet Labels\n let newDatasetLabels = newData.datasets.map((dataset) => {\n return dataset.label\n })\n\n let oldDatasetLabels = oldData.datasets.map((dataset) => {\n return dataset.label\n })\n\n // Stringify 'em for easier compare\n const oldLabels = JSON.stringify(oldDatasetLabels)\n const newLabels = JSON.stringify(newDatasetLabels)\n\n // Check if Labels are equal and if dataset length is equal\n if (newLabels === oldLabels && oldData.datasets.length === newData.datasets.length) {\n newData.datasets.forEach((dataset, i) => {\n // Get new and old dataset keys\n const oldDatasetKeys = Object.keys(oldData.datasets[i])\n const newDatasetKeys = Object.keys(dataset)\n\n // Get keys that aren't present in the new data\n const deletionKeys = oldDatasetKeys.filter((key) => {\n return key !== '_meta' && newDatasetKeys.indexOf(key) === -1\n })\n\n // Remove outdated key-value pairs\n deletionKeys.forEach((deletionKey) => {\n delete chart.data.datasets[i][deletionKey]\n })\n\n // Update attributes individually to avoid re-rendering the entire chart\n for (const attribute in dataset) {\n if (dataset.hasOwnProperty(attribute)) {\n chart.data.datasets[i][attribute] = dataset[attribute]\n }\n }\n })\n\n if (newData.hasOwnProperty('labels')) {\n chart.data.labels = newData.labels\n }\n if (newData.hasOwnProperty('xLabels')) {\n chart.data.xLabels = newData.xLabels\n }\n if (newData.hasOwnProperty('yLabels')) {\n chart.data.yLabels = newData.yLabels\n }\n chart.update()\n } else {\n chart.destroy()\n this.renderChart(this.chartData, this.options)\n }\n } else {\n if (this.$data._chart) {\n this.$data._chart.destroy()\n }\n this.renderChart(this.chartData, this.options)\n }\n}\n\nexport const reactiveData = {\n data () {\n return {\n chartData: null\n }\n },\n\n watch: {\n 'chartData': dataHandler\n }\n}\n\nexport const reactiveProp = {\n props: {\n chartData: {\n required: true\n }\n },\n watch: {\n 'chartData': dataHandler\n }\n}\n\nexport default {\n reactiveData,\n reactiveProp\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/index.js","import Chart from 'chart.js'\n\nexport function generateChart (chartId, chartType) {\n return {\n render: function (createElement) {\n return createElement(\n 'div', {\n style: this.styles,\n class: this.cssClasses\n },\n [\n createElement(\n 'canvas', {\n attrs: {\n id: this.chartId,\n width: this.width,\n height: this.height\n },\n ref: 'canvas'\n }\n )\n ]\n )\n },\n\n props: {\n chartId: {\n default: chartId,\n type: String\n },\n width: {\n default: 400,\n type: Number\n },\n height: {\n default: 400,\n type: Number\n },\n cssClasses: {\n type: String,\n default: ''\n },\n styles: {\n type: Object\n },\n plugins: {\n type: Array,\n default () {\n return []\n }\n }\n },\n\n data () {\n return {\n _chart: null,\n _plugins: this.plugins\n }\n },\n\n methods: {\n addPlugin (plugin) {\n this.$data._plugins.push(plugin)\n },\n renderChart (data, options) {\n this.$data._chart = new Chart(\n this.$refs.canvas.getContext('2d'), {\n type: chartType,\n data: data,\n options: options,\n plugins: this.$data._plugins\n }\n )\n }\n },\n beforeDestroy () {\n if (this.$data._chart) {\n this.$data._chart.destroy()\n }\n }\n }\n}\n\nexport const Bar = generateChart('bar-chart', 'bar')\nexport const HorizontalBar = generateChart('horizontalbar-chart', 'horizontalBar')\nexport const Doughnut = generateChart('doughnut-chart', 'doughnut')\nexport const Line = generateChart('line-chart', 'line')\nexport const Pie = generateChart('pie-chart', 'pie')\nexport const PolarArea = generateChart('polar-chart', 'polarArea')\nexport const Radar = generateChart('radar-chart', 'radar')\nexport const Bubble = generateChart('bubble-chart', 'bubble')\nexport const Scatter = generateChart('scatter-chart', 'scatter')\n\nexport default {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/BaseCharts.js","import mixins from './mixins/index.js'\n\nimport {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n generateChart\n} from './BaseCharts'\n\nconst VueCharts = {\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n mixins,\n generateChart\n}\n\nexport default VueCharts\n\nexport {\n VueCharts,\n Bar,\n HorizontalBar,\n Doughnut,\n Line,\n Pie,\n PolarArea,\n Radar,\n Bubble,\n Scatter,\n mixins,\n generateChart\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"Chart\",\"commonjs\":\"chart.js\",\"commonjs2\":\"chart.js\",\"amd\":\"chart.js\"}\n// module id = 1\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
index 27a8df94..9eccd84f 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -15,18 +15,5 @@
-
-
-
-
-