chore: bump to 1.5.3 and update build
This commit is contained in:
parent
25122f974f
commit
92a3df9690
16
dist/frappe-charts.esm.js
vendored
16
dist/frappe-charts.esm.js
vendored
@ -377,6 +377,16 @@ function isValidNumber(candidate, nonNegative=false) {
|
||||
else return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Round a number to the closes precision, max max precision 4
|
||||
* @param {Number} d Any Number
|
||||
*/
|
||||
function round(d) {
|
||||
// https://floating-point-gui.de/
|
||||
// https://www.jacklmoore.com/notes/rounding-in-javascript/
|
||||
return Number(Math.round(d + 'e4') + 'e-4');
|
||||
}
|
||||
|
||||
function getBarHeightAndYAttr(yTop, zeroLine) {
|
||||
let height, y;
|
||||
if (yTop <= zeroLine) {
|
||||
@ -1811,6 +1821,7 @@ class AggregationChart extends BaseChart {
|
||||
configure(args) {
|
||||
super.configure(args);
|
||||
|
||||
this.config.formatTooltipY = args.tooltipOptions.formatTooltipY;
|
||||
this.config.maxSlices = args.maxSlices || 20;
|
||||
this.config.maxLegendPoints = args.maxLegendPoints || 20;
|
||||
}
|
||||
@ -1844,7 +1855,7 @@ class AggregationChart extends BaseChart {
|
||||
|
||||
s.labels = [];
|
||||
totals.map(d => {
|
||||
s.sliceTotals.push(d[0]);
|
||||
s.sliceTotals.push(round(d[0]));
|
||||
s.labels.push(d[1]);
|
||||
});
|
||||
|
||||
@ -1877,12 +1888,13 @@ class AggregationChart extends BaseChart {
|
||||
}
|
||||
let x = barWidth * count + 5;
|
||||
let label = this.config.truncateLegends ? truncateString(s.labels[i], barWidth/10) : s.labels[i];
|
||||
let formatted = this.config.formatTooltipY ? this.config.formatTooltipY(d) : d;
|
||||
let dot = legendDot(
|
||||
x,
|
||||
y,
|
||||
5,
|
||||
this.colors[i],
|
||||
`${label}: ${d}`,
|
||||
`${label}: ${formatted}`,
|
||||
false
|
||||
);
|
||||
this.legendArea.appendChild(dot);
|
||||
|
||||
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
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frappe-charts",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"description": "https://frappe.github.io/charts",
|
||||
"main": "dist/frappe-charts.min.cjs.js",
|
||||
"module": "dist/frappe-charts.min.esm.js",
|
||||
|
||||
@ -3,7 +3,7 @@ import * as Charts from './chart';
|
||||
let frappe = { };
|
||||
|
||||
frappe.NAME = 'Frappe Charts';
|
||||
frappe.VERSION = '1.5.2';
|
||||
frappe.VERSION = '1.5.3';
|
||||
|
||||
frappe = Object.assign({ }, frappe, Charts);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user