From a9c6bcbc9796ca6bc2965266d882594056f4833e Mon Sep 17 00:00:00 2001 From: pratu16x7 Date: Wed, 15 Nov 2017 23:48:52 +0530 Subject: [PATCH] build version 0.0.6 --- README.md | 2 +- dist/frappe-charts.esm.js | 29 ++++++++++++++--------------- dist/frappe-charts.min.cjs.js | 2 +- dist/frappe-charts.min.esm.js | 2 +- dist/frappe-charts.min.iife.js | 2 +- docs/assets/js/frappe-charts.min.js | 2 +- docs/index.html | 2 +- package.json | 2 +- src/scripts/charts/AxisChart.js | 10 +++++++--- src/scripts/charts/BaseChart.js | 11 +++++++---- 10 files changed, 35 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index f704a25..dcbf7b4 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ * ...or include within your HTML ```html - + ``` #### Usage diff --git a/dist/frappe-charts.esm.js b/dist/frappe-charts.esm.js index 16861bb..3161899 100644 --- a/dist/frappe-charts.esm.js +++ b/dist/frappe-charts.esm.js @@ -788,12 +788,15 @@ class BaseChart { console.error("No parent element to render on was provided."); return; } - this.validate_and_prepare_data(); - this.bind_window_events(); - this.refresh(true); + if(this.validate_and_prepare_data()) { + this.bind_window_events(); + this.refresh(true); + } } - validate_and_prepare_data() {} + validate_and_prepare_data() { + return true; + } bind_window_events() { window.addEventListener('resize', () => this.refresh()); @@ -970,8 +973,8 @@ class AxisChart extends BaseChart { constructor(args) { super(args); - this.x = this.data.labels; - this.y = this.data.datasets; + this.x = this.data.labels || []; + this.y = this.data.datasets || []; this.is_series = args.is_series; @@ -980,7 +983,11 @@ class AxisChart extends BaseChart { this.zero_line = this.height; - this.old_values = {}; + // this.old_values = {}; + } + + validate_and_prepare_data() { + return true; } setup_values() { @@ -2719,14 +2726,6 @@ class Heatmap extends BaseChart { } } -// if ("development" !== 'production') { -// // Enable LiveReload -// document.write( -// '