build version 0.0.6
This commit is contained in:
parent
4c9ca4864e
commit
a9c6bcbc97
@ -41,7 +41,7 @@
|
||||
* ...or include within your HTML
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/frappe-charts@0.0.5/dist/frappe-charts.min.iife.js"></script>
|
||||
<script src="https://unpkg.com/frappe-charts@0.0.6/dist/frappe-charts.min.iife.js"></script>
|
||||
```
|
||||
|
||||
#### Usage
|
||||
|
||||
29
dist/frappe-charts.esm.js
vendored
29
dist/frappe-charts.esm.js
vendored
@ -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(
|
||||
// '<script src="http://' + (location.host || 'localhost').split(':')[0] +
|
||||
// ':35729/livereload.js?snipver=1"></' + 'script>'
|
||||
// );
|
||||
// }
|
||||
|
||||
const chartTypes = {
|
||||
line: LineChart,
|
||||
bar: BarChart,
|
||||
|
||||
2
dist/frappe-charts.min.cjs.js
vendored
2
dist/frappe-charts.min.cjs.js
vendored
File diff suppressed because one or more lines are too long
2
dist/frappe-charts.min.esm.js
vendored
2
dist/frappe-charts.min.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/frappe-charts.min.iife.js
vendored
2
dist/frappe-charts.min.iife.js
vendored
File diff suppressed because one or more lines are too long
2
docs/assets/js/frappe-charts.min.js
vendored
2
docs/assets/js/frappe-charts.min.js
vendored
File diff suppressed because one or more lines are too long
@ -53,7 +53,7 @@
|
||||
<p class="step-explain">And include it in your project</p>
|
||||
<pre><code class="hljs javascript"> import Chart from "frappe-charts/dist/frappe-charts.min.esm"</code></pre>
|
||||
<p class="step-explain">... or include it directly in your HTML</p>
|
||||
<pre><code class="hljs html"> <script src="https://unpkg.com/frappe-charts@0.0.5/dist/frappe-charts.min.iife.js"></script></code></pre>
|
||||
<pre><code class="hljs html"> <script src="https://unpkg.com/frappe-charts@0.0.6/dist/frappe-charts.min.iife.js"></script></code></pre>
|
||||
<p class="step-explain">Make a new Chart</p>
|
||||
<pre><code class="hljs html"> <!--HTML-->
|
||||
<div id="chart"></div></code></pre>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frappe-charts",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.6",
|
||||
"description": "https://frappe.github.io/charts",
|
||||
"main": "dist/frappe-charts.min.cjs.js",
|
||||
"module": "dist/frappe-charts.min.esm.js",
|
||||
|
||||
@ -9,8 +9,8 @@ export default 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;
|
||||
|
||||
@ -19,7 +19,11 @@ export default class AxisChart extends BaseChart {
|
||||
|
||||
this.zero_line = this.height;
|
||||
|
||||
this.old_values = {};
|
||||
// this.old_values = {};
|
||||
}
|
||||
|
||||
validate_and_prepare_data() {
|
||||
return true;
|
||||
}
|
||||
|
||||
setup_values() {
|
||||
|
||||
@ -92,12 +92,15 @@ export default 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());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user