bump to v1.1.0
This commit is contained in:
parent
ffc50d41c2
commit
9470e62954
@ -50,9 +50,9 @@
|
|||||||
* ...or include within your HTML
|
* ...or include within your HTML
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/frappe-charts@1.0.0/dist/frappe-charts.min.iife.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/frappe-charts@1.1.0/dist/frappe-charts.min.iife.js"></script>
|
||||||
<!-- or -->
|
<!-- or -->
|
||||||
<script src="https://unpkg.com/frappe-charts@1.0.0/dist/frappe-charts.min.iife.js"></script>
|
<script src="https://unpkg.com/frappe-charts@1.1.0/dist/frappe-charts.min.iife.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Usage
|
#### Usage
|
||||||
|
|||||||
8
dist/frappe-charts.esm.js
vendored
8
dist/frappe-charts.esm.js
vendored
@ -298,6 +298,10 @@ class SvgTip {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of a number upto 2 decimal places.
|
||||||
|
* @param {Number} d Any number
|
||||||
|
*/
|
||||||
function floatTwo(d) {
|
function floatTwo(d) {
|
||||||
return parseFloat(d.toFixed(2));
|
return parseFloat(d.toFixed(2));
|
||||||
}
|
}
|
||||||
@ -1669,7 +1673,7 @@ class AggregationChart extends BaseChart {
|
|||||||
total += e.values[i];
|
total += e.values[i];
|
||||||
});
|
});
|
||||||
return [total, label];
|
return [total, label];
|
||||||
}).filter(d => { return d[0] > 0; }); // keep only positive results
|
}).filter(d => { return d[0] >= 0; }); // keep only positive results
|
||||||
|
|
||||||
let totals = allTotals;
|
let totals = allTotals;
|
||||||
if(allTotals.length > maxSlices) {
|
if(allTotals.length > maxSlices) {
|
||||||
@ -3073,6 +3077,7 @@ function zeroDataPrep(realData) {
|
|||||||
|
|
||||||
function getShortenedLabels(chartWidth, labels=[], isSeries=true) {
|
function getShortenedLabels(chartWidth, labels=[], isSeries=true) {
|
||||||
let allowedSpace = chartWidth / labels.length;
|
let allowedSpace = chartWidth / labels.length;
|
||||||
|
if(allowedSpace <= 0) allowedSpace = 1;
|
||||||
let allowedLetters = allowedSpace / DEFAULT_CHAR_WIDTH;
|
let allowedLetters = allowedSpace / DEFAULT_CHAR_WIDTH;
|
||||||
|
|
||||||
let calcLabels = labels.map((label, i) => {
|
let calcLabels = labels.map((label, i) => {
|
||||||
@ -3672,6 +3677,7 @@ class AxisChart extends BaseChart {
|
|||||||
// removeDataPoint(index = 0) {}
|
// removeDataPoint(index = 0) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// import MultiAxisChart from './charts/MultiAxisChart';
|
||||||
const chartTypes = {
|
const chartTypes = {
|
||||||
bar: AxisChart,
|
bar: AxisChart,
|
||||||
line: AxisChart,
|
line: AxisChart,
|
||||||
|
|||||||
3
dist/frappe-charts.min.cjs.js
vendored
3
dist/frappe-charts.min.cjs.js
vendored
File diff suppressed because one or more lines are too long
1
dist/frappe-charts.min.cjs.js.map
vendored
Normal file
1
dist/frappe-charts.min.cjs.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3
dist/frappe-charts.min.esm.js
vendored
3
dist/frappe-charts.min.esm.js
vendored
File diff suppressed because one or more lines are too long
1
dist/frappe-charts.min.esm.js.map
vendored
Normal file
1
dist/frappe-charts.min.esm.js.map
vendored
Normal file
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
dist/frappe-charts.min.iife.js.map
vendored
2
dist/frappe-charts.min.iife.js.map
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
File diff suppressed because one or more lines are too long
9
docs/assets/js/index.min.js
vendored
9
docs/assets/js/index.min.js
vendored
@ -46,6 +46,12 @@ var HEATMAP_COLORS_YELLOW = ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001
|
|||||||
|
|
||||||
// Universal constants
|
// Universal constants
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of a number upto 2 decimal places.
|
||||||
|
* @param {Number} d Any number
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not two given arrays are equal.
|
* Returns whether or not two given arrays are equal.
|
||||||
* @param {Array} arr1 First array
|
* @param {Array} arr1 First array
|
||||||
@ -114,7 +120,6 @@ var MONTH_NAMES_SHORT = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// https://stackoverflow.com/a/11252167/6495043
|
|
||||||
|
|
||||||
|
|
||||||
function clone(date) {
|
function clone(date) {
|
||||||
@ -295,6 +300,8 @@ var heatmapData = {
|
|||||||
end: end
|
end: end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ================================================================================
|
||||||
|
|
||||||
var c1 = document.querySelector("#chart-composite-1");
|
var c1 = document.querySelector("#chart-composite-1");
|
||||||
var c2 = document.querySelector("#chart-composite-2");
|
var c2 = document.querySelector("#chart-composite-2");
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "frappe-charts",
|
"name": "frappe-charts",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"description": "https://frappe.github.io/charts",
|
"description": "https://frappe.github.io/charts",
|
||||||
"main": "dist/frappe-charts.min.cjs.js",
|
"main": "dist/frappe-charts.min.cjs.js",
|
||||||
"module": "dist/frappe-charts.min.esm.js",
|
"module": "dist/frappe-charts.min.esm.js",
|
||||||
|
|||||||
@ -120,6 +120,7 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: 'src/js/chart.js',
|
input: 'src/js/chart.js',
|
||||||
|
sourcemap: true,
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
file: pkg.main,
|
file: pkg.main,
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export default class AggregationChart extends BaseChart {
|
|||||||
total += e.values[i];
|
total += e.values[i];
|
||||||
});
|
});
|
||||||
return [total, label];
|
return [total, label];
|
||||||
}).filter(d => { return d[0] > 0; }); // keep only positive results
|
}).filter(d => { return d[0] >= 0; }); // keep only positive results
|
||||||
|
|
||||||
let totals = allTotals;
|
let totals = allTotals;
|
||||||
if(allTotals.length > maxSlices) {
|
if(allTotals.length > maxSlices) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import * as Charts from './chart';
|
|||||||
let frappe = { };
|
let frappe = { };
|
||||||
|
|
||||||
frappe.NAME = 'Frappe Charts';
|
frappe.NAME = 'Frappe Charts';
|
||||||
frappe.VERSION = '1.0.0';
|
frappe.VERSION = '1.1.0';
|
||||||
|
|
||||||
frappe = Object.assign({ }, frappe, Charts);
|
frappe = Object.assign({ }, frappe, Charts);
|
||||||
|
|
||||||
|
|||||||
@ -98,6 +98,7 @@ export function zeroDataPrep(realData) {
|
|||||||
|
|
||||||
export function getShortenedLabels(chartWidth, labels=[], isSeries=true) {
|
export function getShortenedLabels(chartWidth, labels=[], isSeries=true) {
|
||||||
let allowedSpace = chartWidth / labels.length;
|
let allowedSpace = chartWidth / labels.length;
|
||||||
|
if(allowedSpace <= 0) allowedSpace = 1;
|
||||||
let allowedLetters = allowedSpace / DEFAULT_CHAR_WIDTH;
|
let allowedLetters = allowedSpace / DEFAULT_CHAR_WIDTH;
|
||||||
|
|
||||||
let calcLabels = labels.map((label, i) => {
|
let calcLabels = labels.map((label, i) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user