chore: bump to 1.5.2 🎉
This commit is contained in:
parent
222cbb686f
commit
2572e317c7
23
dist/frappe-charts.esm.js
vendored
23
dist/frappe-charts.esm.js
vendored
@ -364,6 +364,19 @@ function getPositionByAngle(angle, radius) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a number is valid for svg attributes
|
||||||
|
* @param {object} candidate Candidate to test
|
||||||
|
* @param {Boolean} nonNegative flag to treat negative number as invalid
|
||||||
|
*/
|
||||||
|
function isValidNumber(candidate, nonNegative=false) {
|
||||||
|
if (Number.isNaN(candidate)) return false;
|
||||||
|
else if (candidate === undefined) return false;
|
||||||
|
else if (!Number.isFinite(candidate)) return false;
|
||||||
|
else if (nonNegative && candidate < 0) return false;
|
||||||
|
else return true;
|
||||||
|
}
|
||||||
|
|
||||||
function getBarHeightAndYAttr(yTop, zeroLine) {
|
function getBarHeightAndYAttr(yTop, zeroLine) {
|
||||||
let height, y;
|
let height, y;
|
||||||
if (yTop <= zeroLine) {
|
if (yTop <= zeroLine) {
|
||||||
@ -864,6 +877,8 @@ function makeHoriLine(y, label, x1, x2, options={}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function yLine(y, label, width, options={}) {
|
function yLine(y, label, width, options={}) {
|
||||||
|
if (!isValidNumber(y)) y = 0;
|
||||||
|
|
||||||
if(!options.pos) options.pos = 'left';
|
if(!options.pos) options.pos = 'left';
|
||||||
if(!options.offset) options.offset = 0;
|
if(!options.offset) options.offset = 0;
|
||||||
if(!options.mode) options.mode = 'span';
|
if(!options.mode) options.mode = 'span';
|
||||||
@ -892,6 +907,8 @@ function yLine(y, label, width, options={}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function xLine(x, label, height, options={}) {
|
function xLine(x, label, height, options={}) {
|
||||||
|
if (!isValidNumber(x)) x = 0;
|
||||||
|
|
||||||
if(!options.pos) options.pos = 'bottom';
|
if(!options.pos) options.pos = 'bottom';
|
||||||
if(!options.offset) options.offset = 0;
|
if(!options.offset) options.offset = 0;
|
||||||
if(!options.mode) options.mode = 'span';
|
if(!options.mode) options.mode = 'span';
|
||||||
@ -1002,6 +1019,12 @@ function datasetBar(x, yTop, width, color, label='', index=0, offset=0, meta={})
|
|||||||
y -= meta.minHeight;
|
y -= meta.minHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Preprocess numbers to avoid svg building errors
|
||||||
|
if (!isValidNumber(x)) x = 0;
|
||||||
|
if (!isValidNumber(y)) y = 0;
|
||||||
|
if (!isValidNumber(height, true)) height = 0;
|
||||||
|
if (!isValidNumber(width, true)) width = 0;
|
||||||
|
|
||||||
let rect = createSVG('rect', {
|
let rect = createSVG('rect', {
|
||||||
className: `bar mini`,
|
className: `bar mini`,
|
||||||
style: `fill: ${color}`,
|
style: `fill: ${color}`,
|
||||||
|
|||||||
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.cjs.js.map
vendored
2
dist/frappe-charts.min.cjs.js.map
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.esm.js.map
vendored
2
dist/frappe-charts.min.esm.js.map
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
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
8
docs/assets/js/index.min.js
vendored
8
docs/assets/js/index.min.js
vendored
@ -79,6 +79,14 @@ function getRandomBias(min, max, bias, influence) {
|
|||||||
return rnd * (1 - mix) + biasValue * mix; // mix full range and bias
|
return rnd * (1 - mix) + biasValue * mix; // mix full range and bias
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a number is valid for svg attributes
|
||||||
|
* @param {object} candidate Candidate to test
|
||||||
|
* @param {Boolean} nonNegative flag to treat negative number as invalid
|
||||||
|
*/
|
||||||
|
|
||||||
// Playing around with dates
|
// Playing around with dates
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "frappe-charts",
|
"name": "frappe-charts",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"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",
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import * as Charts from './chart';
|
|||||||
let frappe = { };
|
let frappe = { };
|
||||||
|
|
||||||
frappe.NAME = 'Frappe Charts';
|
frappe.NAME = 'Frappe Charts';
|
||||||
frappe.VERSION = '1.5.1';
|
frappe.VERSION = '1.5.2';
|
||||||
|
|
||||||
frappe = Object.assign({ }, frappe, Charts);
|
frappe = Object.assign({ }, frappe, Charts);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user